Objlab
← News
Linguaggi e compilatori

Mostra HN: indicatori nella barra dei menu di macOS per la tua quota di Claude Code

Sintesi redazionale: URL dell'articolo: https://github.com/grzegorz-raczek-unit8/claude-quota URL dei commenti: https://news.ycombinator.com/item?id=48473845 Punti: 3 # Commenti: 1. Fonte originale: https://github.com/grzegorz-raczek-unit8/claude-quota

<p>Menu bar gauges for your Claude Code quota — one bar per account, like this:</p><p>*(dark menu bar shown — outlines, labels and the mascot follow the menu bar<br>appearance, so light mode gets black-on-light)*</p><p>- Each bar shows the<br>**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<br>**countdown until reset**(`4:28`</p><p>) instead of the percentage. - When the<br>**weekly limit**is hit, the bar turns**black**with a countdown to the weekly reset (`2D`</p><p>) — that&#x27;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.<br>- Refreshes every 5 minutes (SwiftBar filename convention) plus a manual &quot;Refresh now&quot; entry.</p><p>`curl -fsSL https://raw.githubusercontent.com/grzegorz-raczek-unit8/claude-quota/main/install.sh | bash`</p><p>Requires macOS and Homebrew. When macOS shows a Keychain<br>permission dialog on the first refresh, click **Always Allow**.</p><p>The plugin reads your Claude Code OAuth token from the macOS Keychain<br>(**read-only** — it never refreshes or rewrites tokens, so it can&#x27;t log you<br>out) and queries the same usage endpoint that Claude Code&#x27;s `/usage`</p><p>screen<br>uses. No passwords, no scraping, no third-party services.</p><p>Note:that endpoint is internal to Claude Code and undocumented, so a future Claude Code change may require a small fix here.</p><p>```<br>git clone https://github.com/grzegorz-raczek-unit8/claude-quota.git<br>cd claude-quota<br>./install.sh<br>```</p><p>Either install path sets up SwiftBar<br>via Homebrew if you don&#x27;t have it, and adds it to your Login Items so the<br>gauges come back after a reboot. If an account shows ⚠, its token went<br>stale from disuse — run that `claude`</p><p>CLI once and the widget recovers on the<br>next cycle.</p><p>By default the plugin auto-discovers accounts: every `~/.claude`</p><p>/<br>`~/.claude-*`</p><p>config directory that has a Claude Code Keychain entry gets a<br>bar, labeled by the directory suffix (`~/.claude-work`</p><p>→ `W`</p><p>). A single<br>auto-discovered account shows no letter label — just the bar.</p><p>To pin or rename accounts (e.g. you use multiple `CLAUDE_CONFIG_DIR`</p><p>s), create<br>`~/.config/claude-quota/accounts`</p><p>with one `path [label]`</p><p>per line<br>(single-word labels):</p><p>```<br>~/.claude-work Work<br>~/.claude-priv Priv<br>```</p><p>To hide an account&#x27;s menu bar gauge (its dropdown detail stays), use<br>**Hide from menu bar** under that account&#x27;s row in the dropdown — or edit<br>`~/.config/claude-quota/hidden`</p><p>(one label per line).</p><p>Multiple accounts via `CLAUDE_CONFIG_DIR`</p><p>look like this in your shell rc:</p><p>```<br>claude() { CLAUDE_CONFIG_DIR=&quot;$HOME/.claude-work&quot; command claude &quot;$@&quot;; }<br>claude-priv() { CLAUDE_CONFIG_DIR=&quot;$HOME/.claude-priv&quot; command claude &quot;$@&quot;; }<br>```</p><p>Delete `claude-quota.5m.py`</p><p>from your SwiftBar plugin folder<br>(`~/.swiftbar`</p><p>by default). If you no longer use SwiftBar, also remove it<br>from System Settings → General → Login Items.</p>