Could idle Compaction make me lose important context?
There is a risk. Compaction trades detail for a summary, so exact code snippets, error messages and early decisions can be simplified. Whether it happens and how much is lost depends on the quality of the summary, and I found no official quantified data.
If a long task is sensitive to detail, raise CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS or turn the feature off, and before stepping away run /compact yourself with instructions on what to keep.
I use an API key with a five-minute cache. Is idle Compaction still useful?
Uncertain. The changelog describes compaction before a one-hour cache expires, and I found no explanation of behavior with a five-minute cache.
Watch the miss count and cache warm or cold status in the Prompt cache line of /usage before deciding whether to rely on it, and control compaction timing yourself where needed.
Should I raise or lower the 200K-Token threshold?
There is no standard answer. Lowering it compacts more conversations automatically, saving more recomputation cost but increasing the chance of information loss; raising it does the opposite.
The safer approach is to keep the default first, observe the misses and re-cached volume shown in /usage over a week, and then adjust based on how sensitive your tasks are to detail.
How is idle Compaction different from running /compact myself?
The biggest difference is control. A manual /compact lets you say what to keep, while idle compaction happens automatically when you are away and gives you no chance to specify.
If you are leaving in the middle of important work, compacting manually before you go with clear keep-points is more controllable than relying on the automatic one.
Claude Code v2.1.299 (October 14, 2026) adds idle Compaction in the terminal: a conversation of 200K or more tokens that sits idle for about 54 minutes is compacted before its one-hour prompt cache expires, so your next message does not make the model reprocess the whole thing. v2.1.302 then added an Idle compaction row to /config, and the notice shown after an idle compaction now says how to turn it off.
The official costs documentation is explicit: the first message after a break longer than the cache lifetime misses the cache and reprocesses your full context. The lifetime is an hour on a subscription and drops to five minutes once you are drawing on usage credits; on an API key or a cloud provider it is five minutes by default. So coming back from lunch, or from a meeting with a long conversation open, the first message is often the most expensive one. Idle compaction shrinks the conversation while the cache is still warm, so what has to be reprocessed when you return is the compacted summary rather than 200K tokens of original text.
The default minimum is 200K tokens, adjustable with the environment variable CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS; to turn it off entirely, put "idleCompaction": false in settings.json. Both need v2.1.290 or later. One more detail: since v2.1.296 Sonnet 5.5 cache reads are priced at $0.10 per million tokens (down from $0.20), so reading 200K tokens of warm cache comes to about $0.02. Compaction is itself a large request (the documentation warns that compacting a large context is a big request), so it pays off on the condition that it happens while the cache is warm.
The biggest cost is information loss: compaction trades detail for a summary, so if your work depends on exact code snippets, error messages or early decision context in the conversation, the model sees a summary after you return, not the original. Also, the changelog describes compaction as happening before the one-hour cache expires, and I found nothing on how it behaves with a five-minute cache (API key or usage credits); verify that yourself with the Prompt cache line in /usage, which shows whether the cache is warm or cold and how many misses occurred.
If you habitually leave long conversations open overnight or through lunch, idle compaction may save the recomputation cost of that first message when you return, provided your cache lifetime is one hour. Check your miss count and re-cached Token volume in /usage first, then decide whether to raise the threshold, or to turn it off for important long tasks and run /compact yourself with explicit instructions about what to keep. The habit that really saves money is still /clear between unrelated tasks, which costs nothing.