What it does
The rule lowers the Claude Code idle compaction threshold to 100K tokens, the lowest value the tool accepts, from the default of 200K. A terminal conversation left idle for about 54 minutes is compacted before its one-hour prompt cache expires, so the next message does not reprocess the whole conversation.
It suits developers who leave Claude Code sessions open for long periods and want resumed sessions to avoid reprocessing their full history. It is the counterpart of idle-compaction-off, which disables the feature, and the two are not meant to be used together.
Idle compaction runs only when auto-compact is enabled and the session uses the one-hour prompt cache. That cache is the default on a Claude subscription. On API billing, the ENABLE_PROMPT_CACHING_1H environment variable must be set to 1.
Limitations and requirements
Idle compaction runs only when auto-compact is on and the session uses the one-hour prompt cache. On API billing, ENABLE_PROMPT_CACHING_1H must be set to 1. Do not combine with idle-compaction-off, which turns the feature off.
Safety
Our team has not reviewed this resource. Only automated rules checked it; resources with high-risk signals are not published. These are signals, not a guarantee that installing it is safe. Try it in a sandbox project first.
Sources
- AI Templates (aitmpl) first seen 13 Nov 2026 · last seen 18 Nov 2026 · its page on the source · figures reported by the source: aitmpl downloads 33
idle-compaction-early
Start idle compaction at 100K tokens instead of 200K (Claude Code 2.1.290+). A terminal conversation left idle for about 54 minutes is compacted before its one-hour prompt cache expires, so the next message does not reprocess it all. 100K is the lowest value Claude Code accepts. Idle compaction only runs when auto-compact is on and the session uses the one-hour prompt cache (the default on a Claude subscription; set ENABLE_PROMPT_CACHING_1H=1 on API billing). Do not combine with idle-compaction-off, which turns the feature off.
As shown on www.aitmpl.com when we last read it