[BUG] The math for `/context` doesn't add up correctly
Resolved 💬 3 comments Opened Oct 1, 2025 by prathapsridharan Closed Oct 5, 2025
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?
Claude version
claude --version
2.0.1 (Claude Code)
Issue
The free space calculation in /context seems wrong:
> /context
⎿ Context Usage 60k/200k tokens (30%)
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛝ ⛝ ⛝
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝
⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛁ System prompt: 3.0k tokens (1.5%)
⛀ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 11.5k tokens (5.8%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ Reserved: 45.0k tokens (22.5%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ [autocompact + output tokens]
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Memory files: 271 tokens (0.1%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ Messages: 91 tokens (0.0%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Free space: 95k (47.6%)
⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
Memory files · /memory
└ Local 271 tokens
(.../CLAUDE.local.md):
SlashCommand Tool · 0 commands
└ Total: 757 tokens
The 60K of Context Usage seems to be System prompt + System tools + Reserved + Memory files + Messages.
Then Free space should be 140K (200K - 60K) - not 95K as the display states.
NOTE: I simply ran claude on the terminal. I did not pass any arguments like --continue or --resume.
What Should Happen?
Then Free space should be 140K (200K - 60K) - not 95K as the display states.
Error Messages/Logs
Steps to Reproduce
Type /context in a claude session (no extra command line args) and check the math of Free space.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.0
Claude Code Version
2.0.1
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Warp
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗