Prompts & AI use

Context Rot

AI-assisted editorial review:

Context rot is the uneven decline in a language model's output quality as its input context grows longer. Simon Willison recorded the phrase in a quotation from a developer comment in June 2025.[5] In July 2025, Chroma, the company behind an open-source vector database, published a technical report titled "Context Rot" that tested 18 models, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3, and found that performance became less reliable as input length grew, even on simple tasks.[1] A larger context window does not mean the model reads everything equally well. This is a main reason context engineering, choosing only the information a model needs, has gained attention.[3]

What does Context Rot mean in simple terms?

Context rot means an AI's answers can slowly get worse as you give it more and more input. "Rot" suggests that useful material gets buried as content piles up.[1] It is a bit like handing a reviewer a 300-page report: details in the middle are easy to skim past. With AI, choosing what to include usually works better than including everything.[3]

How can Context Rot be explained with an analogy?

The thicker a report gets, the easier it is for a reviewer to miss something on the middle pages.

Where is Context Rot used?

Case 1

Chroma (US) — Testing 18 models

In July 2025, Chroma measured how 18 models, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3, performed as input length increased while the task itself stayed the same.[1] Performance became uneven and declined with longer inputs even on simple tasks such as copying a sequence of repeated words.[1] In a conversational question-answering test, models did much better when given only the relevant parts of a chat history (about 300 tokens) than when given the full history (about 113,000 tokens).[1]
Result: Across the 18 models, performance declined as input length increased, even when task difficulty was held constant (per the report).[1]

Case 2

Lost in the Middle — Position matters

A 2023 study by Nelson F. Liu, Percy Liang and co-authors tested multi-document question answering and key-value retrieval.[2] Performance was often highest when the relevant information appeared at the beginning or end of the input, and dropped significantly when it sat in the middle, even for models built for long contexts.[2] This earlier work showed that where information sits in a long input can change the answer, and it is often cited alongside later context-rot research.[1][2]
Result: Accuracy varied with the position of relevant information and was often lowest in the middle (per the paper).[2]

Case 3

Anthropic (US) — Context engineering guidance

Anthropic's engineering guide for AI agents cites context rot: as the number of tokens grows, a model's ability to recall information from its context decreases.[3] It advises treating context as a finite resource and looking for the smallest set of high-signal tokens.[3] It describes compaction (summarizing a long conversation and restarting with the summary), structured note-taking outside the context window, just-in-time retrieval and sub-agents with clean context windows.[3]
Result: Design principles such as compaction, structured notes and sub-agent separation (per the official guide).[3]

Case 4

Claude Developer Platform (US) — Product features for long-running agents

Anthropic introduced two features on its developer platform in September 2025: context editing, which clears stale tool calls and results as the context nears its limit, and a memory tool that stores information in files outside the context window.[4] On Anthropic's internal agentic-search evaluation, combining the two improved performance by 39% over baseline, and context editing alone by 29%.[4] In a 100-turn web search evaluation, context editing cut token use by 84%.[4] These are vendor-run internal results, not independent benchmarks.
Result: +39% (memory tool + context editing) and +29% (context editing alone) on an internal evaluation (per Anthropic).[4]

Try it today

  1. When a long chat has drifted, ask the AI to summarize the decisions so far, then continue in a new chat with that summary.[3]
  2. Instead of pasting a whole document, paste only the parts relevant to your question, and compare the answers.[1]
  3. Put the key facts or documents near the beginning or end of a long prompt rather than burying them in the middle, and check the results, because effects differ by model and task.[1][2]
  4. Read the summary of Chroma's report and review which of your team's tasks feed the AI the longest inputs.[1]
  5. Add one principle to your team's prompt guide: context is a finite resource.[3]

Limits and direction

The main limit is that the effect is hard to generalize. How much quality drops depends on the model and the task, and some models degrade more gently than others.[1][3] Anthropic describes it as a gradient rather than a cliff: models remain capable with long inputs but become less precise at retrieval and long-range reasoning.[3] Chroma kept its tasks deliberately simple to isolate input length, and its authors expect the decline to be even more severe in complex real-world work.[1] Position effects also vary: Lost in the Middle found a strong middle penalty, while Chroma saw no notable position effect in one of its retrieval tests.[1][2] Long context can be useful, but length alone can affect reliability in tested tasks; irrelevant or distracting material can add further difficulty.[1]

The direction is the standardization of context engineering. Compaction, structured notes, retrieval at the moment of need and sub-agent separation are becoming basic patterns for building agents.[3][4] The focus is shifting from competing on context window size to using a given window well.[3]

Which sources explain Context Rot?

  1. Chroma — Context Rot: How Increasing Input Tokens Impacts LLM Performance (technical report, 2025-07-14) — https://research.trychroma.com/context-rot
  2. arXiv — Liu et al., Lost in the Middle: How Language Models Use Long Contexts (2023-07-06, revised 2023-11-20; TACL) — https://arxiv.org/abs/2307.03172
  3. Anthropic — Effective context engineering for AI agents (2025-09-29) — https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
  4. Anthropic — Managing context on the Claude Developer Platform (2025-09-29) — https://www.anthropic.com/news/context-management
  5. Simon Willison's Weblog — A quote from Workaccount2 on Hacker News (2025-06-18) — https://simonwillison.net/2025/Jun/18/context-rot/