← all repositories
crwdla/tokentab

Your AI pair programmers leave logs; this tool adds up the tab

It reads the session logs already sitting on disk and turns them into a cost breakdown by model, day, and project—no API keys, no network calls.

tokentab
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does

Tokentab is a local CLI that parses session logs left behind by Claude Code, OpenAI Codex, and Gemini CLI to calculate exactly how much you’re spending on AI-assisted coding. It groups the damage by model, project, day, and even tries to categorize the kind of work—debugging, testing, refactoring, or just chatting. Everything stays on your machine; there are no accounts to create and no telemetry to worry about.

The interesting bit

Instead of guessing or querying live APIs, the tool relies on a hand-curated, offline price table and fuzzy model-name matching, which means a vendor renaming a model overnight won’t crash your report. It also handles vendor-specific cache accounting—subtracting Gemini’s included cache hits and tracking Claude’s separate cache reads—so you don’t pay twice on paper for tokens you already paid for once.

Key highlights

  • Only third-party dependency is rich; the web dashboard, parsers, and HTTP server are pure Python standard library.
  • Serves a local-only web dashboard at localhost:4747 with charts and monthly statements—no CDN fonts, works offline.
  • Automatically strips color codes when piped, making it safe to paste into PRs or chat logs.
  • Adding support for a new coding tool is a single module implementing a collect() function; pricing and reporting are decoupled from provider specifics.
  • Exports JSON for further analysis and supports filtering by date range, provider, or project.

Caveats

  • Cursor support is currently stubbed out and not yet functional.
  • Model pricing is maintained manually, so newer or renamed models may show as $0.00 until the table is updated.
  • Activity labels like “debugging” or “refactoring” are deterministic heuristics based on your first message, not ground truth.

Verdict

Worth a look if you’re running up a tab across multiple AI coding tools and want to know which project or model is eating your budget. If you only dip into a single chatbot occasionally, it’s probably overkill.

Frequently asked

What is crwdla/tokentab?
It reads the session logs already sitting on disk and turns them into a cost breakdown by model, day, and project—no API keys, no network calls.
Is tokentab open source?
Yes — crwdla/tokentab is open source, released under the MIT license.
What language is tokentab written in?
crwdla/tokentab is primarily written in Python.
How popular is tokentab?
crwdla/tokentab has 558 stars on GitHub.
Where can I find tokentab?
crwdla/tokentab is on GitHub at https://github.com/crwdla/tokentab.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.