Add usage limit tracking (5-hour and weekly) via Anthropic OAuth API#9
Open
Dobidop wants to merge 2 commits intojack21:mainfrom
Open
Add usage limit tracking (5-hour and weekly) via Anthropic OAuth API#9Dobidop wants to merge 2 commits intojack21:mainfrom
Dobidop wants to merge 2 commits intojack21:mainfrom
Conversation
Fetches real-time usage limits from api.anthropic.com/api/oauth/usage using Claude Code's existing OAuth credentials (~/.claude/.credentials.json). Displays 5-hour and weekly usage percentages in the status bar alongside the cost display, with warning highlights at 80%+ utilization. Detailed breakdown with progress bars and reset times shown in the webview panel. - New ClaudeApiClient for OAuth-based API calls with auto token refresh - Status bar shows: $X.XX | 5h:X% | 7d:X% - Warning background when either limit exceeds 80% - Tooltip shows reset times for both limits - Webview cards with color-coded progress bars (normal/warning/critical) - Supports per-model limits (Sonnet/Opus weekly) for Max tier users - Graceful fallback when credentials are unavailable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
api.anthropic.com/api/oauth/usageusing Claude Code's existing OAuth credentials (~/.claude/.credentials.json)$X.XX | 5h:X% | 7d:X%How it works
~/.claude/.credentials.json(created byclaude auth login)https://api.anthropic.com/api/oauth/usagewith Bearer token +anthropic-beta: oauth-2025-04-20https://console.anthropic.com/v1/oauth/tokenScreenshots