Claude Token Monitor π β Real-Time Claude Usage HUD for Your Windows Desktop
Source: Dev.to
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 sessionKey cookie
Browser Extension Sync β A companion Chrome Extension pushes live stats the moment you send a message on claude.ai
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.json on your machine. The local server binds only to 127.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
Enter fullscreen mode
Exit fullscreen mode
Log Watcher β Monitors %USERPROFILE%\.claude\projects\*.jsonl for 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 sessionKey cookie when the extension isnβt running
π Installation & Setup
Prerequisites
-
Python 3.10+
-
Windows OS
- 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
Enter fullscreen mode
Exit fullscreen mode
Windows users can just double-click run.bat to install dependencies and launch in one step.
- 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!
- 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.json on your local disk
Localhost Lock β The API server binds to 127.0.0.1 only; no LAN access
Credential Isolation β The Chrome Extension never touches your sessionKey. Itβs stored locally in app/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!
