I use an API key. Will this feature save me money?
Probably it will not fire. The default prompt cache lifetime on an API key is five minutes, and idle compaction needs the one-hour TTL to arm its timer. To enable it you have to set "promptCacheTtl": "1h" yourself, but one-hour cache writes cost 2x the base input price against 1.25x for five-minute writes, so short bursts can lose money. Don't assume it is saving you anything; first run claude -p "Reply with the single word: ok" --output-format json and see which TTL the writes land in.
I often leave long sessions idle while I eat. Should I turn it off?
It depends on the kind of work. For file-based work (coding, maintenance), the summary plus re-read files usually carries most of what matters, so leaving it on is fine; if the work lives in the conversation itself (design discussions, exact instructions, orchestrator flows that depend on files staying in context), turn it off or raise the threshold. That is nardit's view, not a measurement. A further safeguard is to put whatever must survive into the project-root CLAUDE.md, an unscoped rule, or a SessionStart hook for the compact source, because decisions stated only in chat get paraphrased in the summary.
How do I confirm it actually ran, rather than guessing?
When you return to the session, look for the "Compacted while idle, before the prompt cache expired" notice; the "Prompt cache (main)" line in /usage shows the hit ratio, misses, whether the cache is still warm, and the likely cause of the last miss. With OpenTelemetry on, look for the claude_code.api_request event whose query_source is compact and whose cache_read_tokens is large. A big one-hour cache write on your first message back can mean the window was missed, but a model switch or a changed prefix leaves the same signature, so rule those out first.
I'm not an engineer; I only watch the team's AI tool costs. What should I pay attention to?
First ask whether the team is on a subscription plan or API keys. On a subscription, what this saves is quota, not money, and Anthropic does not publish how quota counts cache reads and writes, so it is hard to estimate in dollars. On an API key the default cache lifetime is five minutes and the feature mostly will not start, so do not count it toward expected savings. It is also a default-on behavior change, so if someone complains that the AI "forgot details I gave it earlier," this is one cause worth checking first.
Claude Code v2.1.299, released October 14, 2026, added a new behavior in its release notes: in the terminal, a conversation over 200K tokens that sits idle for about 54 minutes is compacted before its one-hour prompt cache expires, so your first message when you return does not have to reprocess the whole thing. v2.1.302 on October 16 added an "Idle compaction" row to /config and made the notice shown after compaction say how to turn it off. It is a default-on change that touches both your bill and what sits in your context.
The point is to compact before the prompt cache expires: the summarization request then reads a prefix that is still cached, at the cheap cache-read rate, instead of rewriting the whole conversation from a cold start. As for the number 54, Developers Digest cites a commenter's binary analysis in a GitHub issue: the timer arms only when the cache lifetime is one hour and fires at about 90% of the way to expiry, and 90% of 60 minutes is 54. That is a community report, not official documentation, and the article's author did not verify cache behavior for each plan type.
A write-up on max.nardit.com, citing the settings reference and the prompt caching docs, lists what makes it actually fire:
claude -p and Agent SDK sessions never trigger it."promptCacheTtl": "1h". One-hour cache writes bill at 2x the base input price against 1.25x for five-minute writes, and the docs warn the longer TTL can lose money on short bursts.DISABLE_GROWTHBOOK=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turns it off.CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS; values below 100,000 are raised to 100,000.Official pricing puts cache reads at 0.1x the base input price (0.05x for Opus 5.5 and Sonnet 5.5), five-minute writes at 1.25x and one-hour writes at 2x. nardit's estimate (the author's arithmetic, not documentation) is that for a 200K-token conversation on Opus 5.5, an idle-compaction read costs about 10K base-input units, while coming back cold means rewriting about 400K units, roughly 40 times more on the prefix alone. The real saving is smaller, because you still pay for the summary's output tokens and for rebuilding the context (summary, instructions, restored files and skills).
Developers Digest relays one user's data from a GitHub issue: a session of about 740K tokens on an API key cost about $9.25 per wake from a cold cache versus about $0.19 to compact while warm, and across 142 compactions the compacted context was about 20% of the original. That is one user's measurement, not a benchmark. On a subscription, what you save is quota rather than dollars, and Anthropic does not publish how quota weighs cache reads against writes.
Per the documentation as summarized by nardit, the summary keeps requests and intent, key technical concepts, files examined or modified (with important snippets), errors and fixes, pending tasks, and current work. Full tool outputs and intermediate reasoning are removed from the working context, though the on-disk session record stays. After compaction these reload: the project-root CLAUDE.md, unscoped rules and auto memory; up to five recently modified files (a file over 5,000 tokens returns only as a path); invoked skill bodies (5,000 tokens each, 25,000 total, oldest dropped first); and SessionStart hook output matching the compact source. Rules with paths: frontmatter and nested CLAUDE.md files do not reload automatically; they come back only when Claude touches a matching file. Background commands keep running through a compaction.
The community complaints center on silently lost detail: one bug report says a summary replaced exact instructions, decision rationale and in-flight state without any warning, and another user running an orchestrator workflow said files were not re-read afterward, which broke the process.
"idleCompaction": false turns off only idle compaction and works in any settings file, including a project's .claude/settings.local.json; since v2.1.302 you can also toggle it in /config.DISABLE_AUTO_COMPACT=1 turns off normal auto-compaction as well, leaving only manual /compact.CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS keeps the feature on but limits it to larger sessions./usage shows the hit ratio; with OpenTelemetry on, look for api_request events whose query_source is compact.The docs do not say whether a running background command or a pending scheduled wakeup holds off the idle timer, or how claude --resume behaves after an idle compaction. The release notes say both settings need v2.1.290 or later even though the feature appeared in v2.1.299, and nardit advises treating 2.1.299 as the minimum. Developers Digest also notes that a GitHub issue places this behavior in 2.1.286 as a silent default, which would explain why some people met it earlier, but that is a report and unverified.