A macOS menu bar app that tracks your Claude AI usage limits in real time. See session and weekly utilization at a glance, monitor Claude Code CLI activity, and never get surprised by a rate limit again.
- Real-time usage monitoring -- View current session (5-hour window), weekly (all models), and weekly (Sonnet-only) utilization as progress bars directly from your menu bar.
- Claude Code CLI stats -- Messages sent, sessions started, tool calls made, and token usage broken down by model, for today and this week.
- Auto-detect plan tier -- Reads your Claude Code CLI credentials from macOS Keychain to determine whether you are on Free, Pro, Max 5x, or Max 20x.
- Chrome cookie auto-extraction -- Automatically extracts your
sessionKeyfrom Chrome cookies (with Keychain permission) so you can connect without any manual steps. - Manual session cookie connection -- If auto-extraction is unavailable, paste your
sessionKeyfrom browser DevTools. - Extra usage billing display -- Shows how much of your extra usage budget has been consumed (for plans that support it).
- Reset countdown timers -- See exactly when your session and weekly limits reset.
- Color-coded status icon -- The menu bar icon changes color based on your current session usage: green (< 50%), yellow (50-80%), orange (> 80%).
- Secure credential storage -- All session keys are stored in the macOS Keychain. Nothing is sent to any server other than
claude.ai. - Auto-refresh -- Usage data updates every 5 minutes in the background.
- macOS (uses macOS Keychain,
rumpsmenu bar framework, and Chrome cookie decryption viasecurityCLI) - Python 3.13+
- Claude Code CLI installed and authenticated (for automatic tier detection and CLI stats)
- Google Chrome (optional, for automatic session cookie extraction)
# Clone the repository
git clone https://github.com/your-username/claude-macOS-usage.git
cd claude-macOS-usage
# Run the build script
./scripts/build.shThe build script will:
- Create a Python virtual environment
- Install all dependencies
- Generate the app icon
- Build the
.appbundle with py2app
Once complete, install the app:
cp -r 'dist/Claude Usage Monitor.app' /Applications/Or run it directly:
open 'dist/Claude Usage Monitor.app'If you prefer to run the script directly without creating an app bundle:
# Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the app
python claude_usage.pyOnce launched, the app lives in your macOS menu bar. Click the icon to open the dropdown menu.
| Section | Description |
|---|---|
| Header | Your username, plan tier, and price. A checkmark indicates Claude CLI credentials were detected. |
| Usage limits | Progress bars for session, weekly (all models), and weekly (Sonnet-only) utilization, with reset countdowns. |
| Extra usage | Credits consumed vs. monthly limit (shown only if extra usage is enabled on your plan). |
| Claude Code activity | Messages, sessions, and tool calls for today and this week. Token breakdown by model. |
| Actions | Refresh Now, open claude.ai usage settings, change tier, connect/disconnect session. |
The app tries to connect automatically on launch:
- Automatic (Chrome) -- If you are logged into claude.ai in Chrome, the app attempts to extract your
sessionKeycookie. macOS may prompt you to allow Keychain access. - Manual -- Click "Connect claude.ai Session..." and follow the instructions to copy the
sessionKeycookie from your browser's DevTools.
Without a connected session the app still shows Claude Code CLI stats and estimated reset countdowns, but cannot display live utilization percentages.
If automatic detection picks the wrong tier, click Tier in the menu and select the correct plan. This affects the estimated usage calculations when live data is unavailable.
macOS Menu Bar
|
ClaudeUsageApp (rumps)
/ | \
CLI Keychain CLI Stats claude.ai API
(tier, user) (stats-cache) (live usage)
- On launch, the app reads Claude Code CLI credentials from the macOS Keychain (
Claude Code-credentials) to detect your plan tier and username. - CLI stats are read from
~/.claude/stats-cache.json, a file maintained by the Claude Code CLI. This provides message counts, session counts, tool call counts, and token usage by model. - Live usage data is fetched from the
claude.ai/api/organizations/{org_id}/usageendpoint using a session cookie. This returns utilization percentages for the 5-hour session window, 7-day rolling window (all models), and 7-day rolling window (Sonnet only). - Every 5 minutes, the app refreshes both CLI stats and live usage data in a background thread.
- The menu bar icon updates its color based on current session utilization.
- Session keys are stored exclusively in the macOS Keychain via the
keyringlibrary. They are never written to disk as plain text. - No external data transmission. The app only communicates with
claude.aito fetch your usage data. No analytics, telemetry, or third-party services are involved. - Chrome cookie access requires explicit Keychain permission. The app copies the Chrome cookie database to a temporary file, reads the relevant cookie, and immediately deletes the copy.
- CLI credentials are read-only. The app reads your existing Claude Code credentials from Keychain but never modifies them.
Configuration constants are defined in src/config.py:
| Constant | Default | Description |
|---|---|---|
AUTO_REFRESH_INTERVAL |
300 (5 minutes) |
How often usage data is refreshed, in seconds. |
CLI_STATS_PATH |
~/.claude/stats-cache.json |
Path to Claude Code CLI stats file. |
CLAUDE_AI_API |
https://claude.ai/api |
Base URL for the claude.ai internal API. |
claude-macOS-usage/
claude_usage.py # Entry point
setup.py # py2app build configuration
requirements.txt # Python dependencies
src/
__init__.py
__main__.py
app.py # Menu bar app class (ClaudeUsageApp)
auth.py # Authentication, cookie extraction, session validation
config.py # Constants and tier definitions
usage.py # Usage data fetching, parsing, and formatting
scripts/
build.sh # Build script
generate_icon.py # Icon generator
resources/
icon.icns # App icon
The app does not appear in the menu bar.
Make sure you are running macOS and that rumps is installed correctly. If running from source, ensure the virtual environment is activated.
"Connect claude.ai Session..." does not auto-extract the cookie. Chrome must be installed at the default path and you must be logged into claude.ai. macOS will prompt for Keychain access to "Chrome Safe Storage" -- you must click Allow. If Chrome's cookie database is locked, try closing Chrome first.
Usage data shows 0% even though I have been using Claude. Verify your session is connected (the menu should show "Disconnect Session" rather than "Connect claude.ai Session..."). If the session has expired, disconnect and reconnect.
Tier detection shows the wrong plan. Use the Tier submenu to manually override. Tier detection depends on Claude Code CLI credentials being present in the Keychain.
CLI stats are not showing.
Claude Code CLI must be installed and must have been used at least once so that ~/.claude/stats-cache.json exists.
The build fails with py2app errors.
Ensure you are using Python 3.13+ and that all dependencies in requirements.txt are installed. Run the build inside a clean virtual environment.
This project is licensed under the MIT License.
Contributions are welcome. Please open an issue to discuss proposed changes before submitting a pull request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m "Add my feature") - Push to the branch (
git push origin feature/my-feature) - Open a pull request