[BUG] Status line: current_usage flickers to null during slash commands and @ mentions
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?
When using the status line feature, context_window.current_usage in the stdin JSON payload becomes null during UI interactions such as:
- Typing / to open the slash command menu and back to input after the dropdown
- Typing @ for file mentions and clearing it to return to the input
This causes status line displays to flicker or show incorrect values during these interactions, even though the actual context usage hasn't changed.
What Should Happen?
The context_window.current_usage should maintain its last known value during UI interactions. It should only be null at true session start (before any API calls).
Error Messages/Logs
Steps to Reproduce
- Configure a status line command that logs the stdin JSON. E.g.
#!/bin/bash
INPUT=$(cat)
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id')
echo "$INPUT" | jq '.' > /tmp/ccstatus-${SESSION_ID}-$(date +%s%N).json
- Start a Claude Code session and send a message (so context has data)
- Type / to open slash command menu, then press Escape
- Check the captured JSON -
current_usagebecomes null during the menu interaction - Same behavior with @ for file mentions
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.11
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Evidence:
Captured JSON sequence from same session (same session_id):
Timestamp (ns) | Time | current_usage | Gap
-----------------------|-------------------------|---------------|------------
1768633387430603000 | 2026-01-17 12:33:07.430 | null | (first)
1768633387435522000 | 2026-01-17 12:33:07.435 | data | +4ms
1768633403885355000 | 2026-01-17 12:33:23.885 | null | +16.4s
1768633404144485000 | 2026-01-17 12:33:24.144 | data | +259ms
Note: total_input_tokens and total_output_tokens remain stable throughout - only current_usage flickers to null during UI interactions.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗