Skip to content

Build Not yet confirmed elsewhere1 publisher 2 min read Published

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

How we use AI Send a correction

Illustration accompanying Claude Code compacts idle sessions of 200k tokens or more before the prompt cache expires
Generated illustration
After the cache expires, return reprocesses it all Tokens reprocessed on return, counted against plan limits, beside the context size idle compaction applies from and the cache TTL it needs on an API key.

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.

After the cache expires, return reprocesses it all
FigureValueNoteClaim
First message back after 61 minutes idle reprocesses300,000 tokens6
Idle compaction applies at200,000 tokens or more9
API key cache TTL it needs1 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
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [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.

    Reported Supported Source: dev.to post by its-tahirView cited source
  2. [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.

    Reported Supported Source: dev.to post by its-tahirView cited source
  3. [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.

    Reported Supported Source: dev.to post by its-tahirView cited source

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.

Add to ChatGPTAdd to Claude

Sources

1 independent publisher whose own reporting we read for this story.

  1. dev.to

    1 article · October 15, 2026

    Claude Code 'Compacted While Idle'? How to Turn It Off (and When You Shouldn't)

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Loading related stories