Sub topic 14
Common Ways Plans Go Wrong
This chapter assumes you have used a coding agent on a repository, can read a diff, and can run a project's tests. It covers what can still fail after you ask for a plan, and how to catch each failure early.
A plan reduces risk, but it is not a guarantee. A plan is a written prediction, and predictions can be wrong or incomplete. The failures below are the ones you are most likely to meet.
Failures in the plan itself
Plausible but wrong assumptions
An agent may state an assumption that sounds reasonable but is false for your project. In the rate limiting example, the plan assumed a single server process. If you run several, an in-memory counter silently lets through more attempts than the limit allows.
The fix is to read the "Risks and assumptions" section line by line and check each item against what you know. If the plan has no assumptions listed, ask for them. A plan that claims to have none is hiding them.
Solving a nearby problem
The plan may be well written but answer a slightly different question. You asked to reject failed attempts per IP address, and the plan counts all requests per IP address. Compare the plan's first sentence with your goal before reading the details.
Vague steps
A step such as "update the authentication code" cannot be checked. You cannot tell whether the result matches it. Ask for steps that name a file, a function, and an observable result.
Scope creep
Plans sometimes include extra work: renaming a helper, upgrading a library, reformatting a file. Each addition makes the diff harder to review. Check every listed file against the question "did I ask for this?"
Failures after approval
Drift from the plan
The agent may start implementing and then change course without saying so. It might touch a file the plan never named. Compare the diff with the plan's file list after every step. If a file appears that was not planned, ask why before continuing.
Approval that is too broad
Replying "looks good, go ahead" lets the agent implement every step at once. You then review a large diff with no checkpoints. Limit each approval to one step, as shown earlier in this tutorial.
A plan that goes stale
If you change your mind, edit the code yourself, or the branch moves, the plan no longer matches reality. Do not keep following it. Ask for a revised plan that reflects the current state of the code.
Verification that proves nothing
A plan may say "run the tests" when no test covers the new behavior. Passing tests then show only that old behavior still works. Check that the verification section includes a test that would fail if the feature were missing.
A quick diagnosis table
| Symptom | Likely cause | Response |
|---|---|---|
| Feature works locally but fails in production | Unchecked assumption about the environment | Add the assumption to the plan and test it |
| Diff touches unexpected files | Scope creep or drift | Ask the agent to justify each file, or revert it |
| Tests pass but behavior is wrong | Weak verification | Add a test that fails without the change |
| Plan no longer fits the code | Stale plan | Request a new plan from the current state |
A correction prompt
When you find drift, state what you saw and what you want:
The diff changes `auth/utils.py`, which is not in the approved plan.
Explain why it was needed. If it was not needed, revert that change.
Do not continue to step 2 until I confirm.Exercise
A plan for the /login rate limiter lists the verification step as "run the existing test suite." Why is this weak, and what would you ask for instead?
Show answer
The existing tests were written before the limiter existed, so they pass whether or not the limiter works. Ask for new tests that fail without the change: one for requests under the limit, one at the limit, and one after the window expires.
Exercise
You approved a plan with the reply "looks good, go ahead." The agent changed six files in one pass, and one of them was not in the plan. What went wrong in the approval, and what do you do now?
Show answer
The approval was too broad, so there was no checkpoint between steps. Ask the agent to explain the unplanned file and revert it if it is unnecessary. Then restate approval for one step at a time, with a pause to review the diff after each.