Context Inertia Is Why Your Coding Agent Keeps Chasing a Dead Plan
Bigger context windows let agents remember more of their own mistakes. Here is the reset routine that fixes it, with the exact commands.
Coding agents rarely fail because they forget. They fail because they remember too well.
You have probably watched it happen. An agent forms a theory early in a session (the bug is in the cache layer, say), and an hour later it is still poking at the cache layer, even after the logs pointed somewhere else. You correct it. It agrees with you, then drifts right back. The plan it wrote forty minutes ago is still sitting in its context, and it keeps reading that plan as if it were fresh.
That failure now has a name. Drew Breunig calls it context inertia, and the fix he offers is almost embarrassingly simple. This piece explains what is going on inside the session, why bigger and cheaper context windows made it worse, and a reset routine you can run in Claude Code (Anthropic's terminal coding agent) this afternoon.
The new failure has a name
Breunig has been cataloguing how agent context goes wrong since 2025. His original list had four failures, like context poisoning (a wrong fact that sticks around and keeps getting reused) and context clash (two instructions or tools that contradict each other).
On October 24 he published the transcript of his talk at the AGNTCon conference, and it adds two more.
The first is fighting the weights. In his words, it is "when the model doesn't do what you ask because you're working against what it was trained to do." The weights are the model's trained knowledge, the part you cannot edit from a prompt. If your instructions push against habits baked in during training, you lose more often than you would expect. His tell for this is repetition: when a prompt repeats the same instruction in all caps, someone was losing that fight.
The second is the one this article is about. Context inertia, per Breunig, is when "models hyper-focus on a hypothesis, subtask, or goal in their context, and keep pursuing it after they should stop."
Think of it like a GPS that will not reroute. You missed the exit ten minutes ago, the GPS has your old route loaded, and it keeps telling you to make a U-turn. The map is fine. The route is stale.
Why bigger windows made this worse
For two years the promise was that long context would fix everything. Put the whole repo in. Put every doc in. Let the model sort it out.
Breunig's answer to that is one sentence worth taping to your monitor: "Long contexts let you fit in more information, but they also let you fit in more errors."
Every failed attempt, every abandoned theory, every half-right plan stays in the session. The model sees all of it on every turn. A bigger window does not make the model better at ignoring its own old ideas. It just gives those old ideas more room to live.
Price removed the other brake. Max Woolf's October 25 tally of API price cuts shows Anthropic's Opus 5.5 charging a standard $0.20 per million cached input tokens (cached tokens are the repeated part of a conversation the provider has already processed), down from $0.50 for Opus 5. When rereading a long history costs cents, nothing on the bill tells you the session has gone stale. The cost moved from your invoice to your results.
The research says forgetting helps
This is not only a practitioner's hunch. A UC Berkeley team (first author Shangyin Tan) posted a preprint, Scaling Discovery Requires Forgetting, on October 14. They ran AI agents on hard open-ended tasks (writing search heuristics, making low-level GPU code run faster, training models) and tried the usual ways to throw more budget at them: run one agent longer, run several in parallel, or let parallel agents talk to each other.
All three eventually stalled. The authors found that agents become anchored to their own past attempts and start making fewer and smaller changes. The paper does not use Breunig's term, but that is the same pattern he calls context inertia, measured on real tasks.
Their fix was to periodically throw away the agents' session history and restart from the best result found so far. Same budget, more progress: the paper reports gains of up to 15% over parallel agents and up to 39% over a single agent.
Notice what they kept and what they threw away. They kept the best artifact, the actual work. They threw away the story of how they got there.
That is the whole idea in one line: treat context as a workbench, not a diary. The workbench holds what you are working on right now. The diary of every attempt belongs on disk, or nowhere.
Breunig's six old tools still do the job
The interesting part of the talk is how little the toolbox has changed. Breunig's six tactics from 2025 still cover the 2026 failures. Here they are in plain terms:
- Augmentation: pull in only the docs and skills this task needs (this is what retrieval, or RAG, does).
- Tool loadout: give the agent a short list of tools for the job instead of every tool you own.
- Quarantine: hand a self-contained subtask to a subagent, a fresh helper session that starts with a clean history.
- Pruning: delete history turns that no longer matter.
- Offloading: write state to a file or database so the agent can reread it later instead of carrying it.
- Summarization: compress the history into a short summary (often called compaction).
The loadout point is bigger than it sounds. Breunig describes an enterprise team whose software was "loading 600 skills for every engineer at startup." Every skill description is text the model reads before it does anything. That is a crowded workbench before the first task even starts.
His bigger point: "We're moving more and more of the work of assembling context from probabilistic model calls to deterministic code." In plain terms, stop asking the model to decide what it should remember. Decide in code, or decide yourself, and give it a clean bench.
Put this into practice: a reset routine for Claude Code
Claude Code ships every piece you need. The commands below come from Anthropic's context window documentation. The routine has one rule: before you throw away the conversation, put the work somewhere the agent can find it again.
1. Look at what is loaded. Run:
/context
You get a live breakdown of what is taking up the window by category, including which CLAUDE.md and memory files loaded. If skill descriptions or tools take a big slice before you have typed anything, start there.
2. Write the state to a file. Before any reset, ask the agent to save what matters:
Write NOTES.md with: the goal, what we tried, what failed and why,
what we know for sure, and the next step. Keep it under 40 lines.
This is offloading. The file survives the reset; the conversation does not. Forty lines is my number, not a rule from the docs. The point is a short file you can read in one look.
3. Clear between unrelated tasks.
/clear
Anthropic's own guidance is to run /clear when you switch to unrelated work, because the old conversation crowds out the files you need next and spends tokens on every message. After the clear, start with "Read NOTES.md and continue from the next step."
4. Compact with a focus when you stay on the same task.
/compact focus on the auth bug fix
Plain /compact replaces the conversation with a structured summary. Adding instructions tells it what to keep, instead of letting the automatic pass guess.
5. Compact earlier. Claude Code compacts automatically as you near the limit (the exact point depends on your model and settings). You can move that point with:
/autocompact 500k
That sets how full the window gets before the automatic pass runs. Breunig's personal warning line sits much lower: "Around 200,000 tokens is my warning point."
6. Quarantine the side quests. When a subtask stands on its own (survey these five files, write tests for this module), ask for a subagent. Its messy exploration stays in its own context, and only the result comes back.
What to expect: the first message after a reset feels slower, because the agent rereads files instead of coasting on memory. Then it usually stops repeating the old theory, because the old theory is gone. If it rediscovers the same dead end from NOTES.md, your notes were too vague about why it failed. Write that part more bluntly.
The other failure: when the reset will not save you
Fighting the weights is a different animal. A fresh context does not change what a model learned in training.
Breunig points to a study, Do as I Say, Not as I Do, where 13 models received examples that contradicted their instructions. By his account, smaller models such as Gemma 3 12B dropped below 50% instruction-following after a few contradicting examples. Larger models held out longer but were not immune.
The practical read: if you keep writing the same instruction in capital letters and the agent keeps ignoring it, stop shouting. Change the setup so the model does not have to resist its habits. Give it the tool it naturally wants to use, or move that decision into a script.
Honest limitations
The numbers in this article come from different places, and they deserve different levels of trust.
Breunig's 200,000-token warning line is one experienced practitioner's rule of thumb. It is not a benchmark, and your model and codebase may tolerate more or less.
The Berkeley results come from research tasks like kernel tuning and heuristic search, where you can score each attempt. A messy production bug does not hand you a "best candidate so far" to restart from. NOTES.md is a rough stand-in, not the same thing.
Resets cost something. Breunig's warning on pruning is short: "Just mind your prompt caching." Providers discount the repeated start of a conversation, and when you change that history the discount can disappear for the next request.
Summaries lose things. Compaction keeps what it judges important, and it will sometimes judge wrong. That is why the routine writes the file first and compacts second.
And none of this fixes a model that is fighting its training. Resets clear stale plans. They do not rewrite habits.
What to try first
You do not need a new framework to fix context inertia. You need a habit.
Next time an agent circles the same wrong idea twice, do not argue with it a third time. Have it write NOTES.md, run /clear, and point it at the file. Run /context once at the start of tomorrow's session and see how much of the window your tools and skills take before you type a word.
Then pick your own warning line. Breunig picked 200,000 tokens. Yours might be a number, or it might be the moment you hear yourself say "no, we already tried that."
Sources: Drew Breunig, "The State of Context Engineering" (October 24, 2026) and his 2025 post on how contexts fail; Tan et al., Scaling Discovery Requires Forgetting, arXiv 2610.20563 (submitted October 14, 2026); Camassa and Shiller, Do as I Say, Not as I Do; Anthropic, Claude Code context window docs; Max Woolf, "OpenAI and Anthropic cut their LLM prices by up to 80% within a few months. Why?" (October 25, 2026).