Topic 5 of 5 · 4 min read
Warning signs of an oversized agent task
Goal: Recognise from a run log that a task was too big and choose how to split or restart it.
An oversized task shows itself during the run: the context fills, the same fix is tried again and again, the diff spreads, and the agent claims success before anything passes. When you see these signs, stop and re-slice. Pushing on usually makes it worse.
Check yourself · 1 of 3
Which is a warning sign that an agent task is too big?
Why it matters
Agents keep their instructions and history in a limited context window. As it fills, earlier instructions get less weight and the agent forgets constraints you set at the start. Anthropic's best-practice guidance for Claude Code warns about this and recommends clearing or restarting sessions when they drift. The cost of noticing late is a large diff, a muddled history and a review you cannot trust.
The five signs
- A filling context. The tool shows context usage climbing, or the agent starts re-reading files it already read.
- Repeated fix attempts. The same test fails three or four times with small variations of the same patch.
- A growing diff. The changed-file count keeps rising while the failing check does not change.
- Edits far from the target. Changes appear in config, build scripts or unrelated modules to make something pass.
- Early success claims. "Done, all working" arrives while a check is still red, or without any run.
What to do
- Stop the run. Do not add "please try again" on top of a confused session.
- Save what you learned. Note which files matter, what the failing check says and what was tried.
- Revert or stash the diff. Keep only parts you understand.
- Re-slice. Make the first failing step its own task, with its own check.
- Restart with a fresh session and a short brief of the notes.
$ git diff --stat
src/orders/total.ts | 44 ++--
src/orders/total.test.ts | 31 +-
webpack.config.js | 12 +
package.json | 3 +-
src/auth/session.ts | 27 ++--
5 files changed
The task was "fix rounding in order totals". The build config and the auth file should not appear. That is edits far from the target, and each one is a reason to stop.
What goes wrong
- Sunk-cost continuing. "It is nearly there" after the fourth failed attempt.
- Fixing the checker. The agent loosens a test or a lint rule to get green.
- Ignoring the first sign. One sign may be noise. Two together mean re-slice.
Examples
Reading a run log
[12:01] edit src/orders/total.ts
[12:03] run pnpm test orders -> 2 failed
[12:05] edit src/orders/total.ts
[12:06] run pnpm test orders -> 2 failed
[12:09] edit jest.config.js
[12:11] run pnpm test orders -> 1 failed
[12:14] "All set. The rounding bug is fixed."
Three signs show: repeated attempts, an edit to config, and a success claim with a failing test. Stop, revert the config change, and split off the first failing test as its own task.
Restarting with notes
After stopping, you write four lines: the bug lives in total.ts; tax rounding is shared with invoice.ts; two tests fail because of banker's rounding; the config change was not needed. A fresh session starts from those lines and a single failing test, and finishes the small task.
Key points
- The five signs of an oversized task are a filling context, repeated fix attempts, a growing diff, edits far from the target and early success claims.
- One sign can be noise, but two together mean the task should be re-sliced.
- Stop the run instead of piling "try again" onto a confused session.
- Save notes on what matters, revert what you do not understand and restart fresh with a smaller task.
- Edits to build, config or unrelated modules to make a check pass are a stop signal.
Common mistakes
- Adding "try again" to a session that is already confused instead of stopping and re-slicing.
- Accepting edits to config or unrelated files because they make a check pass.
- Believing a "done" message without running the check.
- Throwing away the session without saving what it taught you about the code.
Check yourself · 2 of 3
An agent editing order totals also changes a build config file. What should you do?
Check yourself · 3 of 3
You stop an oversized run. What is the best next step?
Practice items, not counted towards your mastery.
Start here
- Small CLs (Google Engineering Practices) (opens in a new tab)ArticleFree
Why small, self-contained changes get better reviews, and how to split large ones.
- Best practices for Claude Code (Claude Code docs) (opens in a new tab)DocsFree
A vendor's advice on verification, planning first and managing a filling context.
- Best practices for using GitHub Copilot to work on tasks (opens in a new tab)DocsFree
What makes a task a good fit for a coding agent: clear scope and acceptance criteria.