Independent · Source-cited · No sponsored rankingsSources linked in every article
AIToolRanked
AI News · 5 min read

Claude Code Auto-Compacts at 400K Now: How to Keep 1M Context

Claude Code 2.1.334 moves auto-compact on 1M models to about 400K tokens. What changed, who it affects, how to get the full 1M back, and whether you should.

RA
· Founder, AIToolRanked
Illustration of a long terminal scroll of colored code lines squeezed by arrows into a short summary card, with a progress bar filled to about a third and a starburst mark
On this page

What changed

Claude Code 2.1.334, released on GitHub ↗ at 22:12 UTC on December 1, 2026 (03:12 on December 2 in Pakistan), changes when long sessions get compacted. The changelog ↗ line is short: "Changed auto-compact's per-model auto setting to near 400K on most current 1M models, -p and SDK runs too (rolling out; on now with third-party providers or telemetry off)."

A few hours later, Lydia Hallie of the Claude Code team posted on X ↗: "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." By Wednesday evening the post had more than 270,000 views and about 2,800 likes.

Compaction is when Claude Code swaps your long conversation for a summary so it can keep going. Until now, on a model with a 1M-token window, it waited until the window was nearly full. Anthropic's model configuration docs ↗ now spell out the new numbers:

  • On auto at 400K, compaction runs at about 367K tokens. Before, it ran at about 967K.

  • The status line's used_percentage still counts against the full 1M, so it reads about 37% when compaction fires. A script that warns at 80% will never trigger.

  • It covers the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later.

The independent dev-news site sysnote ↗ and other trackers picked up the change. So far no major tech outlet has covered it.

Who's affected, and who isn't

The docs list sessions that still run past 400K by default:

  • Desktop scheduled tasks, cloud scheduled tasks and self-hosted environments stay at 1M.

  • A conversation you resume that's already past 400K keeps 1M until it next compacts.

  • Sessions that send more than about 180K tokens of system prompt, tools and instruction files get a raised window.

  • Anything on a Claude Code version before 2.1.334.

Headless runs are not spared. claude -p and Agent SDK jobs move to 400K too, so a pipeline that used to carry 900K tokens of history will now compact at well under half that. Some users get a one-time prompt titled "Autocompact now defaults to 400k tokens" with Apply, Apply for the current model only, or Keep. If you close it, nothing is saved and you stay on auto.

One related change from the day before matters here. Version 2.1.333's changelog says compaction no longer re-attaches "uploaded files, downloads and saved tool results"; Claude reads them again when it needs them.

How to keep the full 1M window

From the docs:

  1. Check what you're on: run /autocompact with no value, or open the new Auto-compact window row in /config.

  2. Current model, saved: /autocompact 1M. Compaction goes back to about 967K for that model version.

  3. One launch only: claude --autocompact 1m.

  4. Every model: add "autoCompactWindow": 1000000 to ~/.claude/settings.json.

  5. Scripts and cloud: set CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000. Note that a bare number means tokens, so 200 is 200 tokens, not 200K.

  6. Whole organization: pin a modelSettings entry per model in managed settings, such as "claude-opus-5-5": { "autoCompactWindow": 1000000 }.

Run /autocompact auto to go back to Anthropic's default. The docs also warn that "Anthropic continues to evaluate auto for future models," so check again after you switch models.

What developers are saying

  • "Good move! Long sessions are where my weekly limit goes, so this should help a lot." — @EnvolDev ↗

  • "Interesting. I was using 300k well before this. Just changed it to 500k recently." — @rchardkovacs ↗

  • "please stop messing around with the developer experience by changing stuff nobody asked for!" — @AmirAnonn ↗

  • "It would be good to have some recommendations on where to set autocompact for different kinds of knowledge work." — @SmolCompute ↗ (typo fixed)

The sharpest pushback is a GitHub issue ↗ filed hours after the release, labeled "regression." Its author says their agent sessions "regularly reach 700–800K tokens" and that the default "should be the full window." They ask Anthropic to publish its evaluation, because the only reason given anywhere is lower cost.

Our take

For most people this is a quiet discount. Every turn resends the conversation, and cached tokens still count toward your plan. Compacting at 367K instead of 967K means each turn carries far less history. If you mostly run sessions that never pass 367K, nothing changes. If you run long sessions on Pro or Max and keep hitting weekly limits, leave it on.

Turn it off for long, stateful jobs. Big refactors across many files, long debugging sessions where early rules matter, and headless pipelines that were built around 1M are where an early summary costs you. Summaries keep what happened and lose the why. Two habits help either way: keep the rules that must survive in your root CLAUDE.md, and watch the status line knowing that 37% now means "about to compact."

The rollout is the real complaint. Changing behavior for -p and SDK jobs silently, with no published numbers, is the wrong way to save tokens. A startup notice doesn't reach a CI job. If you run Claude Code in automation, set CLAUDE_CODE_AUTO_COMPACT_WINDOW explicitly today, whatever value you choose.

Versus the alternatives: if cost is why you're here, compare our cheaper Claude Code alternatives and Codex vs Claude Code. Claude Code's other token saver, Code Mode, is still opt-in. Our full Claude Code review covers the rest. We haven't measured the savings ourselves, and Anthropic hasn't published any.

Sources

More from the news desk · About Rai Ansar