Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One capture · claude-docs

One read of Claude Documentationclaude-docs-20261202T000708Z

2 pages moved out of 300 read.

Pages moved 2 significant first
Pages read 300 in this capture
Captured 00:07 UTC
Corpus hash 87c6312f403d corpus-hash

What this read moved

1-2 of 2

third-party/claude-desktop/gateway Changed · +12 / -3 lines

#### Compaction in Code sessions on 1M models

from line 551
551551* **Standard entry**: 1M tokens for a model the session recognizes as having a native 1M context window, as listed under [the context window behind a gateway](https://code.claude.com/docs/en/model-config#context-window-behind-a-gateway) in the Claude Code documentation, and 200K tokens for every other model ID, including an ID the session doesn't recognize whose `inferenceModels` entry doesn't set [`behavesAs`](https://claude.com/docs/third-party/claude-desktop/models#map-an-unrecognized-model-id-to-a-claude-model). On Claude Desktop versions earlier than 2.19675.0, a session assumes 200K tokens on this entry for every model.
552552* **1M context window entry**, or the single entry from `prefer1m` or `modelPrefer1mContext`: 1M tokens, regardless of the model ID.
553553 
554If the gateway or the provider accepts less than the window a session assumes, requests past that limit fail. The session then compacts and retries only when the provider's too-long error reaches it unchanged. To make sessions compact earlier than the window they assume, for example when your provider serves a natively 1M model with only a 200K window, see [Set the auto-compact window](https://code.claude.com/docs/en/model-config#set-the-auto-compact-window) in the Claude Code documentation. For a model ID the session doesn't recognize, see [Context window for unrecognized model IDs](#context-window-for-unrecognized-model-ids).
554If the gateway or the provider accepts less than the window a session assumes, requests past that limit fail. The session then compacts and retries only when the provider's too-long error reaches it unchanged. To make sessions compact earlier, for example when your provider serves a natively 1M model with only a 200K window, see [Set the auto-compact window](https://code.claude.com/docs/en/model-config#set-the-auto-compact-window) in the Claude Code documentation. For a model ID the session doesn't recognize, see [Context window for unrecognized model IDs](#context-window-for-unrecognized-model-ids). For the size at which a Code session compacts on a 1M model, see [Compaction in Code sessions on 1M models](#compaction-in-code-sessions-on-1m-models).
555555 
556The following table lists what the model configuration and the gateway need to provide so that sessions use the full context window and compact when they reach it, and how to check each requirement.
556The following table lists what the model configuration and the gateway need to provide so that sessions can use the full context window and can compact, and how to check each requirement.
557557 
558558| Requirement | What fails without it | How to check |
559559| - | - | - |
from line 563
563563| [Forward the provider's status code and error body unchanged](https://code.claude.com/docs/en/llm-gateway-protocol#automatic-retry-and-error-forwarding) when it rejects a request. | Where the provider's too-long error is the compaction trigger, the session compacts and retries only if that error reaches it unchanged. With a rewritten error, the session doesn't compact. | Send an oversized request through the gateway and confirm that the client receives the provider's status code and error body. |
564564 
565565The entry for [`inferenceStreamIdleTimeoutSec`](https://claude.com/docs/third-party/claude-desktop/configuration#inferencestreamidletimeoutsec) gives how long a session waits with and without keep-alive pings. Raise that key if your provider needs longer than that before its first output on a large request.
566 
567#### Compaction in Code sessions on 1M models
568 
569By default, a Code session compacts at an auto-compact window that Anthropic tunes per model. On a model ID that contains the name of a current model with a native 1M context window, such as `bedrock/us.anthropic.claude-opus-5`, a Code session compacts near 400K tokens. For the sessions that compact at a larger size, such as scheduled tasks, see [Sessions that run past 400K by default](https://code.claude.com/docs/en/model-config#sessions-that-run-past-400k-on-auto) in the Claude Code documentation. On Claude Desktop versions earlier than 18.19841.1, a Code session on these models compacts near the [context window that the session assumes](#context-window-and-compaction).
570 
571To let Code sessions use the full 1M tokens, add a `modelSettings` entry for each model version to [Claude Code managed settings](https://code.claude.com/docs/en/settings#settings-files) on each device. For the entry's format, see [Compaction near 400K on a 1M model](https://code.claude.com/docs/en/model-config#compaction-near-400k-on-a-1m-model) in the Claude Code documentation. Add the entries according to what the device has:
572 
573* **The device already has Claude Code managed settings**: add the entries to those settings, and leave [`parentSettingsBehavior`](https://claude.com/docs/third-party/claude-desktop/code#interaction-with-claude-code%E2%80%99s-own-managed-settings) as it is, set or unset.
574* **The device has no Claude Code managed settings yet**: also set `parentSettingsBehavior` to `"merge"` in the settings that you create, so that the policy from Claude Desktop still applies.
566575 
567576#### Context window for unrecognized model IDs
568577 

third-party/claude-desktop/models Changed · +2 / -2 lines

from line 19
1919 
2020On any provider, a Chat conversation, Cowork session, or Code session on an entry without `supports1m` assumes a context window that depends on the model ID:
2121 
22* **An ID recognized as a model with a native 1M context window**, such as `us.anthropic.claude-opus-5`: you don't need `supports1m` or `prefer1m`. Setting them doesn't change the assumed window. For Claude Desktop versions earlier than 2.19675.0, see [Context window and compaction](https://claude.com/docs/third-party/claude-desktop/gateway.md#context-window-and-compaction) on the LLM gateway page. To check whether a model has a native 1M context window, see [Extended context](https://code.claude.com/docs/en/model-config#extended-context) in the Claude Code documentation, which lists the models that run with the 1M window by default.
22* **An ID recognized as a model with a native 1M context window**, such as `us.anthropic.claude-opus-5`: you don't need `supports1m` or `prefer1m`. Setting them doesn't change the assumed window. For the size at which a Code session on the model compacts, see [Compaction in Code sessions on 1M models](https://claude.com/docs/third-party/claude-desktop/gateway.md#compaction-in-code-sessions-on-1m-models). For Claude Desktop versions earlier than 2.19675.0, see [Context window and compaction](https://claude.com/docs/third-party/claude-desktop/gateway.md#context-window-and-compaction) on the LLM gateway page. To check whether a model has a native 1M context window, see [Extended context](https://code.claude.com/docs/en/model-config#extended-context) in the Claude Code documentation, which lists the models that run with the 1M window by default.
2323* **An ID for a model without a native 1M context window, or an unrecognized ID whose entry doesn't set `behavesAs`**, such as `us.anthropic.claude-opus-4-6-v1` or a gateway routing alias: the assumed window is 200K tokens. If your deployment accepts 1M-token requests for the model, [set a larger context window for it](#set-a-larger-context-window-for-a-model).
2424* **An unrecognized ID whose entry sets [`behavesAs`](#map-an-unrecognized-model-id-to-a-claude-model)**, when sessions reach the model through an LLM gateway: the assumed window is the window of the model that `behavesAs` names.
2525 
2626### Set a larger context window for a model
2727 
28A session compacts a long conversation to fit the context window that it assumes for the model, even when your provider accepts more. If your deployment accepts 1M-token requests for a model that sessions assume 200K tokens for, declare the larger window on the model's `inferenceModels` entry:
28A session compacts a long conversation to stay within the context window that it assumes for the model, even when your provider accepts more. If your deployment accepts 1M-token requests for a model that sessions assume 200K tokens for, declare the larger window on the model's `inferenceModels` entry:
2929 
3030* **A gateway routing alias for a Claude model with a native 1M context window**, such as Claude Sonnet 5: set [`behavesAs`](#map-an-unrecognized-model-id-to-a-claude-model) to that model's ID. New sessions on the alias assume that model's window.
3131* **Any other model that your deployment serves with a 1M context window**: set `supports1m` and `prefer1m`. New Chat conversations, Cowork sessions, and Code sessions on the model request the 1M context window from your provider. With `supports1m` alone, only sessions that a user starts on the **1M context window** entry get the larger window.
Feedback