2026-10-16 Claude Code idle compaction - cheaper to resume, but from a summary

Canonical version: 2026-10-16 Claude Code idle compaction - cheaper to resume, but from a summary.

Claude Code now compacts long sessions while you're away. Leave a big conversation alone for about an hour and, when you come back, the conversation shows Compacted while idle, before the prompt cache expired. From that point on, Claude works from a summary of what you did together.

It's a sensible default, and it saves usage. For deep sessions where nuance matters, though, I'd rather decide myself when (and how) my context gets compressed.

What it does

Lydia Hallie (Claude Code team at Anthropic) announced it on 14 October: "It now compacts long idle sessions right before the prompt cache expires (~1h). If you come back to it later, it only has to reprocess the summary instead of the entire conversation, which saves you some usage."

The reason is the prompt cache. Claude Code keeps long conversations on a one-hour cache, so each new message reads the history at the cheap cache-read price. Once that hour has passed, the cache is gone, and your next message reprocesses the whole history at the full input price. On a session with 500,000 tokens of history, that's a lot of usage for a single "ok, let's continue". I explain the 5-minute vs 1-hour cache logic in Claude Code Prompt Caching.

Idle compaction kicks in about 54 minutes after your last request, a few minutes before the cache expires, and compacts the conversation. Your next message then sends the summary instead of the full history.

According to the docs, all of these conditions must hold:

  • You're in an interactive terminal session
  • The conversation is on the one-hour cache TTL
  • Claude Code can fetch feature flags from Anthropic (so it never runs if you set DISABLE_TELEMETRY or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, or if you use Bedrock, Foundry and other third-party providers)
  • The context has reached 200,000 tokens (the default threshold)
  • Your computer is awake at the 54-minute mark

Because of that 200K threshold, it mostly concerns 1M-context sessions. On a 200K window, regular auto-compaction fires before you ever get there.

What you give up

Lydia says it herself in the follow-up post: "It does mean that Claude continues from a summary instead of your full context though."

Compaction is lossy. The summary keeps the broad strokes and drops details: the approach you tried and rejected two hours ago, the exact error message, the constraint you mentioned once at the start. And since you weren't there, nobody told the summary what to keep. That's the tension between compression and context: the more you compress, the more nuance you lose.

For many sessions, that's fine. If you were in the middle of a long refactoring and you'll pick it up tomorrow with "continue", the summary is enough, and you save a big chunk of usage.

For deep sessions, I'd think twice. Think of a design discussion full of nuance, a debugging session where the dead ends matter, or an analysis you built up over hours... In those sessions, Claude needs the details. Re-explaining what the summary forgot costs more than one full reprocess, and that's assuming you even notice what it forgot.

How to control it

You have three options.

Compact yourself before stepping away. Run /compact focus on <what matters> before a break. You still get the cheap resume, but you choose what the summary keeps. The context window docs recommend the same focus trick for steering any summary.

Raise (or lower) the threshold with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS. The default is 200000 and the minimum is 100000 (anything lower gets raised to it). Set it high, e.g. 600000, and only really huge sessions get compacted. Lower it to 150000 if you want sessions on a 200K window to qualify:

{
  "env": {
    "CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS": "600000"
  }
}

Or turn it off with "idleCompaction": false in settings.json (it works in any settings file and needs v2.1.290 or later). For a single session, DISABLE_AUTO_COMPACT=1 turns it off together with regular auto-compaction, and /compact keeps working.

Note that "autoCompactEnabled": false also turns idle compaction off. If you only want to stop the idle one, use idleCompaction. And DISABLE_COMPACT=1 goes further: it disables all compaction, including the manual /compact command.

What I'd do

I'd keep it on. Most idle sessions get resumed with a quick follow-up, and paying full price for a few hundred thousand tokens of history just to say "continue" is a waste of usage.

Before leaving a session that matters, I'd compact it myself with a clear focus. And if you regularly leave nuanced 1M-context sessions open over lunch, set "idleCompaction": false and accept the cost of the full reprocess when you come back.

All the settings (and how they interact) are in Claude Code Configuration. For when to compact, clear or write a handoff file instead, see Claude Code Tips and Best Practices.

That's it for today! ✨

References


About Sébastien

Ready to get to the next level?

Found this valuable? Share it with someone who needs it.

Join 6,000+ readers. Get practical systems for knowledge & AI. Free.

Subscribe ✨

Free: Knowledge System Checklist

A clear roadmap to building your own knowledge system. Subscribe and get it straight to your inbox.

6,000+ readers. No spam. Unsubscribe anytime.

Subscribe