[BUG] Statusline context_window tokens are cumulative and don't reset on /clear

Resolved 💬 6 comments Opened Dec 14, 2025 by Gabtoof Closed Feb 27, 2026

Description

The statusline JSON API reports total_input_tokens and total_output_tokens as cumulative session totals, not current context usage. These values don't reset when running /clear.

Steps to Reproduce

  1. Work in Claude Code until context builds up
  2. Run /context - note actual usage
  3. Check statusline JSON - note different (higher) values
  4. Run /clear
  5. Check statusline JSON again - values NOT reset

Expected Behavior

After /clear, statusline token counts should reset to reflect current context, not cumulative session usage.

Actual Behavior

Statusline shows cumulative tokens since Claude Code started:

  • /context: 105k/200k (53%)
  • Statusline JSON: 383k tokens (191%)

Evidence

"context_window": {
  "total_input_tokens": 325641,
  "total_output_tokens": 57717,
  "context_window_size": 200000
}

This was captured immediately after /clear.

Environment

  • Version: 2.0.69
  • OS: macOS

Related Issues

This is distinct from #13652 and #13776 which are about statusline not including system overhead tokens. This bug is specifically about cumulative values not resetting.

View original on GitHub ↗

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