{"name":"--autocompact","slug":"autocompact","family":"cli","title":"CLI flags","noun":"CLI flag","description":"Set the [auto-compact window](\/docs\/en\/model-config#set-the-auto-compact-window) for this session without changing your saved settings. Accepts the same values as `\/autocompact`; that section covers the value forms and what overrides the flag. Requires Claude Code v2.1.221 or later","description_source":"docs","described_by":{"doc":"claude-code\/cli-reference","title":"CLI reference"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.309","builds":0,"mined_builds":150,"first_cited":{"version":"2.1.221","released_at":"2026-08-03 22:16:25","spans":1}},"aliases":[],"entries":[{"version":"2.1.221","anchor":"autocompact-ungated-plus-an-autocompact-cli-option","heading":"\/autocompact ungated, plus an --autocompact CLI option","line":"You can now set when auto-compaction kicks in with a new --autocompact flag, and \/autocompact works for everyone.","released_at":"2026-08-03 22:16:25","reason":"named in this entry, found in this entry's text"},{"version":"2.1.221","anchor":"new-autocompact-flag-for-the-auto-compact-window","heading":"New --autocompact flag for the auto-compact window","line":"You can set the auto-compact window at launch with --autocompact, using auto or 100k to 1M.","released_at":"2026-08-03 22:16:25","reason":"named in this entry, found in this entry's text"},{"version":"2.1.122","anchor":"notes","heading":"","line":null,"released_at":"2026-04-28 17:35:53","reason":"found in this entry's text"}],"entries_total":3,"docs":[{"source":"claude-code","path":"cli-reference","title":"CLI reference","documented":true},{"source":"claude-code","path":"changelog","title":"Claude Code changelog","documented":false},{"source":"claude-code","path":"env-vars","title":"Environment variables","documented":false},{"source":"claude-code","path":"managed-settings","title":"Deploy managed settings","documented":false},{"source":"claude-code","path":"model-config","title":"Model configuration","documented":false},{"source":"claude-code","path":"settings","title":"Claude Code settings","documented":false},{"source":"claude-code","path":"settings-reference","title":"All settings","documented":false}],"docs_total":7,"gates":[],"related":[],"url":"https:\/\/changelogs.core-directive.com\/reference\/cli\/autocompact","family_url":"https:\/\/changelogs.core-directive.com\/reference\/cli.json"}