anthropics / anthropics/claude-code
[BUG] Prompt cache expires during active session, causing massive token spikes on next prompt
- 主要語言
- Python
- 星號
- 145k
- 分支
- 23.1k
- PR 合併指標
- PR 指標待擷取
描述
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
2 days i see new message: Idle xxx minutes. The prompt cache has likely expired, so your next message will re-cache about 629k tokens.
### What Should Happen?
No idle count or cache expired as before!!
I don't wanna waste tokens on a bugged software working 2 minutes and then hit a 5h limit!
Pro-subscription, Opus 5
### Error Messages/Logs
```shell
```
### Steps to Reproduce
In not even long session just continue to work
### Claude Model
Opus
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
10 September 2026
### Claude Code Version
2.1.270
### Platform
Anthropic API
### Operating System
Windows
### Terminal/Shell
VS Code integrated terminal
### Additional Information
_No response_
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
No repository file or test is named. Reproduce on Windows in the VS Code integrated terminal with Claude Code 2.1.270 by continuing a session until the idle/cache-expired message appears, then compare with the 10 September 2026 version. Done means active sessions no longer report cache expiry or trigger the reported token recache.
由索引模型根據 Issue 內容生成。
評估
- 領域
- ai, api
- Issue 類型
- 缺陷
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 活躍
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100