Search the documentation
6 pages for claude_code_auto_compact_window.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
Use Claude Code on the web
Claude Code CLI · in the page
claude-code-on-the-web
…ompaction triggers. To change the auto-compact window instead, set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](/docs/en/env-vars) in your environment variables, or run [`/autocompact`](/docs/en/commands#all-…
Environment variables
Claude Code CLI · in the page
env-vars
…| | `CLAUDE_CODE_AUTO_COMPACT_WINDOW` | Set the [auto-compact window](/docs/en/model-config#set-the-auto-compact-…
Connect Claude Code to an LLM gateway
Claude Code CLI · in the page
llm-gateway-connect
…| Run `/compact` to recover the session. To prevent it, set `CLAUDE_CODE_AUTO_COMPACT_WINDOW` to the gateway's limit; Claude Code clamps the value to at least 100,000 tokens and at most the m…
Model configuration
Claude Code CLI · in the page
model-config
…mpact before the window fills, at about 967K tokens by default; set [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](/docs/en/env-vars) to choose a different threshold. Two configurations budget the window at 200…
Claude Code settings
Claude Code CLI · in the page
settings
…he [`--autocompact`](/docs/en/cli-reference#cli-flags) flag and the [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](/docs/en/env-vars) environment variable can override it. [Set the auto-compact window](/docs/en/…
Claude Code settings reference
Claude Code CLI · in the page
settings-reference
…ence#cli-flags) takes precedence over this key for one session, and [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](/docs/en/env-vars) takes precedence over both ```json settings.json theme={null} { "autoCompa…