https://github.com/mm7894215/tokentracker
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.
https://github.com/mm7894215/tokentracker
ai-tools claude-code cli codex-cli cost-tracker cursor developer-tools gemini-cli llm local-first macos menubar privacy-first token-tracker usage-tracker widget
Last synced: 6 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/mm7894215/tokentracker
- Owner: mm7894215
- License: mit
- Created: 2026-04-05T12:02:23.000Z (22 days ago)
- Default Branch: main
- Last Pushed: 2026-04-18T17:33:43.000Z (9 days ago)
- Last Synced: 2026-04-18T18:35:45.624Z (9 days ago)
- Topics: ai-tools, claude-code, cli, codex-cli, cost-tracker, cursor, developer-tools, gemini-cli, llm, local-first, macos, menubar, privacy-first, token-tracker, usage-tracker, widget
- Language: JavaScript
- Homepage: https://token.rynn.me
- Size: 18 MB
- Stars: 129
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# TOKEN TRACKER
**Track AI Token Usage Across All Your CLI Tools**
[](https://token.rynn.me)
[](https://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/tokentracker-cli)
[](https://nodejs.org/)
[](https://www.apple.com/macos/)

---
## Two Ways to Use
### Option A: macOS Menu Bar App (Recommended)
Download `TokenTrackerBar.dmg` from the [latest release](https://github.com/mm7894215/tokentracker/releases/latest), drag to Applications, done.
- Lives in your menu bar — click to see usage stats
- Auto-syncs data from all supported CLI tools
- No terminal, no Node.js, no setup required
- **Clawd pixel companion** — animated menu bar icon with breathing, blinking, and eye tracking
- **Interactive dashboard buddy** — Clawd reacts to your usage data with 30+ contextual quips, 5 tap animations, and data-driven moods
### Option B: CLI + Web Dashboard
```bash
npx tokentracker-cli
```
One command does everything: first-time setup → hook installation → data sync → open dashboard at `http://localhost:7680`.
Install globally for shorter commands:
```bash
npm i -g tokentracker-cli
tokentracker # Open dashboard
tokentracker sync # Manual sync
tokentracker status # Check hook status
tokentracker doctor # Health check
```
---
## Leaderboard
Compare your token usage with developers worldwide. Sign in to join the ranking.
## Features
- **Multi-Source Tracking** — Claude Code, Codex CLI, Cursor, Kiro, Gemini CLI, OpenCode, OpenClaw, Every Code
- **Local-First** — All data stays on your machine. No cloud account required.
- **Zero-Config** — Hooks auto-detect and configure on first run
- **Built-in Dashboard** — Web UI with usage trends, model breakdowns, heatmaps
- **Leaderboard** — Global ranking with weekly, monthly, and all-time stats
- **Privacy-First** — Only token counts tracked, never prompts or responses
## Supported CLI Tools
| CLI Tool | Auto-Detection |
|----------|----------------|
| **Claude Code** | ✅ |
| **Codex CLI** | ✅ |
| **Cursor** | ✅ (via API) |
| **Kiro** | ✅ |
| **Gemini CLI** | ✅ |
| **OpenCode** | ✅ |
| **OpenClaw** | ✅ |
| **Every Code** | ✅ |
## How It Works
```
AI CLI Tools (Claude, Codex, Cursor, Kiro, Gemini, OpenCode, ...)
│
│ hooks auto-trigger on usage
▼
Token Tracker (local parsing + aggregation)
│
│ 30-minute UTC buckets
▼
Dashboard (Menu Bar App or localhost:7680)
```
1. AI CLI tools generate logs during usage
2. Lightweight hooks detect changes and trigger sync (Cursor: usage pulled via API)
3. CLI parses logs locally, extracts only token counts
4. Data aggregated into 30-minute buckets
5. Dashboard reads local data directly — no cloud needed
## Privacy
| Protection | Description |
|------------|-------------|
| **No Content Upload** | Never uploads prompts or responses — only token counts |
| **Local Only** | All data stays on your machine, all analysis local |
| **Transparent** | Audit the sync logic in `src/lib/rollout.js` — only numbers and timestamps |
## Configuration
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `TOKENTRACKER_DEBUG` | Enable debug output (`1` to enable) | - |
| `TOKENTRACKER_HTTP_TIMEOUT_MS` | HTTP timeout (ms) | `20000` |
| `CODEX_HOME` | Codex CLI directory override | `~/.codex` |
| `GEMINI_HOME` | Gemini CLI directory override | `~/.gemini` |
## Development
```bash
git clone https://github.com/mm7894215/tokentracker.git
cd tokentracker
npm install
# Build and run web dashboard
cd dashboard && npm install && npm run build && cd ..
node bin/tracker.js
# Run tests
npm test
```
### Building the macOS App
```bash
cd TokenTrackerBar
npm run dashboard:build # Build dashboard (from repo root)
./scripts/bundle-node.sh # Download Node.js + bundle tokentracker
xcodegen generate # Generate Xcode project
ruby scripts/patch-pbxproj-icon.rb # Patch Icon Composer support
xcodebuild -scheme TokenTrackerBar -configuration Release clean build
./scripts/create-dmg.sh # Create distributable DMG
```
Requires: Xcode 16+, [XcodeGen](https://github.com/yonaskolb/XcodeGen)
## Credits
Clawd pixel art inspired by [Clawd-on-Desk](https://github.com/Angel2518975237/Clawd-on-Desk) by [@marciogranzotto](https://github.com/marciogranzotto).
Clawd character design belongs to Anthropic. This is a community project with no official affiliation with Anthropic.
## License
[MIT](LICENSE)
---