soulduse/ai-token-monitor
Über uns
macOS-Menüleisten-App zur Erfassung des Tokenverbrauchs und der Kosten von Claude Code
EntwicklerwerkzeugeGemessener Sternzuwachs
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +9
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
OriginalAI Token Monitor

AI Token Monitor is a lightweight system tray app for macOS and Windows that answers one question, all day long: how much are my AI coding tools actually costing me? It reads the local session logs that Claude Code, Codex, OpenCode, Gemini CLI, GJC, Grok, Kiro, OmO, Pi, omp, Antigravity CLI, and Hermes Agent already write, prices every token with per-model rates (cache reads included), and puts today's spend right next to your clock — with charts, plan-limit alerts, an opt-in leaderboard, chat, and webhook notifications one click away.
- Zero setup — no API keys, no proxies. If you've run Claude Code or Codex once, it just works.
- Spend at a glance — live cost in the menu bar / system tray, full dashboard on click.
- Stay ahead of limits — live 5-hour session & weekly plan bars, plus Discord / Slack / Telegram alerts before you hit the wall.
- Private by design — 100% offline by default; leaderboard, chat, and webhooks are strictly opt-in.
| Overview | Analytics | Leaderboard |
|---|---|---|
![]() |
![]() |
![]() |
| Today's usage, 7-day chart, weekly/monthly totals | Activity graph, 30-day trends, model breakdown | Compare usage with other developers |
Download
| Platform | File | Notes |
|---|---|---|
| macOS (Apple Silicon) | .dmg |
Intel Mac support coming soon |
| Windows | .exe installer |
Windows 10+ (WebView2 required, auto-installed) |
How It Works

- Reads local session logs — watches the JSONL files your AI CLIs already write (see Data Sources for exact paths)
- Parses & prices locally — a Rust engine deduplicates entries, applies per-model pricing (cache reads included), and re-aggregates the moment a file changes
- Shows it everywhere — tray cost ticker, dashboard charts, plan-limit alert bar, and optional webhook notifications
Everything above happens on your machine. The app makes zero network requests unless you opt in to the leaderboard, chat, or webhooks — and even then only aggregated counts are shared, never code or conversation content.
Features

Tracking & Visualization
- Real-time token tracking — parses session JSONL files from Claude Code, Codex, and OpenCode for accurate usage stats
- Multi-provider support — switch between Claude / Codex / OpenCode sources, with per-provider cost models
- Multiple config directories — aggregate work + personal accounts by adding several Claude/Codex roots
- Daily chart — 7/30 day token or cost bar chart with Y-axis labels
- Activity graph — GitHub-style contribution heatmap with 2D/3D toggle and year navigation
- Period navigation — browse weekly/monthly totals with
< >arrows - Model breakdown — Input/Output/Cache ratio visualization
- Cache efficiency — donut chart showing cache hit ratio
- Usage alerts bar — live 5-hour session + weekly plan limits (optional Claude OAuth sign-in)
Social & Sharing
- Leaderboard — compare daily/weekly/monthly usage with other developers (GitHub OAuth, opt-in)
- 7-day TOP 10 grid — at-a-glance ranking history
- Mini profile — activity heatmap, streaks, external profile links
- Badges — card / compact / flat-square styles, export as PNG / SVG / Markdown, or embed a live badge URL in your GitHub README
- Chat — in-app chat for leaderboard members with mentions, replies, image attachments, unread counter, typing indicators, and AI translation
- AI Report (Wrapped) — monthly/yearly recap card with top model, busiest day, and streaks
- Receipt view — receipt-style usage summary for today / week / month / all-time
- Salary comparator — see your monthly AI spend as a share of your salary (lattes / Netflix / chicken)
- Share & export — copy summary markdown, capture screenshot, or copy an app share message from the header menu
Notifications & Alerts
- Tray cost — today's cost shown next to the tray icon (macOS menu bar title, Windows tooltip)
- Webhook notifications — Discord, Slack, and Telegram alerts when usage crosses thresholds or resets
- Auto-updater — in-app update notifications with download progress
Customization
- 4 themes — GitHub (green), Purple, Ocean, Sunset — with Auto/Light/Dark mode
- 10 languages — English, 한국어, 日本語, 简体中文, 繁體中文, Français, Español, Deutsch, Türkçe, Italiano
- Compact / full number format —
377.0Kvs377,000 - Launch on startup — optional auto-start on boot
- AI translation — bring your own Gemini / OpenAI / Anthropic API key to translate chat messages (keys are encrypted locally)
- Auto-hide window — hides when clicking outside
Install from Source
Prerequisites
- Node.js 18+
- Rust toolchain
- Tauri CLI v2
- Claude Code, Codex, or OpenCode installed and used at least once
Build
git clone https://github.com/soulduse/ai-token-monitor.git
cd ai-token-monitor
npm install
npm run tauri dev # development mode
npm run tauri build # production build
Usage
Basics
- Launch the app — an icon appears in the system tray (macOS menu bar / Windows taskbar)
- Click the icon to open the dashboard
- Switch between Overview, Analytics, Leaderboard, and Chat tabs
Tabs
| Tab | Content |
|---|---|
| Overview | Today's summary, 7-day chart, weekly/monthly totals, 8-week heatmap, usage alert bar |
| Analytics | Full-year activity graph (2D/3D), 30-day chart, model breakdown, cache efficiency |
| Leaderboard | Rank against other users, 7-day TOP 10 grid, badges, mini profiles |
| Chat | Realtime chat with leaderboard members — mentions, replies, images, AI translation |
Header actions
The header exposes a share button, a ⋯ more dropdown, and a ⚙ settings button. The more menu contains:
- GitHub repository — open the repo in your browser
- AI Report — see your monthly/yearly recap
- Receipt — receipt-style usage summary
- Share app — copy a recommendation message + repo link
- Capture screenshot — copy the current view to the clipboard
Settings
Settings is organized into four tabs:
| Tab | Options |
|---|---|
| General | Theme, language, appearance, number format, menu bar cost, launch on startup, monthly salary, usage alerts, Claude/Codex directories, Claude usage tracking (OAuth) |
| Account | GitHub sign-in, leaderboard opt-in, profile links |
| AI | Gemini / OpenAI / Anthropic API keys for chat translation (encrypted locally) |
| Webhooks | Discord / Slack / Telegram webhook URLs, alert thresholds, monitored windows, reset notifications |
Leaderboard & chat
- Enable Share Usage Data in Settings → Account
- Click Sign in with GitHub
- See your rank in the Leaderboard tab and join the Chat tab
Shared data: daily token count, cost, messages/sessions. No code or conversation content is shared.
Data Sources
| Provider | Path | Notes |
|---|---|---|
| Claude Code | ~/.claude/projects/**/*.jsonl |
Session/tool-call counts from ~/.claude/stats-cache.json. Supports multiple roots. |
| Codex | ~/.codex/sessions/**/*.jsonl |
Supports multiple roots. |
| OpenCode | ~/.local/share/opencode/**/*.jsonl |
Per-model pricing from bundled registry. |
| Gemini CLI | ~/.gemini/tmp/*/chats/session-*.jsonl (+ subagent chats/<session>/*.jsonl, legacy session-*.json) |
Per-response tokens (prompt / cached / candidates / thoughts / tool); cached tokens are carved out of the prompt count, thoughts bill as output; Pro models switch to long-context rates above 200k prompt tokens. Dedup by message id. Gemini CLI deletes chats older than 30 days by default (general.sessionRetention), so older history disappears with them. |
| GJC (Gajae Code) | ~/.gjc/agent/sessions/**/*.jsonl |
Per-message usage (message.usage) with pre-computed cost; dedup by API response id. Supports multiple roots. |
| Grok | ~/.grok/logs/unified.jsonl |
Exact per-request tokens from shell.turn.inference_done; model/project joined from ~/.grok/sessions. Grok truncates this rolling log, so days are accumulated into a local snapshot. SuperGrok weekly credits are read from billing: fetched credits config. macOS, Linux, and Windows (%USERPROFILE%\\.grok). |
| Kiro | ~/.kiro/sessions/cli/*.json + data.sqlite3 |
Credits, not tokens — Kiro meters a per-turn "unit of work" and records no token counts anywhere, so cost comes from credits (× $0.04, the overage rate). Interactive and non-interactive runs write to two separate stores with different key names; both are read. Turns left on Auto never record which model ran. |
| OmO Native | ~/.omo/agent/sessions/*/*.jsonl + OmO Desktop sessions at ~/.omo/desktop/userdata/omo-sessions/*/*.jsonl (verified on macOS) + subagent sessions at <project>/.omo/senpi-task/children/** |
Per-message usage with pre-computed cost; dedup by API response id. Honors OMO_CODING_AGENT_DIR, plus a flat custom session dir from OMO_CODING_AGENT_SESSION_DIR or sessionDir in the agent dir's settings.json(c) (scanned alongside the default root). |
| Pi | ~/.pi/agent/sessions/*/*.jsonl |
Per-message usage with pre-computed cost; dedup by API response id (forked sessions count once). Honors PI_CODING_AGENT_DIR (leading ~ expanded), plus a flat custom session dir from PI_CODING_AGENT_SESSION_DIR or sessionDir in the agent dir's settings.json (scanned alongside the default root; per-run --session-dir is not discoverable). |
| omp (oh-my-pi) | ~/.omp/agent/sessions/*/*.jsonl |
Same session format as Pi (pre-computed cost, dedup by API response id). Also reads named profiles (~/.omp/profiles/<name>/agent/sessions), the XDG tree ($XDG_DATA_HOME/omp/sessions) once it exists, and subagent/advisor transcripts inside each session's folder. PI_CODING_AGENT_DIR/PI_CODING_AGENT_SESSION_DIR are left to the Pi source to avoid double counting. |
Antigravity CLI (agy, experimental) |
~/.gemini/antigravity-cli/conversations/*.db |
One SQLite db per conversation; per-call input/output tokens (thinking included) decoded from its undocumented protobuf metadata, priced with Gemini rates, dedup by response id. Cache reads are not reported by the CLI and count as 0. The Antigravity IDE's conversation files are encrypted and not supported. |
| Hermes Agent | $HERMES_HOME/state.db (default ~/.hermes/state.db) + <home>/profiles/*/state.db for hermes profile |
Per-model usage from session_model_usage (incl. auxiliary calls such as compression, vision and title generation) plus the sessions totals it doesn't cover; uses Hermes' own actual/estimated cost. |
Network requests: only when leaderboard/chat is opted in (sends aggregated data to Supabase) or when a webhook fires. Without these features, the app runs completely offline. AI translation keys, if set, call the provider you chose directly.
Architecture
┌────────────────────────────────────┐
│ Frontend (React 19 + Vite) │
│ ├── PopoverShell / Header │
│ ├── TabBar (4 tabs) │
│ ├── TodaySummary / DailyChart │
│ ├── ActivityGraph (2D/3D) / Heatmap│
│ ├── ModelBreakdown / CacheEfficiency│
│ ├── Leaderboard + Grid + Badges │
│ ├── Chat + MentionAutocomplete │
│ ├── MiniProfile / Wrapped / Receipt│
│ ├── SalaryComparator / UsageAlertBar│
│ └── SettingsOverlay (4 tabs) │
├────────────────────────────────────┤
│ Backend (Tauri v2 / Rust) │
│ ├── JSONL session parsers (Claude/Codex/OpenCode)│
│ ├── File watcher (notify) │
│ ├── Tray icon + cost display │
│ ├── Auto-updater │
│ ├── Webhook dispatcher │
│ └── Preferences + encrypted secrets│
├────────────────────────────────────┤
│ External services (opt-in) │
│ ├── Supabase (leaderboard + chat) │
│ ├── Discord / Slack / Telegram │
│ └── Gemini / OpenAI / Anthropic │
└────────────────────────────────────┘
Platform Support
| Platform | Status | Notes |
|---|---|---|
| macOS | Supported | Menu bar integration, dock hiding, tray cost title |
| Windows | Supported | System tray integration, NSIS installer, tooltip cost display |
| Linux | Untested | May work since Tauri supports Linux |
Support
If you find this project useful, consider buying me a coffee.
License
MIT
Ähnliche Projekte entdecken
Wird geladen…


