Model configuration changedmodel-config
Nearest release: v2.1.334, published 3 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 1 Dec 2026 22:20 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 1 Dec 2026 22:37 UTC.
Upstream edited
Recorded here
Lines+58added
Lines−5removed
From line
883
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits125to this page, all time
#### Compaction near 400K on a 1M model #### Answer the one-time 400K prompt #### Sessions that run past 400K by default
The whole hunk
from line 883, old and new numbered
/
from line 883
883883
884884On the Anthropic API, Haiku 5.5 runs with the 1M context window on every plan, with no `[1m]` suffix to select. Its model ID is `claude-haiku-5-5`. To use it, run `/model claude-haiku-5-5` in a session, or start Claude Code from your shell with `claude --model claude-haiku-5-5`.
885885
886A Haiku 5.5 request costs more per token when its prompt is longer than 100K tokens. See [Anthropic pricing](https://platform.claude.com/docs/en/about-claude/pricing) for both rates.
886A Haiku 5.5 request costs more per token when its prompt is longer than 100K tokens. See [Anthropic pricing](https://platform.claude.com/docs/en/about-claude/pricing) for both rates. By default, a Haiku 5.5 session compacts [near 400K tokens](#compaction-near-400k-on-a-1m-model), or [later in some cases](#sessions-that-run-past-400k-on-auto). To compact earlier, [set a smaller auto-compact window](#set-the-auto-compact-window) for the model.
887887
888Sessions auto-compact at about 967K tokens by default. To compact earlier, [set a smaller auto-compact window](#set-the-auto-compact-window) for the model.
889
890888## Context window and auto-compaction
891889
892890The auto-compact window is how full the context window can get before Claude Code compacts the conversation. For what compaction keeps and drops per mechanism, see [What survives compaction](https://code.claude.com/docs/en/context-window.md#what-survives-compaction).
from line 931
933931
934932* Sonnet 4.6 and Opus 4.6 without [extended context](#extended-context) compact at the 200K boundary
935933* When you set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](https://code.claude.com/docs/en/env-vars), models with a native 1M window, such as Sonnet 5 and the Fable models, compact at the 200K boundary
936* Models running with a native 1M window compact before the window fills, at about 967K tokens by default. These include the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. Behind a custom `ANTHROPIC_BASE_URL`, see [the context window behind a gateway](#context-window-behind-a-gateway)
934* Current models with a native 1M window compact [near 400K tokens](#compaction-near-400k-on-a-1m-model) by default or [later in some cases](#sessions-that-run-past-400k-on-auto). These models include the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later. Behind a custom `ANTHROPIC_BASE_URL`, see [the context window behind a gateway](#context-window-behind-a-gateway)
937935* Sessions on a model ID Claude Code doesn't recognize, such as an [LLM gateway](https://code.claude.com/docs/en/llm-gateway) alias, compact at the context window Claude Code assumes for the ID; see [Correct the window for a gateway or custom model ID](#correct-the-window-for-a-gateway-or-custom-model-id)
938* [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md#manage-context) on most models compact before these thresholds
936* [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md#manage-context) can compact before these thresholds
939937
940938See the [`idleCompaction`](https://code.claude.com/docs/en/settings-reference#idlecompaction) setting for when Claude Code also compacts a conversation you leave idle.
939
940#### Compaction near 400K on a 1M model
941
942By default, your session uses `auto`, an auto-compact window that Anthropic tunes per model for the best cost and performance. On [current models with a native 1M context window](#default-auto-compact-thresholds), `auto` is 400K, so your session compacts near 400K tokens, or [later in some cases](#sessions-that-run-past-400k-on-auto). Your later requests are smaller when compaction runs sooner, so long sessions use fewer tokens.
943
944A notice like this one means your session is on `auto` at 400K:
945
946```text theme={null}
947This 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.
948```
949
950On `auto` at 400K, compaction runs at about 367K tokens. The [status line's](https://code.claude.com/docs/en/statusline.md#context-window-fields) `used_percentage` then reads about 37%, because it counts against the full 1M.
951
952`auto` is the recommended setting, so you can keep working as you are. To use the full 1M, set the window yourself:
953
954* **Use the full 1M on the current model**: run `/autocompact 1M` in your session. On your own machine, the size is saved for later sessions on that model version, and compaction runs at about 967K tokens.
955
956* **Keep 1M for your organization**: in [managed settings](https://code.claude.com/docs/en/managed-settings.md), add a [`modelSettings`](https://code.claude.com/docs/en/settings-reference#modelsettings) entry for each 1M model version, such as `"claude-opus-5-5": { "autoCompactWindow": 1000000 }`. The managed entry replaces the size a developer saved for that model. A developer can still override it with `--autocompact` or `CLAUDE_CODE_AUTO_COMPACT_WINDOW`.
957
958 If a computer that runs the Desktop app has no managed settings yet, also set [`parentSettingsBehavior`](https://code.claude.com/docs/en/settings-reference#parentsettingsbehavior) to `"merge"` so [Desktop's own policy](https://code.claude.com/docs/en/managed-settings.md#let-an-embedding-host-add-policy) still applies. If Desktop users on Windows work in WSL, also [allow WSL sessions](https://code.claude.com/docs/en/admin-setup.md#wsl-sessions-in-claude-code-desktop), which Desktop turns off on managed devices.
959
960* **Use the full 1M in cloud sessions**: run `/autocompact 1M` for the current [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md#manage-context). For later sessions on one repository, commit the same `modelSettings` entry to its `.claude/settings.json`. Or add `CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000` to your cloud environment's [variables](https://code.claude.com/docs/en/cloud-environments.md#set-environment-variables), which applies to every model. A [project's threads](https://code.claude.com/docs/en/claude-projects.md#choose-models-and-let-claude-manage-context) keep their own window.
961
962* **Set a size for every model or in scripts**: see [Set the auto-compact window](#set-the-auto-compact-window).
963
964A conversation you leave idle can still compact below the size you set. To prevent that, turn off [idle compaction](https://code.claude.com/docs/en/settings-reference.md#idlecompaction).
965
966To check your session's auto-compact window, run `/autocompact` with no value. In a resumed conversation, wait for a reply from Claude first. Check again after you switch to a newer model, because Anthropic continues to evaluate `auto` for future models and can set a different window.
967
968#### Answer the one-time 400K prompt
969
970If you see a prompt titled **Autocompact now defaults to 400k tokens**, choose which of your native 1M models use [`auto` at 400K](#compaction-near-400k-on-a-1m-model):
971
972| If you choose | What happens to those models |
973| :- | :- |
974| **Apply (all models)** | They move to `auto`, and you lose the sizes you saved for them |
975| **Apply** for the current model only | That model moves to `auto`. The others keep their saved size, or get 1M saved if they were on `auto`. |
976| **Keep** | Your saved sizes stay, and models in your `/model` picker that were on `auto` get 1M saved. When you switch to a model version released later, you have no saved size for it. |
977
978If you close the prompt, no setting changes, so models on `auto` compact near 400K. In a cloud session, your answer lasts for that session. To change your answer later, run `/autocompact 1M` or `/autocompact auto` for the model you're using.
979
980#### Sessions that run past 400K by default
981
982In cases such as these, your session's auto-compact window on a current native 1M model is larger than 400K, so the session can run past 400K tokens before it compacts:
983
984| Case | Auto-compact window your session uses |
985| :- | :- |
986| You send more than about 180K tokens of system prompt, tools, and instruction files with each request | Raised for that conversation |
987| You start the session by resuming a conversation that's already past 400K tokens, such as with `claude --resume` | 1M until the conversation compacts |
988| You run a [Desktop scheduled task](https://code.claude.com/docs/en/desktop-scheduled-tasks.md), a [cloud scheduled task](https://code.claude.com/docs/en/routines.md), or a session in a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) | 1M |
989| You run a Claude Code version before v2.1.334. For a local Desktop session, check the [Code tab's Claude Code version](https://code.claude.com/docs/en/desktop.md#claude-code-version-in-the-code-tab), which can differ from your terminal's. | 1M |
990
991To compact sooner, update Claude Code if you run an older version, or [set a smaller window](#set-the-auto-compact-window).
992
993If you see the notice `Raised this conversation's auto-compact window`, use fewer tools or shorter instruction files instead, because a smaller window can refill right after each compaction. In a terminal session, run `/autocompact` to see the raised size.
941994
942995### Correct the window for a gateway or custom model ID
943996
No line in this hunk matches that.