claude-code - 💡(How to fix) Fix [Bug] /compact command does not trigger statusline refresh

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Custom statuslines that try to detect post-compact freshness by inspecting the transcript work correctly when invoked, but the harness doesn't invoke them at this moment, so there is no script-side workaround.

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description /compact does not trigger a statusline refresh. After /compact completes, the statusline continues to display the previous render (including the pre-compact token count) until something else forces a re-invocation, e.g. submitting a prompt or resuming the session. As a result, the displayed context size appears stale even though it's just a frozen frame from before the compact.

Repro: configure a custom statusline that shows context tokens, run /compact, observe the old token count remain on screen until the next prompt or a session resume.

Expected: the harness re-invokes the statusline command on /compact completion (alongside the existing SessionStart:compact hook) so the rendered output reflects post-compact state.

Custom statuslines that try to detect post-compact freshness by inspecting the transcript work correctly when invoked, but the harness doesn't invoke them at this moment, so there is no script-side workaround.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.121
  • Feedback ID: 9e30e64b-dcf1-4d60-8cff-8e00dd64dd41

Errors

[]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] /compact command does not trigger statusline refresh