by sequilade
A CLI that reads Claude Code, Codex, and Gemini CLI session logs and works out how much they cost, by model, project, and day.
# Add to your Claude Code skills
git clone https://github.com/sequilade/tokentabGuides for using cli tools skills like tokentab.
tokentab is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by sequilade. A CLI that reads Claude Code, Codex, and Gemini CLI session logs and works out how much they cost, by model, project, and day. It has 95 GitHub stars.
tokentab's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/sequilade/tokentab" and add it to your Claude Code skills directory (see the Installation section above).
tokentab is primarily written in Python. It is open-source under sequilade on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh tokentab against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
tokentab reads the session logs that Claude Code, Codex, Cursor and Gemini CLI already leave on disk and adds up token usage and cost - broken down by model, by project, by day, and by the kind of work each session was doing. It runs entirely locally: no account, no API key, nothing leaves your machine.
Clone the repo and install it into your environment:
git clone https://github.com/sequilade/tokentab
cd tokentab
pip install -e .
tokentab
That puts a tokentab command on your path. You can also run it without installing at all - see From source.
It understands three tools out of the box, plus a Cursor slot that's wired up but not finished (more on that below).
| Tool | Where its logs live |
|---|---|
| Claude Code | ~/.claude/projects/**/*.jsonl |
| Codex | ~/.codex/sessions/**/rollout-*.jsonl |
| Gemini CLI | ~/.gemini/tmp/**/session-*.json |
| Cursor | (stub - see below) |
If a tool isn't installed, it's just skipped. You'll only ever see the tools you actually use.
The bare command gives you the last 7 days across everything:
tokentab
Some other things it does:
tokentab today # just today
tokentab month # this calendar month
tokentab -p all # everything you've ever run
tokentab --provider claude # one tool only
tokentab --project myapp # one project
tokentab --from 2026-06-01 --to 2026-06-15 # a specific window
tokentab --json | jq . # machine-readable, pipe it wherever
tokentab web # the same thing, in a browser, with charts
Colour drops automatically when you pipe the output somewhere, so pasting into a PR or a chat doesn't drag a load of escape codes along with it.
tokentab web
Opens http://localhost:4747 and lays the same numbers out as a monthly statement - total up top, everything itemised below. It reads from disk on every request (the data's tiny, so there's no reason to cache and risk showing you something stale) and binds to localhost only - nothing gets uploaded, same as the CLI. It doesn't even pull fonts from a CDN; it uses whatever serif and mono your system already has, so it works with the network unplugged. Pick a port with --port, or pass --no-open if you don't want it grabbing your browser.
It's built on Python's standard-library HTTP server - no Flask, no framework, nothing extra to install.
Tokens come straight from the logs - every one of these tools records its own token counts per call, so nothing here is guessed. The one wrinkle is caching: Claude splits cache reads and writes out separately, and Gemini reports input including the cached part, so tokentab pulls the cached tokens back out before pricing to avoid charging you twice for the same thing.
Prices are a hand-kept table in tokentab/pricing/prices.py, in dollars per million tokens. It's a table on purpose - the tool never reaches out to the network to price anything, and a slightly-stale number beats a crash when a vendor renames a model overnight. The matching is fuzzy: claude-opus-4-6-20260514 still finds claude-opus-4-6. If a model shows up as $0.00, it means the name didn't match anything in the table - add a line and it's sorted. The CLI says so when it happens instead of quietly counting it as free.
Activity (coding / debugging / refactor / testing / etc.) is a guess based on which tools got used and the wording of your first message in a session. It's deterministic - no model calls - so it's fast and you can eyeball whether it's roughly right. Treat it as a hint, not gospel.
Every provider is a single module in tokentab/providers/ that exposes a collect() function returning a flat list of UsageRecords (the shape's in tokentab/types.py). Write the module, add it to the list in tokentab/providers/__init__.py, done - pricing, grouping, the dashboard, all of it just works because everything downstream only ever touches that one shared shape. The three real parsers are worth a read as templates; Claude's is the simplest place to start.
git clone https://github.com/sequilade/tokentab
cd tokentab
pip install -e .
tokentab
The only third-party dependency is rich, for the terminal tables. Everything else - the web server, the parsers, the JSON - is Python's standard library.
A few patterns worth knowing when you look at your own numbers:
These are starting points, not verdicts. The tool shows you the data: you know what the work actually was.
Prices are best-effort - if you spot a stale one, a one-line PR or an issue is welcome. Everything runs locally.
MIT - do what you like with it.