Context rot

Context rot is the drop in an AI model’s accuracy as the amount of text in its context window grows. A model that answers well from a short document can miss details, mix up facts or lose track of its instructions when the same material sits inside a much longer input, even though everything still fits in the window.

Why it matters

Advertised context windows suggest you can hand a model a huge amount of material and it will use all of it equally. In practice, the more you put in, the less reliably it finds and uses any one piece. Information in the middle of a long input is the easiest to lose, a pattern often called “lost in the middle”.

This is a growing problem for agents. A long agent session piles up instructions, tool results, file contents and earlier attempts. After a while, the original goal and the important constraints are a small part of a very long context, and the agent starts repeating work, forgetting rules it followed earlier or acting on stale information.

How to limit it

  • Send less. Retrieve the relevant parts of large documents instead of loading everything.
  • Use the edges. Key instructions and facts at the start or end of the input are found more reliably than those in the middle.
  • Start fresh. On long tasks, have the agent write a short summary of where things stand and continue in a new session, rather than letting one context grow without limit.
  • Hand off the reading. A subagent can do the heavy reading in its own context and return only the answer.
  • Test at real length. A model that does well on a short test can fail on a full-size input, so test with inputs as long as the ones you’ll actually use.

Bring your agent. Bring your team.