Your agent didn't run out of context. The context rotted.
Two hours into a refactor yesterday, my agent wrote a helper function—the exact same one it wrote 90 minutes earlier in a file it created itself. Then it apologized. It always apologizes.
The easy diagnosis is "it ran out of context". Except my session was sitting at 120K in a 200K window. Nothing overflowed. The context didn't run out—it rotted.
You have two budgets, not one:
Hard Budget: Token limit. You notice it when the API errors out.
Soft Budget: Attention quality. It drains silently long before you hit the limit.
Chroma tested 18 models on this: every single one degraded as context grew, starting far below advertised limits. Coding sessions are context-rot factories—every git diff, test run, and stack trace turns into dead sediment competing for attention.
A paper from June measured agents with safety policies: fresh in context = 0% violations. After auto-compaction summarized it away = 38% violations. Not disobedience, just amnesia.
What actually works:
Put anything that must stay true in a file the agent reloads every session (AGENTS.md, CLAUDE.md, whatever your tool reads). Stuff you say in chat at turn 3 is one unlucky summarization away from gone. Files survive. Chat doesn't.
Several small sessions beat one epic. A fresh session with a written handoff beats a long one with a silent auto-compact, because you get to read the handoff before it becomes the truth.
Learn the smell. Re-reading files, re-asking questions, re-implementing its own code: that's not thoroughness, that's your cue to compact on your terms and restart.
Bigger windows won't save us btw. They move the cliff, they don't remove it.
How do you handle this? Do you compact manually or trust the tool's auto-truncation?
Replies
This actually explains a lot. I always thought the model was just being lazy.