Skip to content

chiliec/ClaudeBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

132 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClaudeBar

A native macOS menu bar app that shows your Claude.ai usage at a glance.

ClaudeBar popover

Features

  • Menu bar indicator -- ring icon with percentage fills and changes color as usage increases
  • 5-hour rolling window -- progress bar with reset countdown
  • 7-day limits -- separate bars for total, Sonnet, and Opus utilization
  • Subscription detection -- automatically identifies Pro / Max tier
  • Auto-refresh -- polls every 5 minutes, manual refresh available
  • Secure storage -- session key stored in macOS Keychain

Requirements

  • macOS 14 (Sonoma) or later
  • Swift 5.9+
  • Claude Pro or Max subscription

Install

brew install --cask chiliec/tap/claudebar-menubar

That's it. After install, the app updates itself: Sparkle checks daily and shows an "Update available" dialog whenever there's a new version.

The cask is named claudebar-menubar because the short name claudebar is taken by an unrelated project in the central Homebrew tap. Always use the fully-qualified chiliec/tap/claudebar-menubar.

Manual install (without Homebrew)

Download the latest .zip from Releases, unzip, drag ClaudeBar.app to /Applications, then double-click. The first launch shows the same Gatekeeper prompt as above.

Build from source

git clone https://github.com/chiliec/ClaudeBar.git
cd claudebar
./scripts/bundle.sh
cp -r .build/release/ClaudeBar.app /Applications/

The build scripts auto-detect your Apple Development certificate. If you have none, they fall back to ad-hoc signing (the app will ask for your Keychain password on every launch).

To use a specific certificate:

CODE_SIGN_IDENTITY="Apple Development: Your Name (XXXXXXXX)" ./scripts/bundle.sh

On the first launch after building, macOS will ask for your Keychain password to authorize the app — click Always Allow so it won't ask again.

Setup

  1. Open claude.ai in your browser
  2. Open DevTools and find the sessionKey cookie:
    • Safari: Develop -> Show Web Inspector -> Storage -> Cookies
    • Chrome / Arc / Brave: DevTools (Cmd+Opt+I) -> Application -> Cookies
    • Firefox: DevTools (Cmd+Opt+I) -> Storage -> Cookies
  3. Copy the sessionKey value
  4. Launch ClaudeBar and paste it in the setup screen

Development

./scripts/run.sh          # build + sign + run
swift test                # run all tests (65 tests)
swift test --filter AppStateTests  # run one test suite

The project has two SPM targets: ClaudeBarUI (library with models, services, views) and ClaudeBar (thin executable entry point). This split enables SwiftUI #Preview support.

Regenerating the app icon

The icon is generated programmatically with CoreGraphics. To tweak colors or shape, edit scripts/generate-icon.swift and run:

swift scripts/generate-icon.swift
iconutil -c icns .build/ClaudeBar.iconset -o Sources/Resources/AppIcon.icns

Note: Do not use swift run -- the binary must be code-signed to access Keychain. Use ./scripts/run.sh instead.

How it works

ClaudeBar reads usage data from claude.ai/api/organizations/{org_id}/usage using your session cookie. It does not use any unofficial or undocumented endpoints beyond what the Claude.ai web app itself uses.

No data is sent anywhere except to claude.ai. Your session key never leaves your machine (stored in macOS Keychain).

License

MIT

About

A native macOS menu bar app that shows your Claude.ai usage at a glance.

Topics

Resources

Stars

Watchers

Forks

Contributors