
What is Context Rot?
Context rot is the gradual degradation of AI agent or assistant performance that occurs as a session accumulates tokens β causing the model to lose focus on earlier instructions, contradict previous decisions, repeat itself, or fail on tasks it handled correctly earlier in the same session.
Why It Matters
Context rot is one of the most common and least-acknowledged failure modes in production AI applications. A model can handle a task perfectly at turn 5, but fail the identical task at turn 40 β not because the task changed, but because the context window is now crowded with irrelevant history that dilutes the model's effective attention.
For AI coding assistants and long-running agents, context rot typically becomes noticeable after 30β60 minutes of use. This has driven an entire category of tooling β from memory compression systems to sub-agent architectures β specifically designed to prevent or reset it.
How It Works
Context rot arises from three compounding factors:
- Attention dilution β transformer attention is distributed across all tokens; more tokens means proportionally less attention on the critical ones
- Instruction drift β system prompts and early user context receive less relative attention as the context grows
- Noise accumulation β failed tool calls, verbose API responses, and intermediate reasoning steps crowd out the signal
The result is a model that "forgets" constraints it was given earlier, reverts to default behaviors, or makes the same mistakes it corrected in turn 10.