85 agentic tools audited for security incidents · Talk to the lab →
MotionticBook a call
Glossary

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 compared with compaction
Context resetCompaction
SessionEnds; a new agent startsContinues
What carries overOnly the written handoffA model-written summary of the history
Clean slateYesNo; behaviour tied to a full window can persist
OverheadOrchestration, re-reading, extra latencyA summarisation call at each threshold
Anthropic's useLong builds on Sonnet 4.5Continuous 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.

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.