Token Meter: A Live Cost Meter for Your Coding Agents

Artificial Intelligence Pratik Bhavsar , Paul Lacey

Key takeaways

  1. Token Meter tracks coding agent costs like Claude, Codex, and Cursor in real time, right from your computer's menu bar, with no data leaving your machine.
  2. Using Token Meter helped cut weekly AI coding costs by about a third through ending stalled sessions, switching to cheaper models, and disabling unused tools.
  3. The tool includes budget alerts, an efficiency dashboard, and MCP integration, letting users spot wasteful spending and compare models without leaving their coding agent.

You kick off a refactor in Claude Code and go make a coffee. Ten minutes later, it is still working and you have no idea whether this run costs one dollar or hundred.

That gap is why we built Token Meter. It reads the trace files your agents already write to disk, prices them against public model rates, and shows you the cost before you get the next bill or a call from your manager. It sits in your menu bar. No API key, no account, nothing leaves your machine.

Three months of running it against my own work cut my weekly agent spend by roughly a third without sacrificing code quality. Most of the savings came from three habits the tool made obvious: ending sessions that had turned into dead weight, routing routine work to cheaper models, and turning off tools. (That’s right, less is more!)

You get a browser-based dashboard plus a native companion for your OS — a menu-bar app on macOS, an app tray on Linux, and a notification-area extension on Windows (beta). You set your own per-session and monthly budgets and it tracks them with alerts as you go. If your team rations tokens, you can see exactly how much headroom is left and plan around it.

Coding agents: Claude, Codex, Cursor, OpenCode, Kiro, and Pi

Platforms: macOS, Linux, Windows (beta)

Get Started

On macOS or Linux:

bash
git clone https://github.com/splunk/token-meter.git
./token-meter/scripts/install

The installer starts the local server and the native companion along with autostart. Open http://127.0.0.1:8722, run your agent like normal, and pick the session from the list. The server uses the Python standard library alone, binds only to 127.0.0.1, and never asks for admin.

Windows is in beta and has its own bootstrap command in the repo README.

How To Use Token Meter

Back to that refactor example. Token Meter picked up the session the moment the trace started.

Ten minutes in, the menu bar reads about six dollars. Context is sitting around 60 percent and output is streaming out around fifty tokens a second. Cost is climbing, but so is the work, so I let it run.

Five minutes later it reads twelve dollars. Context is near the ceiling and the output speed has dropped to a crawl. I check the dashboard. The session is now spending most of its money re-reading its own history on every turn. That is the cue to start a fresh session or trigger compaction. I trigger compaction after which my responses finish much faster at a lower cost.

I avoided restarting because I would lose agent's working context and spend a few minutes re-priming it. A clean start is only worth it once a run has clearly stalled in speed or quality. Some days I let an expensive session finish because my time is worth more than the tokens it is burning. The point is that I am making that call in the middle of the run, with the curve in front of me instead of finding out later.

token-meter-1.png

Token consumption chart

token-meter-2.png

Efficiency page

The Efficiency view makes those tradeoffs easier to compare over time. Instead of hiding everything behind one score, it shows output per dollar, reasoning ratio, context load, and output per execution for each model and reasoning effort. The numbers tell you the most when you read them together:

To act on this, pick one of your highest-spend models and establish a baseline over comparable work. Then change one variable at a time — model, reasoning effort, skills, prompt structure, context size, or task decomposition — and watch several similar runs before you decide whether the change actually helped.

token-meter-3.png

The menu bar turned out to be the part I reach for most. I assumed everyone would live in the dashboard, but the dashboard is where you investigate a run, and the menu bar is how you decide whether a run is even worth investigating. That matters most when three agents are going at once and you need to know which one to watch.

The live run view holds more than the two numbers in that story. It shows:

Output speed is its own tell: when it sags while cost keeps climbing, the model is usually chewing on a heavy context rather than doing new work. Alongside the run, the dashboard keeps a timeline of raw events, a tools tab for stats on usage, an insights tab for derived signals, and an alerts tab for budget state. It’s a one-stop view for analyzing your session and understanding where the tokens went.

Reduce Spend Using Token Meter

Budget Management

token-agent-4-use.png

Usually I set a per-session budget and a monthly one. Token Meter fires a notification when a run crosses the line or the cost spikes, and otherwise stays quiet in the menu bar. That is the setup that fits a real working day: heads down, with a tripwire instead of a babysitter. The live curve is there when an alert or a slow session sends me looking for it.

Model Routing

A lot of what an agent does all day is simple enough for a cheaper, faster model, so the easy savings come from not paying premium rates. Run the same task on two models first, read the gap in cost and output speed side by side, and route it down to the smaller one once the numbers back you up.

Skill Management

A single skill pack you never trigger can quietly add thousands of tokens to every request, and the Tools view makes that dead weight easy to spot by ranking each capability on how often you actually use it and how much it hands back. Switch off the ones not pulling their weight. If you thought giving your agent more tools was a good idea, this will put that in perspective really fast.

MCP Insights

And when you would rather ask than dig, the read-only MCP server lets you pull this data straight to Claude or Codex, so you can pull usage insights without ever leaving the agent you are already working in. Go to settings, connect with claude and codex, and then restart your coding agent to get these MCP tools:

What Else Can You Do With It

token-meter-5-use.png

Spend page

After a few weeks, here are the questions I stopped guessing at:

token-meter-6-use.png

All sessions view

If You Are on a Subscription

If you pay for Claude Max or a Cursor plan, your marginal token cost is close to zero and dollars are not really your problem. Quota is. Token Meter reads provider-reported limits, so the useful reading becomes how much headroom is left before you hit a cap in the middle of a task, and how one session compares to another. The dollar figures still work as a relative yardstick even when they are not your invoice.

What It Does Not Do

Token Meter computes costs from public price tables, so the numbers are API-equivalent estimates, not a reconstructed invoice. For deciding what to do next, the relative reading is what you need: this session versus that one, this model versus that model, the slope right now versus five minutes ago. The to-the-cent figure is not the point.

It also will not tell you whether the work was any good. A cheap answer that fails its tests is expensive. A slow session that quietly fixes production is a bargain. Quality comes from your evals and your own review. Token Meter measures the cost and leaves the verdict to you.

Built To Extend

Token Meter started as a Mac utility that understood Claude and Codex on MacOS, but has quickly grown due to contributions from other developers. Read our contributing guide and help extend it for your needs.

Try it today!

git clone https://github.com/splunk/token-meter.git
./token-meter/scripts/install

FAQs about Token Meter

What is Token Meter?
Token Meter is a free, open-source tool that reads local Claude Code and Codex logs and shows the live cost and activity of an agent session on your own machine. It needs no API keys and sends no data anywhere.
Which agents does it support?
Claude (Claude Code and the Desktop Agent / Cowork), Codex, Cursor, OpenCode, and Kiro. See the coverage tables above. It runs on macOS and Linux, with Windows in beta.
Are Token Meter's cost numbers exact?
No. Token Meter computes API-equivalent estimates from local price tables, so subscription billing on Claude or Codex can differ. The numbers are most useful as a live trend and as a comparison between sessions and models.
Does Token Meter send my data anywhere?
No. It binds to your local machine, reads logs that already exist on disk, and sends no prompts, responses, token counts, or costs to any external service.
How is Token Meter different from my provider's billing dashboard?
A billing dashboard shows a total after the session ends. Token Meter shows estimated cost and context growth live, so you can act on a runaway session before it finishes rather than after the spend is locked in.

Related Articles

Logs Are For Campfires: Log Data, Big Data, and Splunk Asset & Risk Intelligence
Security
3 Minute Read

Logs Are For Campfires: Log Data, Big Data, and Splunk Asset & Risk Intelligence

Discover how Splunk Asset and Risk Intelligence (ARI) transforms log data into actionable insights. From automated asset discovery to risk and compliance management, ARI empowers organizations with real-time visibility, vulnerability tracking, and proactive threat mitigation. Elevate your security posture today.
LNK or Swim: Analysis & Simulation of Recent LNK Phishing
Security
15 Minute Read

LNK or Swim: Analysis & Simulation of Recent LNK Phishing

LNK files are a common starting point for many phishing campaigns. Read on to strengthen your defenses against these LNK file phishing attacks.
Splunk Security Content for Threat Detection & Response: November 2025 Update
Security
5 Minute Read

Splunk Security Content for Threat Detection & Response: November 2025 Update

Learn about the latest security content from Splunk.