The “Stale /Plan” Problem in Coding Agents
From the publisher’s feed, collected in the ZeroLabs newsroom.
If you are using any coding agent for long running implementation/deubgging tasks you might have already run into this problem:The agent writes a plan.You agree on the plan.Implementation starts.Then reality changes in implementaion/testing phase.A test fails. A reviewer asks for a different direction and you make changes outside planning mode. You correct the agent mid-flight. The agent adapts the code, but the plan file quietly stays behind.That stale plan looks harmless until it becomes the source of truth again when you resume the agent session again at later stage.It is normal for agent to chagne direction based on atual testing outcode but the riskier part is when the intial plan does not change with it.This post is about a small workflow I have started using to handle that scenario: a plan-drift-recovery skill/workflow for coding agents.The idea is simple:When the plan and reality diverge, stop coding/implementation, reconcile the plan and only then resume. The plan doc should always reflect the latest code implemented.TL;DR Plan drift happens when an agent patches code to pass tests or fix bugs without updating the original plan, leaving future readers (human or AI) with a confident document that describes a reality that no longer exists. This post breaks down why it happens, what it costs, and how to guide agents to keep plan and implementation in sync.The hidden failure mode: the old plan wins againCoding-agent plans are useful because they make the work explicit. They capture scope, assumptions, approach, risks, and next steps.However when has to makes changes to addreess some failed test cases etc, it might miss updating the original plan making it outdated.~/plans/.mdWhen a new session starts or a subagent reads the file, the old plan can silently reassert itself.That is how you end up thinking:“Wait, why is the agent doing the old approach again?”Plan drift comes in two formsAfter watching this happen seveal times, I think that plan drift usually comes from two sources.1. Conversation driftConversation drift happens when the user changes the direction of the task outside planning mode, but the plan file is not updated.It can be obvious:“No, do it this way.”“Skip that part.”“That’s not what we agreed.”“We descoped this after review.”It can also be subtle:“Yes, do that.”That last one is tricky. If “that” means a new approach that differs from the plan, the approval changed the source of truth. But unless the plan is updated, the correction only exists in chat.Symptoms of conversation driftThe agent references decisions you already overrodeThe agent re-asks questions you already answeredAfter context compaction, behavior reverts to the original planSubagents inherit the old scope, not the revised onePost-review changes never make it into the durable plan/designThe result is a mismatch between what the team decided and what the plan says.2. Evidence driftEvidence drift is sneakier because it often happens during normal debugging outside planning phase.The plan says:“Use approach A.”Then tests fail. Logs disagree. Production behavior contradicts the assumption. The root cause turns out to be different.The agent patches the code into approach B and gets things working.But the plan still says A.That means the code now reflects reality, while the plan reflects a discarded hypothesis.Symptoms of evidence driftA debugging session finds a different root cause than the plan’s hypothesisCode diverges from the documented approachNew constraints discovered during validation are not written downA future reader sees a confident design that does not match the implementationThe recovery loopThe plan-drift-recovery skill/workflow is supposed to make the agent pause at exactly the moment it is most tempted to keep coding.One of the key step is #6.It is not enough to append a note at the bottom saying:“Actually, we changed direction.”That still leaves the wrong design at the top of the file.If evidence invalidated the approach, the approach section needs to change. If scope changed, the requirements need to change. If debugging found a new root cause, the context and solution need to change.The plan should not be a historical artifact of the first thought of approach. It should describe the work as it is now understood.What should trigger recovery?The workflow I use has two categories of triggers: user-driven triggers and self-detection triggers.User-driven triggersThese are phrases that signal the conversation has diverged from the plan.Direct callouts“You’re off-track”“Re-read the plan”“That’s not what we agreed”Mid-implementation pivots“No, do it this way”“Use A instead of B”“Skip Z”Review-driven revisions“PR feedback says…”“As per new requirement implement.. ”Quiet approvals“Yes, do that”This matters when the approved direction differs from the plan.Frustration signalsRepeated instructions, STOP, short imperatives, or correction loops are all signs that the agent should pause and reconcile.Evidence-driven triggersThese happen when validation contradicts the plan:a failing test invalidates the proposed designa stack trace contradicts the root-cause hypothesisa patch diverges from the documented approacha regression appears after the planned fixSelf-detection triggersThe agent should not wait for the user every time.It should proactively trigger recovery when it notices:it is about to act on an overridden decisiona test result invalidated a design assumptionthe code patch no longer matches the plancontext compaction may have hidden important correctionsdebugging found a different root cause than the one documentedThat self-detection is the difference between a passive checklist and a useful workflow.The rule that makes it workThe whole practice comes down to one rule:For durable agent context, if a correction or contradicting test result is not reflected in the plan file, future sessions should assume it may be lost.The plan file is the durable artifact. Chat is not.If something needs to survive compaction, subagent dispatch, a new session, or a future reader, it needs to be written back into the plan.Let plan.md serve as the agent memory.A lightweight structure for plan updatesWhen drift is found, the skill/workflow updates two parts of the plan.1. A dated decisions logThis gives readers a short history of what changed.## Decisions & Revisions### 2026-05-25- [conversation] User descoped the batch export path.- [evidence] Integration test showed that the optimistic cache approach does not hold after retry.2. The affected sections higher upThis is the part that prevents future confusion.If the Approach section is wrong, edit Approach.If the Requirements section is stale, edit Requirements.If the Root Cause section was a bad hypothesis, edit Root Cause.The revision log explains the change. The body of the plan carries the current truth.Why this mattersCoding agents are getting better at writing code, but long-running work still depends on memory, alignment, and durable context.A plan is supposed to reduce ambiguity.But a stale plan does the opposite. It gives the agent a confident reason to repeat an old mistake.The plan-drift-recovery loop is a small guardrail against that failure mode.It does not make the agent smarter. It makes the source of truth harder to corrupt.And for long-running agentic work, that may be one of the most useful improvements we can make.Question for other coding-agent usersHow does plan drift show up in your workflow?Do you prefer a strict “stop and reconcile” loop, or should agents continuously rewrite plans after every meaningful exchange?I am curious if you have found a workflow that holds up better.The “Stale /Plan” Problem in Coding Agents was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.