{"version":"2.1.98","anchor":"claude-code-max-context-tokens-environment-variable","canonical_anchor":"claude-code-max-context-tokens-environment-variable","heading":"CLAUDE_CODE_MAX_CONTEXT_TOKENS Environment Variable","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.98\/e\/claude-code-max-context-tokens-environment-variable","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.98","markdown":"### `CLAUDE_CODE_MAX_CONTEXT_TOKENS` Environment Variable\n\n**What**\n\nAllows manual control of the maximum context token limit when automatic compaction is disabled.\n\n**Usage**\n\n`export DISABLE_COMPACT=1 export CLAUDE_CODE_MAX_CONTEXT_TOKENS=500000` **Details** - 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.\"`)"}