Unclear Whether setting CLAUDE_CODE_MAX_CONTEXT_TOKENS now removes the unknown-model warning for first-party models is not settled.
What
The context window is how much conversation a model can hold at once. When Claude Code does not recognize a model, it assumes a window size and compacts (summarizes older conversation) to stay within it.
- The warning is no longer one plain string. It now carries the model, the assumed window, a short text and a detail.
- A new 'model-unrecognized' warning shows: 'Model ... isn't recognized · context assumed to be N tokens · update Claude Code, or see the docs'. The app keeps it in a new
unknownModelWindowWarningfield next to the model deprecation warning. - Auto-compact still keeps the session within the assumed window, and
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1still restores the previous behaviour. - The check was moved into a separate helper. A new function exempts first-party models from it when
CLAUDE_CODE_MAX_CONTEXT_TOKENSis set to a positive value and the model qualifies for it.
Why
People on a model Claude Code does not recognize, such as a gateway alias, now see a visible warning. Setting CLAUDE_CODE_MAX_CONTEXT_TOKENS may also change whether that warning applies.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
* **Any other window**: set [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](/docs/en/env-vars) to the window size in tokens in the environment that starts Claude Code, such as `CLAUDE_CODE_MAX_CONTEXT_TOKENS=400000`. For an unrecognized ID that doesn't…model-config see the edit
Whether setting CLAUDE_CODE_MAX_CONTEXT_TOKENS now removes the unknown-model warning for first-party models is not settled.
Anthropic's documentation has since written up CLAUDE_CODE_MAX_CONTEXT_TOKENS, on Model configuration.