Sub-Agent Execution
Once a plan is approved, the agent does not execute everything in a single pass. Instead, it breaks the work into focused steps, each handled by a fresh sub-agent with a review checkpoint in between.
How it works
- The main agent picks the next task from the plan.
- A sub-agent is launched with a specific, scoped instruction (e.g., "Create the database migration for the users table").
- The sub-agent completes its work and returns the result.
- The main agent reviews the output, checks for issues, and moves to the next step.
This cycle repeats until all tasks in the plan are complete.
Why sub-agents
Each sub-agent starts with a clean focus. It receives only the context it needs for its specific task, so it does not get confused by accumulated context from previous steps. This leads to more accurate, reliable results — especially for large plans with many steps.
There is also a natural review checkpoint between each step. The main agent verifies the work before proceeding, catching errors early rather than compounding them across multiple steps.
What you see in the chat
You see all of this happening in real time. The agent reports what each step accomplished, and you can intervene at any point to adjust the direction. If a step produces something unexpected, you can correct the course before the agent moves on.
When it is used
Sub-agent execution is the default strategy for multi-step plans. Any time the agent has a plan with more than one step, it uses sub-agents to execute them. For single-step tasks, the agent handles the work directly without spawning a sub-agent.