← All Daily

Daily⁠ · ⁠ · Claude Code · BackfilledAdded after launch from the official source. · 🌶️🌶️Worth a lookMedium: worth a look Why: Know the opt-out

Claude Code: Idle chats now compact before the cache expires

Walk away from a long chat and Claude Code tidies it up.

After ~54 idle minutes, a 200K+ token chat compacts before the prompt cache expires, so your next message doesn’t re-chew the whole transcript. Tune the threshold with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS, or opt out with "idleCompaction": false.

What changed

Step away from a long Claude Code chat, and it now tidies itself up before you come back.

Claude Code keeps a prompt cache of your conversation for one hour. Leave a very long chat idle past that hour and the cache expires, so the next message has to work through the full transcript again.

What changed

Now a terminal conversation of 200K+ tokens that sits idle for ~54 minutes is compacted (condensed into a shorter summary) before its one-hour prompt cache expires.

How to control it

  • CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS changes the 200K-token minimum.
  • "idleCompaction": false in settings.json turns it off.
  • Both need Claude Code v2.1.290 or later.

Rely on the full, word-for-word history of a long session? Turn idle compaction off. Otherwise, update Claude Code and take your break.

Source: Claude Code v2.1.299 release notes⁠ · Claude Code v2.1.300 release notes