README.md

May 6, 2026 · View on GitHub

MyUsage app icon

MyUsage

One menu bar for every AI coding tool — across every Mac you use.

Latest release macOS 14+ Swift 6 Project site 中文说明

Project site: zchan0.github.io/MyUsage — landing, install guide, multi-device sync deep dive, blog.

MyUsage Screenshot

Why MyUsage

If you use Claude Code, Codex, Cursor, or Antigravity — and especially if you use them across more than one Mac — the official UIs only show what's happening on the device you're sitting at. You hit a weekly limit on Friday afternoon because your laptop has been chewing through tokens all morning while your desktop's "remaining" number lied to you.

MyUsage fixes this with a small native menu bar app that:

  • Talks to all four providers and shows them in one popover, so you don't have to flip between four UIs.
  • Aggregates across every Mac you own by writing tiny snapshots into a folder you already sync (iCloud Drive, Syncthing, Dropbox, an NFS mount — your call). No MyUsage backend exists; the sync transport is yours.
  • Tells you when you're about to run out — when current burn rate would push a limit past 100% before reset, the bar gets a dashed projection marker overflowing past the right edge and a projected 118% note in the footer. Healthy projections stay silent.

It's free, MIT, no telemetry, and pure Swift / SwiftUI with zero third-party dependencies.

Highlights

  • Multi-device aggregation, BYO sync transport. Each Mac drops a per-device JSONL snapshot into <sync-folder>/devices/<id>/. Use iCloud, Syncthing, Dropbox, NAS, or anything else that keeps a folder in sync. The Devices tab in Settings lets you forget retired peers.
  • Four providers in one popover — Claude Code, Codex, Cursor, Antigravity. Reorder and enable/disable per provider in Settings.
  • Burn-rate projection — alarm-only. When the projected end-of-window usage would exceed 100%, the rolling-window bar surfaces a dashed marker overflowing past the right edge and a projected 118% footer note in warn-amber. Healthy projections are intentionally silent — the bar fill alone tells you you have headroom; an extra "you'll land at 31%" marker would just be noise. The math waits for at least 20% of the window to elapse before computing anything, so a single early prompt can't false-trigger the alarm.
  • Per-bucket weekly breakdown for Claude. Anthropic's /api/oauth/usage exposes plan-dependent sub-caps — model families (Opus, Sonnet, Haiku) and product lines (Design, Cowork, OAuth-apps). MyUsage surfaces every non-zero bucket as an indented row under the weekly bar. Plans without separate sub-caps (e.g. Max 5x, where everything pools into the unified weekly total) show none.
  • Limit-pressure notifications. Native macOS notifications fire the moment any tracked limit crosses your warn / crit threshold (default 80% / 95%, both tunable). Idempotent — same percent across two refreshes never double-fires.
  • In-app update channel. On launch, MyUsage checks GitHub Releases and shows a banner when a newer tag is available. The Settings → About banner can download the next release and reveal it in Finder one drag away from /Applications.
  • Privacy-respecting device identity. Multi-device sync uses a salted SHA-256 of IOPlatformUUID as the device ID; the raw hardware UUID never leaves the process. Cached in UserDefaults so reinstalling doesn't create a duplicate device.
  • Zero third-party dependencies. Built only with SwiftUI, SQLite3, Security.framework, Foundation. No Electron, no Sparkle, no analytics SDK.

Supported Providers

ProviderData SourceWhat You See
Claude CodeOAuth API (~/.claude/.credentials.json / Keychain) + /api/oauth/profile for plan label5h session + weekly bars · per-bucket breakdown (model + product caps when plan exposes them) · burn-rate projection · monthly cost (multi-device)
CodexOAuth API (~/.codex/auth.json / Keychain)5h session + weekly bars · burn-rate projection · monthly cost (multi-device) · credits
CursorLocal SQLite + Connect RPC (state.vscdb)Included quota + on-demand budget bars · billing-cycle countdown
AntigravityLocal language server process probePer-model quota bars · IDE running indicator

Requirements

  • macOS 14+ (Sonoma)
  • At least one supported tool installed and signed in

Install

Download the latest MyUsage-<version>.zip from GitHub Releases, unzip it, then move MyUsage.app to /Applications.

MyUsage is ad-hoc signed (no paid Apple Developer certificate), so Gatekeeper will warn on first launch:

  • Right-click MyUsage.app -> Open -> Open once.
  • Or run:
xattr -cr /Applications/MyUsage.app && open /Applications/MyUsage.app

Each release includes a .sha256 file for checksum verification.

Quick Usage

  1. Launch MyUsage from /Applications.
  2. Click the menu bar icon to open the usage popover.
  3. Use the refresh button for manual sync.
  4. Open Settings for:
    • General: refresh interval, menu bar tracking, estimated cost toggle, sync folder, launch at login
    • Providers: reorder providers and toggle each provider on/off
    • Devices: inspect aggregated monthly cost by device and forget stale peers
    • About: app version and project link

Build from Source

# Release build + app bundle
./Scripts/package_app.sh

# Or build release binary only
swift build -c release

# Open packaged app
open MyUsage.app

Open in Xcode (SwiftPM workspace):

open .swiftpm/xcode/package.xcworkspace

Architecture Notes

  • UsageManager drives refresh orchestration and UI state.
  • Provider adapters normalize external/local data into a shared snapshot model.
  • Device sync writes each Mac's monthly totals into its own subfolder in the selected sync directory.

More details: docs/architecture.md

Privacy and Data

  • MyUsage reads local credential/state files and keychain entries needed by each provider integration.
  • Network requests are sent only to provider endpoints required for usage retrieval.
  • Multi-device sync uses a user-selected local/shared folder; MyUsage does not run its own cloud backend.

Roadmap

Possible directions, not commitments. Open an issue if any of these would make MyUsage materially more useful for you:

  • Notarized + signed releases — so the .app opens without the Gatekeeper warning on a fresh Mac. Blocked on an Apple Developer account.
  • More providers as APIs become available. GitHub Copilot is the most requested but doesn't currently expose per-user usage to individual subscribers; we'll add it the moment that changes.
  • iOS / iPadOS companion for at-a-glance checking when you're not at a Mac. Lower priority than core macOS feature work.

License

MIT