Claude Code✓ Confirmed in official docsAdded Nov 13
How to hold Claude Code to a 200K context window when running other vendors' models
Starting with Claude Code 2.1.323, a model ID it doesn't recognize is assumed to have a 1M-token context window instead of 200K. If you plug in another vendor's model whose real window is smaller, then once that window fills, every turn can fail until you run /clear.
If you use such a model, set this variable before the conversation fills up.
export CLAUDE_CODE_DISABLE_1M_CONTEXT=1
With it on, models that run with the 1M window are held to 200K, [1m] variants leave the /model picker, and unrecognized model IDs are treated as 200K again. If you only want compaction to start earlier, use /autocompact.
Check the model's actual context window in its vendor's docs first.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.