Repository navigation
fix(usage): show Claude credit usage when a login has no rate-limit windows - #295
Open
BigWebstas wants to merge 1 commit into
Open
BigWebstas wants to merge 1 commit into
BigWebstas wants to merge 1 commit into
Conversation
…indows Logins billed per use get no five-hour or weekly window from the Claude usage endpoint, only an extra_usage block, so the parser returned nothing and the status bar stayed hidden. Parse extra_usage (and the newer spend block) into creditUsage and show it as "$used / $limit": inline in the bar when there are no windows, and in the popover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Shows Claude credit usage in the status bar for logins that are billed per use instead of a Pro/Max subscription.
For those logins, the Claude usage endpoint returns no
five_hourorseven_daywindow, only anextra_usageblock with the spend and the monthly limit. The parser ignored that block, so it reported "no rate-limit windows" and the status bar stayed hidden even though the user had a dollar limit set.electron/ipc/claude-usage.ts): readsextra_usage, plus the newerspendblock, into a new optionalcreditUsagefield with used, limit, currency and percent used. Amounts arrive in minor units and are converted usingdecimal_placesor theexponentfield, which default to 2.Credits $12.34 / $50.00 (25%). The hover popover always lists them. The meter turns amber at the usual 80% threshold.creditUsageis carried throughUsageResultandUsageState, and cleared on logout along with the windows. Codex is unaffected.Issues Resolved
None filed.
Check List
🤖 Generated with Claude Code