Skip to content

TokenStep 0.2.23: fix Claude quota showing 100% at 1% usage - #29

Merged
Backtthefuture merged 2 commits into
mainfrom
fix/claude-weekly-quota-percent
Sep 28, 2026
Merged

Backtthefuture merged 2 commits into
mainfrom
fix/claude-weekly-quota-percent

Conversation

@Backtthefuture

Copy link
Copy Markdown
Owner

Problem

The popover showed Claude Code's 7-day quota as 100% (red) while the real usage was 1%.

The /api/oauth/usage endpoint reports utilization on a 0–100 scale (e.g. seven_day.utilization = 1.0 means 1%). ClaudeQuotaService.normalizedPercent treated any value ≤ 1 as a 0–1 fraction and multiplied it by 100, so a window between 0% and 1% — common right after the weekly reset — displayed as 100%.

Fix

Drop the fraction heuristic and only clamp the value to 0–100.

Verification

  • Called the endpoint directly: five_hour = 5.0, seven_day = 1.0, which matches Claude's own 5% / 1%.
  • script/test_compact_popover.sh passes.

Note: a stale claude-quota-cache.json may keep showing 100% for up to 4 minutes after upgrading, until the cache expires.

🤖 Generated with Claude Code

Backtthefuture and others added 2 commits September 27, 2026 20:46
The usage endpoint reports utilization on a 0–100 scale, but values at or
below 1 were treated as a 0–1 fraction and scaled by 100. A weekly window
at 1% right after its reset showed as 100% in the popover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Release notes, CHANGELOG, README and the build default, via
script/prepare_release.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Backtthefuture Backtthefuture changed the title fix(quota): read Claude utilization as a 0–100 percentage TokenStep 0.2.23: fix Claude quota showing 100% at 1% usage Sep 28, 2026
@Backtthefuture
Backtthefuture merged commit 3494f8a into main Sep 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant