Claude Code usage
Tokenmeter
htop for AI Agents — monitor token usage, costs & tool calls across Claude Code and Codex in real time
Install
brew install --cask tt-a1i/tap/tmFound in the project README. Check it for setup steps after installing.
git clone https://github.com/tt-a1i/tokenmeter.gitFrom the README
TokenMeter
AI 编码 Agent 的本地用量仪表盘
English
用 CLI 报表和本地 Web Dashboard 监控 Claude Code、Codex 以及其他 AI 编码 Agent 的 Token 消耗、费用、工具调用和会话详情。
功能
Multi-source aggregation
- Claude Code / Codex 实时采集 — hooks、JSONL watcher 和 SQLite 统一到同一套报表。
- 15 个本地 source — Claude Code、Codex、OpenCode、Amp、Gemini CLI、GitHub Copilot CLI、Goose、Codebuff、Hermes、Kilo、Kimi、OpenClaw、pi-agent、Droid、Qwen。
- OpenCode SQLite 支持 — 自动读取新版 opencode.db,同时保留 JSON 文件兼容。
- Droid sidecar fallback — Droid session 主 JSON 缺 model 时,会从 sidecar JSONL 回填。
TokenMeter 独有实时能力(相对 ccusage)
- Live event stream — daemon 通过 Unix socket 接收 Claude hook 事件,并广播给 tm watch / Web Dashboard。
- Web Dashboard — tm web 提供费用趋势、热力图、模型/工具分布、会话详情和对话回顾。
- Budget alerts + webhooks — 月度预算、阈值提醒和 webhook endpoint 都在本地配置。
- Tool error pattern analysis — tm analyze --tool-errors 聚合失败工具、错误片段和高风险会话,这是 ccusage 没有的诊断视角。
Accurate pricing
- LiteLLM 运行期定价同步 — tm pricing refresh 更新 24 小时缓存;离线报告只使用本地缓存 / embedded fallback。
- Codex speed tier — --speed auto|standard|fast 支持 Codex 定价层;auto 会读取 ~/.codex/config.toml 的 service_tier。
- 模型感知估算 — Opus / Sonnet / Haiku / GPT-5 / GPT-4.1 等模型按 token 类型拆分成本。
Configuration and ergonomics
- 统一配置 — tm config show / tm config init 管理 ~/.tokenmeter/config.json,并兼容 legacy pricing.json / webhooks.json。
- 窄终端 compact 表格 — tm daily --compact 在小窗口下输出更紧凑的汇总。
- Blocks token limit — tm blocks --token-limit 100000 显示 5 小时窗口进度条和硬阈值。
- 项目别名归一化 — tm daily --instances --project-aliases '{"core":["/Users/admin/code/core"]}' 可把多个路径归并到同一项目名。
- 单二进制 — tm setup 注入 hooks 后即可采集,核心功能无外部服务依赖。
支持平台
安装
一键安装(推荐)
Homebrew Cask
仅当 release 流水线配置了 Homebrew tap 仓库和 HOMEBREW_TAP_GITHUB_TOKEN 时可用。
发布细节见 docs/release.md。
_Homebrew tap 仓库准备中;目前请用上面的一键安装脚本、go install 或 GitHub Releases 直装。_
Go Install
从源码构建
快速开始
Offline mode
--offline…Details
- Repository
- tt-a1i/tokenmeter
- Website
- tt-a1i.github.io/tokenmeter
- Language
- Go
- License
- MIT
- Last updated
- 2 November 2026
FAQ
What is Tokenmeter?
htop for AI Agents — monitor token usage, costs & tool calls across Claude Code and Codex in real time It is a usage for Claude Code, from tt-a1i/tokenmeter on GitHub.
How do I install Tokenmeter?
Run brew install --cask tt-a1i/tap/tm, then follow the setup in the README.
Is Tokenmeter popular?
tt-a1i/tokenmeter has 45 GitHub stars and 10 forks. It was last updated on 2 November 2026.
More usage & cost trackers
Claudemon
56keremerkan/claudemon
Live Claude Code usage in your macOS menu bar — download the signed, notarized DMG from Releases. Requires Claude Code CLI + macOS 14+.
Claude Statistics
48sj719045032/claude-statistics
A macOS menu bar app for monitoring Claude Code usage, session statistics, and cost tracking.
Agenttop
50vicarious11/agenttop
htop for AI coding agents — monitor token usage, costs, and workflows across Claude Code, Cursor, Kiro, Codex, and Copilot
Claude Code Stats
42AeternaLabsHQ/claude-code-stats
Track and visualize your Claude Code usage, costs, and session statistics with a local HTML dashboard.
Axon
49danieltamas/axon
Axon reads the logs your AI coding-agent harnesses already write — Claude Code, Codex, OpenCode — and shows which harness, project, agent, and model is working, how fast, at what cost, and how much code it's producing.
AI Usage Menubar
42burakgon/ai-usage-menubar
A tiny native macOS menu bar app for Claude Code and Codex usage limits.
Browse the most popular Claude Code mods, all usage & cost trackers, or the skills and MCP server directories.