A macOS menu bar application that monitors and displays Claude Code CLI usage statistics directly in your menubar.
- Displays usage statistics in menubar dropdown with visual indicators
- Shows Session, Week (All), and Week (Sonnet) usage percentages
- Dynamic menu bar icon that changes color based on session usage:
- Green icon (0-50%): Safe usage level
- Yellow icon (51-85%): Moderate usage
- Red icon (86-100%): High usage, approaching limit
- Color-coded emoji indicators in menu (π’ 0-50%, π‘ 51-85%, π΄ 86-100%)
- Displays reset times for each metric
- Automatic update checker - notifies when a new version is available on GitHub
- Configurable auto-update with customizable intervals (1m, 5m, 10m, 30m, 60m) or disabled
- Manual "Update Now" button with visual feedback
- Settings menu for easy configuration
- Smart model detection - automatically shows Sonnet or Opus section based on your plan
- Menubar-only app (does not appear in Dock)
- Auto-installs dependencies (jq, expect)
- Auto-configures directory trust
- Auto-detects Claude CLI location (including NVM installations)
- Saves detailed logs to
~/.claude-code-monitor/ - Persistent settings stored in
~/.claude-code-monitor/config.json - Supports both Intel and Apple Silicon Macs
- Lightweight and runs in background
- macOS (Intel or Apple Silicon)
- Claude Code CLI installed and configured
- Homebrew (for auto-installing dependencies)
- Go 1.16+ (for building from source)
Note: The app will automatically install jq and expect via Homebrew if not found, and will auto-detect Claude CLI location even in NVM installations.
Installation Steps:
- Download
ClaudeCodeMonitor-1.1.1.dmgfrom releases - Double-click the DMG file to open it
- Drag
ClaudeCodeMonitor.appto the Applications folder - Eject the DMG
- Try to open ClaudeCodeMonitor from Applications
- You will see a security warning - this is expected (see below)
- Go to System Settings > Privacy & Security
- Scroll down to the Security section
- Click "Open Anyway" next to the message about ClaudeCodeMonitor
- Click "Open" in the confirmation dialog
- The app icon will appear in your menubar
Why the security warning?
This app is not signed with an Apple Developer certificate (which costs $99/year). macOS will show a warning saying it "can't be opened because Apple cannot check it for malicious software."
This is expected and safe - you can review the complete source code in this repository to verify there's no malware.
Installation Tutorial:
Note: The DMG includes a universal binary that works on both Intel and Apple Silicon Macs.
git clone https://github.com/ribeirogab/claude-code-monitor.git
cd claude-code-monitor
make dmg-universalThis creates dist/ClaudeCodeMonitor-1.1.1.dmg with a universal binary (Intel + Apple Silicon).
make app # Current architecture only
make app-intel # Intel only
make app-universal # Universal binarymake installThis installs the binary to /usr/local/bin/.
# Current architecture
make build
# Intel only
make build-intel
# Apple Silicon only
make build-armNote: Cross-compilation requires CGO toolchains. Use make app to build for current architecture.
- Start the application by opening
ClaudeCodeMonitor.app - A small icon will appear in your macOS menu bar (color changes based on usage)
- Click the icon to see current usage statistics:
- Session usage with percentage and emoji indicator
- Week (All models) usage
- Week (Sonnet) usage (or Week (Opus) for older CLI versions)
- Reset times for each metric
- Last update timestamp
- "Update Available" notification when a new version is released
- Use the "Update Now" button to manually refresh usage data
- Click "Update Available" to open the GitHub releases page (when shown)
- Configure auto-update settings via Settings > Auto-Update:
- Disabled - No automatic updates (manual only)
- 1 minute - Update every minute
- 5 minutes - Update every 5 minutes
- 10 minutes - Update every 10 minutes
- 30 minutes - Update every 30 minutes (default)
- 60 minutes - Update every hour
- Usage data is also saved to
~/.claude-code-monitor/:config.json- User settings (auto-update preferences)claude-code-usage.json- Parsed usage statisticsclaude-code-usage.log- Raw output from monitoring scriptclaude-code-usage-execution.log- Execution timestamps and logsmonitor.log- Application logs
- Click the menu bar icon and select "Quit" to stop the application
The app uses two types of visual indicators:
Menu Bar Icon (changes based on session usage):
| Usage Level | Icon | Description |
|---|---|---|
| 0-50% | Safe usage level | |
| 51-85% | Moderate usage | |
| 86-100% | High usage, approaching limit |
Menu Emojis (shown next to each percentage):
- π’ Green (0-50%): Safe usage level
- π‘ Yellow (51-85%): Moderate usage
- π΄ Red (86-100%): High usage, approaching limit
The claude-code-usage.json file contains:
{
"session_percent": 40,
"session_reset": "10pm (America/Sao_Paulo)",
"week_all_percent": 19,
"week_all_reset": "Nov 21 at 9pm (America/Sao_Paulo)",
"week_opus_percent": 0,
"week_opus_reset": "",
"week_sonnet_percent": 23,
"week_sonnet_reset": "Nov 21 at 9pm (America/Sao_Paulo)",
"timestamp": "2025-11-16T00:26:20Z"
}Note: week_opus_* fields are for backward compatibility with older Claude CLI versions. Newer versions use week_sonnet_* fields.
Run in development mode:
make run # Run with go run (no build)
make dev # Build and execute binary (clean build, no cache)Clean build artifacts:
make cleanShow all available commands:
make help.
βββ cmd/
β βββ monitor/ # Main application entry point
β βββ main.go
βββ internal/
β βββ config/ # Configuration management
β β βββ config.go
β βββ executor/ # Script execution logic
β β βββ executor.go
β βββ scheduler/ # Periodic task scheduling
β β βββ scheduler.go
β βββ updater/ # GitHub update checker
β βββ github.go # GitHub API client
β βββ updater.go # Update logic
β βββ version.go # Semantic version parsing
βββ assets/
β βββ icons/ # Menu bar icons (green, yellow, red)
βββ claude-code-usage.sh # Monitoring script
βββ Makefile # Build automation
βββ go.mod # Go module definition
βββ README.md # This file
- The application runs as a menubar-only app using
systray - On startup, it:
- Loads user configuration from
~/.claude-code-monitor/config.json - Loads menubar icon from assets
- Creates menu items for displaying usage stats
- Detects Sonnet/Opus access and conditionally shows the appropriate section
- Starts a scheduler with configurable interval (default: 30 minutes, disabled by default)
- Starts the update checker (checks GitHub releases every hour)
- Loads user configuration from
- The scheduler executes
claude-code-usage.shwhich:- Auto-installs
jqandexpectvia Homebrew if not found - Pre-configures directory trust in
~/.claude.jsonto bypass security prompts - Auto-detects Claude CLI location (supports standard paths and NVM installations)
- Launches Claude Code CLI using
expect - Captures the
/usagecommand output - Parses usage percentages and reset times (supports both Sonnet and Opus formats)
- Generates JSON output with timestamp
- Auto-installs
- After successful execution:
- The menubar display updates automatically
- The menu bar icon changes color based on session usage (green/yellow/red)
- Users can manually trigger updates via "Update Now" button
- When a new version is detected, "Update Available" menu item appears
- Settings are persisted and loaded on next startup
Application doesn't start:
- Check that Claude Code CLI is installed and accessible:
which claude - Verify Homebrew is installed (for auto-installing jq):
which brew - Check application logs in
~/.claude-code-monitor/monitor.log
Application won't quit:
If the app doesn't close properly (e.g., when a script is running), force quit it:
killall claude-code-monitorNo data being generated:
- Verify that Claude Code CLI is properly configured
- Check logs in
~/.claude-code-monitor/claude-code-usage-execution.log - If using NVM, ensure Node.js is properly installed
- Verify Homebrew is working:
brew --version
Menu not updating:
- Check if JSON file is being updated:
cat ~/.claude-code-monitor/claude-code-usage.json - View execution logs:
tail -f ~/.claude-code-monitor/claude-code-usage-execution.log - Restart the application
Menu bar icon not showing:
- Check if icon file exists in the app bundle
- The app will show "claude-code" as title text if icon is not found
- The app is still running - check Activity Monitor for
claude-code-monitor
Trust dialog appearing:
- This should be auto-handled by the script
- If it persists, manually trust the directory in Claude Code CLI
- Check if
~/.claude.jsonhas the correct permissions
MIT License - see LICENSE file for details

