Death to Autocompactification
Death to Autocompactification

I have complained as long as I have been using Claude Code that it reserves 22.5% of its tokens (45k of 200k) for autocompactificauon—a process I try at all costs to avoid.

It turns out there is a mechanism for turning off autocompactification, but it has taken me about 6 weeks to discover it.

If you don’t change anything, when you start, if you say /context you will see something like this:

gardot:$ claude-code
CheckEagle environment set: /Users/njr/python/checkeagle1
CLAUDE_MODE=checkeagle CLAUDE_TASKDIR=/Users/njr/python/checkeagle1

  ▐▛███▜▌        Claude Code v2.0.30
 ▝▜█████▛▘  ▄    Sonnet 4.5 · Claude Max
   ▘▘ ▝▝   ███   /Users/njr/python/checkeagle1

> /context
  ⎿
      Context Usage
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛁ ⛀   claude-sonnet-4-5-20250929 · 63k/200k tokens (31%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 2.5k tokens (1.3%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 13.3k tokens (6.6%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Memory files: 2.0k tokens (1.0%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 8 tokens (0.0%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 137k (68.6%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝   ⛝ Autocompact buffer: 45.0k tokens (22.5%)
     ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝
     ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝

     Memory files · /memory
     └ User (/Users/njr/.claude/CLAUDE.md): 931 tokens
     └ Project (/Users/njr/python/checkeagle1/CLAUDE.md): 1.1k tokens

     SlashCommand Tool · 0 commands
     └ Total: 864 tokens

But there is a /config command (also available as the second “tab” in /status) that looks like this:

 Settings:  Status   Config   Usage   (tab to cycle)

 Configure Claude Code preferences

 ❯ Auto-compact                              true
   Show tips                                 true
   Rewind code (checkpoints)                 true
   Verbose output                            false
   Respect .gitignore in file picker         true
   Theme                                     Dark mode
   Notifications                             Auto
   Output style                              default
   Editor mode                               normal
   Model                                     sonnet
   Auto-connect to IDE (external terminal)   false

If you change Auto-compact then autocompactification is turned off, naturally, (which is great, because in my experience Claude post-compactification “knows” less than Claude at startup). Better yet, you get your 45k reserved tokens back.

> /context
  ⎿
      Context Usage
     ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ ⛀   claude-sonnet-4-5-20250929 · 17k/200k tokens (9%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 2.9k tokens (1.4%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 13.4k tokens (6.7%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Memory files: 1.2k tokens (0.6%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ Messages: 8 tokens (0.0%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛶ Free space: 183k (91.3%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶

     Memory files · /memory
     └ User (/Users/njr/.claude/CLAUDE.md): 931 tokens
     └ Project (/Users/njr/python/tdda/CLAUDE.md): 255 tokens

     SlashCommand Tool · 0 commands
     └ Total: 864 tokens

Happy days!