SuperAPI AI Directory

token-meter

Local dashboard for Claude Code and Codex token usage: cost, per-MCP and per-tool breakdown, hourly distribution and session drill-down.

Open website

About this tool

Token Meter is a local-first usage and cost dashboard for tracking token consumption and expenses for Claude Code and Codex. It reads the JSONL files that Claude Code and Codex have already written to disk, converting them into a visual dashboard that shows cost distribution by project, by model, by MCP tool, and by hour. All processing is done locally, no account is required, and no data is uploaded.

Main capabilities:

  • Cost statistics: Display dollar-equivalent costs by day, model, and project. The documentation explains that if you are on a subscription plan such as Max, this figure represents how much this usage would cost at API pricing, not the amount you actually paid.
  • MCP and tool details: Show which MCP server consumes the most tokens, the average duration of each tool, and the response size of each call.
  • Time distribution: Show the hourly distribution of output tokens.
  • Comparison view: View Claude Code and Codex data side by side in the same view.
  • Audit feature: Scan imported Claude Code and Codex history to find high-cost sessions, oversized tool responses, slow tools, duplicate calls, and cache waste, sorted by cost and confidence. The audit runs entirely on a local SQLite database and supports --json output for machine-readable results (see docs/audit.md).

How to use:

  • Install via the npm package @whdrnr2583/token-meter; the CLI binary name remains token-meter. After installation, it can be run via npx -y @whdrnr2583/token-meter.
  • MCP integration: Run install-mcp all to register Token Meter for all supported clients on the machine (Claude Code, Cursor, Claude Desktop) with a single command. This command is idempotent, backs up existing configurations, and preserves other MCP servers; single-client variants install-mcp claude-code | cursor | claude-desktop are also supported, and --dry-run can be added for preview. Manual configuration is also possible.
  • After MCP integration, the AI assistant can use four tools (all read-only; data does not leave the local machine). Example prompts include asking the assistant to call token-meter to show a summary of recent sessions or this week's usage.
  • Claude Code shortcut: run npx -y @whdrnr2583/token-meter install-command claude-code to register the /token-meter slash command; after reopening the session, enter /token-meter to get a one-time summary.

Use cases:

  • Want to know how many tokens and how much cost a Claude Code or Codex session consumes, broken down by project, model, and MCP tool.
  • Using a flat-fee plan (such as Claude Max) and want to know what the equivalent API cost would be.
  • Want to find out which MCP server or tool consumes the most tokens, or which time of day is most expensive.
  • Want to resume a recent session and need the claude --resume / codex resume commands.
  • Want all of the above to run offline, with no account required and no data uploaded.

Limitations and notes:

  • Costs are local estimates: derived by multiplying the token counts in the JSONL by the model's published per-million-token price, not verified against actual Anthropic / OpenAI bills, and may differ from bills due to vendor price changes, subscription plans billed at a flat fee, and some token categories (server-side tool use, cache write variants) being approximated. Suitable as a relative signal for spotting waste, not suitable as billing-grade accounting.
  • Privacy: Token Meter does not touch either vendor's network APIs; by default it does not store prompt or response bodies, only metadata (timestamps, token counts, tool names, response lengths); the database is located at ~/.tokenpulse/, and deleting that folder clears it (a future version will rename it to ~/.tokenmeter/ and migrate automatically).
  • License: the CLI, dashboard, and parsers are MIT licensed; Pro tier features are released in a separate closed-source licensed package. Pro is live and can be subscribed to at token-meter.dev; Pro+ depends on Pro signup volume and community demand.
  • The bare name token-meter on npm conflicts with an existing similar name, so the package is published under the @whdrnr2583/ scope.