Add idle compaction to VS Code and Desktop
CHANGELOG · original
Added idle compaction to VS Code and Claude Desktop's Code tab: a 200K+ token conversation left idle is summarized, and the summary is used on your next message if the prompt cache has expired Open official changelog ↗ Documentation
Documentation excerpt
Compacting the conversation
Compaction replaces your message history with a summary. By design, this invalidates the conversation layer: the next request has a new, shorter history that doesn't share a prefix with the old one.
- System prompt: when the conversation's prompt is current, the next request reads this layer from the cache. If that prompt is out of date, such as after you resume the conversation, Claude Code switches to the current prompt and the next request rebuilds this layer's cache once.
- Project context: Claude Code reloads this layer from disk. It's cached together with the conversation, so after
/compactor automatic compaction its cache is rebuilt even if its files are unchanged.
To produce the summary, Claude Code sends a separate request. The request repeats your conversation's system prompt, tools, and the history being summarized. It ends with a summarization instruction. While the cache is warm, that request reads your prefix from the cache. A mid-session /compact then costs a fraction of what the context size suggests and spends most of its time generating the summary.
After a break longer than the cache lifetime, there is no cache left to read, so the summarization request reprocesses that history as uncached input. This is why /compact costs the most when you resume an old session. In both the warm and cold cases, the turn after compaction rebuilds the conversation cache for only the much shorter history, so that turn isn't the slow part.
[!TIP]
Compaction works in your favor when the context you discard is content you no longer need. To choose when its overhead happens, run
/compactat a natural break in your work, such as between tasks, instead of waiting for auto-compaction to trigger mid-task. If you've gone down a path you want to abandon entirely,/rewindto an earlier turn instead. Rewinding truncates back to a prefix that is already cached, rather than building a new one as compaction does.
If you leave a long conversation idle while it is on the one-hour TTL, Claude Code can compact it. To turn idle compaction off, set idleCompaction to false, which requires Claude Code v2.1.290 or later.
Documentation snapshot · 2026-11-20