Search the documentation
5 pages for --autocompact.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
CLI reference
Claude Code CLI · in the page
cli-reference
…./extra-rules.txt` | | `--autocompact <auto\|tokens>` | Set the [auto-compact window](/docs/en/model-config#set-the-auto-compact-window)…
Environment variables
Claude Code CLI · in the page
env-vars
…100K minimum. Takes precedence over the `/autocompact` command, the `--autocompact` flag, and the `autoCompactWindow` setting. The status line's `used_percentage` always measures against the model's…
Model configuration
Claude Code CLI · in the page
model-config
…turn to the window tuned for your model. * **For one launch**: pass [`--autocompact`](/docs/en/cli-reference#cli-flags) when starting Claude Code. The flag overrides your saved setting for that launch…
Claude Code settings
Claude Code CLI · in the page
settings
…#all-commands) command, which writes this key to user settings; the [`--autocompact`](/docs/en/cli-reference#cli-flags) flag and the [`CLAUDE_CODE_AUTO_COMPACT_WINDOW`](/docs/en/env-vars) environment…
Claude Code settings reference
Claude Code CLI · in the page
settings-reference
…de picks a window tuned for your model * **Per-session overrides**: [`--autocompact`](/docs/en/cli-reference#cli-flags) takes precedence over this key for one session, and [`CLAUDE_CODE_AUTO_COMPACT_W…