Context rot is why your agent falls apart halfway through a long task.

Reddit r/AI_Agents News

Summary

The article explains 'context rot,' where AI agents degrade on long tasks as context grows, even before the window is full, and offers techniques like compaction, offloading state, and retrieval on demand to maintain reliability.

Your agent runs fine for the first stretch of a long task, then it starts looping, drops a constraint you set early, or contradicts a decision it made ten steps back. The reflex is to blame the model or swap frameworks. Usually it is context rot. The surprising part is that the degradation starts well before the context window is full. Chroma tested 18 models and every one got less reliable as input grew, even on simple retrieval. Anthropic's context engineering guide calls it an attention budget: every token you add spends from it, so signal to noise drops and the model starts attending to the wrong things. A half-full window can already be rotted. That is why context engineering is its own skill, separate from prompt engineering. Writing one good instruction is prompt engineering. Context engineering is everything around it: curating the whole token budget across a multi-step run, what stays, what gets dropped, what gets pulled back in. The fixes that have worked for us: Compaction: past a token or step threshold, summarize the run so far and restart from the summary. Claude Code does this. Offload state: keep the plan and constraints in external memory or scratchpad files, pull back only what the step needs. Retrieve on demand: load what a step needs when it needs it, and leave the rest in storage. Isolate sub-tasks: hand a focused job to a fresh sub-agent context, return only the distilled result. The one that bought us the most was compaction. We had a long refactor agent we told to leave one module alone, and deep into the run it started editing it anyway, because the instruction had aged out of its attention. Compacting the run state, constraints included, fixed it. What is your compaction trigger: token count, step count, or a quality score that starts dropping?
Original Article

Similar Articles

I think long context agents are failing in a very boring way

Reddit r/artificial

An opinion piece arguing that long context windows don't equate to memory and that agent failures are often mundane, like forgetting constraints or rereading files, emphasizing that reliability depends on context architecture decisions.

Your agent gets dumber the longer a session runs

Reddit r/AI_Agents

The article discusses how AI agent performance degrades over long sessions due to context window clutter from raw history, tool outputs, and repeated reasoning, and suggests solutions like summarizing old turns and trimming tool outputs to extend useful run length.