claude-code
claude-code copied to clipboard
[BUG] /context reports incorrect token counts per mcp tool
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?
/context reports about 600 tokens used for every single tool from added mcp servers, whereas one tool only adds on the order of 100-200 tokens in reality It looks like it incorrectly counts every single tool token usage one by one, overcounting the shared tools system prelude token by N times, where N is the number of tools
What Should Happen?
/context reports correct token counts for mcp tools
Error Messages/Logs
Steps to Reproduce
Add an mcp server(s) with more than 1 tool overall
Claude Model
None
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.0.14
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response