{"version":"2.1.295","anchor":"idle-sleep-compact-timer-compacts-context-just-before-pro","canonical_anchor":"idle-sleep-compact-timer-compacts-context-just-before-pro","heading":"Idle compaction is now timed to run just before the prompt cache expires","tier":"notice","area":"Compaction","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.295\/e\/idle-sleep-compact-timer-compacts-context-just-before-pro","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.295","markdown":"### Idle compaction is now timed to run just before the prompt cache expires\n\nA timer now compacts an idle conversation shortly before its prompt cache runs out, if it is large enough and rate limits allow\n\n**What**\n\nCompaction is when Claude Code summarises the earlier part of a conversation to free up room. The prompt cache is a short-lived store on the server that lets Claude Code resend a long conversation cheaply, and it expires after a while. Claude Code now sets a timer that goes off when 90% of the time until that cache expires has passed. When it goes off, Claude Code queues a compaction only if all of these hold:\n\n- The session is idle, meaning you are not typing and nothing is running.\n\n- The cache is still warm, meaning it has not expired yet.\n\n- The conversation is large enough.\n\n- Your rate limits allow the extra request.\n\nThe size threshold is still set with `CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS`, which defaults to 150000 tokens. The timer also checks whether idle compaction has been turned off.\n\n**Why**\n\nYour conversation may be compacted on its own while you are away. If you come back to a shorter, summarised history, this timer is the likely reason.\n\n- Area: Compaction\n- Tier: You'll notice\n- Useful: 4\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: yes"}