Claude Code v2.1.98 · 9 Apr 2026
Entry Kind: in v2.1.98, 09 Apr 26
New Features Section of the release
What
Allows manual control of the maximum context token limit when automatic compaction is disabled.
Usage
export DISABLE_COMPACT=1
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=500000Details
Only takes effect when DISABLE_COMPACT is set to a truthy value Parses the value as an integer; ignores invalid or non-positive values When compaction is disabled without this variable, the context limit message now shows "Compaction is disabled." instead of the previous autocompact instructions Evidence
Context limit override (search for "CLAUDE_CODE_MAX_CONTEXT_TOKENS " and "Compaction is disabled.")
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
How sure we are
One source agrees One thing we can check says the same as this entry.
Anthropic's release notes agree Fixed CLAUDE_CODE_MAX_CONTEXT_TOKENS to honor DISABLE_COMPACT when it is set.
See this entry in the whole of v2.1.98 →
Names in this entry
env CLAUDE_CODE_MAX_CONTEXT_TOKENS Override the context window size Claude Code assumes for the active model. As of v2.1.193, how it applies depends on how Claude Code resolves the model ID; see Correct the window for a gateway or custom model ID . Use this when routing to a model through ANTHROPIC_BASE_URL whose context window does not match the built-in size for its name
env DISABLE_COMPACT Unknown model names now get an assumed context budget so auto-compact works instead of stalling.
Anthropic's notes
Upstream's own release notes for v2.1.98 name something this entry names, so the two are probably about the same change. Probably: the pairing is made on a shared name rather than on the words around it.
Is this right?
0
0
Feedback
What's wrong with this entry?
Hard to understand Too vague Looks wrong Not relevant to me Too long Missing the detail I wanted Duplicate of another card
Clear Learned something new I can act on this Good catch
Related
Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.
← Previous · 5 of 23
--exclude-dynamic-system-prompt-sections CLI Flag
In v2.1.98 New Features release-page order
Next → · 7 of 23
CLAUDE_CODE_SCRIPT_CAPS Environment Variable