In this categoryClaude Code ยท 45
Claude CodeIntermediate

How to Make an Agent Plan Before It Edits

Ask for a written plan first so you can correct the approach before any file changes, saving rework on bigger tasks.

7 minIntermediate

For anything bigger than a one-line fix, the cheapest correction is one made before the agent writes any code. Asking for a plan first turns a vague request into a checklist you can approve or redirect, which is far faster than reviewing edits you then have to throw away.

What you need

  • An agent session in a real project
  • A task that touches more than one file
  • About 6 minutes

Step 1: Ask for a plan, not edits

State clearly that you want a plan only. The agent should list the files it will change and the approach, and then wait.

Agent - plan request
You
Plan only, no edits: how would you add rate limiting to the public API? List files and the approach, then wait.
Agent
Plan: 1) add a token-bucket helper in lib/ratelimit.ts, 2) wrap the public routes in middleware, 3) add 429 handling, 4) a test. Awaiting your go.
No edits yet; the agent proposes an approach.

Step 2: Correct the approach

Read the plan like a design doc. Redirecting one step here costs a sentence; redirecting it after the edits costs a full re-do.

Cheap to change now
A wrong assumption in a plan is a one-line correction. The same wrong assumption baked into five edited files is a cleanup job.

Step 3: Approve, then let it build

Once the plan looks right, give a short go-ahead. The agent now executes a path you already agreed to, so the diffs need far less back-and-forth.

prompt
Plan looks good. Use step 1 through 4 as written. Add the test in tests/ratelimit.test.ts. Go ahead.
Keep plan mode for the big ones
Tiny fixes do not need a plan first. Reserve this for multi-file work, migrations, and anything you cannot easily revert.

Result: you catch wrong turns while they are still words, and the edits that follow land closer to right on the first try.

Watch related tutorials

Free weekly email

New guides in your inbox

Fresh step-by-step how-to guides as we publish them. One email a week, no more.

Tags
#agents#planning#workflow#review#tips