
Step away from a long conversation in the terminal and Claude Code acts before the cache runs out. After about 54 minutes idle, a conversation of 200K tokens or more gets compacted, just ahead of the one-hour prompt cache expiry, so your next message doesn't have to reprocess all of it.
You'll see a line that starts with Compacted while idle. CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS moves the 200K-token minimum, and "idleCompaction": false in settings.json switches it off. Either needs Claude Code 2.1.290 or later.
