[BUG] Idle '/clear to save tokens' hint waits 75 minutes, but the 1-hour prompt cache is usually gone by 62

Status Open
Reported on v2.1.295
Maintainer reply None cached
Activity 0 comments · opened Oct 9, 2026

What's wrong

The idle hint new task? /clear to save N tokens appears after 75 minutes of idle by default (CLAUDE_CODE_IDLE_THRESHOLD_MINUTES ?? 75, gated on CLAUDE_CODE_IDLE_TOKEN_THRESHOLD ?? 1e5). The main-thread prompt cache uses the 1-hour TTL, so between 60 and 75 minutes of idle the next message usually pays a full cache rebuild. That is exactly the cost the hint points out, and in that window it stays silent.

Evidence

From one user's local transcripts over 30 days: main-thread prompts typed after an idle period, with over 50k tokens of context, bucketed by the idle timer (prompt time minus the end of the previous reply). A call counts as a cache hit when cache reads exceed half its context.

| Idle minutes | Prompts | Cache hits |
|---|---|---|
| 45–60 | 47 | 100% |
| 60–62 | 5 | 40% |
| 62–65 | 10 | 30% |
| 65–75 | 11 | 9% |

Hits are 100% up to 60 minutes and mostly gone shortly after. Between 60 and 75 minutes, 20 of 26 prompts paid a rebuild with no hint shown.

The impact is modest: the window is 15 minutes wide, and the hint only saves tokens when the user was about to start a new task. The point is that the hint's claim ("to save N tokens") becomes true at about 60 minutes, not 75.

What should happen

Show the hint at 60 minutes of idle, or time it from the cache's own expiry, which idle compaction already tracks.

Workaround

CLAUDE_CODE_IDLE_THRESHOLD_MINUTES=60 in the env block of settings. The variable is undocumented.

Environment

Claude Code 2.1.295, macOS (Darwin 24.6.0), Claude subscription, main thread on the 1-hour cache TTL.

🤖 Generated with Claude Code

https://claude.ai/code/session_016Rixu2TyyhcVTojhoAVx1Q

View original on GitHub ↗