[BUG] Status bar shows different token count than /context command (22k vs 24k)
Status Fixed / completed
Reported on v2.1.16
Maintainer reply None cached
Activity 4 comments · opened Jan 22, 2026 · closed Jan 23, 2026
Bug Description
The status bar displays a different token count and percentage than the /context command output, even though issue #6537 and fix in v2.1.14 were supposed to align these values.
Environment
- Claude Code version: 2.1.16
- OS: macOS (Darwin 25.2.0)
- Node: v20.13.1
- Model: claude-opus-4-5-20251101
Steps to Reproduce
- Start a Claude Code session
- Have a conversation to build up context
- Run
/contextcommand - Compare with status bar display
Expected Behavior
Both /context command and status bar should show the same token count and percentage.
Actual Behavior
- Status bar shows:
24k/200k tokens (12%) /contextshows:22k/200k tokens (11%)
Difference is ~2k tokens (~1-2% discrepancy).
Additional Context
- This occurs consistently, not just once
- According to CHANGELOG, v2.1.14 should have fixed
/contextto show same values as status line
Related Issues
- #6537 (context reporting bug)
- #9964 (status bar baseline mismatch - closed as duplicate)
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Closing as duplicate of #19316 - same issue (status bar vs /context showing different token counts)
Root Cause Found & Solution
After debugging the statusline API, I discovered the issue:
Problem
context_window.total_input_tokensis cumulative - it sums ALL input tokens sent during the entire session, not the current context window usage.This causes custom status bars to show inflated values that grow continuously (e.g., 241k/200k = 120%) while
/contextshows the correct 32k/200k.Available Fields
Fix for Custom Statuslines
Before (wrong):
After (correct):
This now matches
/contextoutput exactly.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.