Tokenmeter is a free, open-source token usage and cost tracker for AI coding agents: Claude Code, OpenAI Codex CLI and GitHub Copilot CLI. It runs a local dashboard that shows how many tokens every prompt used, what it cost at API prices, how that compares with your Claude Pro, Claude Max or ChatGPT Plus plan, your cache hit rate and cache misses, and how close you are to your usage limits.
Use it for token monitoring and token optimization: watch token usage live, see which prompts, models and projects burn the most tokens, and find what to change to reduce token usage and lower your AI coding costs. It flags cache misses, where a long conversation loses its prompt cache and gets re-sent at full price, and splits every cost into cached, fresh and output tokens so the expensive part is obvious.
It reads the logs the agents already keep on your disk, so there is no API key, no proxy and no account, and nothing leaves your machine unless you ask for tips. Install it on macOS with Homebrew, or on Linux and Windows with pipx or uv. Zero dependencies: one Python file and one HTML file.
It answers questions like:
How much does Claude Code cost me per day, per project or per prompt?
How many tokens did Claude Code, Codex or Copilot use this week?
Why did this prompt cost so much? Tokens are split into cached, fresh and output, with the math shown.
Am I close to my Codex 5-hour or weekly limit, and how much have I used in the last 5 hours?
How can I reduce Claude Code token usage? Start with the most expensive prompts and the cache misses.
Which model or project is eating my token budget?
Is my subscription worth it compared with API pricing?
Live feed of every model turn from Claude Code, Codex and GitHub Copilot CLI, updated a few seconds after each prompt finishes
Spend tile that shows what you actually pay first (your subscription, prorated to the range) with the API-equivalent cost underneath, or the API cost on top if you have no plan configured
Usage limits: Codex 5-hour and weekly windows as Codex reports them, plus rolling 5-hour and 7-day usage for every tool
Active sessions with a context-fill gauge, so you see compaction coming
Every prompt with its text, the turns it triggered, tokens, cost and duration, plus a resume command. Click any header to sort by date, tokens, cost, turns or duration
Cache-miss detector: turns where the cached prefix collapsed and had to be re-written, with the prompt that was in progress and what the re-write cost
Tips to spend less: one click sends your 5 or 10 most expensive prompts to Claude Code, Codex or Copilot CLI on your machine, with your own login, and shows what to change. Without one of those commands, copy the prompt and paste it into any AI
Most expensive prompts, cost per git commit, cost mix by token type, and breakdowns by model, project and session
Budget alerts: set a daily or monthly cap and get a desktop notification when you cross it
Team mode: teammates export daily aggregates to one shared Tokenmeter and you filter by person
Menu bar widget for SwiftBar or xbar showing today's spend
Filters for time range, tool, project, model and user, kept in the URL so views are bookmarkable, plus CSV export and light and dark themes
How it works
Nothing is installed inside Claude Code, Codex or Copilot. All three already save every conversation to a log file on your disk, and each model reply in that log includes how many tokens it used. Tokenmeter just reads those logs.