{"version":"2.1.213","anchor":"claude-code-no-model-fallback-prevent-model-substitution","canonical_anchor":"claude-code-no-model-fallback-prevent-model-substitution","heading":"CLAUDE_CODE_NO_MODEL_FALLBACK \u2014 Prevent Model Substitution","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.213\/e\/claude-code-no-model-fallback-prevent-model-substitution","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.213","markdown":"### `CLAUDE_CODE_NO_MODEL_FALLBACK` \u2014 Prevent Model Substitution\n\n**What**\n\nA new environment variable that locks Claude Code to exactly the configured model and disallows any automatic fallback to a different model \u2014 including during compaction.\n\n**Usage**\n\n`export CLAUDE_CODE_NO_MODEL_FALLBACK=true claude --model claude-opus-4-5 ...` **Details** - When set, the availability fallback chain collapses to `[primary]` only \u2014 no alternate models are tried - Compaction is disabled with the message \"Compaction unavailable: CLAUDE_CODE_NO_MODEL_FALLBACK is set and model substitution is disabled \u00b7 unset it to allow the swap\" - If code attempts a model-fallback pivot while the flag is active, a tripwire throws an error identifying the call site (this is a developer safety net, not a normal user-visible error) - The flag is intended for environments where model consistency is a hard requirement (compliance, billing, reproducibility) **Evidence** Tripwire implementation (search for `\"CLAUDE_CODE_NO_MODEL_FALLBACK tripwire: a model-fallback pivot was attempted\"`, `\"CLAUDE_CODE_NO_MODEL_FALLBACK\"`)"}