Claude Code · tool · fg-0596

Session on a non-Claude model with a small context window fails every turn once full after 2.1.323

If you see Every turn errors after a long conversation on a third-party model, the cause and the fix for Claude Code are below, last verified 2026-11-13.

Verified Nov 2026trust 50/100
Symptom
Every turn errors after a long conversation on a third-party modelContext overflow errors that only clear after /clearAutocompact never triggers early enough
Cause
From 2.1.323, a model ID that Claude Code does not recognize is assumed to have a 1M context window instead of 200K. On models with a smaller real window, the session grows past the limit before compaction runs.
Fix
Force the 200K assumption with the environment variable, or lower the compaction point with /autocompact, before the session fills.
Apply
export CLAUDE_CODE_DISABLE_1M_CONTEXT=1
Affected
Claude Code 2.1.323 and later with unrecognized model IDs, such as other vendors' models behind a gateway
Sources

Last verified 2026-11-13 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun