[BUG] After /compact, statusLine receives one tick with used_percentage=0 and input_tokens=0

Resolved 💬 2 comments Opened May 27, 2026 by sirouyang Closed May 31, 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?

After /compact, the statusLine stdin emits one tick where used_percentage and input_tokens are both 0, causing any
statusLine plugin to briefly display "Context 0%" before recovering on the next tick. The plugin has no way to
distinguish this transient zero from genuinely empty context, so there is no plugin-side workaround.

What Should Happen?

The first post-compact stdin tick should either carry the summary token count in current_usage (so used_percentage and
input_tokens reflect reality), or skip emitting a tick entirely until the summary is loaded into the context window.

Error Messages/Logs

Steps to Reproduce

  1. Install any statusLine plugin that reads context_window.used_percentage or

context_window.current_usage.input_tokens from stdin

  1. Use the session until context reaches ~40%+
  2. Run /compact
  3. Observe the statusline: context briefly shows 0% then jumps back to a non-zero value

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.152 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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