HeadlinesBriefing favicon HeadlinesBriefing.com

Context Rot: Why Claude Code Sessions Decay

Towards Data Science •
×

The context window is the core memory mechanism for models like Claude Code, holding system prompts and session history. As sessions grow, output quality declines gradually—a phenomenon called context rot. This stems from two sources: intrinsic rot, inherent to model architecture, and content rot, the accumulation of stale or contradictory information. Intrinsic rot arises because attention heads distribute a fixed budget across all tokens via softmax, meaning irrelevant context always dilutes signal. Research by Liu et al., 2024 shows retrieval accuracy dips in the middle of long contexts. Vendor benchmarks overstate usable context; real reasoning degrades well within stated limits.

Content rot involves four failure modes identified by Drew Breunig: confusion (overloaded tools), clash (contradictory info), distraction (tangential outputs), and poisoning (errors feeding forward). Since the model conditions on its own prior outputs, errors compound. Managing content rot requires governing autonomy: curating tools, pruning context, and intervening before errors cascade. The stated token limit is not a cliff; useful context budget sits far lower.