grzegorz-raczek-unit8/claude-quota: Menu bar gauges for Claude Code quota (SwiftBar plugin) ยท GitHub

โœจ Check out this must-read post from Hacker News ๐Ÿ“–

๐Ÿ“‚ **Category**:

๐Ÿ“Œ **What Youโ€™ll Learn**:

Menu bar gauges for your Claude Code quota โ€” one bar per account, like this:

menu bar screenshot

(drawn for dark menu bars โ€” white outlines)

  • Each bar shows the 5-hour-window utilization for one account, colored
    green / orange (โ‰ฅ70%) / red (โ‰ฅ90%).
  • When the 5-hour window is fully used, the bar shows a countdown until
    reset
    (4:28) instead of the percentage.
  • When the weekly limit is hit, the bar turns black with a countdown
    to the weekly reset (2D) โ€” that’s the harder cap, whatever the 5-hour
    window says.
  • The dropdown lists full detail for every account inline: 5-hour and weekly
    windows, per-model windows where your plan reports them, extra-usage
    credits, and reset times.
  • Refreshes every 5 minutes (SwiftBar filename convention) plus a manual
    “Refresh now” entry.
curl -fsSL https://raw.githubusercontent.com/grzegorz-raczek-unit8/claude-quota/main/install.sh | bash

Requires macOS and Homebrew. When macOS shows a Keychain
permission dialog on the first refresh, click Always Allow.

The plugin reads your Claude Code OAuth token from the macOS Keychain
(read-only โ€” it never refreshes or rewrites tokens, so it can’t log you
out) and queries the same usage endpoint that Claude Code’s /usage screen
uses. No passwords, no scraping, no third-party services.

Note: that endpoint is internal to Claude Code and undocumented, so a
future Claude Code change may require a small fix here.

git clone https://github.com/grzegorz-raczek-unit8/claude-quota.git
cd claude-quota
./install.sh

Either install path sets up SwiftBar
via Homebrew if you don’t have it. If an account shows โš , its token went
stale from disuse โ€” run that claude CLI once and the widget recovers on the
next cycle.

By default the plugin auto-discovers accounts: every ~/.claude /
~/.claude-* config directory that has a Claude Code Keychain entry gets a
bar, labeled by the directory suffix (~/.claude-work โ†’ W). A single
auto-discovered account shows no letter label โ€” just the bar.

To pin or rename accounts (e.g. you use multiple CLAUDE_CONFIG_DIRs), create
~/.config/claude-quota/accounts with one path [label] per line
(single-word labels):

~/.claude-work Work
~/.claude-priv Priv

To hide an account’s menu bar gauge (its dropdown detail stays), use
Hide from menu bar under that account’s row in the dropdown โ€” or edit
~/.config/claude-quota/hidden (one label per line).

Multiple accounts via CLAUDE_CONFIG_DIR look like this in your shell rc:

claude()      ๐Ÿ’ฌ
claude-priv() โšก

Delete claude-quota.5m.py from your SwiftBar plugin folder
(~/.swiftbar by default).

{๐Ÿ’ฌ|โšก|๐Ÿ”ฅ} **Whatโ€™s your take?**
Share your thoughts in the comments below!

#๏ธโƒฃ **#grzegorzraczekunit8claudequota #Menu #bar #gauges #Claude #Code #quota #SwiftBar #plugin #GitHub**

๐Ÿ•’ **Posted on**: 1781090691

๐ŸŒŸ **Want more?** Click here for more info! ๐ŸŒŸ

By

Leave a Reply

Your email address will not be published. Required fields are marked *