The five-step loop turns coding agent workflows into persistent artifacts, solving the drift problem that plagues AI code generation. Skipping the spec step is the most expensive failure mode, says the Grounded Code series author.
Key facts
- Five-step loop: Spec, Plan, Implement, Verify, Consolidate
- Skipping spec is the most expensive failure mode
- Bad plan costs ~2,000 tokens; bad implementation costs hours
- All three audited agent codebases use plan-mode affordances
- Drift compounds invisibly across turns without spec anchor
The five-step loop — Spec, Plan, Implement, Verify, Consolidate — addresses a fundamental limitation of current coding agents: they have no persistent memory across turns. [According to the Grounded Code series] the loop makes every step a persistent artifact because "the primary reader of the codebase no longer sustains implicit habits across turns."
Key Takeaways
- The five-step loop makes every coding agent step a persistent artifact.
- Skipping the spec causes compounding drift that's invisible until verification passes for the wrong feature.
Why the spec step is load-bearing
The author makes two non-obvious claims defended explicitly. First, Step 2 (plan mode) is the step that saves the most time. Second, skipping Step 1 (the spec) is the most expensive failure mode. Both claims came from watching the loop run and watching it fail when steps were skipped.
Without a spec, the agent has no contract to hold onto. Three turns later, when context is partially compacted, the original intent is no longer cleanly available. The agent guesses and fills in plausible defaults that almost-but-not-quite match what you wanted. The compounding effect makes this expensive — a wrong decision in turn three influences turn four, which influences turn five. By turn ten you have a feature that "works" (tests pass, code compiles) but isn't what you asked for.
The author identifies two specific failure modes: the agent extends the feature with something out of scope (payment authorization snuck into a pricing function) because nothing told it not to, and the agent solves the right problem with the wrong contract (a function returns the right value but with a signature that breaks two downstream callers) because the public API was never declared.
Plan mode: the cheapest alignment
Plan mode produces an artifact small enough to actually read. You can object to step three of seven without reading a thousand lines of code. That objection is the cheapest possible alignment, and it happens before any code exists.

The economic argument: a bad plan costs maybe two thousand tokens to produce and another five hundred to discuss. A bad implementation dirties git state, introduces test failures, and rebuilds your mental model into something that doesn't match what you wanted. Throwing it away is hard both technically and psychologically.
All three coding-agent codebases audited for the series had explicit plan-mode-like affordances, heavily used and not optional. That convergence is the strongest evidence this step is load-bearing.
What to watch
Watch for major coding agent products (GitHub Copilot, Cursor, Claude Code) to add persistent spec artifacts and explicit plan-mode as default workflows within the next 6 months. The convergence the author observed suggests this pattern will become table stakes for agent reliability.









