https://github.com/Bread-bang/claude-usage
Native macOS menu bar app showing Claude Code usage (session / weekly / Sonnet / credits) — no backend, notarized, brew install
https://github.com/Bread-bang/claude-usage
anthropic claude claude-code developer-tools macos macos-app menu-bar-app menubar statusbar swift swiftui usage-tracker
Last synced: 3 days ago
JSON representation
Native macOS menu bar app showing Claude Code usage (session / weekly / Sonnet / credits) — no backend, notarized, brew install
- Host: GitHub
- URL: https://github.com/Bread-bang/claude-usage
- Owner: Bread-bang
- License: mit
- Created: 2026-06-11T16:54:46.000Z (27 days ago)
- Default Branch: main
- Last Pushed: 2026-06-11T18:14:55.000Z (27 days ago)
- Last Synced: 2026-06-11T19:04:24.214Z (27 days ago)
- Topics: anthropic, claude, claude-code, developer-tools, macos, macos-app, menu-bar-app, menubar, statusbar, swift, swiftui, usage-tracker
- Language: Swift
- Homepage: https://github.com/Bread-bang/claude-usage#readme
- Size: 4.85 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mac - Claude Usage - Claude Code向けのメニューバーアプリ。ステータスラインにペインごとのコンテキストを表示し、セッションと週次の使用量も常に確認可能。usage や context コマンドを実行する必要はありません。 [![Open-Source Software][OSS Icon]](https://github.com/Bread-bang/claude-usage) ![Freeware][Freeware Icon] (AIツール / その他のツール)
- awesome-swift-macos-apps - Claude Usage - bang/claude-usage?style=flat&label=" /> <img align="bottom" height="13" src="https://img.shields.io/github/last-commit/Bread-bang/claude-usage?style=flat&label=" /> - Real-time view of all Claude Code usage without consuming SDK credits or launching the program. (AI Usage/Status)
README
Claude Usage
A lightweight, native macOS app for Claude Code that does two things from the moment you
open a pane:
- **Context in the status line.** A one‑line readout right under your prompt — model,
percent full, and tokens used (e.g. `Opus 4.8 · 11% · 113K/1M`) — so you can `/compact`
*before* the model starts forgetting. Each pane renders its own, so it's always the right
session across tmux and cmux, with no Accessibility permissions.
- **Usage in the menu bar.** Current session (5‑hour), weekly (all models / Sonnet), and
pay‑as‑you‑go credits — each with a utilization bar and reset time, in real time, without
launching Claude Code or spending Agent SDK credits.
- **100% local.** No backend, no telemetry, no cookies — it reuses the OAuth token already
in your Keychain from Claude Code.
- Pure Swift + SwiftUI + `MenuBarExtra`. No Electron, no dependencies. Notarized.
## Install
**Homebrew**
```bash
brew install bread-bang/tap/claude-usage
```
After the tap is added, `brew install claude-usage` works too. The build is notarized, so
it opens with no Gatekeeper warnings.
**Build from source**
```bash
git clone https://github.com/Bread-bang/claude-usage.git
cd claude-usage
./scripts/bundle.sh --open
```
**Requirements:** macOS 13+ and Claude Code signed in (run `claude` once so the Keychain
item exists). To start it at login: System Settings → General → Login Items → add
*Claude Usage.app*.
## Features
- Current session (5‑hour), current week (all models and Sonnet only), and usage credits —
each with a utilization bar and its reset time.
- **Context in the status line:** a one‑line readout under your Claude Code prompt — model,
percent full, and tokens used (e.g. `Opus 4.8 · 11% · 113K/1M`), with the 200K vs 1M window
reported directly by Claude Code. Because each pane renders its own, it's always the right
session — even across many panes (tmux, cmux) — with no guesswork and no Accessibility
permissions.
- Menu‑bar number for the window of your choice, with traffic‑light colors.
- Selectable icon and refresh interval (30s / 1m / 5m); settings and the last report
persist across launches.
- Keeps showing the last good data with a subtle warning when a refresh fails, and backs
off on rate limits.
## Privacy & trust
- The only network request is `GET https://api.anthropic.com/api/oauth/usage` — the same
endpoint Claude Code uses. Nothing is sent anywhere else; no analytics.
- The token is read from Claude Code's Keychain item through Apple's `/usr/bin/security`
tool and held only in memory for each request — never written to disk or logged.
- The context readout is local too: Claude Code passes the live context window to a
status‑line command on stdin, and we just format it. We register that command in
`~/.claude/settings.json` only when the status‑line slot is empty or already ours —
another tool's status line is never overwritten. Nothing leaves your machine.
## Development
```bash
swift run # run from source
open Package.swift # or open in Xcode
./scripts/bundle.sh # build dist/Claude Usage.app (locally signed)
./scripts/release.sh # Developer ID-signed + notarized .zip for a release
```
Getting repeated Keychain prompts on every rebuild? Run `./scripts/create-signing-cert.sh`
once. Architecture and the reverse‑engineering notes (endpoint choice, Keychain access,
token refresh) are in **[DESIGN.md](DESIGN.md)**.
## Limitations
- Relies on the **undocumented** `api.anthropic.com/api/oauth/usage` endpoint and on Claude
Code's Keychain format — both can change without notice.
- The `claude.ai/api/.../usage` endpoint is intentionally not used (Cloudflare‑walled for
non‑browser clients; see [DESIGN.md](DESIGN.md)).
## License
[MIT](LICENSE) © Bread-bang