← Claude Code Hub
Dec 2, 2026 · 5 min read ✦ Tip #298

Claude Code compacts at 400K on a 1M model: how to get the full 1M back

Claude Code now compacts near 400K on 1M models without you touching anything. Since which version, who gets it, and how to get the full million back for one model.

Where a 1M model compacts in Claude Code: with the window on auto, which is 400K from v2.1.334, it compacts around 367K; with /autocompact 1m, around 967K. The status line reads 37% when it compacts because it counts against the full million

TL;DR Run /autocompact. If it says default for this model on a 1M model and you're on v2.1.334 or later, auto compacts around 367K. Leave it unless a task truly needs one huge conversation; for that one, /autocompact 1m, then back with /autocompact auto.

From v2.1.334, auto no longer means 1M on models with a native 1M window: it's 400K. The auto-compact window is how full the context can get before Claude Code summarizes the conversation, and auto is the one Anthropic tunes per model (who else can set it). At 400K, Claude Code keeps its buffer of about 33K and compacts around 367K, not the 967K of before. The change covers claude -p and the SDK too.

Which models, and who gets it

What happens
Fable, Sonnet 5 onwards, Haiku 5.5, Opus 4.7 onwards auto is 400K: they compact around 367K
Opus 4.6 and Sonnet 4.6 without [1m] Still at their 200K boundary
Bedrock, Vertex, Foundry, or telemetry off On now, per the changelog
Anthropic API and claude.ai plans Rolling out gradually

The binary decides by native window: it lowers only where the model ships 1M without opting in, so Haiku 5.5 is in and Opus 4.6 is out.

Until it reaches you, /autocompact says what it always did. Real output on v2.1.334, in a container where it wasn't on yet:

Auto-compact window
Current setting for Haiku 5.5: 1m tokens (default for this model)

What you see when it reaches you

A notice in the conversation, with this text in the terminal (verbatim from the v2.1.334 binary):

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.

In Desktop it points you to the Context card, and in a cloud session /autocompact 1m lasts for that session only. You may also get a one-time dialog titled Autocompact now defaults to 400k tokens:

If you choose What happens
Apply (all models) All your 1M models move to auto and you lose the windows you had saved
Apply (current model only) That model moves to auto; the others get 1M saved if they were on auto
Keep What you saved stays, and models in your picker that were on auto get 1M saved

Closing it changes nothing: models on auto compact near 400K.

One detail that throws people: the status line measures used_percentage against the full million, so it reads about 37% when it compacts. That's not a bug or an early compaction.

When it still runs past 400K

Case Window your session uses
More than about 180K of system prompt, tools and instruction files in every request Raised for that conversation, with the notice Raised this conversation's auto-compact window
You resume a conversation already past 400K, as with claude --resume 1M until it compacts
A Desktop or cloud scheduled task, or a self-hosted environment 1M
A version before v2.1.334 (in Desktop, the Code tab's) 1M

How to see it and change it

1. Check which window you have

/autocompact

The tag in parentheses tells you where it comes from: default for this model is auto; from settings is one you saved.

2. Get the full million back for one model

/autocompact 1m

It answers Auto-compact window for Haiku 5.5 set to 1m tokens and saves it in your user settings for that model only:

{
  "modelSettings": {
    "claude-haiku-5-5": {
      "autoCompactWindow": 1000000
    }
  }
}

From then on it compacts around 967K, and /autocompact says 1m tokens (from settings).

3. Or change it from /config

v2.1.334 adds a row to see and move the same window without typing the command. Search for auto-compact inside /config:

❯ Auto-compact         on
  Auto-compact window  1m tokens ›

4. Go back to the recommended setting

/autocompact auto

5. For a whole team, or the cloud

In managed settings, one modelSettings entry per model, such as "claude-opus-5-5": { "autoCompactWindow": 1000000 }. In the cloud, /autocompact 1m covers the current session; for later ones, the same entry in the repo's .claude/settings.json, or CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000 in the environment's variables, which covers every model.

Why I'd leave it alone

Every request resends the whole conversation, so what you carry in context you pay for on every turn. Going from 967K to 367K makes every request of a long session smaller, and the model was already worse with what sat far back. The cost is compacting more often, and what each one drops is in what survives a /compact.

Raising it to 1M makes sense for a task that needs everything in view at once (a migration across the whole repo, a long log analysis), then back to auto when it's done. On Haiku 5.5 the argument runs the other way: its price steps up at 100K, and 367K is still far past that, so there the 130K window is still the right one.

Official docs: Compaction near 400K on a 1M model

Requirements

  • Claude Code v2.1.334 or later; the /config row ships with that version too.

Found this useful? See more of wmedia.es in your Google results.

Add wmedia.es as a preferred source on Google
FREE GUIDE

Approve less, but better.

Ten minutes in, you're hitting yes without reading. That's not review, that's prayer. A 10-page guide with the five levers in order of risk.

  • 1. Rules the first match wins
  • 2. Mode a dial, not a switch
  • 3. Auto mode a classifier approves for you
  • 4. Sandbox a fence the OS puts up
  • 5. Bypass only inside a container
Are you a professional Web developer?

You'll receive the guide by email · Unsubscribe anytime

of 10
#

Wmedia · 10 pages
FREE GUIDE · 10 pages · 5 levers

Approve less, but better.

Ten minutes in, you're hitting yes without reading. That's not review, that's prayer. A 10-page guide with the five levers in order of risk.

Are you a professional Web developer? · Unsubscribe anytime

Tired of approving permissions without reading?