Claude Token Monitor 🚀
⚠️ Disclaimer: This is an unofficial community-driven tool and is not affiliated, associated, endorsed by, or in any way officially connected with Anthropic, PBC.
Ever wonder how much of your Claude quota you've burned through mid-session? Claude Token Monitor is a local-first desktop utility that gives you a beautiful, always-on-top floating HUD showing your Claude usage in real time — covering both Claude.ai Web App quota and Claude Code CLI token consumption.
🔗 GitHub Repository: github.com/glatinone/claude-token-monitor-usage
📸 What It Looks Like
The HUD uses a sleek glassmorphism design with a circular progress ring that dynamically changes color:
- 🟢 Green — Low usage
- 🟡 Amber — Medium usage
- 🔴 Red — High usage (time to slow down!)
You can drag it anywhere on your screen, collapse it into a tiny title pill with a double-click, and control it via the system tray.
✨ Key Features
-
Double-Sync Strategy:
-
Standalone Mode — Direct API polling using your saved
sessionKeycookie - Browser Extension Sync — A companion Chrome Extension pushes live stats the moment you send a message on claude.ai
-
Standalone Mode — Direct API polling using your saved
- Always-on-Top Floating HUD — Circular progress ring, remaining quota %, and reset timer
- Draggable & Position Memory — Drag it wherever you want; position is saved on exit
- Claude Code CLI Integration — Real-time token parsing (Input, Output, Cache Write, Cache Read) with USD cost estimation based on Claude Sonnet pricing
- Single-Instance Protection — TCP socket lock prevents duplicate processes or tray icon spam
-
100% Private & Offline-First — All data lives in
usage_data.jsonon your machine. The local server binds only to127.0.0.1
🛠️ Architecture
Here's how the pieces fit together:
Web Browser (claude.ai)
└── Chrome Extension MV3
└── POST JSON ──────────────────────┐
▼
Terminal / IDE Desktop App (Python)
└── Claude Code CLI ├── Local HTTP Server :9988
└── Writes logs ──► ├── Log Watcher
~/.claude/projects/ ├── Direct API Fetcher
*.jsonl ├── Storage Manager
├── CTk Floating HUD
└── Tray Manager
-
Log Watcher — Monitors
%USERPROFILE%\.claude\projects\*.jsonlfor CLI token events - Local HTTP Server (port 9988) — Receives pushed JSON payloads from the Chrome Extension
-
Direct Fetcher — Polls the Claude API directly using your
sessionKeycookie when the extension isn't running
🚀 Installation & Setup
Prerequisites
- Python 3.10+
- Windows OS
1. Install the Desktop App
git clone https://github.com/glatinone/claude-token-monitor-usage.git
cd claude-token-monitor-usage
pip install -r requirements.txt
python -m app.main
Windows users can just double-click
run.batto install dependencies and launch in one step.
2. Standalone Mode (Session Key Setup)
To let the app query your quota directly without the extension:
- Open claude.ai and log in
- Press
F12→ Application → Cookies →https://claude.ai - Copy the value of the
sessionKeycookie (starts withsk-ant-sid...) - Right-click the C tray icon → Setup Session Key
- Paste and click OK — the widget syncs automatically!
3. Chrome Extension (Optional but Recommended)
- Open
chrome://extensions - Enable Developer Mode
- Click Load Unpacked → select the
extension/folder - Open claude.ai and send a message — your quota syncs instantly!
🔒 Security & Privacy
-
Zero Cloud Sharing — Usage data stays strictly in
app/usage_data.jsonon your local disk -
Localhost Lock — The API server binds to
127.0.0.1only; no LAN access -
Credential Isolation — The Chrome Extension never touches your
sessionKey. It's stored locally inapp/config.json(git-ignored)
🤝 Contributing
Contributions are very welcome! Whether it's Linux/macOS support, UI improvements, or better CLI log parsing:
- Fork the repo
- Create your branch:
git checkout -b feature/AmazingFeature - Commit:
git commit -m 'Add AmazingFeature' - Push:
git push origin feature/AmazingFeature - Open a Pull Request
📄 License
MIT License — free to use, modify, and distribute.
🔗 Check out the full project on GitHub: github.com/glatinone/claude-token-monitor-usage
If you find it useful, drop a ⭐ on the repo and share it with fellow Claude power users!
Top comments (0)