From the team behind aidrop.it — one workspace to build, host, and keep changing your code.
Context rot is the quiet performance drop that happens as you fill a model's context window. Past a point, more text makes the model worse: relevant facts get buried in the middle, attention spreads thin, and the agent forgets a constraint you stated a thousand tokens ago. The fix isn't a bigger window — it's putting less in it, and pulling the right few facts in on demand.
This is why a long, stuffed session often gives worse answers than a short, focused one on the same model. The bottleneck stopped being window size years ago; it's window quality.
What context rot is
Context rot is degradation in output quality as input length grows, even well within the window's limit. Models attend best to information at the very start and very end of the context; anything in the long middle gets diluted. Load a 100k-token context and the model technically "sees" it all — but reasons over it as if half were missing.
Why more context backfires
Every token you add competes for attention with every other token. A precise instruction surrounded by ten irrelevant files is harder to follow than the same instruction alone. Bigger windows don't fix this — they just let you pour in more maybe-relevant text, deepening the haystack. This is the same dynamic behind burning your usage limits: you pay for the bloat twice, in cost and in accuracy.
Rot vs. forgetting
Context rot and forgetting look alike but differ. Forgetting is the model losing information that left the window — through session end or compaction. Rot is the model degrading on information that's still in the window, just buried. One is a storage problem; the other is an attention problem. Both point to the same cure: keep the window short and relevant.
The fix: retrieve, don't stuff
The antidote is selection. Instead of loading everything "just in case," store knowledge outside the window and retrieve only the chunks the current task needs. A handful of relevant passages beats a wall of full files — cheaper and sharper, because the model attends to signal instead of wading through noise. Deciding what enters the window is the core of context engineering.
Where memory comes in
A retrieval-backed memory is how you keep context lean without losing knowledge. The memory can hold years of decisions while each session sees just the three facts it needs — the opposite of rot.
Habits that avoid rot
Start fresh sessions for unrelated tasks instead of letting one thread balloon. Don't paste documents an agent can search. Summarize-and-offload long histories into persistent memory rather than dragging them along. The discipline is the same one good memory architecture automates: short window, right facts, nothing extra.
FAQ
What is context rot? The drop in answer quality as a model's input grows longer, even below the window limit. Information in the long middle of the context gets diluted, so the model effectively ignores facts it can technically see.
Does a bigger context window fix it? No — it makes it easier to trigger. A larger window holds more irrelevant text, and models still attend best to short, relevant context. Selection beats size at any window length.
How do I prevent context rot? Keep the window lean: retrieve only task-relevant facts instead of loading everything. A retrieval-backed memory stores knowledge outside the window and injects just the matching chunks, so context stays short and sharp.
One workspace to build, host, and keep changing your code
The repository, what the project knows, the rules a change has to follow, and the path to an address — kept together, and reachable by the coding agent your team already uses.