feat: add per-model 7-day usage breakdown in popup menu - #22
Open
ThomasSAMP wants to merge 4 commits into
Open
Conversation
Add a boolean setting to control whether the popup menu shows per-model 7-day usage sections (e.g. Opus, Sonnet) when exposed by the API.
Auto-discover seven_day_<model> keys in the API response and render one section per non-null entry under the global 7-day section. Keys map to friendly names for known models (Opus, Sonnet, Haiku, OAuth Apps) and fall back to a titlecased suffix for unknown codenames. The whole block hides silently when the API returns nothing useful or when show-per-model-weekly is off.
Add a new "Menu Display" preferences group containing a SwitchRow bound to show-per-model-weekly. Document the new feature in the README.
The Anthropic web UI surfaces the seven_day_omelette quota as "Claude Design". Add the mapping to PER_MODEL_LABEL_MAP so the popup menu uses the same friendly label as claude.ai.
imajus
added a commit
to imajus/claude-usage-extension
that referenced
this pull request
May 16, 2026
From Haletran#22 (Thomas). Adds optional per-model 7-day sections (Opus/Sonnet/Haiku/OAuth Apps/etc) auto-discovered from API response, gated behind a 'show-per-model-weekly' setting.
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
Adds optional per-model 7-day usage sections to the popup menu, in addition to the existing global 5-hour and 7-day windows.
The Anthropic OAuth
/api/oauth/usageendpoint exposes per-model 7-day windows alongside the global ones (seven_day_opus,seven_day_sonnet,seven_day_oauth_apps, etc.). This PR auto-discovers anyseven_day_<name>keys in the API response and renders one section per non-null entry, so the menu reflects exactly what the user's plan exposes — no schema churn needed if Anthropic adds new model-specificquotas later.
What's new
seven_day_<name>field, render a section with title, percentage, progress bar, and reset timeopus→ "Opus",sonnet→ "Sonnet",haiku→ "Haiku",oauth_apps→ "OAuth Apps") with a titlecased fallback for anything elseshow-per-model-weeklysetting (default: on) controlling visibility of the whole blockScreenshots
Test plan
curlagainst/api/oauth/usageshow-per-model-weeklyin settings hides/shows the block livenullentries are filtered (Opus / OAuth Apps / Cowork hidden when not on those quotas){utilization: 0, resets_at: null}entries render as "0.0%" / "Not used yet"Notes
claude-usage-section,claude-section-title,claude-percent-label,claude-progress-bg,claude-progress-bar,claude-reset-labelstyle classesmetadata.json(46–49)