Plan-execute
📖 4 min readUpdated 2026-04-18
Plan-execute agents generate a plan upfront, optionally get it approved, then execute step by step. Trading adaptiveness for predictability.
The flow
1. Given goal G, generate plan [step_1, step_2, ..., step_n]
2. (Optional) Show plan to user, get approval
3. For each step:
a. Execute (tool call or reasoning)
b. Observe result
c. If result breaks assumptions, replan; otherwise continue
4. Return final result
Why plan first?
- Fewer surprises. You see the full plan before any tool call happens.
- Cheaper. Simple steps don't need LLM reasoning between them, the plan already specified what to do.
- Easier to parallelize. Independent plan steps can run concurrently.
- Easier to audit. The plan is the record of intent.
Where plan-execute excels
- Data migrations. Steps are known upfront, no branching needed.
- Multi-file refactors. Plan the list of files to edit, then edit.
- Scheduled reports. Fetch from these sources → process → assemble → send.
- Long-horizon tasks. Agent should keep context, not reconstruct it at each step.
Where plan-execute fails
- Exploratory work. You don't know the plan upfront; you learn it by running.
- High-branching. If half the plan depends on results from the first half, replanning constantly is worse than ReAct.
- User-driven. If the user keeps redirecting, a rigid plan is friction.
Hybrid: plan → execute with replan triggers
Best of both worlds. Plan first, but every step also asks: "does this result violate an assumption the plan made?" If yes, replan that branch. If no, continue executing.
This is what Claude Code's "plan mode" does. The model produces a plan, user approves, execution proceeds, but if something unexpected happens, the model can re-enter plan mode.
Plan quality matters
A bad plan is worse than no plan. Some markers of a good plan:
- Each step is concrete (names a tool, input, expected output)
- Steps are independent where possible
- Risks and unknowns are flagged
- A verification step exists at the end
When to require user approval of the plan
- When the task touches production systems
- When the task is long enough that you don't want to find out the plan was wrong at step 15
- When the task costs money at each step
- First time running a new type of task, build trust before automating approval
Claude Code implementation note
Claude Code's plan mode surfaces the plan in a structured way and requires explicit approval before execution. For anything autonomous and non-trivial, invoke plan mode first. Routine work can stay in auto mode.