What is Context rot?

Context rot is the degradation in an LLM's answer quality as its context window fills up with stale, redundant, or low-signal tokens, so older and middle content gets effectively ignored even though it technically still fits.

Context rot describes how a model's effective use of its context window decays as that window grows long and noisy. A context window has a hard token limit, but well before you hit it the model starts to weight the available tokens unevenly: recent instructions dominate, the middle is under-attended, and accumulated cruft from earlier turns dilutes the signal. The result is that stuffing more history into the prompt can make answers worse, not better, because the model is now reasoning over a haystack instead of the few facts that matter. Context rot is closely related to the lost-in-the-middle effect and is one of the core reasons context engineering and context compaction exist. The durable fix is to keep the working context small and high-signal: instead of replaying every prior turn, retrieve only the facts relevant to the current task. This is exactly what a memory layer like Glen does for AI agents. Rather than letting each session's transcript balloon, Glen stores durable observations in an org-shared store and returns only the relevant ones through one MCP tool, so the agent's context stays lean and the rot never sets in.