What is a context reset in AI agents?
A context reset is a long-running agent technique that ends the current context window and starts a fresh agent session, carrying work forward only through a structured handoff such as a progress file, plan or commit history.
Compaction keeps the same session going on a shorter history. A context reset stops it. A new agent starts with an empty window and reads whatever the previous one wrote down: a progress log, a feature list, a plan, the git history.
Anthropic's "Harness design for long-running application development" (2026-03-24) explains why that clean slate mattered. With Claude Sonnet 4.5, context anxiety was strong enough that compaction alone did not support long tasks, so resets became an essential part of the harness.
How a reset works
The handoff is written first
Before a session ends, it records what was done, what is next and anything the next session must not forget. Anthropic's earlier harness post (2025-11-26) used a progress file, a JSON feature list and git commits.
The next session re-orients
In Anthropic's harness, each new session checks the working directory, reads the git log and progress file, picks the highest-priority unfinished feature, starts the dev server and runs a basic end-to-end test before writing new code.
Interruption is assumed
Anthropic's memory tool adds a system instruction telling the model its context might be reset at any moment, so progress not recorded in memory risks being lost.
What a reset costs
Anthropic's March 2026 post lists the price: resets add orchestration complexity, token overhead and latency to every harness run, and they only work if the handoff holds enough state for the next agent to pick up cleanly.
The same post records the reverse move. Claude Opus 4.5 largely removed context anxiety on its own, so Anthropic dropped resets and ran the later build as one continuous session, with the Claude Agent SDK's automatic compaction handling context growth. A reset is a fix for a model behaviour, and it is worth re-testing each time the model changes.
Where it fails
Thin handoffs
Anything not written down is gone. A decision made in conversation, an ID found mid-run or a constraint the user stated early can all vanish at the reset.
Unverified state
A progress file can claim more than is true. Starting each session with a quick end-to-end check catches what the previous session left broken.
Rework
The new session spends tokens re-reading files the old one already understood.
How Motiontic's engineers apply it
Motiontic's engineers design the handoff before choosing between reset and compaction: what state a fresh session needs, in what format, and how it proves the state is true. Long-run evals then compare both strategies on the model in use, because the answer has changed between model versions.
Context reset compared with compaction
| Context reset | Compaction | |
|---|---|---|
| Session | Ends; a new agent starts | Continues |
| What carries over | Only the written handoff | A model-written summary of the history |
| Clean slate | Yes | No; behaviour tied to a full window can persist |
| Overhead | Orchestration, re-reading, extra latency | A summarisation call at each threshold |
| Anthropic's use | Long builds on Sonnet 4.5 | Continuous runs from Opus 4.5 onward |
Common questions
What is the difference between a context reset and compaction?
Compaction summarises the history so the same session continues. A context reset ends the session and starts a new agent that knows only what the structured handoff records.
When should an agent use a context reset?
When a model degrades or wraps up early as its window fills and compaction does not fix it, or when work naturally splits into sessions. Anthropic used resets for long builds with Sonnet 4.5 and dropped them for Opus 4.5.
What goes into a context reset handoff?
Progress so far, the next task, open decisions and constraints, and pointers to the source of truth, such as a feature list and the commit history. It should be verifiable, not just a narrative.
Related
Compaction
Summarise the old turns, keep working: the standard move for long agent runs.
Context anxiety
The model thinks it is running out of room, so it rushes to finish.
Long-running agent
Agents that work for hours or days, and the state that lets them pick up where they stopped.
Durable project memory
The spec, plan and status files a long agent run is anchored to.
AI agent development
Agents that do real work for users, with the evals, traces and guardrails to keep them in production.
Running agents that have to hold up?
Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.