Skip to content
Back to skills

tokenmeter

ASecurity

Open the Tokenmeter dashboard, a local web page that tracks token usage, cost, rate-limit windows and cache misses for every prompt in Claude Code, Codex and Copilot CLI. Use when the user asks about token usage, token spend, cost per prompt or per commit, cache hit rate, usage limits or 5-hour window, usage per project or model, a usage dashboard, or says "tokenmeter", "how many tokens", "how much am I spending", "show usage", "open the dashboard".

  • 22 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 29, 2026
ai-agentspythonbashapi

Works with

  • claude code
  • cli
  • api

Security analysis

A100/100

Pro scans all 17 files and shows the line behind each finding

Scanned September 29, 2026

npx -y skills add serkankorkut/tokenmeter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of tokenmeter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for tokenmeter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/serkankorkut-tokenmeter/badge)](https://www.skillsdirectory.com/skills/serkankorkut-tokenmeter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tokenmeter
description: Open the Tokenmeter dashboard, a local web page that tracks token usage, cost, rate-limit windows and cache misses for every prompt in Claude Code, Codex and Copilot CLI. Use when the user asks about token usage, token spend, cost per prompt or per commit, cache hit rate, usage limits or 5-hour window, usage per project or model, a usage dashboard, or says "tokenmeter", "how many tokens", "how much am I spending", "show usage", "open the dashboard".
---

# Tokenmeter

Tokenmeter reads the transcripts Claude Code, Codex and Copilot CLI already write to disk, so no hook or instrumentation is needed. Every completed model turn shows up in the dashboard within a few seconds.

## Start the dashboard

Run the server in the background (it is safe to run repeatedly, a second start just reports the existing URL). Try these in order and use the first that exists:

```bash
command -v tokenmeter >/dev/null && tokenmeter start || (nohup python3 ~/.claude/skills/tokenmeter/tokenmeter/server.py --open >/dev/null 2>&1 &) || (nohup python3 ~/.codex/skills/tokenmeter/tokenmeter/server.py --open >/dev/null 2>&1 &)
```

The `tokenmeter` command exists when installed with pip, pipx, uv or Homebrew. The two paths are the plugin checkouts for Claude Code and Codex.

Then tell the user the dashboard URL that `tokenmeter start` printed and stop. It is http://127.0.0.1:7788 unless that port was taken, in which case Tokenmeter uses the next free port up to 7798 or the port saved in `~/.tokenmeter/config.json`. Do not paste usage numbers into chat unless asked; the dashboard is the deliverable.

## Answer a usage question directly

If the user asks a specific question ("how much did I spend today", "which project uses the most tokens", "am I close to my limit"), start the server as above, then read `/api/summary` on that URL for today, last 5 hours, month, projection and limits, or `/api/usage` for every turn, and answer from the JSON. Records carry `tool`, `model`, `project`, `ts`, token fields `in`, `cr` (cache read), `cw5`/`cw1h` (cache write), `out`, `reason`, and `cost` in USD (null when the model has no entry in `pricing.json`).

## Configuration

- `tokenmeter start --port N` uses and saves another port (as `_port` in `~/.tokenmeter/config.json`); `TOKENMETER_PORT` overrides it for one run.
- `~/.tokenmeter/config.json` overrides the bundled `pricing.json`: `_plans` (what the user pays per month per tool), `_budget` (alert caps), `_context_windows`, and model prices. If the user mentions their subscription price, write it there, for example `{"_plans": {"claude": 100, "codex": 20}}`.
- `--export URL` pushes aggregates to a team server; `--host 0.0.0.0` runs one.
- `CLAUDE_CONFIG_DIR` and `CODEX_HOME` override the transcript locations.

Files in this skill

  • .claude-plugin/marketplace.json512 B
  • .claude-plugin/plugin.json315 B
  • AGENTS.md14.4 KB
  • CLAUDE.md10 B
  • SKILL.md2.7 KB
  • install.sh615 B
  • menubar/tokenmeter.1m.sh1.6 KB
  • pyproject.toml1.2 KB
  • release/brew-formula.sh2.1 KB
  • release/brew-stats.sh348 B
  • release/demo_data.py8 KB
  • test_server.py6.6 KB
  • tokenmeter/__init__.py41 B
  • tokenmeter/__main__.py42 B
  • tokenmeter/index.html53.9 KB
  • tokenmeter/pricing.json4.9 KB
  • tokenmeter/server.py31.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…