Sub topic 14
Common Ways Plans Go Wrong
This chapter assumes you have used a coding agent on a real repository, can read a diff, and can run a project's test suite. It also assumes you know the planning workflow from earlier chapters: ask for a plan, review it, approve it, then implement in small steps. Here we look at how that workflow fails and what to do about each failure.
A plan reduces risk, but it does not remove it. A plan is text written by an agent that may not have read everything it needed. It can sound confident and still be wrong. Most plan failures fall into a small number of patterns, and each one has a visible sign you can learn to spot.
Failures in the plan itself
The plan solves a nearby problem
The agent restates your goal in its own words and drifts. You asked to reject more than 5 failed logins per IP in 10 minutes. The plan limits all requests to /login, successful or not. Both sound similar, but they behave differently for a user who logs in often.
Sign: the plan's summary line uses different words from your goal, and the steps do not mention the exact numbers or conditions you gave.
Fix: compare the plan's first sentence with your goal, word by word. If the plan changed a condition, quote your original condition back and ask for a revision.
Unstated or false assumptions
Plans rest on assumptions, and the dangerous ones are the ones the agent does not write down. The sample plan in this tutorial assumes a single server process. If your service runs several processes, an in-memory counter silently fails: each process counts separately, so the real limit becomes five times the number of processes.
Sign: the plan has no "Risks and assumptions" section, or that section is empty or generic ("assumes the code works as expected").
Fix: ask directly, "List every assumption you are making about how this service is deployed and run." Then check each one against what you know. You can often confirm an assumption faster than the agent can, because you know your deployment.
Plausible but invented details
An agent that did not read a file can still name it. A plan may refer to config/limits.yaml, a helper called get_client_ip(), or a library function that does not exist.
Sign: a file path or function name you do not recognize.
Fix: check every name in the plan against the repository before approving. A quick search is enough.
# Confirm that files and symbols named in the plan exist
ls auth/routes.py config/limits.yaml
grep -rn "def get_client_ip" .If a name does not exist, the plan was not grounded in the code. Ask the agent to read the relevant files and revise, rather than correcting one name at a time.
Vague steps
"Update the authentication module" is not a step. It cannot be reviewed, and it cannot be checked afterward. Vague steps hide the real decisions.
Sign: steps with no file, function, or observable result.
Fix: ask for each step to name the file, the change, and how you would know it worked.
Scope creep
Plans tend to grow. The agent adds a refactor "while we're here," renames a function, or upgrades a dependency. This breaks your constraints, such as "do not add new dependencies," and makes the diff harder to review.
Sign: files in the plan that you would not have listed yourself, or steps with words like "also," "clean up," or "modernize."
Fix: ask the agent to mark each step as required or optional, and remove the optional ones. Unrequested work belongs in a separate request.
Missing verification
A plan that says "test the change" has no verification. A useful plan names the tests to add, the existing tests to run, and the behavior to check by hand.
Sign: the verification section is one line, or absent.
Fix: ask for specific cases. For the rate limiter these are under the limit, exactly at the limit, over the limit, and after the window expires.
Failures in the process
Approving without reading
The most common failure is a reply of "looks good" to a long plan. The approval gate only works if the review behind it was real. Use the checklist from the review chapter every time, even when the plan is long.
Vague approval
"Go ahead" can be read as permission for the whole plan, including parts you did not review. Approve specific scope instead.
Approved. Implement step 1 only, then stop and show me the diff and the test results before moving to step 2.Letting the plan go stale
Plans describe the code at the moment they were written. If you change the code, switch branches, or pull new commits between planning and implementing, the plan may describe files that no longer look the same. The same happens when the conversation is long and the agent's earlier reading falls out of its working context.
Sign: the agent's edits do not match the surrounding code, or it refers to a function that has since been renamed.
Fix: for long gaps, ask the agent to re-read the affected files and confirm the plan still applies. If you saved the plan as a file, include a note of which commit it was written against.
Following the plan after reality disagrees
Sometimes step 3 turns out to be impossible. The function the plan depends on does not behave as described. The agent may then improvise quietly and keep going, so the implementation no longer matches what you approved.
Sign: the diff contains changes that no step describes.
Fix: tell the agent in advance what to do when this happens.
If a step cannot be done as written, stop and tell me what you found. Do not change the approach without asking.Never comparing the result to the plan
The plan is also a measuring stick. If you approve a plan and then skip the comparison, you lose most of its value. Check each changed file against the plan's file list, and check each step against the diff.
A quick map of failures
| Failure | Where it appears | Early sign | First response |
|---|---|---|---|
| Nearby problem | Plan content | Goal wording changed | Quote the original goal and ask for revision |
| False assumption | Plan content | No assumptions section | Ask for all assumptions, then check them |
| Invented detail | Plan content | Unknown file or function name | Search the repo, then ask for a grounded revision |
| Vague step | Plan content | No file or result named | Ask for file, change, and check per step |
| Scope creep | Plan content | Extra files or "also" steps | Mark steps required or optional |
| Missing verification | Plan content | One-line test section | Ask for named test cases |
| Rubber-stamp approval | Process | Short reply to long plan | Use the review checklist |
| Stale plan | Process | Edits do not fit the code | Re-read files, confirm the plan |
| Silent deviation | Process | Diff has unplanned changes | Stop, require agent to report blockers |
Where failures enter the workflow
Content failures are cheapest to catch at plan review, because nothing has been written yet. Process failures show up later, at the diff. Sending the work back to revision from either point is normal and does not mean the approach failed.
Handling a failure after code exists
Sometimes you find a problem after implementation has started. Work through it in order.
- Stop further edits. Do not let the agent continue while the plan and the code disagree.
- Look at the diff and decide whether the problem is in the plan or in the implementation.
- If the plan was wrong, revise it first, then ask the agent to adjust the code to match. Do not patch the code and leave the plan unchanged.
- If the implementation drifted from a correct plan, point to the step it violated and ask for a correction.
- If the change is small and bad, revert it with version control and restart from the last good step.
# See what changed since the last good commit
git diff --stat
# Discard uncommitted changes to one file you decided to redo
git restore auth/routes.pygit restore discards uncommitted changes to that file. Run git diff first to be sure you will not lose work you want to keep.
Edge cases
- A correct plan can still be too large. If you cannot review it in one sitting, split the goal into two planning requests.
- Agents sometimes agree too readily with your corrections. If you say an assumption is wrong, ask the agent to explain how it changes the plan, not only to say "updated."
- A plan can be right and incomplete. It lists the files that change but misses a test fixture or a config file that must change too. Run the existing test suite early to find these.
- Some failures are invisible in the plan. Performance and security problems may only show in the code. Ask for these in the risks section, and review the diff with them in mind.
Exercise
An agent's plan for "reject more than 5 failed logins per IP in 10 minutes" includes a step: "Add a cache layer, upgrade the web framework, and rate limit all /login requests." Your constraints say no new dependencies. Name three failures in this step and say how you would respond.
Show answer
First, scope creep: the cache layer and framework upgrade were not requested, and the upgrade likely adds or changes a dependency, which breaks your constraint. Second, a nearby problem: limiting all /login requests differs from limiting failed attempts only. Third, a vague step: three unrelated changes are bundled into one step with no file or check named. Respond by quoting your goal and constraints, asking the agent to remove the optional work, split the remaining work into separate steps that each name a file and a check, and revise the plan before you approve anything.
Exercise
You approved a four-step plan and told the agent to implement step 2. The diff shows the step 2 change plus a renamed helper function that no step mentions. What do you do, and what instruction could have prevented it?
Show answer
Stop further edits and ask the agent why it renamed the helper. If the rename is not needed, ask it to revert that part, or revert it yourself with version control. If it is needed, update the plan to include it, then approve it. Prevent this by instructing the agent beforehand: "If a step cannot be done as written, or needs a change not in the plan, stop and tell me. Do not change the approach without asking."