{"slug": "show-hn-claude-usage-tray-windows-tray-for-claude-code-rate-limits", "title": "Show HN: Claude Usage Tray – Windows Tray for Claude Code Rate Limits", "summary": "A developer released Claude Usage Tray, a Windows system-tray application that displays Claude Code rate-limit usage in real time through a colored circle icon. The tool monitors session and weekly usage percentages from Anthropic's API, showing green below 70%, amber at 70-89%, and red at 90% or higher, helping users avoid mid-refactor interruptions. The open-source PowerShell script runs without admin rights or Node.js, polling Anthropic's usage endpoint every five minutes and displaying the data via a clickable tray icon.", "body_md": "Windows system-tray app that shows your Claude Code rate-limit usage at a glance.\n\nA colored circle next to your clock with your session and weekly usage percentage. Green under 70, amber at 70+, red at 90+. Click for the full breakdown.\n\nIf you use Claude Code on a Pro or Max subscription, you have a 5-hour session window and a 7-day weekly cap. Hit either and you get cut off mid-refactor. Anthropic shows this in the CLI when you run `/usage`\n\n, but only when you ask. This puts it in your tray so you can glance like any other dev metric.\n\nWorks across every IDE you use Claude Code in (VS Code, Cursor, plain terminal). The data comes from your own account via the same endpoint Claude Code itself uses.\n\n- Windows 10 or 11\n- Windows PowerShell 5.1 (built in) or PowerShell 7\n- Claude Code installed and logged in (so\n`~/.claude/.credentials.json`\n\nexists)\n\nNo Node, no npm, no installer, no admin rights needed.\n\n- Clone this repo to a permanent location:\n\n```\ngit clone https://github.com/apexlocal-jz/claude-usage-tray.git \"$env:USERPROFILE\\.claude\\bin\\claude-usage-tray\"\n```\n\n- Run the installer:\n\n```\n& \"$env:USERPROFILE\\.claude\\bin\\claude-usage-tray\\install.ps1\"\n```\n\nThat adds a shortcut to your Startup folder and launches the tray immediately. You should see a colored circle with a number appear next to your clock within ~5 seconds.\n\nIf Windows blocks the script with `cannot be loaded because running scripts is disabled on this system`\n\n, run this once and try again:\n\n```\nSet-ExecutionPolicy -Scope CurrentUser RemoteSigned\n```\n\n| Action | Result |\n|---|---|\n| Always visible | Colored % circle in the system tray |\n| Hover | Compact tooltip: `Claude S:54% W:6% So:1%` |\n| Left click | Modal with full breakdown and reset times |\n| Right click | Refresh now / Details / Quit |\n\nThe icon color reflects the higher of your session and weekly utilization:\n\n**Green** under 70%**Amber** at 70-89%**Red** at 90%+\n\nIf the icon shows `!`\n\n(red) the tooltip explains the error. Usually it means your OAuth token expired (open Claude Code to refresh it) or the network is down.\n\n**Passive — just the icon next to your clock:**\n\n**Hover — compact tooltip:**\n\n**Left click — full breakdown with reset times:**\n\n```\n& \"$env:USERPROFILE\\.claude\\bin\\claude-usage-tray\\install.ps1\" -Uninstall\n```\n\nThat stops the running tray, removes the Startup-folder shortcut, and deletes the log directory at `%LOCALAPPDATA%\\claude-usage-tray`\n\n. To remove the script files too:\n\n```\nRemove-Item \"$env:USERPROFILE\\.claude\\bin\\claude-usage-tray\" -Recurse -Force\n```\n\nNo registry keys, no other files. Clean uninstall.\n\nEvery 5 minutes (with 0-60 second jitter), the script:\n\n- Reads your OAuth token from\n`~/.claude/.credentials.json`\n\n(the file Claude Code itself maintains) - Calls\n`GET https://api.anthropic.com/api/oauth/usage`\n\nwith that token - Parses\n`five_hour.utilization`\n\n,`seven_day.utilization`\n\n,`seven_day_sonnet.utilization`\n\nand their`resets_at`\n\ntimestamps - Redraws the tray icon and tooltip\n\nThat's it. No background services, no extra processes, no telemetry. Single ~300-line PowerShell script using WinForms `NotifyIcon`\n\nfor the UI. The polling cadence matches Claude Code's own internal polling, with jitter added so we don't sync.\n\nOn 429 (rate limited), the script honors `Retry-After`\n\nand backs off. On 401 (token expired), it shows a friendly error and waits for the next poll, by which time Claude Code has usually refreshed the token.\n\n- Your OAuth token never leaves your machine except in the\n`Authorization: Bearer`\n\nheader sent to`api.anthropic.com`\n\nover TLS 1.2. - No telemetry. The script makes exactly one HTTPS call (to Anthropic) per poll. There are no other network destinations.\n- The log file (\n`%LOCALAPPDATA%\\claude-usage-tray\\tray.log`\n\n) records timestamps of errors and start/stop events. No tokens, no response bodies. - Response body is capped at 1 MB before parsing to prevent memory-exhaustion from a hostile or misconfigured response.\n`Retry-After`\n\nis capped at 1 hour so a bad 429 header can't lock the tray out indefinitely.- Source is ~320 lines of PowerShell with zero runtime dependencies. Audit it yourself in 10 minutes.\n\n**Threat model note:** like Claude Code itself, the running script holds your OAuth token in memory during each poll (~5 ms per fetch, every 5 min). Any process running as the same Windows user can read that memory. This is inherent to all credential-using local utilities. If your threat model includes a hostile process running as your user, this tool is not a meaningful additional exposure on top of Claude Code itself, but it's worth knowing.\n\nThis is an independent, unofficial tool. **Not affiliated with or endorsed by Anthropic.**\n\nIt uses an undocumented Anthropic endpoint (`/api/oauth/usage`\n\n) that powers Claude Code's own usage display. Anthropic may change or remove that endpoint at any time. If they do, this tool will break and that's a fixable bug, not a guarantee of service.\n\nUse at your own risk. The MIT license disclaims all warranties.\n\nThe idea, the endpoint, and the color-threshold model come from [Harsh1210/claude-usage-bar](https://github.com/Harsh1210/claude-usage-bar), a VS Code extension that does the same thing inside VS Code's status bar. If you live in VS Code, install that instead. This project is a Windows-tray equivalent for cross-IDE users.\n\nMIT. See [LICENSE](/apexlocal-jz/claude-usage-tray/blob/main/LICENSE).", "url": "https://wpnews.pro/news/show-hn-claude-usage-tray-windows-tray-for-claude-code-rate-limits", "canonical_source": "https://github.com/apexlocal-jz/claude-usage-tray", "published_at": "2026-05-27 14:31:33+00:00", "updated_at": "2026-05-27 14:46:07.589277+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "artificial-intelligence", "large-language-models", "generative-ai"], "entities": ["Claude Code", "Anthropic", "VS Code", "Cursor", "Windows", "PowerShell", "Claude Usage Tray", "apexlocal-jz"], "alternates": {"html": "https://wpnews.pro/news/show-hn-claude-usage-tray-windows-tray-for-claude-code-rate-limits", "markdown": "https://wpnews.pro/news/show-hn-claude-usage-tray-windows-tray-for-claude-code-rate-limits.md", "text": "https://wpnews.pro/news/show-hn-claude-usage-tray-windows-tray-for-claude-code-rate-limits.txt", "jsonld": "https://wpnews.pro/news/show-hn-claude-usage-tray-windows-tray-for-claude-code-rate-limits.jsonld"}}