Context Rot: Why Agents Fail Long Tasks and How to Fix It
Future_AGI · reddit · 2026-08-12
Agents often loop or drop early constraints during long tasks, primarily due to context rot rather than model limitations. Chroma's tests across 18 models show reliability degrades as input grows, even before the context window fills.
Anthropic explains this via an "attention budget": every token spends from it, lowering the signal-to-noise ratio. Thus, context engineering must be treated as a distinct skill from prompt engineering, focusing on curating the overall token budget across multi-step runs.
The author shares four effective fixes:
- Compaction: Summarize the run past a threshold and restart from the summary (used by Claude Code).
- Offload state: Keep plans/constraints in external files, pulling back only what's needed.
- Retrieve on demand: Load information only when a step requires it.
- Isolate sub-tasks: Hand focused jobs to fresh sub-agent contexts, returning only distilled results.
Compaction proved most effective, fixing an issue where a refactoring agent ignored early instructions deep into a run.
More from coding & agent
- Opinion: Economic Coordination Might be the Missing Layer for AGI — kleffew94 · 2026-08-13
- Deep Dive with XBOW: Hunting Zero-Days with Autonomous Agents — moyix · 2026-08-13
- Dropping Cosine Similarity: Ranking RAG Retrieval by 'Blast Radius' Boosts Accuracy — AfraidBorder5994 · 2026-08-13
- Building AI-Driven SEO Workflows Using CrawlRaven and Other MCP Tools — ayushtweetshere · 2026-08-13
- Stanford Team Proposes 'The Virtual Biotech' Multi-Agent AI Framework for Drug Discovery — james_y_zou · 2026-08-13
- Nuphos: Turning Cloud Cost Spikes into Actionable Fixes — nikola_mr64990 · 2026-08-13