[BUG] Status line: current_usage flickers to null during slash commands and @ mentions

Resolved 💬 3 comments Opened Jan 17, 2026 by Mirage20 Closed Feb 27, 2026

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

  1. 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
  1. Start a Claude Code session and send a message (so context has data)
  2. Type / to open slash command menu, then press Escape
  3. Check the captured JSON - current_usage becomes null during the menu interaction
  4. 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗