claude-usage-tracker

Claude Usage Tracker

A Chrome extension that tracks your token usage across Claude Chat, Projects, Cowork, and Design in real time — with desktop alerts before you run low and full trend analytics.

Independent open-source project. Not affiliated with Anthropic.


Features


How it works

The extension intercepts fetch calls on claude.ai and reads the input_tokens / output_tokens fields from Anthropic’s streaming SSE responses. Message content is never read or stored. Since Anthropic does not expose a public quota API, usage is tracked relative to your own rolling average rather than against an absolute limit.


Installation (development)

  1. Clone the repo
    git clone https://github.com/Ashutosh-Sharma-IN/claude-usage-tracker.git
    cd claude-usage-tracker
    
  2. Generate icons Open icons/create-icons.html in Chrome, click Download all icons, and move the three PNGs into the icons/ folder.

  3. Load in Chrome
    • Go to chrome://extensions
    • Enable Developer mode (top-right toggle)
    • Click Load unpacked → select the claude-usage-tracker folder
  4. Visit claude.ai and start a conversation. The badge will appear after the first response.

Chrome Web Store

Publishing in progress — link will be added here once approved.


File structure

claude-usage-tracker/
├── manifest.json              Extension config (Manifest V3)
├── background/
│   └── service-worker.js      Storage, notifications, stats aggregation
├── content/
│   ├── interceptor.js         Fetch interceptor (MAIN world)
│   └── bridge.js              Event relay to service worker (ISOLATED world)
├── popup/
│   ├── popup.html/css/js      Toolbar popup — live status + mini charts
├── dashboard/
│   ├── dashboard.html/css/js  Full analytics page with SVG charts
├── options/
│   ├── options.html/css/js    Settings: products, thresholds, data export
├── icons/
│   ├── create-icons.html      Open in Chrome to generate PNGs
│   ├── icon16.png             (generate via create-icons.html)
│   ├── icon48.png
│   └── icon128.png
└── privacy-policy.md

Settings

Setting Default Description
Tracked products All 4 Which Claude surfaces to include
Alert thresholds 50 / 75 / 90 % Notification triggers (% of daily avg)
Baseline window 7 days Rolling average used for relative comparisons

Roadmap


Contributing

PRs welcome. Open an issue first for anything beyond a small bug fix.


License

MIT © Ashutosh-Sharma-IN


Disclaimer

This extension reads token-count metadata from Anthropic’s API responses on claude.ai. It does not read, store, or transmit message content. Claude and claude.ai are trademarks of Anthropic. This project is not affiliated with or endorsed by Anthropic.