Make Claude Compact Earlier: The Setting and the CLAUDE.md Note
Claude Code sends your whole chat with every message. One command makes it summarize the pile earlier, and a short note keeps the facts that matter. The setting, the note, and the one catch
In a long Claude Code session, every request carries the whole conversation, old tangents included. Anthropic's cost guide says a one-line question late in a day-long session still draws usage for the entire history.
Here's the one command that makes Claude summarize earlier, the note that protects your key facts, and the catch.
Step 1: set an earlier compact point
- In Claude Code, run: /autocompact 200k
- Claude now summarizes the conversation once it reaches about 200,000 tokens. Valid sizes run from 100K to 1M.
- To go back to the default, run: /autocompact auto
- Prefer a settings file? Add "autoCompactWindow": 200000 to ~/.claude/settings.json. For one launch only: claude --autocompact 200k
The default is much later: on models with a native 1M window (Fable, Sonnet 5 and later, Haiku 5.5, Opus 4.7 and later), Claude Code compacts at about 967K tokens.
Keep reading
Free, for an email.
Unlocks 3 more sections, 1 copy-paste prompt, the document version, and every other guide on the site, for free. Enter your email once to keep reading.
45,000+ follow where these guides come from.No spam. Unsubscribe in one click.