Requires Node.js 22+. Two sources need a little more:
- OpenCode, Kilo CLI, Cursor, Zed, Codex Desktop and Antigravity keep history in
SQLite and need 22.13+ (or 23.4+) for
node:sqlite. On older Node those sources stay empty. - DeepSeek Harness compresses its logs with zstd and needs 22.15+. On older Node its compressed sessions are skipped, with a warning naming how many.
Tokmeter sends no provider credentials. Pricing downloads public catalogs, and
--light skips that for one command. The daemon refreshes them on its own about
daily whatever --light says. See
Security and privacy.
Try it without installing
npx -y @sriinnu/tokmeter --today
CLI + TUI
npm install -g @sriinnu/tokmeter
tokmeter --today
tokmeter-tui
Daemon, MCP server, statusline
These live in @sriinnu/tokmeter-mcp:
npm install -g @sriinnu/tokmeter-mcp
tokmeter-mcp daemon start # warm aggregation daemon (HTTP 9877, WS 9876)
tokmeter-mcp serve # MCP server over stdio
tokmeter-mcp statusline # one statusline tick
MCP client config (stdio):
{ "command": "npx", "args": ["-y", "@sriinnu/tokmeter-mcp", "serve"] }
For Claude Code, register it with its CLI instead of editing a file:
claude mcp add tokmeter --scope user -- npx -y @sriinnu/tokmeter-mcp serve
Since 1.15.0, tokmeter-mcp install-mcp runs claude mcp add for you. Older
versions wrote the entry to ~/.claude/settings.json, which Claude Code doesn’t
load MCP servers from; if you set it up that way, delete that entry.
tokmeter-mcp install-all sets up the statusline and the MCP server for every
supported editor (tokmeter-mcp editors lists them). Releases up to 1.19.3
also added Claude Code PreToolUse “guard” hooks that pointed at scripts which
don’t exist on your machine; nothing installs them any more, and
tokmeter-mcp install-hooks is now a no-op. If you ran install-hooks or
install-all on one of those releases, upgrade first, then run
tokmeter-mcp uninstall-hooks: it removes only those guard entries and leaves
your own hooks alone.
The default command launches a terminal UI, so the MCP entry point is the
serve subcommand. On macOS, tokmeter-mcp daemon install-agent installs a
launchd LaunchAgent so the daemon auto-starts at login and respawns on crash.
After every upgrade, restart the daemon so the new version replaces the running process:
tokmeter-mcp daemon restart
tokmeter-mcp daemon status
The token is created under ~/.tokmeter/daemon/; keep that directory private.
Existing Tokmeter settings and caches are tightened to owner-only permissions
as the new version uses them.
macOS menubar app
Apple silicon, macOS 14+.
brew install --cask sriinnu/homebrew-tap/tokmeterbar
Or download TokmeterBar-<version>.zip from
GitHub Releases and move it to
/Applications. The app auto-updates via Sparkle from a signed appcast. It needs
Node.js 22+ with npx for the local daemon.
Something wrong or out of date? This page is generated from its source on GitHub, at the revision this site was checked against.