A simple SwiftBar plugin that shows your Claude Code usage in the macOS menu bar.
- 💰 Shows today's Claude Code cost in the menu bar
- 📊 Click to see full usage table with daily breakdown
- 🔄 Auto-updates every 30 minutes (customizable)
- 🆕 Self-updating with version checking
- 🍎 Full support for Intel and Apple Silicon Macs
Run this one-liner in your terminal:
curl -fsSL https://raw.githubusercontent.com/AnkMister/ccusage-menubar/main/install.sh | bashThis will:
- Check for and install dependencies (Node.js required, SwiftBar optional)
- Download and install the ccusage plugin
- Launch SwiftBar if needed
If you prefer to install manually:
-
Install SwiftBar (if not already installed):
brew install --cask swiftbar
-
Install Node.js (if not already installed):
brew install node
-
Download the plugin:
curl -fsSL https://raw.githubusercontent.com/AnkMister/ccusage-menubar/main/ccusage.30m.sh -o ~/Documents/SwiftBarPlugins/ccusage.30m.sh chmod +x ~/Documents/SwiftBarPlugins/ccusage.30m.sh
-
Launch SwiftBar and select your plugin directory
For development, symlink the plugin instead of copying:
# Clone the repository
git clone https://github.com/ankur/ccusage-menubar.git
cd ccusage-menubar
# Create symlink to SwiftBar plugins directory
ln -sf "$(pwd)/ccusage.30m.sh" ~/Documents/SwiftBarPlugins/ccusage.30m.sh
# Make sure it's executable
chmod +x ccusage.30m.shNow you can edit the plugin file and changes will be reflected immediately after refresh.
The plugin updates every 30 minutes by default. To change this, rename the file:
ccusage.5s.sh→ Updates every 5 seconds (not recommended)ccusage.1m.sh→ Updates every minuteccusage.5m.sh→ Updates every 5 minutesccusage.30m.sh→ Updates every 30 minutes (default)ccusage.1h.sh→ Updates every hourccusage.1d.sh→ Updates once per day
Example:
cd ~/Documents/SwiftBarPlugins
mv ccusage.30m.sh ccusage.5m.shEdit the script to customize what appears in the menu bar. The default shows today's cost, but you can modify it to show:
- Total cost
- Weekly cost
- Custom emoji
- Different formatting
The plugin automatically checks for updates once per day. When an update is available:
- You'll see a "🆕 Update Available" notification in the menu
- Click it to update automatically
You can also manually check for updates from the menu.
To remove the plugin:
curl -fsSL https://raw.githubusercontent.com/ankur/ccusage-menubar/main/uninstall.sh | bashOr manually delete the plugin file from your SwiftBar plugins directory.
- Make sure SwiftBar is running
- Check that the plugin is in the correct directory
- Verify the plugin is executable:
chmod +x ~/Documents/SwiftBarPlugins/ccusage.30m.sh - Click SwiftBar icon → Refresh All
Install Node.js:
brew install node- Check your internet connection
- Verify ccusage works in terminal:
npx ccusage@latest - Check SwiftBar logs for errors
- macOS (Intel or Apple Silicon)
- Node.js 14+
- SwiftBar app
- Active Claude Code subscription
Pull requests welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT - see LICENSE file
