Skip to content

erophames/claude-usage-bar

 
 

Repository files navigation

Claude Usage Bar icon

Claude Usage Bar

Have you ever found yourself refreshing the Claude usage page, wondering how close you are to hitting your rate limit? Yeah, I've been there too. So I built this.

Now it's just a glimpse away — always sitting at the top of your screen.

Claude Usage Bar demo

macOS 14+ Swift 5.9 License

What it does

A tiny macOS menu bar app that shows your Claude API usage at a glance. Click it for the full picture:

  • Menu bar icon with a mini dual-bar showing 5-hour and 7-day utilization
  • Detailed popover with per-window usage and reset timers
  • Usage history chart — see how your usage evolves over time (1h / 6h / 1d / 7d / 30d)
  • Hover over the chart to see exact values at any point
  • Just sign in — OAuth via browser, no API keys to manage
  • Zero dependencies — pure SwiftUI, Swift Charts, and Foundation

Install

Download

  1. Download ClaudeUsageBar.zip from the latest release
  2. Extract and drag ClaudeUsageBar.app to /Applications
  3. On first launch: right-click the app → Open (required for ad-hoc signed apps)

Build from source

Requires Xcode 15+ / Swift 5.9+ and macOS 14 (Sonoma) or later.

git clone https://github.com/Blimp-Labs/claude-usage-bar.git
cd claude-usage-bar
make app            # build .app bundle
make install        # copy to /Applications

Usage

  1. Launch the app — a menu bar icon appears
  2. Click the icon → Sign in with Claude → authorize in your browser
  3. Paste the code back into the app
  4. The icon updates every 60 seconds with your current utilization

Click the icon anytime to see:

  • 5-hour and 7-day usage with progress bars and reset timers
  • Usage history chart with adjustable time range and hover details

Data storage

All data is stored locally in ~/.config/claude-usage-bar/:

File Purpose
token OAuth access token (permissions: 0600)
history.json Usage history for the chart (30-day retention)

History is buffered in memory and flushed to disk every 5 minutes and on app quit. No data is sent anywhere other than the Anthropic API.

Development

make build          # release build only
make app            # build + create .app bundle
make zip            # build + bundle + zip for distribution
make install        # build + install to /Applications
make clean          # remove build artifacts

Project structure

Sources/ClaudeUsageBar/
├── ClaudeUsageBarApp.swift      # App entry point, menu bar setup
├── UsageService.swift           # OAuth, polling, API calls
├── UsageModel.swift             # API response types
├── UsageHistoryModel.swift      # History data types, time ranges
├── UsageHistoryService.swift    # Persistence, downsampling
├── UsageChartView.swift         # Swift Charts trajectory view
├── PopoverView.swift            # Main popover UI
└── MenuBarIconRenderer.swift    # Menu bar icon drawing

License

BSD 2-Clause

About

A macOS menu bar app that shows your Claude API usage at a glance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Swift 95.6%
  • Shell 3.7%
  • Makefile 0.7%