Skip to content

Surface the weekly Opus limit in the status bar (opt-in showOpusWeekly) - #38

Merged
Carl723000 merged 1 commit into
ClaudeCodeUsage:mainfrom
wheelbarrel00:feat/opus-weekly-status-bar
Jun 17, 2026
Merged

Carl723000 merged 1 commit into
ClaudeCodeUsage:mainfrom
wheelbarrel00:feat/opus-weekly-status-bar

Conversation

@wheelbarrel00

Copy link
Copy Markdown
Contributor

Summary

The OAuth usage response already includes the weekly Opus window (seven_day_opus) and the quota hover tooltip shows it, but the status-bar quota item only ever renders the 5-hour and weekly figures. Anyone running Opus-heavy workloads has no at-a-glance read on their weekly Opus cap. This adds an opt-in claudeCodeUsage.showOpusWeekly setting that appends opus:NN% after the weekly figure, mirroring the existing showCost / showContext display toggles.

Linked issues

None.

Type of change

  • New feature (non-breaking) -> feature (minor)

How was this tested?

npm run compile is clean. Loaded in the Extension Development Host: with showOpusWeekly on, the quota item renders 5h:.. wk:.. opus:..; with it off the bar is unchanged from current behaviour. My account had no live weekly-Opus window during testing, so I verified the opus:NN% segment specifically by feeding a synthetic seven_day_opus window through the usage path -- it renders after wk: as intended and is absent when no Opus window exists.

Checklist

  • npm run compile is clean
  • The new opus: label is hardcoded to match the existing 5h: / wk: sibling labels in statusBar.ts (those aren't routed through I18n either) -- happy to migrate all three if you'd prefer
  • CHANGELOG.md updated
  • README.md / README-en.md updated (localized READMEs left for translators rather than pasting untranslated English -- glad to add if you point me at conventions)
  • New setting defaults to existing behaviour (opt-in, false)
  • No new runtime dependencies

The OAuth usage response already includes seven_day_opus and the quota tooltip shows it, but the status-bar quota item only displays the 5h and weekly figures - so heavy Opus users have no at-a-glance signal for their weekly Opus cap.

Add a showOpusWeekly setting (default off) that appends opus:NN% after the weekly figure, mirroring the existing showCost/showContext display toggles. Off by default, so current users see no change.
Copilot AI review requested due to automatic review settings June 16, 2026 02:10
@wheelbarrel00
wheelbarrel00 requested a review from jack21 as a code owner June 16, 2026 02:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an opt-in setting to display the weekly Opus quota utilization alongside existing 5-hour and weekly quota indicators in the VS Code status bar.

Changes:

  • Introduced claudeCodeUsage.showOpusWeekly configuration flag (types + package.json).
  • Extended status bar quota rendering to include opus:NN% when available and enabled.
  • Updated README(s) and changelog to document the new setting.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types.ts Adds showOpusWeekly to extension configuration typing.
src/statusBar.ts Adds a flag and rendering logic for weekly Opus utilization in the quota item.
src/extension.ts Plumbs showOpusWeekly from VS Code config into the status bar manager.
package.json Declares the new claudeCodeUsage.showOpusWeekly setting and its description.
README.md Documents the new setting in the config table.
README-en.md Documents the new setting in the English README.
CHANGELOG.md Notes the newly added setting under “Added”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/statusBar.ts
Comment on lines 175 to +179
const live = this.liveWindows(usageLimits);
const fiveHour = live?.five_hour;
const weekly = live?.seven_day;
if (!fiveHour && !weekly) {
const opus = live?.seven_day_opus;
if (!fiveHour && !weekly && !(this.showOpusWeekly && opus)) {
Comment thread src/statusBar.ts
* immediately; re-showing happens on the next data update (the caller
* triggers a refresh right after a config change). */
setVisibility(showCost: boolean, showContext: boolean): void {
setVisibility(showCost: boolean, showContext: boolean, showOpusWeekly: boolean = false): void {
Comment thread src/extension.ts
I18n.setCompactNumbers(config.compactNumbers);
I18n.setTimezone(config.timezone);
this.statusBar.setVisibility(config.showCost, config.showContext);
this.statusBar.setVisibility(config.showCost, config.showContext, config.showOpusWeekly);
@Carl723000
Carl723000 merged commit 6f017a5 into ClaudeCodeUsage:main Jun 17, 2026
1 check passed
@wheelbarrel00
wheelbarrel00 deleted the feat/opus-weekly-status-bar branch June 17, 2026 13:47
Carl723000 added a commit to Carl723000/ClaudeCodeUsage that referenced this pull request Jun 26, 2026
…mented on the new dashboard-settings architecture, original PR ClaudeCodeUsage#38 by @wheelbarrel00 retained as a merged ancestor)
Carl723000 added a commit that referenced this pull request Jun 26, 2026
Integrate the leftover upstream PR #38 (@wheelbarrel00) that never shipped with
the unreleased v2.0.3. It adds `showOpusWeekly` (opt-in, default off): when on,
the quota item appends `opus:NN%` after the 5h / weekly figures, so heavy Opus
users get an at-a-glance weekly Opus signal.

This branch diverged from upstream at PR #31, so #38 wasn't present; cherry-pick
would conflict with the status-bar changes made here (setVisibility signature,
cost/tokens metric, all-off entry icon). Re-applied faithfully instead, adapted
to the dashboard-managed settings:
- settings.ts: showOpusWeekly in the Status-bar group (state-stored, default off).
- statusBar.ts: 5th setVisibility param; updateQuota appends opus:NN% and keeps
  the item visible when only the Opus window is present.
- extension.ts / types.ts: thread the setting through.
- README / README-zh-CN / CHANGELOG: documented and credited @wheelbarrel00 (#38).

Compile clean; 11/11 node:test green.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: wheelbarrel00 <103789673+wheelbarrel00@users.noreply.github.com>
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.

3 participants