The AI AdoptionFree AI pre-audit

Claude Code now compacts
long sessions near 400K.

Claude Code 2.1.3341 December 2026

1M400K

Where a long session now compacts by default, on current models with a 1M context window.

The notice and the figures come from Anthropic’s Claude Code docs.

On 1 December 2026 Anthropic changed when Claude Code compacts a long session. On current models with a 1M context window, a session now compacts near 400K tokens by default, where it used to run to the full 1M. Each request then carries a smaller conversation, so long sessions use fewer tokens. In exchange, compaction comes more often, and you usually wait while it runs. We measured both on our own work and set our sessions to 550K.

By The AI Adoption · Published on 4 December 2026 · Sources: Anthropic’s Claude Code changelog and docs, and our own sessions

Claude Code1 December 2026

What Anthropic changed

Version 2.1.334 of Claude Code came out on 1 December 2026. Its changelog says the automatic setting for compaction now sits near 400K tokens on most current models with a 1M context window, and that it covers scripted runs and the Agent SDK too. The change is rolling out. It is already on for sessions that go through a third-party provider or have telemetry turned off.

Anthropic’s docs explain the setting. It is called auto, and Anthropic tunes it per model for cost and performance. On these models auto is now 400K, so compaction runs at about 367K tokens. The docs name the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later.

Anthropic’s Claude Code changelog.

What compaction does to a session

Every request Claude Code sends carries the conversation so far: your messages, Claude’s answers, the files it read and what its tools returned. The longer the session, the bigger each request. When the conversation nears the size you allow, Claude Code summarises it to make room, so a long piece of work can carry on in the same session.

After a compaction, your project’s main CLAUDE.md, your memory and your list of skills load again. Claude Code also re-reads up to five of the files Claude worked on, starting with the most recently modified. The conversation itself is replaced by a structured summary. The docs suggest running /compact yourself before a long new task, with a note on what to keep, so the summary keeps what you choose.

Anthropic’s interactive session in its Claude Code docs. Its window and figures are illustrative.
367Ktokens, about where a session on auto now compacts
967Ktokens, about where it compacts after /autocompact 1M
100Ktokens, the smallest window Claude Code accepts

Our own sessions12 October to 4 December 2026

How often compaction stopped our work

We moved our own sessions off the full 1M before Anthropic did. On 11 November we set the window to 400K, and each request carried 47% less of the conversation than in the 30 days before. A week later the waits were slowing our work, so on 18 November we raised the window to 550K.

The figures below come from the logs Claude Code keeps on our computer, for every session we ran. Active work is the time a session was running, with any pause longer than five minutes counted as five minutes. Some compactions were ready in advance and took no time. The others took 90 seconds at 400K and 83 seconds at 550K in the middle case.

Measured on our sessions400KNew default550KOur setting
A compaction everyof active work, in a typical long session26min50min
Time spent waiting on compactionper hour of active work2.4min1.2min
Compactions that took over 2 minutesamong those that made us wait1 in 71 in 12
Conversation carried by each requestagainst the old 1M default47%less33%less

So our advice is 550K. It is enough to save on usage, and it avoids compacting too often, which sometimes takes 2 minutes. A compaction that makes you wait adds to the usual wait for Claude’s answer.

A short session never gets near the window, so auto rarely stops it. 45 of our 73 sessions at 400K never compacted at all. The waits added up in the long ones.

auto is the recommended setting, so you can keep working as you are.

From Anthropic’s Claude Code docs

Anthropic recommends staying on auto. Our figures count how often compaction happened and how long it took. We chose 550K for the waiting time alone. /autocompact auto puts the size back on Anthropic’s setting.

How to set the auto-compact window

You change the size in Claude Code itself. The quickest way is to type /autocompact 550k in a session. Claude Code saves that size for the model you are using and applies it straight away. Typed with no value, /autocompact shows the size your session uses.

  • /autocompact 550kKeeps 550K for the model you use
  • /autocompact autoGoes back to Anthropic’s setting
  • /autocompact 1MUses the full window again
  • /configShows and changes the size in its Auto-compact window row

To set one size for every model, put "autoCompactWindow": 550000 in your settings file, which is what we did. A size saved with /autocompact for one model wins over it for that model.

For one launch there is the --autocompact flag. Scripts and cloud environments use the CLAUDE_CODE_AUTO_COMPACT_WINDOW variable, which wins over the other settings. Whichever you use, Claude Code accepts 100K or more and caps the size at the model’s own window. A business can also set the size for everyone in its managed settings, model by model, and that replaces the size each person saved.

The prompt you may see once

Some people get a prompt titled Autocompact now defaults to 400k tokens. It asks which of your 1M models should move to auto at 400K. Apply moves all of them to auto, and you lose the sizes you saved for them. The second answer moves only the model you are using, and the others keep their saved size or get 1M saved. Keep leaves your saved sizes as they are, and the models in your /model list that were on auto get 1M saved.

If you close the prompt, nothing changes, so models on auto compact near 400K. You can change your answer later with /autocompact for the model you are using.

Anthropic’s table of the three answers to the one-time prompt: apply to all models, apply for the current model only, or keep, with what happens to your saved sizes in each case.
The three answers in Anthropic’s Claude Code docs.

Sessions that still run past 400K

Some sessions keep a bigger window by default, and a few compact at another point than the size you set. Scheduled tasks are the ones to know about, because they keep running to the full 1M.

Still run to the full 1M

  • A Desktop scheduled task
  • A cloud scheduled task
  • A session in a self-hosted environment
  • Any version of Claude Code before 2.1.334. The Code tab of the desktop app can run a different version from your terminal.

Compact later or sooner

  • A conversation you resume when it is already past 400K keeps 1M until it compacts.
  • When each request carries more than about 180K tokens of system prompt, tools and instruction files, the window is raised for that conversation. The docs suggest fewer tools or shorter instruction files.
  • A conversation you leave idle can compact below the size you set, unless you turn idle compaction off.

What the docs do not say

The changelog and the docs give no figure for what a session saves at 400K, in tokens or in money, and no date for the rollout to reach everyone. Anthropic says it keeps evaluating auto for future models and can set a different window, so it is worth checking /autocompact again after a change of model.

Nor do they say whether Claude works as well after a compaction, and our own figures do not measure it. They come from our sessions only, so yours will differ with the length of your work and the model you use.

How we start

We set up Claude for the businesses we work with, or the AI tool a team already uses. That includes who can open what and where a person approves. Our guide on adopting AI securely shows how.

You can read how we help and who we are. Our security page says how we handle your data. Another page explains what an AI adoption consultant does.

Claude Duet is built from the auto mode of Claude Code. The Claude Frontier Academy is Anthropic’s programme for engineers. We also compared Claude and ChatGPT for a business.

The first step with us is a free AI pre-audit

45 minutes to explore where AI could help your business and what to put in place first. With or without us.

Book your free AI pre-audit

Sources

Every fact about Claude Code on this page comes from Anthropic’s changelog and two pages of its Claude Code docs, read on 4 December 2026. The images are cropped from Anthropic’s own pages and demo. Our own figures come from the session logs Claude Code keeps on our computer.

  1. Anthropic: Claude Code changelog, version 2.1.334, 1 December 2026
  2. Claude Code docs: Model configuration, context window and auto-compaction
  3. Claude Code docs: Explore the context window
  4. The AI Adoption: our own Claude Code sessions from 12 October to 4 December 2026, measured on 18 November and 4 December 2026

Bring your questions.

Free AI pre-audit