What this thread does
Our recommendation: keep idle compaction if a summary is an acceptable return point; turn it off if preserving the earlier conversation matters more.
Do first: in the terminal, run /config and inspect Idle compaction. The row requires 2.1.302 or later; the underlying setting requires 2.1.290 or later. See the 2.1.302 notes for the row and the 2.1.299 notes for the setting. Our example settings.json entry (no placeholders):
{ "idleCompaction": false }
What changed
The 2.1.299 notes describe terminal idle compaction for a 200K+ token conversation left idle for about 54 minutes, before its one-hour prompt cache expires. The 2.1.314 notes say that in VS Code and Desktop’s Code tab, the summary is used on your next message if the prompt cache has expired.
The release notes describe these version-specific details:
- 2.1.299 documents terminal idle compaction; 2.1.314 adds VS Code and Desktop’s Code tab.
- 2.1.314 extends idle compaction to subscribers with telemetry off, and to Bedrock, Vertex, Foundry and LLM gateways once the one-hour prompt cache is on.
- 2.1.299 documents a 200K-token minimum and a setting to change it.
The trade-off
- On: for VS Code and Desktop’s Code tab, the 2.1.314 notes say the summary is used on your next message if the prompt cache has expired.
- Off: the 2.1.299 notes document
"idleCompaction": falseas the setting to turn idle compaction off.
How to change it
Turn it off in settings.json (requires Claude Code v2.1.290+). Our example entry (no placeholders):
{ "idleCompaction": false }
Change the 200K-token minimum with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS (requires v2.1.290 or later).
Questions for reports
- Did you notice Claude losing something important after an idle compaction? What kind of detail?
- If you changed the threshold, how did that affect returning to the session?
- If you turned it off, how did returning to the session compare?
Related
- For cache countdowns, see
claude-code-prompt-cache-countdown. - For manual context pruning, see the related thread on pruning context yourself vs built-in compaction.
Primary source
Release notes: 2.1.299, 2.1.314, and 2.1.318. Our recommendation: use the keep-or-disable choice above according to how much you want to retain the earlier conversation.
Update, October 2026
Claude Code 2.1.299 documents terminal idle compaction for a 200K+ token conversation left idle for about 54 minutes, before its one-hour prompt cache expires. CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS changes the minimum; "idleCompaction": false disables it. The notes explicitly say both settings require v2.1.290 or later. Source: Claude Code 2.1.299 release notes.
Update, November 2026
Anthropic’s 2.1.318 notes list a fix for idle compaction replacing a conversation with a reply that was not a summary.
Claude Code 2.1.314, October 30, adds idle compaction to VS Code and Claude Desktop's Code tab. It also enables eligible sessions with Anthropic telemetry disabled, and Bedrock, Vertex, Foundry and gateways when they use the one-hour cache.
Evidence: adamlevineagent's October 28 report #105775 describes unexpected compactions in long-running sessions and requests explicit choice.
Further reference: idle compaction settings, prompt caching, subagent cache settings, and environment variables.
Not for: showing a cache countdown; see claude-code-prompt-cache-countdown, or manually rewriting tool history to save context.
Started from a post by @lydiahallie, packaged by the editor. Original post