A chrome extension to view your codex or claude code usage.
翻譯準備中
外掛JavaScript · ShellGitHub @boblee0717自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
安裝型專案無需部署網域也可驗證。個人儲存庫可透過 GitHub 登入驗證,組織儲存庫可使用上方的儲存庫驗證檔案。
正在載入完整 README。 以下為已儲存的摘錄。
A local-first usage dashboard for your AI coding tools — Codex, TraeX, Claude Code, DeepSeek, Cursor, and Kimi Code. See it in a Chrome popup or a macOS menu-bar app: token counts, estimated cost (totalled across all providers), plan-usage %, and balances at a glance.
Built for personal and team use: install it, adapt it, and make your own version.
Everything starts from one clone; then you choose how you want to see your usage. On
macOS you can run the menu-bar app on its own, the Chrome extension on its own, or both.檢視完整 README ↗A local-first usage dashboard for your AI coding tools — Codex, TraeX, Claude Code, DeepSeek, Cursor, and Kimi Code. See it in a Chrome popup or a macOS menu-bar app: token counts, estimated cost (totalled across all providers), plan-usage %, and balances at a glance.
Built for personal and team use: install it, adapt it, and make your own version.
Everything starts from one clone; then you choose how you want to see your usage. On macOS you can run the menu-bar app on its own, the Chrome extension on its own, or both.
| Setup | One command | What you get | Needs Chrome running? |
|---|---|---|---|
| 🎫 macOS menu bar (standalone) | ./install.sh --menubar | Every tool's tokens / cost / requests + Cursor plan-usage % & cost + local Codex quota snapshots, in the menu bar | No — updates with Chrome closed |
| 🧩 Chrome extension (popup) | ./install.sh + load unpacked | The same, in a popup — plus Claude.ai plan usage and Codex browser analytics when available | Yes |
| Both | --menubar + load the extension | Menu bar and popup; the extension adds Claude.ai usage and can refresh older Codex quota windows | Yes |
Why two paths? Token/cost and canonical Codex
rate_limitssnapshots come from local logs, and Cursor's usage is reachable with your saved cookie — so the menu bar runs standalone. Cloudflare prevents a standalone fetch of browser analytics: Claude.ai needs the extension, while Codex analytics from the extension can provide a newer record for the same quota window than the local snapshot.
What shows where:
| Data | 🎫 Menu bar | 🧩 Extension |
|---|---|---|
| Local tokens / cost / requests (Claude Code · Codex · TraeX · Kimi Code · DeepSeek) | ✅ | ✅ |
| Cursor tokens / cost / plan-usage % | ✅ | ✅ |
Codex quota % from local canonical rate_limits | ✅¹ | ✅ |
| Claude.ai plan usage + newer Codex browser analytics | ↳ from the extension² | ✅ |
| Show / hide providers | — | ✅ |
¹ Local Codex quota is only as recent as the newest token_count snapshot; it is not a live server fetch.
² Cloudflare blocks a standalone browser-analytics fetch. The extension caches Claude.ai usage and any Codex analytics it can read; the menu bar keeps the newer record for each Codex quota window.
First, clone (or hand this repo to your coding agent and say "install this" — ~1 min):
git clone https://github.com/boblee0717/oh-my-tokens.git /tmp/oh-my-tokens
cd /tmp/oh-my-tokens
./install.sh --menubar # host + SwiftBar (free, notarized) + the 🎫 plugin
A 🎫 item appears showing today's total estimated cost and total tokens; the dropdown breaks down
plan-usage % and per-provider tokens/cost in one tap. Cursor and local Codex quota snapshots
(when the logs contain canonical rate_limits) refresh on their own, so they remain available
with Chrome closed.
Details + uninstall: menubar/README.md.
macOS / Linux:
./install.sh # registers the native host (fixed Extension ID)
# --deepseek-key sk-... also set the DeepSeek key (→ ~/.oh-my-tokens/config.json)
# --browser canary|beta|edge
# --launch quit Chrome first, then auto-load the extension (no manual step)
Windows (PowerShell):
git clone https://github.com/boblee0717/oh-my-tokens.git $env:TEMP\oh-my-tokens
powershell -ExecutionPolicy Bypass -File $env:TEMP\oh-my-tokens\install.ps1
# -DeepSeekKey sk-... also set the DeepSeek key (→ ~/.oh-my-tokens/config.json)
# -Browser edge|chromium|beta|canary
The installer copies the host runtime to ~/.oh-my-tokens/native-host/ and registers the
browser against that stable path (on Windows via the per-user registry, run-host.cmd, no
admin). Then load the extension once: chrome://extensions → Developer mode → Load unpacked
→ extension/ (or quit Chrome and use --launch). Extension ID is fixed:
obmkhlamcmbmacadoolbfaagmojdobah.
Why a host? A sandboxed extension can't read local files, so it reads your
~/.claude/~/.codex/~/.trae/clilogs through a Native Messaging host.install.shautomates everything scriptable; only loading an unpacked extension into an already-running Chrome needs a click.
Run ./install.sh --menubar and load the extension (Option B). The menu bar then adds
Claude.ai plan usage, and can replace an older local Codex quota window with a newer browser
analytics record.
~/.claude/ /
~/.codex/ / ~/.trae/cli / ~/.kimi-code, i.e. %USERPROFILE%\.claude / %USERPROFILE%\.codex /
%USERPROFILE%\.trae\cli / %USERPROFILE%\.kimi-code on Windows).For DeepSeek balance: install.sh --deepseek-key sk-..., the extension Options page, or
~/.oh-my-tokens/config.json:
{ "deepseekApiKey": "sk-..." }
node ~/.oh-my-tokens/native-host/host/index.js.When the installed checkout is behind its upstream, both surfaces show an update reminder:
chrome://extensions.The updater refuses to run when the source checkout has local changes. It never force-resets or stashes your work.
Don't use one of the providers? Hide it from the pills at the top of the popup or the Options page — a hidden provider is neither displayed nor queried.
These tools track usage separately (or not in a glanceable way). oh-my-tokens aggregates token counts, estimated cost, and remaining balance into one place — a Chrome popup or a macOS menu bar.
One Native Messaging host (log parsers + a DeepSeek client + a standalone Cursor fetch) feeds two independent viewers. No long-running daemon and no open port: the host runs on demand, reads logs / calls APIs, returns JSON, and exits.
Chrome extension (popup) ─┐ ┌─▶ ~/.claude, ~/.codex, ~/.trae/cli, ~/.kimi-code
├─▶ Native host ───────▶├─▶ api.deepseek.com (balance, your key)
macOS menu bar (SwiftBar)─┘ (on-demand) └─▶ cursor.com (your saved cookie)
Both viewers read the same host. The menu bar runs the host CLI on a ~1-minute timer and needs no extension, including for local canonical Codex quota snapshots. The extension adds browser-only Claude.ai plan usage and, when available, newer Codex analytics behind Cloudflare.
| Tool | Source | What we get |
|---|---|---|
| Claude Code | local JSONL ~/.claude/projects/**/*.jsonl | per-message tokens + estimated cost by model |
| Codex | local ~/.codex/sessions/ + archived_sessions/ canonical rate_limits snapshots; browser analytics cache when the extension can read it | session tokens + estimated cost (OpenRouter list price for supported exact models) + local 5h/weekly quota, plan, reset; newer browser analytics may replace the same window |
| TraeX | local JSONL $TRAE_CLI_HOME/sessions/** or ~/.trae/cli/sessions/** | session tokens + estimated cost when the model is priced + quota %/credits when rate_limits are present |
| Kimi Code | local ~/.kimi-code/sessions/**/wire.jsonl | per-turn tokens by model (no cost estimate — no authoritative price source yet) |
| DeepSeek | DeepSeek API (balance) + platform.deepseek.com (token usage) | balance + per-model per-day token usage |
| Cursor | cursor.com dashboard API (popup; and the menu-bar host standalone, via your saved cookie) + local sqlite fallback | per-model tokens + estimated cost, quota %; prompts login when signed out |
Codex, TraeX, Claude Code, and Cursor quota % render as progress bars; DeepSeek shows balance. Cost figures are estimates, not billing — Claude uses a published price table; Codex uses static OpenRouter list prices for GPT-5.6 Luna, Terra, and Sol (including Pro variants), then falls back to the generic GPT estimate for other model names; TraeX uses the same generic estimate when its model names match it; Cursor uses its own per-event reported value; Kimi Code shows tokens only, no cost (no authoritative price source yet). Edit host/pricing.js to update the static table. In the menu bar, Codex quota comes from the latest local canonical snapshot (not a live fetch); if the extension has newer browser analytics, the menu bar keeps that newer record per quota window. Claude.ai remains extension-provided, while Cursor remains standalone.
oh-my-tokens/
├─ extension/ # MV3 Chrome extension (no build step, no deps)
├─ host/ # Native Messaging host (log parsers + DeepSeek client + standalone Cursor fetch)
│ └─ parsers/ # claude / codex / traex / deepseek / cursor / kimi
├─ menubar/ # macOS menu-bar app (SwiftBar plugin + installer)
├─ shared/ # UsageRecord schema
└─ README.md
Log parsing happens entirely on your machine. The host returns only aggregated usage (no raw prompts/responses). The only outbound calls are to DeepSeek's API (with your key) and to claude.ai / platform.deepseek.com / cursor.com for quota and token usage.
Menu-bar standalone fetch (macOS): to show Cursor usage without Chrome open, the host reads your saved cursor.com cookie from the local Chrome cookie store — decrypted with the key in your login Keychain (you approve this once via the standard macOS prompt). The cookie is used only to call cursor.com from your own machine; it is never logged, stored elsewhere, or sent anywhere but cursor.com.
MIT. In plain English: anyone can use, copy, modify, and redistribute this project, including for their own customized version.
See LICENSE for the full text.
Ready to use on macOS and Windows (Chrome, Edge, or Chromium); the optional menu-bar app is macOS-only. On Windows the Cursor local fallback parser needs a sqlite3 CLI on PATH (not bundled with Windows); without it Cursor data still comes from the web connector, which is the primary source. Linux follows the macOS path (install.sh).