Skip to content
BENIBIX Learn

CLAUDE_AUTOCOMPACT_PCT_OVERRIDE

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_AUTOCOMPACT_PCT_OVERRIDE environment variable

It sets the percent full at which a chat is squeezed.

Think of it like

It is like you empty the bin when it is half full. You do not wait till it spills.

Example

Lucy finds Claude gets sloppy late in long chats. She sets this to 60, so the chat is squeezed while it is still sharp.

Why it matters

Squeezing early keeps the chat small. A model often works better with less in front of it.

Definition

CLAUDE_AUTOCOMPACT_PCT_OVERRIDE sets how full the auto-compact window gets before the chat is squeezed. Give it a percent from 1 to 100. A low value such as 50 squeezes sooner. It can only lower the point, so values above the default are ignored. It works for the main chat and for subagents.

Example code

bash
export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50
claude
Squeeze the chat at half full.
The percent sets the line where squeezing starts.

Common mistake

Setting 95 to squeeze later. It can only make it sooner, so a high value is ignored.

Key takeaways

  1. 1
    1 to 100. Percent of the window.
  2. 2
    Only lowers it. High values ignored.
  3. 3
    Subagents too. Same rule.

Compare