Claude Code plugin · free and open source

Tokenmeter

See where your Claude Code tokens go: a live pane in every session, and a local dashboard with the full history.

MIT license · no account · nothing leaves your computer

Tokenmeter dashboard with demo data: last session, 14.35 million tokens today, a 30-day projection, 95.2% cache hit rate, plan limits at 37.5% (5-hour) and 18% (weekly), and a usage summary
The dashboard, shown with built-in demo data.

What you get

Tokens pane, in every session

  • This session's tokens, cache use and tool calls
  • How full the context window is
  • Your 5-hour and weekly plan limits, with reset times
  • Today, the last 7 days and all-time totals
  • Your project's TokenDiet result, when you have one

Dashboard, on your computer

  • 14-day chart of input, output and cache tokens
  • 90-day heatmap and peak hours
  • Projects, sessions, models and tools
  • Instruction weight per project, from TokenDiet
  • An idle pixel companion

Install

The pane

From a terminal:

claude plugin install tokenmeter --marketplace bar-madar/claude-tokenmeter

Or at the prompt of a Claude Code session:

/plugin install tokenmeter --marketplace bar-madar/claude-tokenmeter

In the Claude desktop app: click + next to the prompt box, choose Plugins, then Add marketplace with bar-madar/claude-tokenmeter, and Add plugin. Start a new session and the pane opens; type /tokens to bring it back.

The dashboard

git clone https://github.com/bar-madar/claude-tokenmeter && cd claude-tokenmeter && npm start

It opens http://localhost:4545. There's nothing to npm install. Try npm run demo to see it with made-up data.

Works with TokenDiet

When a session's context passes half the window, or its prompt cache keeps missing, the pane suggests a diet. After a TokenDiet audit, the pane and dashboard show your project's instruction weight, before and after. Tokenmeter stays free and works fully on its own.

Private and accurate

Stays on your computer

Reads the logs Claude Code already keeps locally, listens on 127.0.0.1 only, and sends nothing anywhere. No analytics, no telemetry, no update checks.

Counts each response once

Claude Code logs a response once per content block. Tokenmeter counts it once, so its totals match what was actually used.

Open source

MIT license, no dependencies, tests on Windows, macOS and Linux. Read the code.

Frequently asked questions

Is it really free?

Yes. Tokenmeter is open source under the MIT license. The code is on GitHub.

Why do its numbers differ from other tools?

Claude Code writes each response to its log once per content block, and every copy repeats the same usage. Tokenmeter counts each response once. Tools that add up every line report roughly three times as many tokens.

Does it work in the Claude desktop app?

Yes, in the Code tab, as well as in the terminal and VS Code. Conversations in the Chat tab aren't logged on your computer, so they aren't counted.

Why don't I see plan-limit bars?

They appear when you sign in to Claude Code with a Claude subscription, after the first reply in a session. With an API key you still get every token count and the context window.

What does it need?

Claude Code with plugin support, and Node.js 20 or newer for the dashboard and log reading.