|
1 | 1 | # Claude Code Usage Monitor |
2 | 2 |
|
3 | | -A lightweight Windows taskbar widget that displays your Claude API rate limit usage in real time. |
| 3 | +A lightweight Windows taskbar widget for people already using Claude Code. |
| 4 | + |
| 5 | +It sits in your taskbar and shows how much of your Claude Code usage window you have left, without needing to open the terminal or the Claude site. |
4 | 6 |
|
5 | 7 |  |
6 | | - |
7 | 8 | [](https://opensource.org/licenses/MIT) |
8 | 9 |
|
9 | 10 |  |
10 | 11 |
|
11 | | -## What it does |
| 12 | +## What You Get |
12 | 13 |
|
13 | | -Embeds directly into the Windows taskbar and shows two progress bars: |
| 14 | +- A **5h** bar for your current 5-hour Claude usage window |
| 15 | +- A **7d** bar for your current 7-day window |
| 16 | +- A live countdown until each limit resets |
| 17 | +- A small native widget that lives directly in the Windows taskbar |
| 18 | +- Right-click options for refresh, update frequency, language, startup, and updates |
14 | 19 |
|
15 | | -- **5h** — Session usage (5-hour rolling window) |
16 | | -- **7d** — Weekly usage (7-day rolling window) |
| 20 | +## Who This Is For |
17 | 21 |
|
18 | | -Each bar shows the current utilization percentage and a countdown until the rate limit resets. |
| 22 | +This app is for Windows users who already have **Claude Code (CLI or App) installed and signed in**. |
19 | 23 |
|
20 | | -## How it works |
| 24 | +It works best if you want a simple "how close am I to the limit?" display that is always visible. |
21 | 25 |
|
22 | | -1. Reads your Claude OAuth token from `~/.claude/.credentials.json`, or from `~/.claude/.credentials.json` inside an installed WSL distro if the Windows file is missing or expired (automatically refreshes expired tokens via the matching Claude CLI) |
23 | | -2. Queries the dedicated Anthropic OAuth usage endpoint (`/api/oauth/usage`) for utilization data |
24 | | -3. Falls back to the Messages API with rate limit header parsing (`anthropic-ratelimit-unified-*`) if the usage endpoint is unavailable |
25 | | -4. Renders the widget using Win32 GDI, embedded as a child window of the taskbar |
26 | | -5. Polls every 15 minutes by default (adjustable via context menu) and updates countdown timers between polls |
| 26 | +## Requirements |
27 | 27 |
|
28 | | -The widget automatically detects dark/light mode from Windows system settings. You can drag the left divider to reposition the widget along the taskbar. Settings (position and poll frequency) are persisted to `%APPDATA%\ClaudeCodeUsageMonitor\settings.json`. |
| 28 | +- Windows 10 or Windows 11 |
| 29 | +- Claude Code (CLI or App) installed and authenticated |
29 | 30 |
|
30 | | -## Requirements |
| 31 | +If you use Claude Code through WSL, that is supported too. The monitor can read your Claude Code credentials from Windows or from your WSL environment. |
31 | 32 |
|
32 | | -- Windows 10/11 |
33 | | -- [Rust toolchain](https://rustup.rs/) (MSVC target) |
34 | | -- An active Claude Pro/Team subscription with OAuth credentials stored by [Claude Code](https://docs.anthropic.com/en/docs/claude-code) |
| 33 | +## Install |
35 | 34 |
|
36 | | -If you use Claude Code inside WSL2, keep `claude` installed and authenticated in that distro. The monitor will scan installed WSL distros and use the first accessible non-expired credential set it finds. |
| 35 | +For now, download the latest `claude-code-usage-monitor.exe` from the [Releases](../../releases) page and run it. |
37 | 36 |
|
38 | | -## Building |
| 37 | +WinGet support is on the way and currently waiting on final approval. When that is live, installation will be a one-liner. |
39 | 38 |
|
40 | | -```bash |
41 | | -cargo build --release |
42 | | -``` |
| 39 | +Planned command: |
43 | 40 |
|
44 | | -The binary will be at `target/release/claude-code-usage-monitor.exe`. |
| 41 | +```powershell |
| 42 | +winget install CodeZeno.ClaudeCodeUsageMonitor |
| 43 | +``` |
45 | 44 |
|
46 | | -## Usage |
| 45 | +## Use |
47 | 46 |
|
48 | | -Run the executable — the widget appears in your taskbar. |
| 47 | +Run the app and it will appear in your taskbar. |
49 | 48 |
|
50 | | -- **Drag** the left divider to reposition the widget along the taskbar |
51 | | -- **Right-click** for a context menu with **Refresh**, **Update Frequency**, **Settings** (Start with Windows, Reset Position), and **Exit** |
52 | | -- Installations managed by WinGet defer upgrades to `winget upgrade` instead of replacing the executable in place |
| 49 | +- Drag the left divider to move it |
| 50 | +- Right-click for refresh, update frequency, start with Windows, reset position, language, updates, and exit |
53 | 51 |
|
54 | | -## Project structure |
| 52 | +Settings are saved to: |
55 | 53 |
|
| 54 | +```text |
| 55 | +%APPDATA%\ClaudeCodeUsageMonitor\settings.json |
56 | 56 | ``` |
57 | | -src/ |
58 | | -├── main.rs # Entry point |
59 | | -├── models.rs # UsageData / UsageSection types |
60 | | -├── poller.rs # API polling, header parsing, formatting |
61 | | -├── window.rs # Win32 window, rendering, message loop |
62 | | -├── native_interop.rs # Win32 helper functions (taskbar, colors, etc.) |
63 | | -└── theme.rs # Dark/light mode detection via registry |
64 | | -``` |
65 | 57 |
|
66 | | -## Releases |
| 58 | +## Account Support |
| 59 | + |
| 60 | +This app works with the same account types that Claude Code itself supports. |
| 61 | + |
| 62 | +As of **March 19, 2026**, Anthropic's Claude Code setup documentation says: |
| 63 | + |
| 64 | +- **Supported:** Pro, Max, Teams, Enterprise, and Console accounts |
| 65 | +- **Not supported:** the free Claude.ai plan |
| 66 | + |
| 67 | +If Anthropic changes Claude Code availability in the future, this app should follow whatever Claude Code supports, as long as the usage data remains exposed through the same authenticated endpoints. |
| 68 | + |
| 69 | +## Privacy And Security |
| 70 | + |
| 71 | +This project is **open source**, so you can inspect exactly what it does. |
| 72 | + |
| 73 | +What the app reads: |
| 74 | + |
| 75 | +- Your local Claude Code OAuth credentials from `~/.claude/.credentials.json` |
| 76 | +- If needed, the same credentials file inside an installed WSL distro |
| 77 | + |
| 78 | +What the app sends over the network: |
| 79 | + |
| 80 | +- Requests to Anthropic's Claude endpoints to read your usage and rate-limit information |
| 81 | +- Requests to GitHub only if you use the app's update check / self-update feature |
| 82 | + |
| 83 | +What the app stores locally: |
| 84 | + |
| 85 | +- Widget position |
| 86 | +- Polling frequency |
| 87 | +- Language preference |
| 88 | + |
| 89 | +What it does **not** do: |
| 90 | + |
| 91 | +- It does not send your credentials to any other server |
| 92 | +- It does not use a separate backend service |
| 93 | +- It does not collect analytics or telemetry |
| 94 | +- It does not upload your project files |
| 95 | + |
| 96 | +Notes: |
| 97 | + |
| 98 | +- If your Claude Code token is expired, the app may ask the local Claude CLI to refresh it in the background |
| 99 | +- Portable installs can update themselves by downloading the latest release from this repository |
| 100 | + |
| 101 | +## How It Works |
| 102 | + |
| 103 | +The monitor: |
| 104 | + |
| 105 | +1. Finds your Claude Code login credentials |
| 106 | +2. Reads your current usage from Anthropic |
| 107 | +3. Shows the result directly in the Windows taskbar |
| 108 | +4. Refreshes periodically in the background |
| 109 | + |
| 110 | +If the newer usage endpoint is unavailable, it can fall back to reading the rate-limit headers returned by Claude's Messages API. |
67 | 111 |
|
68 | | -Pre-built Windows executables are available on the [Releases](../../releases) page. Download `claude-code-usage-monitor.exe` and run it directly — no Rust toolchain required. |
| 112 | +## Open Source |
69 | 113 |
|
70 | | -After the GitHub Release is published, the release workflow also attempts to submit a WinGet manifest update for `CodeZeno.ClaudeCodeUsageMonitor`. |
| 114 | +This project is licensed under MIT. |
71 | 115 |
|
72 | | -- Configure a classic PAT as the `WINGETCREATE_GITHUB_TOKEN` repository secret with `public_repo` scope so `wingetcreate` can submit to `microsoft/winget-pkgs` |
73 | | -- The first WinGet submission still needs to be created manually; after the package exists, later tagged releases can update it automatically |
| 116 | +If you want to inspect the behavior or audit the code, everything is in this repository. |
0 commit comments