ArticlesField notes
The day context rot bit me at 80% full
A field note on watching a long session quietly degrade as the window filled — and the compaction habit I keep now.
I lost an afternoon to context rot before I knew the term for it. This is the field note on what it looks like from the inside, why it took me so long to diagnose, and the habit that means it doesn't happen anymore.
The session that went sideways
It was a long one — a meaty refactor, lots of back and forth, the kind of session where you're deep in it and don't want to stop. For the first hour the agent was excellent. Sharp, precise, getting it right.
Somewhere in the second hour it started to slip. It reintroduced a pattern I'd explicitly told it to drop early on. It contradicted a decision I'd made forty minutes earlier. Small things, then less small. And it stated all of it with total confidence.
The tell: confident and wrong
That's what threw me. I kept assuming a confident agent was a correct one, so I went looking for the bug in the code. There wasn't one. The agent was producing wrong work and presenting it exactly like the right work it had produced an hour before.
I burned a good while chasing the wrong cause, because the failure had no error message. It just got quietly, confidently worse.
Stuart Leo
When an agent gets confidently worse deep into a session, suspect the context window before the model.
Realising the window was full
The penny dropped when I noticed when it started — not at any particular task, but at a particular depth. The context window had filled. As it filled, the model degraded — it started dropping the earlier instructions and decisions to make room. This is context rot, and it's a property of every model, not a one-off glitch. Teams running agents at scale treat managing the window as core engineering for exactly this reason.
The agent hadn't got dumber. Its working memory had filled past the point where it could hold everything, so the early context — the very decisions it was now violating — had rotted out.
The compaction fix
The fix in the moment was simple once I understood it: I had the agent write a short note of where the refactor was up to and what was decided, then I started a fresh session from that note. Clean window, all the decisions restated concisely, back to sharp immediately.
What I changed
Now I don't wait for the slip. A few habits keep me out of it:
- Watch the fill level, not the clock. When a session's window gets past half to sixty percent, I compact — summarise and move on — rather than pushing to full.
- Long task, fresh start. When something runs long, I have the agent write where it's up to and I start clean from that.
- Suspect the window first. When output degrades with no error, my first question now is "how full is the context?" — not "is the model having a bad day?"
When an agent gets confidently worse deep into a session, suspect the context window before the model. The fix is compaction, and it's a habit, not a rescue.
Start here: see compaction, in detail, how to stop your agent forgetting, or read the method.
Related
Every model degrades as its context fills — context rot. Compaction keeps the working set lean without losing what matters. The three mechanisms C² uses.
How to stop your AI agent forgetting what it learnedAI agents forget everything when the session ends or the context window fills. Why the memory wall happens — and the written-context fix that makes learning stick.