Search the documentation
2 pages for claude_code_max_context_tokens.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Environment variables
Claude Code CLI · in the page
env-vars
…e, Claude Code compacts at the context window it assumes for the ID. `CLAUDE_CODE_MAX_CONTEXT_TOKENS` can correct the assumed window instead; see [Correct the window for a gateway or custom model ID](…
Model configuration
Claude Code CLI · in the page
model-config
…s real window, whether or not it resolves the ID to a Claude model. [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](/docs/en/env-vars) declares the window Claude Code should assume instead. How the variable applie…