Articles/Context engineering
Resets Beat Compaction: What 2026 Taught Us About Long-Running AI Agents
Compaction keeps a conversation going; it does not give the agent a clean slate. Across vendors, 2026’s answer to context exhaustion is durable state outside the window.
Jose R. Gonzalez, CPA · Founder of ContxOS
Updated · 2 min read
In short
Every long agent task eventually runs out of context. In 2026 the vendors converged on one answer: keep the durable state of the work outside the context window and rebuild the window from it. Anthropic found that context resets with structured handoff artifacts beat compaction for long jobs. Its Managed Agents keep the session log outside the window. Codex added an experimental reset-with-notes mode. Research on "context rot" shows why: models get worse, and give up earlier, as context grows.
Compaction is not a clean slate
In March 2026 Anthropic’s engineering team published its harness design for long-running application development: a planner, a generator and an evaluator working in sprints. One finding stood out. For long jobs, resetting the context worked better than compacting it, because "compaction preserves continuity, it doesn’t give the agent a clean slate." Resets only work if the next context can be rebuilt, so the agents communicated through structured handoff files and explicit "sprint contracts".
The platforms followed. Claude Managed Agents keep an append-only session log outside the context window, so a crashed harness recovers from the log. The Claude API gained server-side compaction in February and on-demand compaction in September. Codex shipped an experimental context-management mode in September that resets with history notes instead of summarizing.
Why long context degrades
- Chroma’s 2025 "Context Rot" study showed performance falling as input grows, even on simple tasks, across 18 models.
- A May 2026 paper found that frontier models used as safety monitors missed dangerous actions 2 to 30 times more often when the actions came after 800,000 tokens of benign activity.
- A June 2026 paper on long-horizon search found models "give up … long before exhausting the context window", and give up earlier as the context gets longer.
A bigger window delays the problem without removing it. Default 1M-token windows arrived on the newest Claude models this year, and the research says quality still decays long before that limit.
The pattern: state outside, window rebuilt
Put together, 2026’s answer is architectural. Keep the plan, the position and the verified facts somewhere durable. Let each context window hold only what the current step needs. Make the handoff between windows a structured artifact, not a summary.
What it means in practice
You do not need to build a custom harness to get this. ContxOS provides the pieces as a service your existing agent calls: handoffs that capture pending work, blockers and decisions as separate records, and workflow runs that keep position, verified facts and holds outside the chat, so any new session, or a subagent, picks up at the right step.
Sources
- Harness design for long-running application development — Anthropic Engineering, March 24, 2026
- Decoupling the brain from the hands (Managed Agents) — Anthropic Engineering, April 8, 2026
- Claude Platform release notes — Anthropic
- Codex releases — OpenAI on GitHub
- Context Rot — Chroma, July 14, 2025
- Classifier Context Rot — arXiv 2605.12366, May 12, 2026
- Diagnosing and Mitigating Context Rot in Long-horizon Search — arXiv 2606.29718, June 29, 2026
Frequently asked questions
Is compaction useless?
No. It is the right tool for keeping one conversation going. For jobs that span many windows or many agents, a structured reset holds up better.
Does a 1M-token window solve this?
It delays it. Research this year shows quality and vigilance degrade well before the window is full.
Give your agent a memory that lasts
Connect ContxOS to Claude in about a minute. The free plan includes one project.
Product names belong to their owners. ContxOS is not affiliated with the companies named here.