Claude Code now auto-compacts at ~400K on 1M-context models: what changes and how to adapt
If your Claude Code sessions started "forgetting" things earlier this week, this is probably why.
Starting in v2.1.334, Claude Code moved the default auto-compact point on 1M-context models from the full window (about 967K tokens) down to near 400K. It's rolling out gradually and covers the Fable models, Sonnet 5+, Haiku 5.5 and Opus 4.7+, plus -p and SDK runs.
The stated reason makes sense: when compaction runs sooner, every later request is smaller, so long sessions burn fewer tokens. But it changes a few habits.
Your status line is lying to you (a bit)
On the new default, compaction fires at roughly 367K. If your status line or context meter divides by the full 1M window, it reads about 37% at the moment compaction hits. So "I'm only at 30%, plenty of room" is no longer a safe read.
If you build or use a context meter, measure against the compact threshold, not the window size. (I hit this myself. I maintain a small desktop app that shows context usage, and it was measuring against a fixed window. The fix was to treat ~367K as 100% on 1M models, and fall back to ~967K if a session clearly runs past 400K without compacting, which means it's on the full window.)
Anything important can't live only in chat
Compaction summarizes your conversation. Three hours of explaining "never touch the payments folder" can come out as one vague line in the summary.
The fix is boring and it works: put durable rules in CLAUDE.md (or your project rules files), not in conversation. Those are loaded as project instructions, so they don't depend on the chat surviving compaction.
A good test: if you'd be annoyed to explain it again after a compact, it belongs in a file.
Hand off before compaction, not after
Auto-compact fires mid-task, whenever it decides to. A better rhythm:
- Watch context as you work.
- At a natural stopping point (around 60-70% of the compact budget), ask Claude to write a short handoff: goal, decisions made, files touched, next step.
/clearand start fresh from that handoff.
You decide what gets kept, instead of the summarizer.
Want the old behavior back?
/autocompact 1M
This compacts at about 967K again. Run /autocompact with no value to see which window your current session is using. Some sessions still run past 400K anyway, for example scheduled tasks and resumed conversations that were already over it.
TL;DR
- 1M models now compact near 400K (fires ~367K).
- A meter that measures against 1M reads ~37% when compaction hits.
- Durable rules go in
CLAUDE.md, not chat. - Hand off +
/clearon your own terms. /autocompact 1Mrestores the old behavior.
If you want the context meter part done for you: I build Mochi, a small pixel cat for your Mac that watches Claude Code through its hooks. She chimes when the agent needs your permission and gets sleepy as you approach the compact point. Fully local, $3.99 launch price.
Comments
No comments yet. Start the discussion.