Plan-execute

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?

Where plan-execute excels

Where plan-execute fails

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:

When to require user approval of the plan

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.