Why Claude Code started compacting your idle chats
The short version
Leave a 200K+ token Claude Code terminal session idle ~54 minutes and it can compact before the one-hour prompt cache dies — so your next message doesn’t re-chew the whole transcript. Tune with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS or disable with "idleCompaction": false. Primary source: v2.1.299 release notes.
What shipped
Claude Code v2.1.299 (Oct 14, 2026) documents idle compaction for long terminal sessions: after roughly 54 minutes idle on chats above ~200K tokens, the session can compact before the hour-long prompt cache expires (release tag v2.1.299). Independent weeklies picked it up the same day (e.g. DevAgentRadar brief (Oct 15, 2026)).
Public conversation spiked with the release: X recent-search counts for queries covering Claude Code / idle compaction jumped from tens of posts/day earlier in the week to 200–300+ on Oct 14–15 (measured via X recent post counts API for this issue).
Same release train also calls out related context hygiene: CLAUDE_CODE_DISABLE_FILE_MENTIONS (paths without dumping file guts) and OTel splitting cache writes into cache_creation_5m_tokens / cache_creation_1h_tokens (v2.1.299). Idle compaction is the headline; the metrics and mention controls are the side dishes teams will actually wire into dashboards.
Why the one-hour cache matters
Prompt caching discounts repeated prefixes. If the cache expires, the next turn re-processes the transcript — latency and bill go up. Compacting before expiry trades some history fidelity for a warm cache. Anthropic’s platform docs cover context windows and caching behavior at a product level (context windows); the Claude Code release notes are the authority for the terminal-specific idle timer.
For agentic coding, marathon sessions are normal: a refactor that spans lunch, a debug loop that waits on CI, a long tool-using plan. Without idle compaction, walking away near the cache boundary is how you come back to a cold prefix and a slow first message. With it, the runtime babysits the boundary for you — on purpose, with knobs.
This week was less “smarter model,” more “you can actually walk away.” Idle compaction is babysitting for marathon sessions.
We are not claiming measured dollar savings on your account. Read the release notes and your own usage dashboard. Cache economics depend on model, plan, and how often you actually cross the TTL.
Mechanics and thresholds
From the v2.1.299 notes (release):
- Idle window: roughly 54 minutes of idle time before compaction can fire.
- Size gate: sessions around 200K+ tokens are in scope for the default behavior.
- Goal: compact before the one-hour prompt-cache TTL elapses, so the next user message can reuse a warm prefix instead of re-ingesting the full transcript.
Downstream effect: compacted history is not a bit-perfect transcript. If your workflow depends on scrolling back through every tool call for audit or demo, treat compaction as a fidelity trade. If your workflow depends on snappy resumes after coffee, treat it as a latency/cost trade that usually wins.
Observability: the same train splits cache-write metrics into 5m vs 1h buckets in OTel. That is how you tell whether idle compaction is doing real work versus whether you are still paying cold-prefix taxes (v2.1.299). Wire those series before you argue about savings in a sprint review.
Blast radius for teams
| Surface | Why it matters | What to check |
|---|---|---|
| Solo power users | Overnight terminals stop waking up cold | Personal default: leave compaction on |
| Pairing / demos | Full transcript may be part of the show | Disable for demo profiles |
| CI / unattended loops | Compaction timing vs long jobs | Confirm idle thresholds before overnight runs |
| Observability | Cache write buckets change meaning | Update dashboards for 5m / 1h split |
| Compliance / retention | Compaction changes what remains in-session | Document expectations with security |
| MCP + skills | Skills-from-MCP verify size + SHA-256 before load | Still review skill contents (v2.1.299) |
Idle compaction is a client/runtime behavior for Claude Code terminals, not a silent change to Anthropic’s cloud retention policies. Do not conflate "session compacted locally" with "logs deleted in the vendor console." Your logging stack remains your logging stack.
Migration notes and ops checklist
Rollout tips grounded in the release notes and adjacent tooling the same week:
- Inventory long-lived terminals. Who leaves 200K+ sessions open overnight? Those users feel this first (v2.1.299).
- Pick a default per profile. Personal marathon coding: on. Customer demos / training recordings: off via
"idleCompaction": false. - Tune before you disable. Raise
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENSif you want fewer compactions without giving up the babysitter entirely. - Update runbooks. If on-call pastebacks assume a full scrollback, say so. Compaction is not a bug; it is a documented trade.
- Align hooks and deny/ask policy. Unattended loops that used to freeze waiting for a human should fail closed — same class of failure as idle sessions waiting on someone who walked away.
- Dashboard the new OTel fields. Confirm
cache_creation_5m_tokens/cache_creation_1h_tokensland in your collector before you declare victory on cost (v2.1.299). - File mentions. If
@paths are bloating context, tryCLAUDE_CODE_DISABLE_FILE_MENTIONSso mentions stay paths, not file bodies (v2.1.299).
Controls and escape hatches
From the v2.1.299 notes and weeklies citing them:
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS— raise the threshold so smaller sessions never compact"idleCompaction": false— turn it off for a profile or machineCLAUDE_CODE_DISABLE_FILE_MENTIONS—@paths without dumping file bytes into context
Also in the same window: MCP servers can expose skills that Claude Code verifies by size and SHA-256 before load (v2.1.299 skill-from-MCP behavior). Idle compaction does not replace skill trust checks; they solve different problems (cache TTL vs supply chain).
Related releases in the same window
- Claude Code v2.1.299 / v2.1.300 release notes (idle compaction + split cache-write metrics) (v2.1.299)
- Anthropic’s context-window and prompt-caching primer (context windows)
- Agent Skills overview (progressive disclosure vs always-on rules) (overview)
Chef’s pick: keep idle compaction on for personal marathon sessions; disable it in demos where you need the full transcript on screen. Tune the token threshold before you kill the feature — most teams want the babysitter, not a colder cache.
Source: github.com · v2.1.299 · devagentradar.com · DevAgentRadar brief (Oct 15, 2026) · platform.claude.com · context windows · overview