Claude Code Now Assumes a 1M Context Window for Model IDs It Does Not Recognize

Claude CodeView original changelog

Claude Code 2.1.323 changes the context window it assumes for an unrecognized model ID from 200K to 1M. Sessions on other vendors' models with a smaller window can now fail every turn once full, so Anthropic points those users to CLAUDE_CODE_DISABLE_1M_CONTEXT=1.

Key Takeaways

  • The assumed window for unrecognized model IDs goes from 200K to 1M.
  • Models with smaller real windows can fail every turn once full, until /clear.
  • CLAUDE_CODE_DISABLE_1M_CONTEXT=1 keeps the 200K assumption.
  • /autocompact lets users compact earlier.
  • The change mostly affects custom, gateway or other-vendor model IDs.
  • It shipped in Claude Code 2.1.323.

The new default

For a model ID that Claude Code does not recognize, the assumed context window moved from 200K to 1M tokens in 2.1.323. Users who want to compact earlier can use /autocompact, and those who want to keep the old 200K assumption can set CLAUDE_CODE_DISABLE_1M_CONTEXT=1.

Risk for smaller-window models

The release notes warn about sessions on other vendors' models with a smaller window. Once such a session fills, it can fail on every turn until the user runs /clear. Anthropic advises setting CLAUDE_CODE_DISABLE_1M_CONTEXT=1 before the window fills. Users running custom or gateway-named models should check this setting after updating.