Claude Code compacts idle sessions of 200k tokens or more before the prompt cache expires
Anthropic switched on idle compaction in Claude Code around v2.1.286, replacing long idle conversations with a summary, a dev.to analysis reports. Version 2.1.290 adds idleCompaction: false, a choice that falls on anyone keeping large sessions open past an hour.
The Engineer · Build desk

Key figures: a 300,000-token session left for 61 minutes reprocesses all 300,000 tokens on the first message back. Idle compaction currently applies to contexts of 200k tokens or more. On an API key it runs only with promptCacheTtl set to 1h.
| Figure | Value | Note | Claim |
|---|---|---|---|
| First message back after 61 minutes idle reprocesses | 300,000 tokens | 6 | |
| Idle compaction applies at | 200,000 tokens or more | 9 | |
| API key cache TTL it needs | 1 hour (1h) | 10 |
What happened
- An Anthropic collaborator confirmed in the GitHub thread that the feature currently applies only to contexts of 200k tokens or more, so short sessions are never touched.
- On an API key or a cloud provider the main conversation defaults to a five-minute cache, so idle compaction does not run unless promptCacheTtl is set to 1h.
- The idle-compaction code and its server switch already shipped in 2.1.285, and what changed around 2.1.286 was Anthropic turning it on.
- Before 2.1.290 the only exits were autoCompactEnabled: false or DISABLE_AUTO_COMPACT=1, and both also remove the safety net at the context limit.
Why it matters
- decision The setting works at user, project, local and managed level, so the choice can be made per project instead of globally.
- cost Opting out puts the cold-cache bill on the user's own plan limits. Leaving it on puts the cost on the fidelity of the context.
- exposure Parallel long sessions get summarized together. One GitHub report had 35% of a user's open sessions compacted overnight.
Idle compaction is a cache-cost trade, and the cost sits in the first message back. On a Claude subscription the main conversation gets a one-hour prompt cache [5]. Leave a 300,000-token session for 61 minutes and your next message pays to reprocess all 300,000 tokens against your plan's usage limits, according to the dev.to post [6]. Idle compaction summarizes the conversation just before the cache expires, so you pay for the short summary instead [7].
The price is fidelity. The post says the exact instructions you gave, the reasons behind decisions and the approach you agreed on are replaced by that summary [8]. The only notice is a banner: "Compacted while idle, before the prompt cache expired" [4].
Opting out takes one line. On 2.1.290 or later, add "idleCompaction": false to ~/.claude/settings.json [2]. The post quotes the setting's built-in description from the code: "Set to false to stop Claude Code from compacting a long conversation while the session is idle. Setting it to true does not turn idle compaction on." [15] The author reads that as a one-way switch. Setting true cannot force the feature on, because Anthropic's server switch still decides that [18]. The setting leaves ordinary auto-compaction at the context limit alone [17].
Every detail here comes from one post. Its author says the official docs do not describe the feature, so the trigger conditions come from reading the 2.1.290 package [3]. The feature was also requested. A June feature request asked for exactly this, and the community had already built add-ons such as claude-idle-compact [16]. A feature that rewrites your context while you are at lunch warrants a release note, and the post says this one got none [1].
In our view the default is the right tradeoff for scratch sessions and the wrong one for sessions that hold a specification. If a summary could lose something you cannot restate in a paragraph, and you regularly step away for more than an hour, opt out and accept the full reprocess on return. If you usually resume with a fresh instruction anyway, leave it on.
What to watch
- Whether Anthropic documents idleCompaction or adds a changelog entry, since the current account of the trigger conditions comes from one reader of the package code.
- Whether the 200k-token threshold moves, given that the Anthropic collaborator described it as the current behavior.
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence58
- Adoption
- Insufficient
- Hype gap−5
- Incentives
- Insufficient
- Confidence60
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
Anthropic switched idle compaction on from its side around Claude Code version 2.1.286, with no release note and, until the week of the post, no way to turn it off.
- [2]
Adding "idleCompaction": false to settings on Claude Code version 2.1.290 or later stops the idle summaries; the post suggests ~/.claude/settings.json.
- [3]
The official docs do not describe the feature yet, so the author downloaded the Claude Code 2.1.290 package and read the code that decides when it runs.
- [4]
Users returning to an idle session see the banner: "Compacted while idle, before the prompt cache expired".
- [5]
On a Claude subscription, the main conversation gets a one-hour prompt cache.
- [6]
If you have a 300,000-token session and walk away for 61 minutes, your first message back pays to reprocess all 300,000 tokens, against your plan's usage limits.
- [7]
Idle compaction summarises the conversation just before the prompt cache expires, so on return the user pays for the short summary rather than the full history.
- [8]
The exact instructions given, the reasons behind decisions and the agreed approach are replaced by a summary.
- [9]
An Anthropic collaborator confirmed in the GitHub issue thread that idle compaction currently applies only for larger contexts (200k+), so short sessions are never touched.
- [10]
On an API key or a cloud provider the main conversation defaults to a five-minute cache, so idle compaction does not run unless promptCacheTtl is set to 1h.
- [11]
The idle-compaction code and its server switch are already in version 2.1.285; what changed around 2.1.286 was Anthropic switching it on, so downgrading is not a reliable way out.
- [12]
Before 2.1.290 the only way to stop idle compaction was to turn off auto-compaction entirely with autoCompactEnabled: false or DISABLE_AUTO_COMPACT=1; both still work but also remove the safety net at the context limit.
- [13]
The GitHub issue about the feature describes one user returning to find seven of their twenty open sessions compacted overnight.
- [14]
The idleCompaction setting also works in a project's .claude/settings.json, a local settings file, or managed settings.
- [15]
The setting's built-in description in the code reads: "Set to false to stop Claude Code from compacting a long conversation while the session is idle. Setting it to true does not turn idle compaction on."
- [16]
A feature request from June wanted idle compaction, and the community had already built add-ons such as claude-idle-compact.
- [17]
The idleCompaction setting leaves normal auto-compaction, which fires near the context limit, alone.
- [18]
False opts a user out but true cannot force idle compaction on; Anthropic's server switch still decides that.
- [19]
Seven of twenty open sessions compacted overnight is 35% of that user's sessions.
Get this ledger inside ChatGPT. Ask about any of our stories and the answer brings its figure, each claim’s verdict and the sources. Free, no account.
Sources
1 independent publisher whose own reporting we read for this story.
- dev.toClaude Code 'Compacted While Idle'? How to Turn It Off (and When You Shouldn't)
1 article · October 15, 2026
Topics and entities
Follow any of these and your For You feed starts watching them — no settings page required.