Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Learn Claude Skills. Do Everything Better.
claudeskill-me.com
LATEST
Check Before Upgrading to Claude Code 2.1.299: Stricter MCP Allow Rules, Skill Names With Odd Characters Rejected, UserPromptSubmit Hooks Now Run First  ·  Claude Code Adds Idle Compaction: Conversations Over 200K Tokens Are Compacted After About 54 Idle Minutes — It Saves Cache Cost and May Drop Detail  ·  Fork Subagents Inherit the Whole Conversation Instead of Starting Blank — and Since v2.1.302 They Are On by Default in VS Code, Desktop and Headless Runs  ·  claude plugin eval Explained: Using the With/Without Delta (Δ) to Judge Whether a Skill Helps — and Why Δ Never Fails Your CI  ·  Claude Code Hooks Fail Open by Default: A Missing Script, a Timeout or Exit 1 Lets the Action Through — Using onFailure: "block" from v2.1.295  ·  Claude Haiku 5.5 Becomes Claude Code's Default Haiku: Input Drops to $0.10, but Crossing 100K Tokens Makes the Whole Request Five Times Pricier
news

Claude Code Adds Idle Compaction: Conversations Over 200K Tokens Are Compacted After About 54 Idle Minutes — It Saves Cache Cost and May Drop Detail

30-Second Version · For the impatient
The idle-compaction timer does not understand your work: stepping away for lunch and stepping away right after a key decision look identical to it.

Full Explanation +
01 · Why did this happen?

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.

02 · What is the mechanism?

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.

03 · How does it affect me?

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.

04 · What should I do?

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.

Full Content +

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.

Why 54 minutes

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.

Five conditions that must all hold

A write-up on max.nardit.com, citing the settings reference and the prompt caching docs, lists what makes it actually fire:

  • An interactive terminal session: claude -p and Agent SDK sessions never trigger it.
  • The one-hour TTL: on a subscription, within plan usage, the main conversation gets one hour; with an API key, usage credits or a cloud provider the default is only five minutes, so it usually will not fire unless you set "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.
  • Feature flags reachable: setting DISABLE_GROWTHBOOK=1 or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turns it off.
  • The threshold reached: 200,000 tokens by default, adjustable with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS; values below 100,000 are raised to 100,000.
  • About 54 minutes with the machine awake: a laptop that sleeps through the window does not compact.

How much it saves: an author's estimate and one user's numbers

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.

What compaction keeps and what it drops

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.

How to turn it off, tune it, and confirm it ran

  • "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.
  • Raising CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS keeps the feature on but limits it to larger sessions.
  • A "Compacted while idle, before the prompt cache expired" notice when you return means it ran; the "Prompt cache (main)" line in /usage shows the hit ratio; with OpenTelemetry on, look for api_request events whose query_source is compact.

What is still unclear

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.

Sources: Claude Code changelog - Claude Code Docs, Claude Code idle compaction: idleCompaction, CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS and the 1-hour prompt cache - max.nardit.com, Claude Code Idle Compaction: What It Does and How to Turn It Off - Developers Digest, Claude Code 2.1.299 - idle compaction saves long sessions - ai-tldr.dev
Ask a Question
Please enter at least 10 characters
Related Articles
Why a Single "hi" Can Burn 20,000+ Tokens in Claude Code: Breaking Down the Fixed Startup Overhead
advanced · Sep 05
Claude Suddenly Stopped Using Your Skills After /compact? It's Not Broken — It's Designed Not to Restore Them Automatically
beginners · Oct 02
Subagents Aren't Smarter Mini-Claudes — They Solve Isolation, Not Capability
advanced · Aug 31
Fork Subagents Inherit the Whole Conversation Instead of Starting Blank — and Since v2.1.302 They Are On by Default in VS Code, Desktop and Headless Runs
advanced · Oct 19
Related News
More Related Topics