by mm7894215
Track Claude Code, Codex, Cursor, Gemini, Kiro, OpenCode, OpenClaw & Every Code token usage. Local-first, zero-config, with a beautiful dashboard, native macOS menu bar app, and 4 desktop widgets.
# Add to your Claude Code skills
git clone https://github.com/mm7894215/TokenTrackerAuto-collect token counts from 8 AI coding tools, aggregate them locally, and see real cost trends in a beautiful dashboard. No cloud account, no API keys, no setup — just one command.
⭐ If TokenTracker saves you time, please star it on GitHub — it helps other developers find it.
Requirements: Node.js 20+ (CLI runs on macOS / Linux / Windows; menu bar app and Cursor SQLite reader are macOS-only).
npx tokentracker-cli
That's it. First run installs hooks, syncs your data, and opens the dashboard at .
No comments yet. Be the first to share your thoughts!
http://localhost:7680What you get in 30 seconds:
localhost:7680 with usage trends, model breakdown, cost analysisWant a native macOS menu bar app? Download
TokenTrackerBar.dmg→ drag to Applications. Includes desktop widgets, menu bar status icon, and the same dashboard in a WKWebView.
Install globally for shorter commands:
npm i -g tokentracker-cli
tokentracker # Open the dashboard
tokentracker sync # Manual sync
tokentracker status # Check hook status
tokentracker doctor # Health check
Prefer brew? Install directly — no extra tap step needed:
# macOS menu bar app (DMG)
brew install --cask mm7894215/tokentracker/tokentracker
# CLI only
brew install mm7894215/tokentracker/tokentracker
Upgrade with brew upgrade --cask mm7894215/tokentracker/tokentracker. The tap auto-bumps within an hour of every new release.
Dashboard — usage trends, model breakdown, cost analysis
Desktop Widgets — pin usage to your desktop
Menu Bar App — animated Clawd companion + native panels
Global Leaderboard — compare with developers worldwide
| Tool | Detection | Method |
|---|---|---|
| Claude Code | ✅ Auto | SessionEnd hook in settings.json |
| Codex CLI | ✅ Auto | TOML notify hook in config.toml |
| Cursor | ✅ Auto | API + SQLite auth token |
| Kiro | ✅ Auto | SQLite + JSONL hybrid |
| Gemini CLI | ✅ Auto | SessionEnd hook |
| OpenCode | ✅ Auto | Plugin system + SQLite |
| OpenClaw | ✅ Auto | Session plugin |
| Every Code | ✅ Auto | TOML notify hook |
Missing your tool? Open an issue — adding new providers is usually one parser file away.
| | TokenTracker | ccusage | Cursor stats | |--------------------------|:---:|:---:|:---:| | AI tools supported | 8 | 1 (Claude) | 1 (Cursor) | | Local-first, no account | ✅ | ✅ | ❌ | | Native menu bar app | ✅ | ❌ | ❌ | | Desktop widgets | ✅ 4 widgets | ❌ | ❌ | | Rate-limit tracking | ✅ 6 providers | ❌ | Cursor only |
flowchart LR
A["AI CLI Tools<br/>Claude · Codex · Cursor<br/>Gemini · Kiro · OpenCode · ..."]
A -->|hooks trigger| B[Token Tracker]
B -->|parse logs<br/>30-min UTC buckets| C[(Local SQLite)]
C --> D[Web Dashboard]
C --> E[Menu Bar App]
C --> F[Desktop Widgets]
C -.->|opt-in| G[(Cloud Leaderboard)]
| Protection | Description |
|---|---|
| No content upload | Only token counts and timestamps. Never prompts, responses, or file contents. |
| Local-only by default | All data stays on your machine. The leaderboard is fully opt-in. |
| Auditable | Open source. Read src/lib/rollout.js — only numbers and timestamps. |
| No telemetry | No analytics, no crash reporting, no phone-home. |
Most users never need this — defaults are sensible. For advanced setups:
| Variable | Description | Default |
|---|---|---|
| TOKENTRACKER_DEBUG | Enable debug output (1 to enable) | — |
| TOKENTRACKER_HTTP_TIMEOUT_MS | HTTP timeout in milliseconds | 20000 |
| CODEX_HOME | Override Codex CLI directory | ~/.codex |
| GEMINI_HOME | Override Gemini CLI directory | ~/.gemini |
git clone https://github.com/mm7894215/TokenTracker.git
cd TokenTracker
npm install
# Build dashboard + run CLI
cd dashboard && npm install && npm run build && cd ..
node bin/tracker.js
# Tests
npm test
cd TokenTrackerBar
npm run dashboard:build # Build the dashboard bundle
./scripts/bundle-node.sh # Bundle Node.js + tokentracker source
xcodegen generate # Generate the Xcode project
ruby scripts/patch-pbxproj-icon.rb # Patch in the Icon Composer asset
xcodebuild -scheme TokenTrackerBar -configuration Release clean build
./scripts/create-dmg.sh # Package the .app into a DMG
Requires Xcode 16+ and XcodeGen.
TokenTracker requires Node 20+. Check your version:
node --version
The dashboard server picks the next free port automatically (7681, 7682, ...) when 7680 is taken. The actual port is logged on startup. If you want to force a specific port:
PORT=7700 tokentracker serve
To find what's holding 7680:
lsof -i :7680
Check the integration status:
tokentracker status
Then run the doctor for a deeper health check:
tokentracker doctor
If a provider shows as not configured even though you use it, try tokentracker activate-if-needed to re-run hook detection. If still missing, open an issue with the doctor output attached.
tokentracker uninstall
This removes every hook TokenTracker installed across all detected AI tools, plus the local config and data. Safe to re-run.