Tauri v2 menubar/tray app for monitoring Claude and Codex quota usage on macOS and Windows.
- Menubar tray icon is created at startup and stays resident.
- Left click tray icon toggles the quota panel.
- Right click menu provides
Show / Hide WindowandQuit. - Claude and Codex are separated into independent tabs and polling flows.
- Quota polling runs every 60 seconds in the background, with adaptive backoff to 5 minutes on 429.
- OAuth token is proactively refreshed before expiry (30-minute buffer) using the keychain
expiresAtfield. - macOS tray mode disables webview background throttling so hidden windows keep polling.
- Tray percentage now represents used quota (not remaining quota).
- Claude tray value:
- prefers weekly window (
weeklyTotal) - falls back to max of
weeklyOpusandweeklySonnet - falls back to current session usage
- prefers weekly window (
- Codex tray value:
- prefers weekly window (
secondary_window.used_percent) - falls back to short window (
primary_window.used_percent)
- prefers weekly window (
- Frontend:
src/App.tsxsrc/components/*src/services/backend.ts(single Tauri invoke gateway)src/types/models.ts(shared frontend contracts)
- Backend (Rust):
src-tauri/src/commands.rs(thin command boundary)src-tauri/src/domain/models.rs(serialized contracts)src-tauri/src/services/claude.rssrc-tauri/src/services/codex.rssrc-tauri/src/services/tray.rssrc-tauri/src/services/tray_icon.rssrc-tauri/src/services/window.rssrc-tauri/src/services/link.rs
- macOS or Windows
- Bun (recommended package manager/runtime)
- Rust toolchain
- Tauri prerequisites installed
bun install
bun run tauri devbun run tauri build --bundles appmacOS app bundle output:
src-tauri/target/release/bundle/macos/Quota Menubar Tauri.app
Windows installer output:
src-tauri/target/release/bundle/msi/
src-tauri/target/release/bundle/nsis/
macOS:
./scripts/stop_app.sh
./scripts/install_app.sh
./scripts/run_app.shOr one-shot restart after rebuild:
./scripts/reinstall_and_run.shWindows:
- Build installer:
bun run tauri build --bundles msi,nsis - Install from generated
.msior.exe
bun run build
cd src-tauri && cargo check
cd src-tauri && cargo test- Tray icon flashes then disappears:
- check menu bar manager hidden area (Ice/Bartender)
- ensure app is not auto-grouped into hidden extras
- No quota data:
- Claude on macOS: ensure Claude Code login exists in macOS Keychain (
claude login) - Claude on Windows/Linux: set
CLAUDE_CODE_OAUTH_TOKENenvironment variable - Codex: ensure
~/.codex/auth.jsonis valid and not expired
- Claude on macOS: ensure Claude Code login exists in macOS Keychain (
- Token expired after long idle (24h+):
- App auto-refreshes using the keychain refresh token — no manual action needed
- If refresh fails, run
claude loginin terminal
- Persistent 429 rate limiting:
- App uses
User-Agent: claude-code/*header to avoid strict rate limit buckets - On 429, app serves stale cached data and backs off polling to 5 minutes
- App uses
- Codex token expired:
- run
codexlogin flow again
- run
Private/internal project (update as needed before open-source release).