Context Rot Is Mostly Solved. Except This One
Long-running agents fill their context windows with files, terminal logs, and their own notes, and any of those can push them in the wrong direction. Researchers call this context rot and describe five ways it happens: context poisoning, context distraction, context confusion, context clash, and self-conditioning. This video explains each failure mode using a coding agent that migrates a codebase to a new database driver. It also covers the standard fix for each one: validation, compaction, tool curation, and pruning. Thanks to Firecrawl for making this video possible: https://firecrawl.link/promptengineer Test harness and all results: https://github.com/PromtEngineer/context-rot-lab Chroma, "Context Rot": https://www.trychroma.com/research/context-rot Drew Breunig, "How Long Contexts Fail": https://www.dbreunig.com/2025/06/22/how-contexts-fail-and-how-to-fix-them.html Drew Breunig, "How to Fix Your Context": https://www.dbreunig.com/2025/06/26/how-to-fix-your-context.html Gemini 2.5 technical report (the Pokémon agent): https://arxiv.org/abs/2507.06261 "Less is More" (46 vs 19 tools): https://arxiv.org/abs/2411.15399 "LLMs Get Lost in Multi-Turn Conversation": https://arxiv.org/abs/2505.06120 "The Illusion of Diminishing Returns" (self-conditioning): https://arxiv.org/abs/2509.09677 Manus, "Context Engineering for AI Agents": https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus What is an Agent Harness?: https://www.youtube.com/watch?v=nWzXyjXCoCE 00:00 Why Long Context Windows Cause Context Rot 02:46 Context Poisoning and Validation Fix 03:47 Context Distraction and Compaction Tradeoffs 04:44 Context Confusion From Too Many Tools 05:38 Sponsor: Firecrawl Alexandria Data Skills 06:56 Context Clash and Agent Self-Conditioning 08:50 Testing Context Rot on Qwen and Gemini 09:50 Results: Poisoning, Clash, Distraction, Tool Confusion 11:47 Self-Trust Test: Agents Miss Their Own Bugs 12:56 Limitations and How to Fix Agent Self-Trust