Phase 07 — Planning and Subagents
Part of Harness engineering.
A long task needs a plan, and a big task needs more than one agent. This phase covers both. You give the agent a todo list whose steps close only when a check passes. You put it in plan mode so it reads before it writes. Then you split work across subagents: a contract, waves with disjoint files, and a supervisor that sees results, not transcripts.
Lessons
- The Todo List — a status list with one step in progress and verified completion.
- Plan Mode — a read-only state until a human approves the plan.
- Contract, Waves and Isolation — budget, parallel waves, file ownership and checkpoints.
- Supervisor and Workers — delegate with role allowlists and take back only results.
Where the depth lives
| If you want | Read |
|---|---|
| Planning and reasoning for agents, in product terms | Planning and reasoning |
| How to keep a plan on track across a long run | Planning, reasoning and reliability across a run |
| When several agents help and when they hurt | Orchestrating more than one agent |
| Multi-agent systems and the protocols between them | Multi-agent and protocols |
Test yourself
- Why must the harness, not the model, decide that a todo step is complete?
<details><summary>Answer</summary>A model that grades its own work marks steps done too early. The harness runs a done-check, and only a pass sets
completed. A step that keeps failing goes toneeds_replaninstead of looping. (<a href=“./01-todo-list/docs/en.md”>Lesson 1</a>)</details> - Plan mode lets the agent run
git statusbut not edit a file. Why allow any shell command? <details><summary>Answer</summary>A good plan needs exploration, and exploration uses read-only commands. The gate allows reads and read-only commands and denies everything that changes state. (<a href=“./02-plan-mode/docs/en.md”>Lesson 2</a>)</details> - Why is “ask the model to plan first” weaker than plan mode? <details><summary>Answer</summary>A prompt is a request the model can forget. Plan mode is a permission state, so a blocked edit stays blocked. It still has limits: in an interactive session with bypass permissions available, Claude Code does not enforce the blocks. (<a href=“./02-plan-mode/docs/en.md”>Lesson 2</a>)</details>
- Two independent tasks both own
api/routes.py. What does the wave planner do, and why? <details><summary>Answer</summary>It puts them in different waves. Two parallel workers on one file would silently overwrite each other, so no wave may share a file. (<a href=“./03-contract-waves-and-isolation/docs/en.md”>Lesson 3</a>)</details> - A worker hits its call limit. What should the run do? <details><summary>Answer</summary>It stops and reports. Budget ceilings are hard and never extend themselves, so a human decides whether to spend more. (<a href=“./03-contract-waves-and-isolation/docs/en.md”>Lesson 3</a>)</details>
- How can you test that a wave truly runs in parallel and not one task after another? <details><summary>Answer</summary>Make two workers wait on a shared barrier with a timeout. If they run in series, the barrier times out and the test fails. (<a href=“./03-contract-waves-and-isolation/docs/en.md”>Lesson 3</a>)</details>
- Why does a reviewer subagent get the diff but not the plan? <details><summary>Answer</summary>A reviewer who sees the plan explains the output instead of judging it. You enforce this when you build the prompt, so the plan is never in scope. (<a href=“./04-supervisor-and-workers/docs/en.md”>Lesson 4</a>)</details>
- What does a supervisor receive from a worker, and what does that buy you? <details><summary>Answer</summary>A short result, not the worker’s transcript. The supervisor’s context stays small, and a worker crash becomes one failed result instead of a crashed run. (<a href=“./04-supervisor-and-workers/docs/en.md”>Lesson 4</a>)</details>
