sysnote
News

Claude Code 2.1.334 auto-compacts 1M-context sessions near 400K tokens instead of 967K; /autocompact 1m restores the full window

Claude Code now summarizes long conversations much earlier on its 1M-context models. Version 2.1.334 changes the default auto-compact window ("auto") to "near 400K on most current 1M models, -p and SDK runs too", according to the changelog. Lydia Hallie of the Claude Code team announced the rollout on December 2: "This should help with your usage if you run longer sessions."

LLydia Hallie ✨@lydiahallie

400k auto-compact is now rolling out as the default in Claude Code for most 1M models! This should help with your usage if you run longer sessions

You can still keep the full 1M window by running "/autocompact 1m" or in /config https://t.co/1ai8FtzUrp

December 2, 2026

Until now a session on a 1M model ran almost to the end of its window. In October Hallie explained that compaction on those models fired at about 967K tokens, and that it replaces the whole conversation with a short summary rather than keeping the last million tokens around. Under the new default, the model configuration docs say, compaction runs at about 367K tokens.

Who gets it

The docs list the models with a native 1M window as the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. The changelog marks the change as "rolling out", already on for sessions through third-party providers or with telemetry turned off. Headless runs with claude -p and the Agent SDK are included, so a scripted job that used to carry 900K tokens of history will now compact at roughly a third of that.

A session that picked up the new value shows this notice:

This session is on auto, which now autocompacts near 400k tokens instead of 1m to lower the cost of long sessions. To opt out, run /autocompact 1m.

Getting the full window back

  • /autocompact 1m in a session saves the full window for that model version; compaction then runs at about 967K again.
  • claude --autocompact 1m does it for one launch without changing saved settings.
  • CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 overrides everything else, which suits scripts and cloud environments.
  • Organizations can pin it in managed settings per model, for example "claude-opus-5-5": { "autoCompactWindow": 1000000 }.

The same release adds an "Auto-compact window" row to /config.

One detail will confuse status-line scripts. The used_percentage field still counts against the full 1M, so on the new default it reads about 37% at the moment compaction runs. A script that warns at 80% will never fire.

Why earlier is cheaper

Every turn in a coding agent sends the whole conversation back to the model. Most of it comes from the prompt cache, but cached tokens are still billed (on Opus 5.5, $0.20 per million cache-read tokens on the API) and still count against subscription usage. Compaction resets that history to a summary, and the conversation starts growing again.

A rough sawtooth model shows the size of the effect. If a session restarts from a summary of about 20K tokens (my assumption; the real size depends on CLAUDE.md, skills and the summary itself) and grows steadily to the threshold, the average turn carries about 494K tokens with compaction at 967K and about 194K with compaction at 367K. That is roughly 2.5 times fewer tokens read per turn in a session long enough to compact repeatedly; at the Opus 5.5 cache-read price it is about $0.10 versus $0.04 a turn.

The extra compactions cost less than they seem to. Hallie described compaction as one request that reads about as many tokens as the conversation holds, so its overhead per token of growth is about the same at either threshold. After each one the cache is rebuilt for the shorter history, which Hallie confirmed in a reply. Sessions that never pass 367K see no change at all.

What the change gives up is detail. A summary at 367K throws away more working context per hour of work than one at 967K, simply because it runs more often, and the docs on what survives compaction spell out the losses: startup content such as CLAUDE.md reloads, but path-scoped rules are summarized away until their files are touched again, and large skills are truncated when re-injected. Anthropic has published no measurements of the savings or of any effect on task quality.

This sits next to the cache trade-off we covered this week, where Claude's 5-minute prompt cache makes pauses expensive for API users. Both changes point at the same cost: the history a coding agent resends on every turn. Anthropic's answer here is to resend less of it by default, and to leave the full million one command away for anyone who needs the model to remember more.

Comments

No comments yet. Be the first.

Write a comment

Comments are published after review.