Back to Development
developmentL5 AutonomousCoding Agent Usage

Planner → Worker hierarchy

How to structure a two-tier agent architecture where a planner decomposes engineering tasks and workers execute them in parallel - the canonical L5 pattern for complex autonomous development.

  • ·Multi-agent orchestration system (planner-worker hierarchy) is in production
  • ·Agent fleet sustains 100+ concurrent agents on the codebase
  • ·Agent fleet produces 1,000+ commits per week without manual dispatch
  • ·Planner agents decompose epics into tasks and assign to worker agents autonomously
  • ·Agent fleet self-recovers from failures without human escalation for 90%+ of error cases

Evidence

  • ·Orchestration system dashboard showing planner-worker task flow
  • ·Git history showing 1,000+ weekly commits attributed to agent fleet
  • ·Agent fleet monitoring showing concurrent agent count and error recovery rate

What It Is

The planner-worker hierarchy is a specific multi-agent architecture pattern where responsibility is divided between two tiers. The planner agent operates at the task level: it receives a high-level engineering goal, analyzes the codebase, decomposes the goal into concrete subtasks with clear acceptance criteria, and assigns those subtasks to worker agents. Worker agents operate at the implementation level: they receive a specific, bounded subtask and execute it - writing code, running tests, fixing failures - until the subtask is complete or definitively fails.

The planner maintains overall context and coordinates: it tracks which subtasks are complete, detects when a worker needs additional information, recognizes when the original decomposition needs revision (because a subtask revealed unexpected complexity), and synthesizes the workers' outputs into a coherent whole. Workers are stateless and focused: they know only their subtask and the context the planner provides.

This architecture is "canonical" at L5 because it mirrors how effective engineering teams work: a tech lead (planner) breaks down a project and assigns pieces to developers (workers), maintains visibility into progress, unblocks problems, and integrates the final result. The planner-worker hierarchy is this pattern implemented in software, with agents in both roles.

The planner can run a more capable, larger model (e.g., Claude Opus) while workers run faster, cheaper models (e.g., Claude Haiku or Sonnet), since planning requires deep reasoning while execution requires speed. This cost optimization is a practical advantage of the two-tier architecture over a flat multi-agent system where all agents run the same model.

Why It Matters

The planner-worker separation solves the fundamental tension in autonomous agent systems between depth and breadth:

  • Depth vs. breadth - a single agent trying to implement a complex feature either goes deep (loses track of the overall goal) or stays broad (produces superficial implementations); the two-tier system assigns depth to workers and breadth to the planner
  • Context management - the planner maintains the full task context; workers receive only what they need; this prevents context window overload while preserving task coherence
  • Parallelism with coordination - workers execute in parallel while the planner coordinates; this delivers parallelism benefits without the consistency problems of uncoordinated parallel execution
  • Graceful failure handling - when a worker fails, the planner can replan - decompose the failed subtask differently, provide additional context, or route to a different worker; the system recovers without human intervention for common failure modes
  • Cost optimization - using different models at different tiers matches computational cost to task complexity; planning is expensive (uses the most capable model); routine implementation is cheaper (uses a faster model)
Tip

The quality of the planner's task decomposition is the primary determinant of the system's output quality. Before optimizing workers, optimize the planner. A planner that consistently decomposes tasks into the right subtask granularity (small enough to be unambiguous, large enough to be meaningful) produces dramatically better results than a planner that produces either too-fine or too-coarse subtasks.

Getting Started

6 steps to get from here to the next level

Common Pitfalls

Mistakes teams actually make at this stage - and how to avoid them

How Different Roles See It

B
BobHead of Engineering

Bob has successfully deployed unattended agents at L4 and wants to tackle the next level of complexity - tasks that are too large or complex for a single agent but genuinely high-value. He's been told the planner-worker architecture is the answer but isn't sure what it would look like in his codebase.

What Bob should do - role-specific action plan

S
SarahProductivity Lead

Sarah wants to build the business case for the L5 investment. The planner-worker system is complex to build, and she needs to demonstrate that the capability it enables is worth the engineering cost.

What Sarah should do - role-specific action plan

V
VictorStaff Engineer - AI Champion

Victor has been manually running the planner-worker pattern for months: he decomposes complex tasks into subtasks, assigns them to Claude Code instances in separate worktrees, monitors progress, and synthesizes the results. He knows this manual process is valuable but also knows he's the bottleneck - only one person on the team knows how to do it.

What Victor should do - role-specific action plan