Skip to content

Show extra-usage spend text in menu bar for Claude/Cursor#1107

Merged
steipete merged 2 commits into
steipete:mainfrom
Yuxin-Qiao:codex/1084-menu-bar-extra-usage-spend-text
May 22, 2026
Merged

Show extra-usage spend text in menu bar for Claude/Cursor#1107
steipete merged 2 commits into
steipete:mainfrom
Yuxin-Qiao:codex/1084-menu-bar-extra-usage-spend-text

Conversation

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor

@Yuxin-Qiao Yuxin-Qiao commented May 22, 2026

Fixes

Fixes #1084 — show money spend in the macOS menu bar.

Summary

  • Reuse existing MenuBarMetricPreference.extraUsage for a display-only menu-bar enhancement
  • When .extraUsage is selected and snapshot.providerCost is usable (limit > 0), render formatted spend text, for example $12.34
  • When provider cost is missing or unusable, fall back to the existing percent display
  • Scope is intentionally limited to Claude/Cursor through the existing preference support
  • No provider fetcher, network, or UsageStore refresh changes

Scope

  • Display/menu-bar text only
  • No provider fetcher changes
  • No UsageStore refresh changes
  • No OpenCode/OpenCodeGo changes
  • No Kimi changes
  • No MiniMax changes

Validation

  • swift test --filter StatusItemExtraUsageMetricTests
  • swift test --filter MenuBarMetricWindowResolverTests
  • make check
  • git diff --check

Runtime proof

Visual runtime proof

Added a redacted macOS screenshot showing the actual menu bar rendering $12.34 for Cursor Extra usage.
The CodexBar menu is open in the same screenshot and shows Cursor → Extra usage → Monthly: $12.34 / $100.00, confirming the menu-bar text corresponds to Cursor Extra usage spend.

The visual proof was captured from:

git branch --show-current
# codex/1084-menu-bar-extra-usage-spend-text

git log --oneline -1
# 43c8a2f Display extra-usage spend in menu bar

Temporary local-only debug overrides were used only to provide deterministic proof data for the visual capture and were reverted before final git status. No tracked source changes remain.

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

Codex review: needs maintainer review before merge.

Latest ClawSweeper review: 2026-05-22 17:48 UTC / May 22, 2026, 1:48 PM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Summary
The branch renders Claude/Cursor extra-usage provider cost as formatted currency in the menu bar when .extraUsage is selected, adds focused tests, and updates the changelog.

Reproducibility: not applicable. as a bug reproduction; this is a feature PR. Source inspection shows current main already supports Cursor/Claude Extra usage as a percent metric, and this branch adds the requested currency text path.

PR rating
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Summary: The PR has direct visual proof and a focused implementation with tests, with only normal CI and maintainer validation remaining.

Rank-up moves:

  • none
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Real behavior proof
Sufficient (screenshot): The attached macOS screenshot directly shows the after-fix menu-bar currency text and matching Cursor Extra usage value in the app menu.

Risk before merge

  • I did not run Swift tests or make check in this read-only review, so merge should still rely on CI or maintainer-run validation for the claimed checks.

Maintainer options:

  1. Decide the mitigation before merge
    Land the display-layer change after CI or maintainer validation, preserving the existing percent fallback when cost data is absent and resolving Feature idea: show money spend on MacOS Menu Bar #1084.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No repair lane is needed; the branch has sufficient proof and no concrete blocking finding, so it awaits normal maintainer review and CI.

Security
Cleared: The diff only changes Swift display logic, focused tests, and the changelog, with no dependency, script, secret, or supply-chain surface change.

Review details

Best possible solution:

Land the display-layer change after CI or maintainer validation, preserving the existing percent fallback when cost data is absent and resolving #1084.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a bug reproduction; this is a feature PR. Source inspection shows current main already supports Cursor/Claude Extra usage as a percent metric, and this branch adds the requested currency text path.

Is this the best way to solve the issue?

Yes. The branch keeps the change in menu-bar display logic, reuses existing providerCost and .extraUsage support, and avoids fetcher, refresh, or settings migrations.

Label justifications:

  • P3: This is a low-risk menu-bar display enhancement with limited display-layer scope and focused tests.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🦞 diamond lobster, patch quality is 🐚 platinum hermit, and The PR has direct visual proof and a focused implementation with tests, with only normal CI and maintainer validation remaining.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The attached macOS screenshot directly shows the after-fix menu-bar currency text and matching Cursor Extra usage value in the app menu.
  • proof: sufficient: Contributor real behavior proof is sufficient. The attached macOS screenshot directly shows the after-fix menu-bar currency text and matching Cursor Extra usage value in the app menu.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The attached macOS screenshot directly shows the after-fix menu-bar currency text and matching Cursor Extra usage value in the app menu.

What I checked:

  • Current main lacks currency text for extra usage: On current main, menuBarDisplayText falls through to percent/pace display after provider-specific balance overrides; there is no extra-usage spend text branch before the percent window rendering. (Sources/CodexBar/StatusItemController+Animation.swift:637, 17b065100a44)
  • Existing preference scope matches PR scope: Current main already restricts .extraUsage menu-bar metric support to Cursor and Claude when a provider cost limit is available, so the PR reuses an existing preference surface rather than adding a new setting. (Sources/CodexBar/SettingsStore+MenuPreferences.swift:73, 17b065100a44)
  • PR implementation is display-only: The implementation commit adds an .extraUsage branch before percent rendering and formats snapshot.providerCost.used with UsageFormatter.currencyString when limit > 0 and used >= 0. (Sources/CodexBar/StatusItemController+Animation.swift:670, c935dfdfaa39)
  • PR tests cover the new behavior and fallback: The PR adds tests for Cursor currency text, Claude currency text, and the existing percent fallback when provider cost is unavailable. (Tests/CodexBarTests/StatusItemExtraUsageMetricTests.swift:59, c935dfdfaa39)
  • Changelog updated: The PR head includes an unreleased changelog entry for showing extra-usage spend as currency text for Claude and Cursor. (CHANGELOG.md:8, 965ff9b26b93)
  • Runtime proof inspected: The posted macOS screenshot shows the menu bar displaying $12.34 and the open Cursor menu showing Extra usage Monthly: $12.34 / $100.00, matching the requested behavior.

Likely related people:

  • steipete: Current-main blame for the menu-bar display and extra-usage preference files points to the release commit, and history shows 91cf1a3 added Claude spend-limit metric behavior in the same preference/resolver area. (role: recent area contributor and merger; confidence: high; commits: f61469c3cde6, 91cf1a3f67ca, 965ff9b26b93; files: Sources/CodexBar/StatusItemController+Animation.swift, Sources/CodexBar/MenuBarMetricWindowResolver.swift, Sources/CodexBar/SettingsStore+MenuPreferences.swift)
  • ratulsarna: Commit a6b0342 added the Cursor extra-usage menu-bar metric, touching the resolver, menu preference support, and dedicated tests that this PR extends. (role: introduced Cursor extra-usage metric; confidence: high; commits: a6b034284bbd; files: Sources/CodexBar/MenuBarMetricWindowResolver.swift, Sources/CodexBar/SettingsStore+MenuPreferences.swift, Tests/CodexBarTests/StatusItemExtraUsageMetricTests.swift)
  • William: Commit c7f3866 added balance-style menu-bar text for providers, the closest existing pattern to rendering spend text instead of a percent in StatusItemController+Animation.swift. (role: adjacent display contributor; confidence: medium; commits: c7f38669a655; files: Sources/CodexBar/StatusItemController+Animation.swift, Tests/CodexBarTests/StatusItemBalanceDisplayTests.swift)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 17b065100a44.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 22, 2026
@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

ClawSweeper PR egg

✨ Hatched: 💎 rare Frosted Test Hopper

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 💎 rare.
Trait: sleeps inside passing CI.
Image traits: location green-check meadow; accessory lint brush; palette coral, mint, and warm cream; mood patient; pose holding its accessory up for inspection; shell paper lantern shell; lighting warm desk-lamp glow; background tiny artifact crates.
Share on X: post this hatch
Copy: My PR egg hatched a 💎 rare Frosted Test Hopper in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@clawsweeper clawsweeper Bot added the P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. label May 22, 2026
@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

Added runtime proof to the PR body.

The focused test exercises the actual menu-bar display path:

and asserts:

This verifies the PR returns currency spend text for Cursor , plus Claude currency text and percent fallback coverage.

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

Added runtime proof to the PR body.

The focused test exercises the actual menu-bar display path:

controller.menuBarDisplayText(for: .cursor, snapshot: snapshot)

and asserts:

#expect(displayText == "$12.34")

This verifies the PR returns currency spend text for Cursor .extraUsage, plus Claude currency text and percent fallback coverage.

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

Added real macOS menu-bar visual proof for PR #1107.

The attached screenshot shows:

  • the actual macOS menu bar displaying $12.34
  • CodexBar opened on Cursor
  • the Extra usage section showing Monthly: $12.34 / $100.00
  • the same value rendered in the menu bar

This supplements the existing focused tests for:

  • Cursor currency spend text
  • Claude currency spend text
  • percent fallback when provider cost is unavailable

Temporary local-only debug overrides were used only to provide deterministic proof data and were reverted. No tracked source changes remain.

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

Re-review progress:

@Yuxin-Qiao
Copy link
Copy Markdown
Contributor Author

K。 Added the actual screenshot proof here because the CLI comment could not upload image assets.

This screenshot shows:

  • the actual macOS menu bar displaying $12.34
  • CodexBar opened on Cursor
  • Cursor Extra usage showing Monthly: $12.34 / $100.00
  • the same value rendered in the menu bar

Captured from PR branch codex/1084-menu-bar-extra-usage-spend-text at commit 43c8a2f.

Temporary local-only debug overrides were used only to provide deterministic proof data and were reverted. No tracked proof-override source changes remain.

@clawsweeper re-review

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 22, 2026

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@clawsweeper clawsweeper Bot added status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels May 22, 2026
@steipete steipete force-pushed the codex/1084-menu-bar-extra-usage-spend-text branch from 43c8a2f to 965ff9b Compare May 22, 2026 17:44
@steipete steipete merged commit de7c25b into steipete:main May 22, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature idea: show money spend on MacOS Menu Bar

2 participants