⌨️CLAUDE_CODE_AUTO_COMPACT_WINDOW
Also known as CLAUDE_CODE_AUTO_COMPACT_WINDOW environment variable
It sets how full a chat gets before it is squeezed.
Think of it like
It is like you pick the size of a box. Then you fill it.
Example
Jack runs on a 1M model, but long chats get slow and costly. He sets the window to 300,000, so chats are squeezed well before that.
Why it matters
A huge window can cost a lot per request. A smaller one keeps each turn lean.
Definition
Example code
bash
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000
claudeCommon mistake
Key takeaways
- 1100,000 to 1,000,000. Tokens.
- 2Smaller squeezes sooner. Leaner requests.
- 3200k form. Needs 2.1.304.