← all repositories
damejan80/tokentab

Finally, an itemized bill for your AI pair-programming habit

It turns the telemetry already on your disk into an itemized cost breakdown, no API keys required.

1.2k stars Python Coding AssistantsLLMOps · Eval
tokentab
Velocity · 7d
+1.9
★ / day
collecting data…
star history

What it does

tokentab is a Python CLI that scavenges session logs already dropped by Claude Code, OpenAI Codex, and Gemini CLI on your local disk, then tallies token spend and estimated cost by model, project, and day. It also spins up a dead-simple web dashboard on localhost—built with only Python’s standard library—that renders the same breakdown as charts and tables. No API keys, no cloud calls, no outbound network traffic at all.

The interesting bit

Instead of querying live pricing APIs that might rename models overnight and crash your script, tokentab ships a hand-curated price table and fuzzily matches model names like claude-opus-4-6-20260514 to known entries. It even accounts for vendor-specific cache accounting quirks—subtracting Gemini’s cached tokens from input so you don’t pay twice, and respecting Claude’s separate cache read/write columns.

Key highlights

  • Reads existing JSONL logs from ~/.claude, ~/.codex, and ~/.gemini without requiring anything beyond the rich terminal library.
  • Categorizes sessions by guessed activity—coding, debugging, testing, etc.—using deterministic heuristics on your first message, not another model call.
  • Auto-strips ANSI colors when piped, outputs JSON for scripting, and filters by date window, provider, or project.
  • Web dashboard uses system fonts and no CDN, so it renders fully offline.

Caveats

  • Cursor support is stubbed but not yet finished.
  • Model prices are manually maintained, so new or renamed models may show up as $0.00 until the table is updated.
  • Activity labels are heuristic guesses based on prompt wording; the README itself says to treat them as hints, not gospel.

Verdict

Worth a look if you’re burning through API budget with multiple AI CLI tools and want a local, private ledger. Skip it if you only use Cursor or need real-time, enterprise-grade billing accuracy.

Frequently asked

What is damejan80/tokentab?
It turns the telemetry already on your disk into an itemized cost breakdown, no API keys required.
Is tokentab open source?
Yes — damejan80/tokentab is open source, released under the MIT license.
What language is tokentab written in?
damejan80/tokentab is primarily written in Python.
How popular is tokentab?
damejan80/tokentab has 1.2k stars on GitHub.
Where can I find tokentab?
damejan80/tokentab is on GitHub at https://github.com/damejan80/tokentab.

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