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).