# Claude Code adds idle compaction for sessions over 200K tokens

> Original title: New in Claude Code: idle compaction

- Source: Ado Kukic
- Published: 2026-10-16T15:41:17.000Z
- Bad Influence: https://badinfluence.news/items/rsl35bh96l7jjwtudbou9p9ie
- Original: https://x.com/adocomplete/status/2111120303619481877

## Summary

Anthropic's Claude Code now auto-compacts a session after about 54 minutes idle when it exceeds 200K tokens, before the 1-hour prompt cache expires. Users come back to a warm summary instead of a cold re-cache. The threshold is set with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS, and the feature can be turned off with "idleCompaction": false.

## Post

New in Claude Code: idle compaction

The prompt cache lives 1h. Leave a 200K+ token session idle ~54 min and it gets auto-compacted, so you come back to a warm summary, not a cold re-cache.

Set the Threshold: CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS
Turn Off: "idleCompaction": false

[Video](https://badinfluence.news/api/img-proxy?u=https%3A%2F%2Fpbs.twimg.com%2Fext_tw_video_thumb%2F2111120283335897088%2Fpu%2Fimg%2FRCnt5osJZQlLXpX0.jpg&mode=thumb&exp=1795737600&sig=52f941394aa6411d)
