# Claude Code 2.1.334 now compacts at 400K, not 1M: what it saves, and how to keep the full window

> Claude Code 2.1.334 compacts long sessions on 1M models near 400K tokens. On Opus 5.5 that cuts a full cache rewrite from $4.84 to $1.84. Run /autocompact 1M to opt out.

Published 2026-12-03 · https://smarterthanus.ai/claude-code-2-1-334-autocompact-400k/

## TL;DR

- Claude Code **2.1.334**, released 1 December 2026, sets the auto-compact window on current 1M-context models to **400K** instead of the full 1M.
- In practice compaction now runs at about **367K tokens**, so the status line shows roughly 37% when it happens.
- On Opus 5.5, rewriting the cache for a full context after a pause costs about **$1.84** at the new trigger instead of **$4.84** near 1M, by our arithmetic from Anthropic's prices.
- To keep the old behaviour, run **/autocompact 1M**. Admins can set it per model in managed settings.

The change in Claude Code 2.1.334 that you'll actually notice is compaction. Sessions on current 1M-context models now summarise the conversation **near 400K tokens** instead of letting it grow to the full million. Anthropic made the change to cut the cost of long sessions. If you need the whole window, run `/autocompact 1M`. The release came out on 1 December 2026, according to the [official changelog](https://code.claude.com/docs/en/changelog). By our count it has about 280 changelog lines, most of them fixes. Version 2.1.335 followed today, 3 December, so `claude update` will take you straight past it.

## What changed with auto-compaction

Here is the line in the [changelog](https://raw.githubusercontent.com/anthropics/claude-code/main/CHANGELOG.md): "Changed auto-compact's per-model auto setting to near 400K on most current 1M models, `-p` and SDK runs too". It is rolling out gradually. Anthropic notes that it is already on for anyone using a third-party provider or running with telemetry off.

The [model configuration docs](https://code.claude.com/docs/en/model-config) give the details:

- **Which models:** the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. These are the current models that run with a native 1M window.
- **When it fires:** with `auto` set to 400K, compaction runs at **about 367K tokens**. The status line's `used_percentage` will read about 37% at that point, because it measures against the full 1M.
- **Why:** each request after compaction is smaller, so "long sessions use fewer tokens."
- **What you'll see:** a one-time prompt titled "Autocompact now defaults to 400k tokens", with Apply and Keep options. If you close it without choosing, your settings stay as they are, and any model on `auto` will compact near 400K.

Some sessions still run past 400K: Desktop and cloud scheduled tasks, self-hosted environments, and sessions resumed from a conversation already over 400K. A session that sends more than about 180K tokens of system prompt, tools and instruction files with every request also gets a raised window.

The same release fixes several compaction bugs. It no longer auto-compacts needlessly when a response hits the output limit before writing any text. `/context` no longer draws the compact buffer as used space when auto-compact is off. Claude's draft notes no longer end up in front of the summary. Code Mode no longer counts a script's tool calls toward the context size, which had been triggering compaction early. There is also a new **Auto-compact window** row in `/config`.

## What the 400K window saves on the API

On the Anthropic API, the 1M window costs the same per token as a short prompt. Haiku 5.5 is the exception. That means the saving comes from sending fewer tokens with each request. Here is our arithmetic, using Anthropic's [pricing page](https://platform.claude.com/docs/en/about-claude/pricing) (checked 3 December 2026), for a single request at each trigger point:

| Model | Cache read at ~967K | Cache read at ~367K | 5-min cache rewrite at ~967K | at ~367K |
|---|---|---|---|---|
| Opus 5.5 ($4 in, $0.20 hit, $5 write) | $0.19 | $0.07 | $4.84 | **$1.84** |
| Sonnet 5.5 ($2 in, $0.10 hit, $2.50 write) | $0.10 | $0.04 | $2.42 | $0.92 |

A cache hit is cheap. The real cost comes when the cache expires, for example after you stop for a coffee and come back. Then the whole context has to be written to the cache again. On Opus 5.5, that rewrite is **$3 cheaper** per occurrence at the new trigger point. Agent turns can also make dozens of requests, and each one reads the full context.

Haiku 5.5 is a special case. Its prompts over 100,000 tokens cost five times as much ($0.50 per million input tokens instead of $0.10). Even at 400K you're past that threshold, and the docs suggest a smaller window if you want to stay under it. For example, type this in a session:

```text
/autocompact 100k
```

On a Pro or Max subscription you don't pay per token, but fewer tokens per request is what Anthropic says the change is for. Our [Claude usage limits guide](https://smarterthanus.ai/claude-apps-usage-limits-free-vs-pro/) explains what drains those plans. For every plan and API rate, see [Claude pricing 2026](https://smarterthanus.ai/claude-pricing-2026-plans-api-claude-code/).

## How to keep the full 1M window

The 400K setting doesn't suit everyone. You might be keeping a whole codebase or a long log in context. The docs list these ways to choose your own window:

| Where | What to do |
|---|---|
| This model, now and in later sessions | `/autocompact 1M` (compacts at about 967K) |
| Back to Anthropic's default | `/autocompact auto` |
| Every model, in a settings file | `"autoCompactWindow": 1000000` in `~/.claude/settings.json` |
| One launch | `claude --autocompact 1M` |
| Scripts and cloud environments | `CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000` (overrides all of the above) |
| A whole organization | a managed `modelSettings` entry per model, such as `"claude-opus-5-5": { "autoCompactWindow": 1000000 }` |

Run `/autocompact` with no value to see your current window. In a resumed conversation, wait for Claude's first reply before you check. Anthropic says it keeps tuning `auto` for each new model, so check again whenever you switch models.

## The other changes worth knowing

Most of the roughly 280 lines are fixes. These are the additions that matter most day to day:

- **`/model` search:** a search box appears once the model list passes 25 entries, matching both names and model IDs.
- **Folder-level REVIEW.md:** local `/code-review` runs now follow REVIEW.md files in parent folders too.
- **Cost fields:** `modelPricing` gains `cacheWrite5m`, `cacheWrite1h` and, for Haiku 5.5, a `longPrompt` key.
- **Windows on Arm:** `/desktop` and `claude --desktop` now work there.
- **VS Code (new look):** a Try again button on failed replies, Edit and Send now for queued messages, a changed-lines count with a "Review Session Changes" command, and Mermaid diagrams in replies.
- **Claude Code on the web:** a confirmation before Rewind (cloud sessions have no undo), One-time and Custom frequencies for scheduled tasks, and a Git providers setting. The setting is off by default and lets Team and Enterprise owners limit which GitHub organizations and personal accounts can be linked to their organization.
- **Hooks and plugins:** a plugin's SessionStart hook no longer gets skipped in terminal and background sessions, and plugins enabled through settings now load on the second start of a new machine.

## How to update

Run `claude update` in your terminal. The Desktop app's Code tab can run a different Claude Code version from your terminal, so check the version there too. Versions before 2.1.334 keep compacting at 1M. If you're on 2.1.335, released today, you also get a `claude mcp add --web` command, `/desktop` on Linux, and expiry times on computer-use approvals.

## Sources

- [Claude Code changelog (code.claude.com)](https://code.claude.com/docs/en/changelog)
- [Claude Code CHANGELOG.md (GitHub)](https://raw.githubusercontent.com/anthropics/claude-code/main/CHANGELOG.md)
- [Model configuration: context window and auto-compaction (Claude Code docs)](https://code.claude.com/docs/en/model-config)
- [Pricing (Claude API docs)](https://platform.claude.com/docs/en/about-claude/pricing)
