claude-code - 💡(How to fix) Fix Status bar: used_percentage returns resets_at timestamp after /clear

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…

Root Cause

In a custom statusLine script, clamp used_percentage values outside [0, 100] and hide the block. Note: this also requires using a non-whitespace IFS delimiter when parsing jq output, because IFS=$'\t' read in bash collapses consecutive tab delimiters (empty fields), causing the timestamp from resets_at to bleed into the used_percentage variable.

Fix Action

Workaround

In a custom statusLine script, clamp used_percentage values outside [0, 100] and hide the block. Note: this also requires using a non-whitespace IFS delimiter when parsing jq output, because IFS=$'\t' read in bash collapses consecutive tab delimiters (empty fields), causing the timestamp from resets_at to bleed into the used_percentage variable.

Code Example

"rate_limits": {
  "five_hour": {
    "used_percentage": 1779124800,
    "resets_at": 1779124800
  }
}
RAW_BUFFERClick to expand / collapse

Bug description

After running the /clear command, the status bar displays an obviously wrong value in the used_percentage field of rate_limits.five_hour — the field receives the value from resets_at (a Unix timestamp, e.g. 1779124800) instead of an actual usage percentage (0–100).

Steps to reproduce

  1. Start Claude Code in any project
  2. Run /clear
  3. Observe the status bar immediately after — it shows something like 5h ████ (1779124800%)

Expected behavior

used_percentage should be a number in the range 0–100 representing the fraction of the 5-hour rate limit used.

Actual behavior

used_percentage equals the value of resets_at (Unix timestamp). Example from /tmp/cc-statusline.json captured right after /clear:

"rate_limits": {
  "five_hour": {
    "used_percentage": 1779124800,
    "resets_at": 1779124800
  }
}

Both fields are identical, suggesting the server puts the reset timestamp into the wrong field when the session is freshly cleared.

Environment

  • Claude Code version: 2.1.143
  • Platform: macOS Darwin 25.4.0
  • Model: claude-sonnet-4-6

Workaround

In a custom statusLine script, clamp used_percentage values outside [0, 100] and hide the block. Note: this also requires using a non-whitespace IFS delimiter when parsing jq output, because IFS=$'\t' read in bash collapses consecutive tab delimiters (empty fields), causing the timestamp from resets_at to bleed into the used_percentage variable.

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…

FAQ

Expected behavior

used_percentage should be a number in the range 0–100 representing the fraction of the 5-hour rate limit used.

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 Status bar: used_percentage returns resets_at timestamp after /clear