How to check Claude Code's new 400K auto-compact default and switch back to 1M
From Claude Code 2.1.334 (December 1), the default auto-compact window changed for 1M-context models. Sessions that don't set a window run on auto, and on the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later, auto is now 400K. Compaction actually runs at about 367K tokens (it used to be about 967K). Compacting sooner keeps later requests smaller, so long sessions use fewer tokens. It also applies to -p and SDK runs, and the changelog says it's rolling out.
- Run it with no value to see your session's window.
/autocompact
2.1.334 also added an Auto-compact window row to /config where you can see and change the size.
-
After updating you may see a one-time prompt titled Autocompact now defaults to 400k tokens. Apply (all models) moves every 1M model to
autoand drops the sizes you saved. Apply for the current model only moves just that model toauto; the others keep their saved size (models that were onautoget 1M saved). Keep leaves your saved sizes and saves 1M for models that were onauto. Closing the prompt changes nothing. -
To use the full 1M, run this in a session on that model. On your own machine it's saved for that model version in later sessions, and compaction runs at about 967K tokens.
/autocompact 1M
To go back to the default, pass /autocompact auto.
- To keep 1M across your organization, add a
modelSettingsentry for each 1M model version in managed settings. It replaces the size a developer saved, but a developer can still override it with the--autocompactflag or theCLAUDE_CODE_AUTO_COMPACT_WINDOWenvironment variable.
{
"modelSettings": {
"claude-opus-5-5": { "autoCompactWindow": 1000000 }
}
}
Desktop scheduled tasks, cloud scheduled tasks and sessions in self-hosted environments still run at 1M. Resuming a conversation that's already past 400K with claude --resume uses 1M until it compacts once. If the system prompt, tools and instruction files sent with each request exceed about 180K tokens, that conversation's window is raised automatically. In that case trim tools or instruction files instead of shrinking the window, since a smaller window can refill right after each compaction.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.