Sub topic 8
Revise the plan until it is right
This chapter assumes you can already write a planning request, read a plan the way you would read a design proposal, and run your project's tests. It covers what to do when the plan you get back is close but not correct. You will turn your review notes into feedback, ask for a revised plan, and decide when the plan is ready for approval.
Why revise the plan instead of the code
A plan is cheap to change. Editing a sentence in a plan costs seconds. Undoing a wrong design after the agent has changed five files costs a diff review, a revert, and often a new explanation of what you wanted.
Revision is also where you add the knowledge the agent cannot get from the code. The agent can read your repository. It cannot know that you run several processes in production, that a teammate is about to rename a module, or that your team does not allow new dependencies.
What goes wrong in a first plan
First plans usually fail in one of a few ways. Knowing which one you are looking at helps you write feedback that fixes it.
| Problem in the plan | What it looks like | What to say |
|---|---|---|
| Wrong assumption | "Assumes a single server process" when you run several | State the fact and name the change it forces |
| Scope too wide | A refactor of unrelated code is bundled in | Name the item to remove and say why |
| Scope too narrow | The plan skips error handling or config | Name the missing piece and where it belongs |
| Wrong order | Tests come last, or a step depends on a later step | Give the order you want |
| Vague verification | "Test that it works" | Name the command or test cases |
| Steps too large | One step touches many files | Ask to split it so each step can be reviewed alone |
Write feedback the agent can act on
Good feedback has four properties.
- It refers to a specific part of the plan, such as a file, a step number, or an assumption.
- It states the fact or decision, not just the dislike. "This is wrong" gives the agent nothing to work with. "We run several processes, so an in-memory counter will not work" does.
- It says what should change as a result.
- It restates the rule that nothing is edited yet.
Here is feedback that follows those rules.
The plan looks good with two changes:
- Use the shared Redis client instead of an in-memory counter, since we run several processes.
- Add the limit values to the existing config file instead of hard-coding them.
Please update the plan. Do not edit any files until I reply "approved".The first change fixes a wrong assumption from the plan's risks section. The second moves a decision about where settings live. Both are specific, and the last line keeps the approval step in your hands.
Ask the agent to check, not just comply
An agent may accept a correction without checking what it implies. If you say "use the shared Redis client", it may write a step that names a file or function that does not exist. Ask it to look.
Before you revise: find the shared Redis client in the code and tell me
which module exposes it and how other code gets a connection. Then update
steps 1 and 2 to use it. Do not edit any files.This keeps the read-only exploration phase going during revision. The revised plan then names real files, not guesses.
Ask for the changes, not only a new plan
A fully rewritten plan can change parts you already accepted. To catch that, ask the agent to list what changed.
Update the plan, then list under "Changes since the last version" exactly
which steps, files, and assumptions you added, removed, or reworded.Compare that list with your feedback. If the agent changed something you did not ask for, you have found it before it reached the code.
Answer clarifying questions as part of revision
When the agent asks questions, your answers are revisions too. Answer each question directly and, where you can, say what you would have the plan do.
Answers:
1. Count only failed logins, not successful ones.
2. The limit is per IP address, not per account.
3. Yes, return the existing 429 response body; do not add a Retry-After header yet.
Update the plan with these answers. If any answer changes the files or steps, say so.If you do not know the answer, say that, and ask the agent to list the options with their consequences. Do not guess just to move on. A guessed answer becomes an assumption in the plan, and you may not notice it later.
The revision loop
Revision repeats until the plan passes your review. Each pass has the same shape.
Review each new version in full, not only the parts you asked about. A change in step 1 often affects the risks, the test list, or a later step.
Know when to stop
A plan is ready when you can answer yes to every item on the review checklist, not when the agent says it is ready.
- [ ] Does the plan solve the problem I described, not a nearby one?
- [ ] Are all listed files ones I expect to change?
- [ ] Is anything changed that I did not ask for?
- [ ] Are the assumptions true for this project?
- [ ] Is there a concrete way to verify the result?
- [ ] Are the steps small enough to review one by one?Most plans need one to three rounds. If you are on a fourth or fifth round and the plan keeps changing in ways you did not ask for, the problem is usually not the plan. Look at these causes first:
- The goal is unclear. Rewrite the goal in two sentences and start the plan again from it.
- The task is too big. Split it into two tasks and plan the first one.
- You are missing a fact. Go find it, such as how production is deployed, and then give it to the agent.
Failure modes during revision
The agent starts editing
Some agents treat feedback like "use Redis" as an instruction to implement. Repeat the no-edits rule in every revision message. If the agent edits files anyway, stop it, check the diff with your version control tool, and revert the edits you did not approve.
Plan accretion
Each round adds a step, and none are removed. The plan grows into a list of every idea mentioned in the conversation. When you notice this, ask the agent to cut it back.
The plan has grown. Remove anything not needed for the stated goal and
constraints, and list what you removed so I can confirm.Contradictions between sections
After a revision, the steps may use Redis while the risks section still says "in-memory counter". Read the whole plan, and ask the agent to check for this.
Check the revised plan for contradictions between the files list, the steps,
the risks, and the verification section. Fix any you find and report them.Stale context in a long conversation
In a long session, the agent may mix up an old version of the plan with the current one. Ask it to print the full current plan in one message before you approve. If you plan to use it in a later session, the next chapter on keeping the plan as a file covers that.
Agreeing too quickly
If the agent accepts every correction with no questions, that may be a sign it is not checking. Push back occasionally with "what does this change break?" and see whether it gives a specific answer based on the code.
Prepare for approval
When the plan passes the checklist, ask for one final complete version.
Show the final plan in full, with no "changes since" notes, so I can read it
once from top to bottom. Do not edit any files.Read it once more from the top. Approval is the next chapter's subject, and it should be a deliberate act on a plan you have read in full.
Exercise
A plan for adding rate limiting says "Assumes a single server process; an in-memory counter is not shared across processes." Your service runs four processes. Write a revision message that corrects the assumption, makes the agent check the code, keeps the plan read-only, and lets you see what changed.
Show answer
A good answer includes all four parts. For example: "We run four server processes, so an in-memory counter will not work. Find the shared Redis client in the code and tell me which module exposes it. Then update the plan to use it, including the files and steps affected and the risks section. List what you changed since the last version. Do not edit any files until I reply 'approved'." It states the fact, asks for a code check, asks for a change list, and repeats the no-edits rule.
Exercise
After three revision rounds, the plan has nine steps, mentions a logging refactor you never requested, and its risks section still describes the old design. Name two actions you would take before approving.
Show answer
Ask the agent to remove everything not needed for the stated goal and constraints, and to list what it removed (this deals with the logging refactor and the accretion). Ask it to check the plan for contradictions between files, steps, risks, and verification, and to fix the risks section. Then read the full final plan once from the top. Splitting the task or rewriting the goal is a reasonable alternative if the plan keeps drifting.