claude-code - 💡(How to fix) Fix /usage: progress bar width desyncs from percentage value on initial render [1 participants]

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…
GitHub stats
anthropics/claude-code#49422Fetched 2026-04-17 08:41:39
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×2

In the /usage dialog (Usage tab), progress bars render with an initial "placeholder" width that never reconciles with the actual percentage value once data arrives.

Root Cause

  • "Current week (all models)" renders without any bar at all (likely because no data is tracked yet — may be intentional)
  • "Extra usage" row shows "100% used" as text but no bar rendered
  • Reopening /usage does not reliably fix the desync
  • Suspect a race condition in the Ink render: text state and bar-width state update independently, and the bar's re-render is skipped after data loads
RAW_BUFFERClick to expand / collapse
<img width="823" height="490" alt="Image" src="https://github.com/user-attachments/assets/8e58f9fa-4b39-45eb-a952-69f0155fd8b3" />

Description

In the /usage dialog (Usage tab), progress bars render with an initial "placeholder" width that never reconciles with the actual percentage value once data arrives.

Steps to reproduce

  1. Run /usage → switch to the Usage tab
  2. Observe progress bars for "Current session" and "Current week (Sonnet only)"
  3. Initial frame: bars render with correct proportions briefly
  4. ~1 second later: text labels update to actual values ("0% used", "1% used"), but the bar widths remain stuck at the initial ~60% fill

Expected

Bar width should match the reported percentage — at 0–1% used, the bar should appear empty or near-empty.

Actual

Bar width stays at ~60% fill while the label reads "0% used" / "1% used". The two visual elements are out of sync.

Environment

  • Claude Code version: 2.1.111
  • OS: macOS (Darwin 25.3.0)
  • Terminal: iTerm2
  • TERM=xterm-256color
  • COLORTERM=truecolor
  • Theme: default (dark)

Additional notes

  • "Current week (all models)" renders without any bar at all (likely because no data is tracked yet — may be intentional)
  • "Extra usage" row shows "100% used" as text but no bar rendered
  • Reopening /usage does not reliably fix the desync
  • Suspect a race condition in the Ink render: text state and bar-width state update independently, and the bar's re-render is skipped after data loads

Screenshot available on request.

extent analysis

TL;DR

The issue can likely be resolved by ensuring that the progress bar width is updated synchronously with the text label values, potentially by re-rendering the bar after data loads.

Guidance

  • Verify that the progress bar's width is being updated correctly by checking the code responsible for rendering the bar and the text labels, looking for any asynchronous updates that might cause the desync.
  • Investigate the possibility of a race condition in the Ink render, as suspected, and consider adding a mechanism to ensure that the bar's re-render is triggered after data loads.
  • Check the CSS or styling rules applied to the progress bar to ensure that the width is being set correctly based on the percentage value.
  • Consider adding a brief delay before updating the progress bar width to ensure that the data has finished loading and the text labels have been updated.

Example

No code snippet is provided as the issue does not include specific code details, but the fix might involve modifying the rendering logic to update the progress bar width synchronously with the text labels, for example:

// Pseudo-code example, actual implementation may vary
updateProgressBar(width) {
  // Update text label
  setTextLabel(width + "%");
  // Update progress bar width
  setProgressBarWidth(width);
}

Notes

The provided information suggests a potential issue with the rendering of the progress bars, but without access to the specific code or more detailed debugging information, it's difficult to provide a definitive solution. The guidance provided is based on the suspected cause of a race condition and the need to ensure synchronous updates of the progress bar width and text labels.

Recommendation

Apply a workaround to ensure synchronous updates of the progress bar width and text labels, as the root cause of the issue appears to be related to the rendering logic rather than a specific version or configuration issue.

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 /usage: progress bar width desyncs from percentage value on initial render [1 participants]