Developer at nested terminal windows beside a jar of glowing tokens being compressed

Quick answer

Claude Code idle compaction compresses a long conversation once it has been idle for close to an hour, before the prompt cache expires. Your next message then processes a short summary instead of the whole history. According to Anthropic’s changelog, it applies to terminal conversations of 200K+ tokens idle for about 54 minutes. You can turn it off with "idleCompaction": false in settings.json. In the desktop app, nested sessions do a similar job for parallel work: child sessions do the messy work and report back, so your main session stays small.

Key takeaways

  • Idle compaction runs before the one-hour prompt cache expires, which saves a costly full re-read
  • It needs Claude Code v2.1.290 or later, and you can tune the token threshold with an environment variable
  • Nested sessions keep tool calls and side work out of your main conversation
  • /btw lets you ask side questions without adding clutter to the main task
  • Every extra session still uses your plan’s usage, so only split work when the tasks really are independent
  • This guide supports our Claude Code update and AI news round-up

📘 Part of this week’s AI news: This how-to supports our main article, Fable 5.5 Release Rumours, OpenAI Spy Arrest and a Big Claude Code Update. That article covers the full Claude Code desktop redesign alongside the Fable 5.5 and Anthropic news. This guide turns the two biggest usage-saving features into settings and habits.

The latest Claude Code update was mostly about interface changes. Two of the new features also affect your bill, or how quickly you hit your plan limits: idle compaction and nested sessions.

This guide answers one question: how do you use them to cut token waste without losing the context you need?

What is Claude Code idle compaction?

Idle compaction is automatic summarising that kicks in when you walk away. Anthropic’s Claude Code changelog describes it like this: a terminal conversation of 200K tokens or more that is left idle for about 54 minutes is compacted before its one-hour prompt cache expires. That way, your next message doesn’t have to reprocess everything.

In the video behind our main article, World of AI describes the same feature as roughly “an hour of inactivity”. The precise figures above come from Anthropic.

Why does idle compaction save tokens?

Long conversations are cheap to continue while they are cached. Once the cache expires, the whole history has to be processed again on your next message. For a long session, that is a large and expensive re-read just to say “carry on”.

You come back after…Without idle compactionWith idle compaction
A few minutesCache still warm, so cheapNo change
About an hour or moreCache has expired, so the full history is re-readOnly a short summary is processed
Short session (under the threshold)Normal behaviourNot compacted

How do you turn idle compaction on, off or tune it?

  1. Update Claude Code. The settings below need v2.1.290 or later.
  2. Leave it on if you often step away from long sessions. This is the default behaviour.
  3. Turn it off for a project where every detail matters. Add "idleCompaction": false to that project’s settings.json.
  4. Change the threshold with the CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS environment variable. Raise it if you only want very large sessions compacted.
  5. Compact on purpose before a break. You can still type /compact yourself to summarise early. This is described in the Claude Code desktop docs.

💡 Tip: Before you step away from an important session, ask Claude to write the key decisions into a notes file in the project. If compaction drops a detail, the file still has it.

What are nested sessions in Claude Code?

In the redesigned Claude Code desktop app, you can ask Claude to work on several tasks at once. It then creates a separate child session for each one. When each child finishes, it reports back to your main session, and most of its tool calls stay out of your main conversation.

Some related features help as well:

  • Suggested tasks. Claude can propose follow-up work, and you can launch any suggestion as its own session.
  • /btw. Opens a side question in a separate tab while the main task keeps running.
  • Saved environments. Preset folders, SSH hosts or cloud targets, with optional Git worktrees so each task changes its own copy of the code.
  • Sidebar status. Shows which sessions are working and which are waiting for you. Each session has a live to-do list, a recap card and a context meter.

How do you run parallel work without burning usage?

  1. Split only independent work. “Build the API” and “write the docs for the agreed API” can run in parallel. “Redesign the same page twice” can’t.
  2. Give each child a clear brief. Say which files it may change, what result it should return and how to check that result.
  3. Use worktrees for code changes, so child sessions don’t edit the same files at the same time.
  4. Send side questions to /btw instead of the main session, so the main context stays small.
  5. Watch the context meter. When a session gets close to full, finish the task, summarise it, or start a fresh session.
  6. Review every result before you merge. Parallel work means more diffs to check.
SituationBest featureWhy
One long task, with breaksIdle compactionAvoids a full re-read when you come back
Three unrelated fixesNested sessions + worktreesClean main thread, no file clashes
A quick “what does this do?”/btwKeeps the main context free of clutter
The same set-up every morningSaved environmentOne click instead of manual set-up
High-stakes session with lots of detailIdle compaction off + notes fileNothing important gets summarised away

What are the trade-offs?

  • Compression can lose detail. A summary is shorter by design. Keep important decisions in files, not just in the chat.
  • Parallel sessions still cost usage. Every active session uses your plan, so running five at once can hit your limits sooner.
  • The model selector has moved out of sight. World of AI noticed it is missing from the new desktop interface, so check which model each session is using.
  • More sessions mean more review work. The app can show many sessions, but you still have to check and merge what each one produces.

💡 Tip: Building your own shortcuts on top of Claude Code? Pair these habits with a reusable checklist command. Our guide to Claude Code mods shows how.

Frequently asked questions

Is Claude Code idle compaction on by default?

It was added as automatic behaviour in the terminal, and you can turn it off with "idleCompaction": false in settings.json. Both that setting and the threshold variable need v2.1.290 or later.

How long before idle compaction runs?

Anthropic’s changelog says about 54 minutes of inactivity, for conversations of 200K tokens or more. That is just before the one-hour prompt cache expires.

Will I lose context?

Some detail can be lost when a conversation is summarised. Keep key decisions in a project file, or turn the feature off for sensitive sessions.

Do nested sessions use more tokens?

Each child session uses usage of its own, but your main session stays much smaller. Splitting saves the most when the tasks really are independent.

What does /btw do?

It opens a side question in a separate tab, so you don’t interrupt or clutter your main coding session.

Where can I read about the full update?

See our AI news round-up for the Claude Code redesign, plus the Fable 5.5 and Anthropic news.

The bottom line

Claude Code idle compaction stops you paying to re-read a long conversation after a break. Nested sessions keep parallel work out of your main context. Keep compaction on for everyday work, turn it off where detail is critical, and only split genuinely independent tasks. For the wider update, read Fable 5.5 Release Rumours, OpenAI Spy Arrest and a Big Claude Code Update.

author avatar
Garry Knight
I'm Garry Knight, the person behind Prodify Digital. I write about email list building, email marketing, SEO, AI search and the tools that connect them. My aim is to make online marketing easier to understand, so creators and small business owners can make informed decisions about building an audience and keeping people engaged. Here you'll find straightforward guides and product reviews that explain what something does, where it fits and which limitations matter. The focus is on clear explanations and useful next steps—not hype, shortcuts or promises of easy earnings.
2 thoughts on “Claude Code Idle Compaction and Nested Sessions: How to Cut Token Waste”

Leave a Reply