[BUG] Disable or limit the total token count of haiku automatically summarizing the previous session
Preflight Checklist
- [x] I have searched existing issues 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?
I've noticed that when I open a new session and start chatting, Haiku automatically summarizes the previous session or sessions that haven't been summarized yet, leading to a large consumption of tokens.
like:
<img width="626" height="168" alt="Image" src="https://github.com/user-attachments/assets/aa6ee254-6b9b-4c8b-b70d-368b4e9b405b" />
Especially when mixing with roocode, the roocode session does not generate a summary, so switching to Claude Code will summarize all roocode sessions, causing a large amount of token consumption.
<img width="530" height="368" alt="Image" src="https://github.com/user-attachments/assets/22275564-4508-4228-a916-4693523d42c1" />
What Should Happen?
The summary function can be turned off, or the total number of summary tokens can be limited.
It shouldn’t summarize all sessions that haven’t been summarized before; at the very least, it should have an upper limit.
Error Messages/Logs
Steps to Reproduce
If using roocode:
- First, have a few conversations in roocode
- Then switch to Claude Code in the same project
- Type "hi" and press Enter
- Using /cost, you can see token consumption that is several to dozens of times higher than usual
If don't use roocode:
- Have a long session in Claude Code
- Close and open a new Claude Code session in the same project
- Type "hi" and press Enter
- Using /cost, you can see token consumption several to ten times higher than usual
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.50
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗