Context Rot in AI Agents: What It Is and How Context Engineering Fixes It
Is context rot the reason my AI agent nails a task on Monday but botches it by Friday? Yes, it likely is. If you run marketing agents every day, you’ve probably wondered this concept of context rot. You see it as forgotten instructions, drifting tone, or a bot claiming it finished work it never did.
Sound familiar? Context rot is the slow decline in an AI model’s accuracy as its context window fills up with more and more text. Even heavy users hit it.
Martin Casado, a general partner at Andreessen Horowitz, recently listed the problems he runs into with agents. Token use keeps climbing, yet agents still make the same mistakes, drift, lose context, and sometimes lie.
My fix at Single Grain is unglamorous, and it works. Every correction becomes a written rule the bot keeps. Stick around for why context rot happens and the context engineering habits my team uses to keep agents on track.
TL;DR
- Context rot is real and measurable. Research from Chroma found model accuracy drops as input length grows, even on simple tasks.
- Bigger context windows don’t fix it. Stuffing more history into a prompt often makes answers worse.
- Context engineering is the fix. Give agents only the tokens they need, when they need them.
- Turn corrections into rules. A short, durable rule file beats hoping the agent remembers last week’s feedback.
What Is Context Rot?
Context rot is the drop in an LLM’s reliability as the amount of text in its prompt grows. The model can technically read everything in its context window. Still, the more you give it, the worse it gets at finding and using the parts that matter.
Chroma’s context rot research tested eighteen models, including GPT-4.1, Claude 4, Gemini 2.5, and Qwen3. Across every experiment, performance degraded as input length increased. The drop was steeper when the question and the relevant passage used different wording, which is exactly how real work looks.
How Context Rot Shows Up in Marketing Agents
For marketing teams, context rot rarely looks like a dramatic failure. It looks like small, annoying slips.
- Forgotten rules. The agent stops following a brand guideline it followed perfectly an hour ago.
- Drift. Tone, format, or priorities slowly wander away from the brief.
- Repeated mistakes. You correct something, and two tasks later it happens again.
- False completion. The agent reports a task as done when it isn’t.

Martin Casado described almost the same list in his post on agent pain points, from memory issues to reward hacking. I quoted it because it matched my week exactly.
Why Does Context Rot Happen?
Every model has a limited attention budget. Anthropic’s engineering team explains in its guide to effective context engineering for AI agents that context is a finite resource with diminishing returns. As tokens pile up, the model’s ability to recall and reason across all of them weakens.
Similar-looking text makes it harder still. Chroma found distractors, passages that look relevant but aren’t, hurt accuracy more as input length grew. For a marketing agent, distractors are everywhere: old briefs, past drafts, rejected headlines, and last quarter’s numbers all sit in the same history as today’s task.
Long-running agents make this worse. Each tool call, file, and message adds to the history. After enough steps, the instructions you care about are buried under logs, drafts, and old back-and-forth.
The Context Window Myth
Context window sizes keep growing, and it’s tempting to assume a bigger window solves the problem. It doesn’t. A model that accepts a million tokens still pays attention unevenly across them.
In Chroma’s tests, models did much better with a focused version of a conversation than with the full history. More room only helps if you fill it with the right material.
What Is Context Engineering?
Context engineering is the practice of deciding exactly what information an agent sees at each step. It’s easy to confuse with prompt engineering, so here’s the difference.
- Prompt engineering focuses on wording one instruction well.
- Context engineering manages everything around that instruction, including rules, retrieved files, tool results, and memory.
Both matter, but context engineering is where long-running agents win or lose.
Here’s how I explain it to my team: the agent is only as good as the desk you hand it. A clean desk with the right three documents beats a desk buried in every file you own.
How to Prevent Context Rot in AI Agents
These are the habits my team uses on the agents running inside Single Grain. None of them need special tools.
- Keep a short rule file. Store durable instructions in one file the agent loads every time. Keep it tight and remove anything stale.
- Turn every correction into a rule. When you fix a mistake, write the fix as a one-line rule and add it to the file.
- Load information just in time. Let agents pull a document when a task needs it, instead of preloading everything.
- Split big jobs into smaller agents. Give each subtask its own focused context and have it return a short summary.
- Compact long histories. Summarize old steps, keep decisions plus open issues, and drop the rest.
- Verify, then trust. Check outputs against the source before an agent marks a task complete.
| Pro-Tip |
|---|
| Date every rule you add to an agent’s rule file. Once a month, delete rules nobody has needed in sixty days. A shorter file gets followed more reliably than a long one. |
The second habit matters most. I wrote about how my team handles AI agent memory with hard rules, and it’s the single biggest reason our repeat mistakes dropped.
AI Agent Memory vs Context
Memory and context get mixed up a lot.
- Context is what the agent sees right now, in this session.
- Memory is what persists between sessions, such as rule files, notes, and saved preferences.
Good memory keeps context clean. Instead of carrying the whole conversation forward, the agent reloads a few durable rules and the files it needs for the current task.

How to Write Rules Agents Actually Follow: 3 StepsÂ
A rule file only helps if the agent can use it. Vague rules get ignored, and long rules get diluted. I keep every rule short, specific, and testable.
1. Make Each Rule One Line
One line forces clarity. “Never use em dashes in client copy” is easy to follow and easy to check. “Write in a friendly but professional voice that reflects our brand” means something different every time the agent reads it.
Short rules are also easier to audit. When the agent gets something wrong, you can point to the exact line it missed and fix just this one line. A paragraph-long rule makes the job much harder, because you can’t tell which part the agent ignored.
2. Say What to Do, With an Example
Agents follow positive instructions better than lists of bans. Pair each rule with one short example of the right output. If a rule needs three examples to make sense, split it into smaller rules.
Examples also save you review time. A ban only tells the agent what to avoid, so it still has to guess what good output looks like. One clear sample removes the guesswork, and you spend less time fixing drafts by hand.
3. Put the Most Important Rules First
Models tend to weigh some parts of long prompts more than others. Keep your must-follow rules at the top of the file and in the task brief, so they stay close to the work.
The same discipline applies to bigger setups. If you’re building an AI chief of staff or a fleet of agents, every agent needs its own short rule file instead of one giant shared prompt.
Signs Your Agents Need a Context Reset
Sometimes the fastest fix is starting fresh. Watch for these signals.
- The agent repeats a mistake you corrected in the same session.
- Answers get longer and vaguer as the session goes on.
- It cites instructions you never gave or ignores ones you did.
When you see them, end the session, update the rule file with what you learned, and start a new one. My team does this so often it’s become routine. It costs a minute and saves an hour of cleanup.
| What You Should Do |
|---|
| Pick the agent your team uses most. Export its last ten corrections, rewrite each as a one-line rule, and add them to its instructions file. Then track how often the same mistakes come back over the next two weeks. |
Small habits like this add up fast across a whole team.
Who Owns Context on Your Team?
Context engineering needs an owner. Without one, rule files bloat, old instructions conflict with new ones, and nobody knows why the agent changed behavior.
At my company, whoever owns a workflow also owns its agent’s rules. It’s part of what being an AI native company means in practice. They review corrections, approve new rules, and prune old ones. If you’re scaling agents across a team, it helps to set clear rules for AI agents in Slack and to watch for automation bias when people start trusting outputs too easily.
Keep Your Agents Sharp as They Scale
Context rot is a normal limit of today’s models, and you can manage it. Keep context focused, load information only when it’s needed, and turn every correction into a durable rule. Agents are still early, but teams who manage context well get far more out of them.
If you want help building AI workflows your team can trust, Single Grain’s AI transformation team can help you design and run them. Contact Single Grain to get started.
Frequently Asked Questions About Context Rot
-
What is context rot in AI?
Context rot is the drop in a language model’s accuracy as the amount of text in its context window grows. The model can read everything, but it gets worse at finding and using the parts that matter.
-
Does a bigger context window prevent context rot?
No. Chroma’s research found performance degrades as input length grows across 18 models, even with large windows. Focused context works better than more context.
-
What is the difference between prompt engineering and context engineering?
Prompt engineering focuses on wording one instruction well. Context engineering manages everything the agent sees, including rules, retrieved files, tool results, and memory.
-
How do you stop an AI agent from repeating mistakes?
Turn each correction into a short written rule the agent loads every session, and prune old rules regularly. See how my team handles AI agent memory with hard rules.
-
When should you reset an AI agent session?
Reset when the agent repeats a corrected mistake, gives longer and vaguer answers, or ignores instructions. Update its rule file first, then start fresh.