Context Rot: Why Claude Code Sessions Decay, and How to Govern Them
Summary
The article discusses "Context Rot" in frontier models like Claude Code, detailing how the context window's contents degrade output quality. It identifies intrinsic rot, an architectural limitation where attention dilutes with growing context, and content rot, the accumulation of stale or contradictory information. Intrinsic rot causes gradual erosion of signal-to-noise, with retrieval accuracy dipping in the middle of long contexts, and performance degrading below stated token limits for complex reasoning. Content rot stems from issues like excessive tools (confusion), committing to wrong theories (clash), irrelevant search results (distraction), and stale notes (poisoning). While intrinsic rot is a model floor, content rot is manageable through deliberate context governance.
Key takeaway
For AI Engineers or Prompt Engineers managing long-running LLM sessions, recognize that context quality, not just quantity, dictates performance. Your useful context budget is often well below stated limits, and models won't self-correct when degrading. Actively govern context by curating initial setup, keeping sessions clean with targeted inputs, and resetting rather than pushing through rot. Consider a Git-branching workflow for detours to isolate messy work and merge only distilled results, ensuring consistent model reliability.
Key insights
Context rot, caused by intrinsic architectural limits and content accumulation, degrades LLM performance, but content rot is manageable.
Principles
- Irrelevant context is never free; it dilutes attention.
- Stated context limits are not performance cliffs.
- Models commit early to theories and struggle to let go.
Method
A workflow frames sessions like Git branches. Detours fork into separate sessions, accumulate rot, then are distilled via a "/conclude" skill and merged back via a "/merge" skill into the main clean thread.
In practice
- Ruthlessly curate CLAUDE.md to be minimal and high-signal.
- Use "/mcp" or "/skills" to disable unneeded tools.
- Refresh session goals at milestones for long tasks.
Topics
- Context Window Management
- Large Language Models
- Claude Code
- Attention Mechanisms
- Context Rot
- Agentic AI Workflows
- Prompt Engineering
Best for: AI Engineer, Machine Learning Engineer, Prompt Engineer
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by Towards Data Science.