[BUG] /context command shows inconsistent token usage between summary and breakdown
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?
<img width="513" height="229" alt="Image" src="https://github.com/user-attachments/assets/54365bbe-d42f-4c2c-9122-e0d74d44579b" />
Description
The header line reported by /context doesn't match the sum of the individual category breakdowns.
Observed behavior
The summary line reports 74k/200k tokens (37%) used, but the category breakdown only accounts for ~51k tokens:
┌────────────────┬────────┐
│ Category │ Tokens │
├────────────────┼────────┤
│ System prompt │ 4k │
├────────────────┼────────┤
│ Custom agents │ 701 │
├────────────────┼────────┤
│ Memory files │ 1.2k │
├────────────────┼────────┤
│ Skills │ 614 │
├────────────────┼────────┤
│ Messages │ 41.2k │
├────────────────┼────────┤
│ Compact buffer │ 3k │
├────────────────┼────────┤
│ Sum │ ~50.7k │
└────────────────┴────────┘
The free space line also contradicts the header: 149k free (74.7%) implies only ~51k used (25.3%), not 74k (37%).
What Should Happen?
Expected behavior
The header total should equal the sum of the listed categories, and should be consistent with 200k - free space.
Error Messages/Logs
Steps to Reproduce
Reproduction
Run /context mid-conversation. The header and breakdown diverge by ~23k tokens.
Environment
- Model: claude-opus-4-6 (200k context)
- ~37% into a conversation per the header, ~25% per the breakdown
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.39 (Claude Code)
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
I have auto-compact disabled - not sure if related.
<img width="1029" height="201" alt="Image" src="https://github.com/user-attachments/assets/665ba27c-4966-43dc-9c1b-76954507a924" />
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗