A Claude Code usage tracker that predicts the 429 reads a different number than ccusage

You came here from a thread asking which tool to install. Short version: there are two camps of trackers, they read non-overlapping data, and the tracker that tells you when your next Claude Code prompt 429s is not the tracker most posts recommend. This page walks the gap, shows the seven lines of source that close it, and tells you which two tools to install (yes, two) so you stop being surprised by rate limits.

M
Matthew Diakonov
7 min read

Direct answer (verified 2026-05-01)

Two trackers, two answers, and you want both. ccusage sums local Claude Code tokens out of ~/.claude/projects/*.jsonl. ClaudeMeter calls GET /api/organizations/{org}/usage with the cookie your browser already has and reads the same percentage Anthropic uses to decide your next 429. ccusage tells you what you spent. ClaudeMeter tells you how close you are to the wall. Install both. Source for the cookie path is verifiable at extension/background.js (the line is credentials: "include").

The 5%-and-rate-limited paradox

You probably hit it once already. Your terminal-side tracker says you have used a small fraction of your tokens this week. Your next Claude Code prompt comes back with rate limit reached. Both readings are correct. They are not the same reading.

What ccusage reports vs what Anthropic enforces

The local tracker counts tokens it can see on your filesystem. That is a faithful, complete record of one channel: Claude Code traffic from this machine. It does not see the chat tab you used to draft a PR description, the per-model weight Anthropic applies (Opus is heavier than Sonnet on the same byte count), the peak-hour multiplier, or any attachments, tool calls, or browser-chat usage that share the same rolling-window bucket on the server.

Server-side utilization is what gets compared against 1.0 before Anthropic decides to 429 your next prompt. It lives at claude.ai/api/organizations/{org}/usage. Read it directly and you can see the 91% before you discover it the way most people do, with an error message mid-loop.

The tracker that predicts the 429 reads a different number

Here is the same minute from the server side. The five-hour bucket is at 91%, two clicks shy of the wall. The chip in the menu bar is painted orange. The CLI prints the same number, machine-readable, so you can fold it into a status line.

ClaudeMeter on the same minute

The seven lines that close the gap

The thing every other server-quota tracker stumbles on is auth. Three common patterns: paste your sessionKey from DevTools, sign into claude.ai inside an embedded webview, or hand over an Anthropic API key (which only reads console spend, never plan quota). All three add a manual step the user has to redo when the cookie rotates.

A real Manifest V3 extension running inside Chrome, Arc, Brave, or Edge has a fourth option, and it is one keyword on a fetch call:

extension/background.js

The browser attaches the existing claude.ai cookie to the request the same way it would for any tab on claude.ai/settings/usage. No paste. No second sign-in. No keychain prompt. The endpoint returns eight Window structs (rolling 5-hour, plus seven 7-day buckets including Sonnet-specific and Opus-specific) and the extra-usage block for April 2026 metered billing. Typed in src/models.rs lines 18 to 28. Shipped over a localhost bridge to the menu bar app.

Two camps of trackers, eight rows that distinguish them

Both are MIT-licensed and free. The choice is not better or worse, it is what you want to measure. ccusage and ClaudeMeter complement each other; running both is the right answer.

FeatureLocal-token tracker (ccusage, Claude-Code-Usage-Monitor)Server-quota tracker (ClaudeMeter)
What it reads~/.claude/projects/*.jsonl on disk (local token transcripts)/api/organizations/{org}/usage on claude.ai (server-side utilization)
Predicts the 429?No. Tokens-on-disk and server-utilization can disagree by 30 to 40 points.Yes. The server utilization is the field Anthropic checks before throwing 429.
Sees browser-chat usage on the same plan?No. Only Claude Code traffic ends up in JSONL.Yes. The server bucket counts every prompt against your plan, regardless of source.
Sees per-model weights and peak-hour multiplier?No. JSONL records raw token counts.Yes. The server has already applied them by the time it returns utilization.
Auth modelNone needed. Reads files on your filesystem.Existing claude.ai browser cookie via credentials: 'include'. No paste, no API key.
Where you read itTerminal pane (ccusage --watch) or one-shot ccusage table.macOS menu bar (always visible), browser toolbar popup, claude-meter --json CLI.
LicenseMIT, TypeScriptMIT, Rust + JavaScript
Best usedTo know which session burned which model and how many tokensTo know whether your next prompt 429s

Five things to remember when you pick a tracker

Mental model for Claude Code usage tracking

  • ccusage and ClaudeMeter measure non-overlapping things. ccusage = tokens you sent. ClaudeMeter = % of plan Anthropic counted those (and your browser-chat usage) against. Treating them as alternatives is a category error; treating them as alternatives is what produces 'I'm only at 5% why am I rate-limited' tweets.
  • Only server-quota trackers can predict the 429. The 429 fires on the server-side utilization, not the local token count, so any tool that does not call /api/organizations/{org}/usage (or watch the live SSE message_limit stream) is structurally unable to warn you in advance.
  • credentials: 'include' is the entire trick. With it, an extension reuses whatever cookie Chrome is storing for claude.ai. Without it, every other server-quota tool has to either embed a webview, ask you to paste the Cookie header from DevTools, or pop a macOS Keychain prompt to decrypt the cookie database itself.
  • An Anthropic API key cannot read plan usage. The console.anthropic.com API key sees console spend (your billable API calls), which has zero relationship to Pro/Max plan quota. Trackers that ask for an API key are reading a different ledger and will never warn you about a Claude Code 429.
  • The endpoints are undocumented but stable enough to ship. The repo declares every Window field as Optional and uses #[serde(default)] on booleans, so a renamed field deserializes as None or false instead of crashing. When Anthropic does rename one, the fix is one line in src/models.rs and the next brew release ships within hours.

Install path, the 60-second version

You can do this later from a Mac. The full path is one brew command plus a one-time browser-extension load. The extension is what removes the cookie-paste step; without it, ClaudeMeter still works by reading the Chrome Safe Storage cookie directly, but Arc, Brave, and Edge will pop a Keychain prompt the first time.

  1. Step 1brew install --cask m13v/tap/claude-meter. Drops ClaudeMeter.app into /Applications and registers a launch agent so the menu bar icon comes back after reboot.
  2. Step 2Clone the repo. Open chrome://extensions (or arc://extensions, brave://extensions, edge://extensions). Enable Developer mode. Click Load unpacked. Point at the extension/ folder. Pin the icon if you want the toolbar popup.
  3. Step 3Visit claude.ai once. The extension fetches /api/organizations/{org}/usage with your existing cookie and POSTs the snapshot to the menu bar over localhost:63762. Within sixty seconds the chip lights up with two percentages.
  4. Step 4 (optional, for the local-token side)npm i -g ccusage and run ccusage --watch in a tmux pane. Now you have both numbers: the local tokens you burned, and the server percentage that decides the 429.

The honest caveat

The endpoints are undocumented. Anthropic can rename a field in any claude.ai release and a tracker built on them has to ship a patch. ClaudeMeter declares every Window field as Optional and ships #[serde(default)] on the booleans, so a missing or renamed field deserializes as None or false instead of crashing. That is forward-compat hedging, not a guarantee. If you need long-term stability over freshness, the official answer is to refresh claude.ai/settings/usage by hand. If you want a live menu bar chip and you accept that the repo follows Anthropic when they move, install ClaudeMeter.

Building your own Claude Code usage tracker?

Send a 15 minute call. Happy to compare endpoint shapes, the cookie pipeline, and the moments the JSON shifts under us.

Frequently asked questions

What is the best Claude Code usage tracker?

Wrong question, because there are two non-overlapping tools and you want both. ccusage (github.com/ryoppippi/ccusage) walks ~/.claude/projects/*.jsonl and totals the tokens your CLI sent. ClaudeMeter (github.com/m13v/claude-meter) calls https://claude.ai/api/organizations/{org}/usage with your browser cookie and reads the percentage of plan that Anthropic counted those tokens against. ccusage answers 'what did this machine spend?'. ClaudeMeter answers 'when does the next prompt get a 429?'. Different inputs, different ledgers, both useful at the same time.

Why does ccusage say 5% used when my Claude Code session got rate-limited?

Because the two numbers are not the same number. ccusage sums input_tokens + output_tokens out of the JSONL transcripts on disk. The 429 is decided by the server-side seven_day or five_hour utilization on Anthropic's side, which factors in per-model weights, the peak-hour multiplier, attachments, browser-chat usage on the same plan, and tool-call overhead. The local token count and the server utilization can drift by 30 or 40 points and both still be correct readings of what they actually measure. ClaudeMeter shows the second one alongside ccusage so you can see the gap and stop guessing.

How does ClaudeMeter read the server-side number without a cookie paste or API key?

It ships a Manifest V3 browser extension that runs in the same browser you're already logged into. The extension fetches /api/organizations/{org}/usage with credentials: 'include', so the existing claude.ai cookie travels automatically. No copy-paste from DevTools, no embedded sign-in webview, no Anthropic API key (which only sees console spend, not plan quota). The seven lines that do this are at extension/background.js lines 5 to 12 in the open-source repo. Same private endpoint that claude.ai/settings/usage itself reads to draw your usage page.

Will Anthropic block this for reading an undocumented endpoint?

It is your own session calling a route your browser already calls every time you open Settings > Usage. There is no second account, no scraping, no parallel session. The READ rate is one request per minute per browser, well under what your normal browsing of claude.ai produces. The endpoint is undocumented, which means Anthropic can change it, not that they prohibit it. If they rename a field, the open-source repo gets a same-day patch and you pull the next brew release. The risk profile sits between 'reading my own bank statement on the bank's site' and 'using a chrome extension that customizes my Gmail'. Worth it for the 429-prediction; not worth it for someone uncomfortable with that.

Does the menu bar app even need the browser extension?

Not strictly, but it is the recommended path. With the extension loaded, the menu bar app gets snapshots over localhost:63762 and never touches your keychain. Without the extension, the app falls back to decrypting the Chrome Safe Storage cookie itself, which works but pops a Keychain prompt the first time on Arc, Brave, and Edge (Chrome silently approves). Most people use Route A because it skips the prompt and works across multiple browsers without configuration.

Will it work on Linux or Windows?

The browser extension yes, the macOS menu bar app no. The README is explicit: macOS only. On Linux or Windows you can install the extension and read the same 5h/7d numbers from the browser toolbar popup, but you don't get the always-visible menu bar chip or the localhost bridge. If you want a status-line readout on those platforms, the extension's chrome.action API still exposes the latest snapshot and a small companion script can mirror it into i3blocks/Polybar/Powershell.

Should I uninstall ccusage if I'm using ClaudeMeter?

No. ccusage is the only thing that breaks down spend by Claude Code session, by model, by project. If you want to see 'this refactor cost me 1.2M Sonnet tokens' you keep ccusage. ClaudeMeter does not parse JSONL at all and cannot show you which session burned which model. The two tools are complements: ccusage tells you what your Claude Code traffic weighed in tokens, ClaudeMeter tells you what fraction of the plan ceiling Anthropic counted that against. Run both. They poll different sources and answer different questions.

What is in the JSON the extension actually reads?

Eight Window structs and one ExtraUsage block, typed in src/models.rs lines 18 to 28. The Window structs are five_hour, seven_day, seven_day_sonnet, seven_day_opus, seven_day_oauth_apps, seven_day_omelette, and seven_day_cowork. Each Window has a utilization float (0.0 to 1.0+) and an optional resets_at timestamp. The ExtraUsage block carries is_enabled, monthly_limit, used_credits, utilization, and currency for the April 2026 metered-billing fall-through. The menu bar surfaces five_hour and seven_day in the title; the dropdown lists every Window, the extra-usage dollar line, and the resets_at countdown for each.

How fast is install? I'm reading this from my phone on a Twitter thread.

Open ClaudeMeter on a Mac later. The full path is brew install --cask m13v/tap/claude-meter (one command), then load the unpacked extension from the cloned repo into Chrome/Arc/Brave/Edge (about 60 seconds), then visit claude.ai once. The menu bar lights up within a minute with two percentages. If you only want the browser side, the extension folder is at github.com/m13v/claude-meter/tree/main/extension; load it unpacked and the toolbar badge starts ticking after one refresh of claude.ai.