Your Claude Code session now compacts at 400K tokens, not 1M, here is how to get the million back
Your 1-million-token Claude Code session now summarizes itself when the status line reads about 37 percent. Claude Code 2.1.334, released 1 December, moves the auto-compact default to near 400K tokens on most current 1M models, so long sessions compact around 367K instead of 967K. The change covers interactive sessions, claude -p and SDK runs, and it is already live for third-party providers or with telemetry off, rolling out gradually to everyone else. Source: https://code.claude.com/docs/en/model-config#compaction-near-400k-on-a-1m-model
Why it matters
Every request resends the whole conversation, so a smaller cap makes each turn of a long session cheaper. The tradeoff is more frequent compaction: your session gets summarized more often, and each summary can drop detail you wanted to keep. If one task needs the whole repo in view, a migration or a long log analysis, raise the window to 1M for that session, then return to auto. Two cases still run past 400K: system prompt, tools and instruction files over about 180K tokens raise the window, and a resumed session past 400K keeps 1M until it compacts. See the [Claude Code agent page](https://agentstacklist.com/agents/claude-code/) for its setup and MCP support.
Who it's for
Claude Code users on 1M-context models: Fable, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. Opus 4.6 and Sonnet 4.6 without the 1M option stay at their 200K boundary. Most useful for anyone running long sessions, claude -p scripts, or SDK jobs.
How to try it
- Check which window you have: run `/autocompact` with no arguments. If it says default for this model on a 1M model, auto compacts around 367K. First check your version with `claude --version`; you need 2.1.334 or later.
- Get the full million back for one model: run `/autocompact 1m`. It saves the setting for that model only, and the session compacts around 967K from then on.
- Or use /config: open it, search for auto-compact, and use the new Auto-compact window row to see and move the same window.
- Go back to the recommended setting when the big task is done: run `/autocompact auto`.
- For a team or the cloud: in managed settings, add one modelSettings entry per model, such as "claude-opus-5-5": { "autoCompactWindow": 1000000 }. In the cloud, `/autocompact 1m` covers the current session only; for later ones, commit the same entry to the repo's .claude/settings.json, or set CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 in the environment. Plan and availability: rolling out gradually on Anthropic accounts; already on with third-party providers or telemetry off. Needs 2.1.334 or later.
Source: https://code.claude.com/docs/en/model-config#compaction-near-400k-on-a-1m-model
Written by Sarah Mitchell from the original post. Checked Checked 3 Dec 2026. Features, plans and availability can change, so confirm on the source before you rely on it.
claude-codeauto-compactcontext-window
More Claude tricks
- One URL and one key for all your MCP servers: ngrok's MCP Gateway is live · Dec 2
- OpenCode 2.4.2 cuts about 700 tokens per request and tunes GPT-6.2 · Nov 26
- OpenCode 2.4 gives your coding agent a browser, automations, and video generation · Nov 24
- Claude Code 2.1.330 draws your charts with easel and lets scheduled tasks run 30 days · Nov 21