Context rot is the degradation of a model's recall, reasoning, and instruction-following as its context window fills with more tokens, including stale, conflicting, or low-signal ones, so output quality declines even while the input still fits inside the window.

How it works

A model attends across everything in its window, but attention is finite and competes for one budget, so adding tokens is not free even when there is space left. Two effects compound. The first is positional: information in the middle of a long context is recalled less reliably than what sits near the start or the end. The second is signal dilution, where stale tool results and superseded instructions draw attention away from the tokens the answer depends on. Independent measurement shows recall declining as input length grows even on tasks that are no harder, which is the finding that separates rot from raw difficulty. The window still reports as valid and the model still answers; what degrades is how well that answer is grounded in the part of the context that mattered.

Why it matters

The dangerous property of context rot is that it is silent: a rotted window produces a fluent, confident answer that is worse-grounded than it looks, and nothing in the output flags the degradation. Treating the window as free space is the mistake that invites it, because every token kept just in case competes with the ones that matter. The honest limit is that rot cannot be eliminated, only managed, since any long-running agent accumulates context, so the question is not whether rot sets in but how aggressively the work prunes against it. It is the failure mode that justifies the disciplines built to fight it, which is why an agent that stays reliable past its first easy turns is usually one whose context was curated rather than left to fill.

In practice

A coding agent works a long task and keeps every tool result, every superseded plan, and every intermediate file dump in its running context. The window is still under its limit, so nothing truncates and no error fires, but the agent starts re-introducing a constraint it already satisfied and citing a file version it already replaced. The tokens it needs are still present; they are just buried among the ones it does not need, and the answer drifts. Clearing the stale results and compacting the old history restores the grounding the raw transcript had quietly eroded.

Practical considerations

Rot correlates with input length, so the first defense is keeping the window small on purpose: clear re-fetchable tool results once their value is spent, compact older history into a summary, and write durable notes outside the window rather than carrying raw transcript forward. Placement is a lever, since tokens an answer depends on survive the middle-of-context drop better near the boundaries of a long context than buried in the center. Subagents bound rot structurally by giving a sub-task its own isolated window, so its intermediate tokens never enter the main one. The symptom to watch is a quiet quality decline late in a long session rather than a hard failure, so a run that was sharp early and vague later is a candidate for rot rather than for a harder task. Because the window still validates, no automatic check catches rot on its own, so the workflow has to be built to prune against it rather than assume capacity is correctness.

Related standards and prior art

  • Chroma: Context Rot · 2025-07-14 · (canonical measurement study) independent multi-model study that popularized and quantified the context-rot framing and measures recall declining as input length grows, including on tasks that are no harder
  • Lost in the Middle (arXiv 2307.03172) · 2023-07-06 · (seminal prior art) seminal study showing models recall the start and end of a long context more reliably than the middle
  • Anthropic: Context windows · continuously updated vendor documentation that names context rot as recall degradation as the window fills

Defined by Ready Solutions AI