richhickson/claudecodeusage
Über uns
Eine macOS-Menüleisten-App, die die Nutzungslimits von Claude Code anzeigt (pro Sitzung, wöchentlich, je Modell und Überschreitungen). Sie meldet, wenn eine Claude-Code-Sitzung Aufmerksamkeit erfordert, und öffnet sie per Klick.
EntwicklerwerkzeugeGemessener Sternzuwachs
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalClaude Usage
A lightweight macOS menubar app that displays your Claude Code usage limits at a glance — and alerts you when a Claude Code session needs your attention.
Built by @richhickson
Features
Usage tracking
📊 Session, Weekly & per-model limits - including model-scoped weekly caps (e.g. Fable/Opus) as Anthropic rolls them out
💵 Overage tracking - extra-usage spend against your monthly limit
🚦 Color-coded status - Green (OK), Yellow (>70%), Red (>90%)
🎨 Menu bar styles - Native (monochrome template icon, colors only when a limit runs hot), Tinted (icon colored by usage), or classic Emoji — plus your choice of metric (session/weekly/model %, spend, or icon only):
Native Tinted Emoji 


⏱️ Time until reset for each limit
🔄 Auto-refresh every 5 minutes, with retry on network/keychain hiccups and refresh on wake from sleep
👥 Multiple accounts - every Claude Code login on the machine (one per
CLAUDE_CONFIG_DIR) appears in an account dropdown, labelled by full account email; the menu-bar percentage and colour follow the selected account📈 History window - daily peak usage charted over 7/30/90/365 days per account, with sparklines and a burn-rate forecast in the popover; history is stored locally for up to 400 days and never leaves your machine
Session alerts (opt-in)
- 🔔 Menu bar bell naming the project that's waiting for your permission or input (a count when several are)
- 💬 macOS notifications when a session needs you - with an on/off toggle, permission status, and a test button
- 📋 Live session list in the popover: needs you 🔔 / working ⚙️ / finished ✅
- 🖱️ Click-to-focus - click a session (or its notification) to jump to the exact Terminal/iTerm2 tab it's running in; alerts clear once you've visited the session
Claude status alerts
- 🌡️ Outage notifications - get notified when status.claude.com reports a problem, and again when service recovers (checked every 5 minutes; toggle in settings)
- 🟢 Status line in the popover with a severity dot, linking to the status page
Claude Code settings editor
- 📝 Edit your global CLAUDE.md - tell Claude Code how you like to work, from the app
- 🗓️ Conversation retention - set how long Claude Code keeps local transcripts (
cleanupPeriodDays), preserving all your other settings
General
- ⬆️ One-click in-app updates - when a new version ships, click "Update & Relaunch" in the popover; the update's code signature is verified before installing
- 🚀 Launch at Login toggle
- 🪶 Lightweight - Native Swift, minimal resources, no frameworks
Installation
Download
- Go to Releases
- Download
ClaudeUsage.zip - Unzip and drag
ClaudeUsage.appto your Applications folder - Open the app (you may need to right-click → Open the first time)
Build from Source
git clone https://github.com/richhickson/claudecodeusage.git
cd claudecodeusage
open ClaudeUsage.xcodeproj
To run the tests: swift test
Then build with ⌘B and run with ⌘R.
Requirements
- macOS 13.0 (Ventura) or later
- Claude Code CLI installed and logged in
Setup
Install Claude Code if you haven't already:
npm install -g @anthropic-ai/claude-codeLog in to Claude Code:
claudeLaunch Claude Usage - it will read your credentials from Keychain automatically
Enabling session alerts (optional)
- Click the menu bar icon → gear icon → toggle Alert when a session needs attention
- This installs a small status hook into
settings.jsonin your Claude Code config dir (pure POSIX sh, no dependencies; your existing settings and hooks are preserved, and toggling off removes it cleanly) - Allow notifications when prompted, and allow "ClaudeUsage wants to control Terminal" on your first click-to-focus - that's what jumps you to the right terminal tab
- Hooks take effect for Claude Code sessions started (or resumed) after enabling
Tip: if you use macOS Focus modes, add ClaudeUsage to your Focus allowed apps or banners will be silenced.
How It Works
Claude Usage reads your Claude Code OAuth credentials from macOS Keychain and queries the usage API endpoint at api.anthropic.com/api/oauth/usage. Stores containing only MCP/plugin logins are excluded from the account dropdown; their credentials are never changed or deleted. Unreadable or malformed account stores still show an error so authentication problems remain visible.
Session alerts work via Claude Code's hooks system: a tiny shell script reports each session's status (working / needs attention / finished) to JSON sidecar files in claudeusage/ inside your Claude Code config dir, which the app watches. Everything stays on your machine.
Note: This uses an undocumented API that could change at any time. The app will gracefully handle API changes but may stop working if Anthropic modifies the endpoint.
Custom config dir (CLAUDE_CONFIG_DIR)
Claude Code keeps its config in ~/.claude unless CLAUDE_CONFIG_DIR points elsewhere. When it does, Claude Code also stores its login under its own Keychain entry, Claude Code-credentials-<8 hex digits>, rather than Claude Code-credentials. Claude Usage finds every such login and lists each one in the account dropdown; settings, CLAUDE.md and session alerts follow the active CLAUDE_CONFIG_DIR.
Apps started from Finder or at login don't see variables set in your shell profile, so Claude Usage also checks the launchd user environment. If you set CLAUDE_CONFIG_DIR in your shell, set it there too:
launchctl setenv CLAUDE_CONFIG_DIR "$HOME/.config/claude"
Then quit and reopen Claude Usage. The footer of its settings window shows the config dir it is using.
Privacy
- Your credentials never leave your machine
- No analytics or telemetry
- No data sent anywhere except Anthropic's API
- Open source - verify the code yourself
Status Colours
| Normal | Warning | Critical |
|---|---|---|
| 🟢 30% | 🟡 75% | 🔴 95% |
Troubleshooting
"Not logged in to Claude Code"
Run claude in Terminal and complete the login flow.
App doesn't appear in menubar
Check if the app is running in Activity Monitor. Try quitting and reopening.
Usage shows wrong values
Click the refresh button (↻) in the dropdown. If still wrong, your Claude Code session may have expired - run claude again.
Contributing
PRs welcome! Please open an issue first to discuss major changes.
License
MIT License - do whatever you want with it.
Disclaimer
This is an unofficial tool not affiliated with Anthropic. It uses an undocumented API that may change without notice.
Made by @richhickson
Ähnliche Projekte entdecken
Wird geladen…