Back to blog
Workflow
Superpowers
Claude Code

Why Your Agent Forgets Step 5 by Step 12

Thắng Đoàn
Thắng Đoàn

You hand an agent a ten-task plan. By task four it has drifted; by task ten the plan is a memory and the code is a surprise. The model is not forgetful, the plan is too coarse. The fix is smaller tasks with sharper edges.

Why big tasks drift

"Implement user authentication" is not a task, it is a feature hiding subtasks with their own decisions. Run as one unit, the agent decides on the fly, and the decisions bury themselves in code. By task seven it is working inside constraints it created by accident three tasks ago.

The bite-sized rule

A task is one action that takes two to five minutes. Writing a failing test, watching it fail, writing minimal code, watching it pass, committing: five tasks for what a junior would call "write the login function". Small tasks produce small failures, and small failures are easy to locate. When task 12 breaks the build, the break is in task 12.

What every task contains

Three things, every time. Exact file paths, never "the relevant file". Complete code, ready to paste, never "implement similar to above". Verification commands with expected output, never just "run the tests". If any of the three is missing, the agent guesses, and guessing is where drift starts.

The no-placeholder rule

Placeholders look like progress and produce nothing. Banned phrases: TBD, TODO, implement later, fill in details, "add appropriate error handling", "similar to Task N". If you do not yet know the content, the plan is not ready. Writing the content first sounds slow and is faster, because the alternative is reviewing improvisations.

Structure first, self-review second

Before any task is written, map the file structure: which files are created, which modified, what each is responsible for. The plan then decides the tasks, and the agent never decides "where does this go". After drafting, self-review: spec coverage (every requirement maps to a task), placeholder scan, and type consistency, because clearLayers in task 3 versus clearFullLayers in task 7 is a bug.

The trade-off

Agents cannot write these plans alone: they reach for abstractions and leave placeholders, because filling them requires decisions nobody made. The plan must come from a layer above the implementer, which costs your time up front. You pay it back by never reviewing improvisations or hunting drift across an eight-task diff.

The smallest test

Take the next plan you are about to hand an agent. Split anything longer than five minutes, replace every placeholder with real code, then run it.

Share:

Recommended for you

Enjoyed this article?

Subscribe for new articles. No spam. Unsubscribe anytime.

By subscribing you agree to receive the newsletter. No spam, and you can unsubscribe anytime.