tokentab

by wzchavVerified

A CLI that reads Claude Code, Codex, and Gemini CLI session logs and works out how much they cost, by model, project, and day.

226
Stars
14
Forks
Python
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/wzchav/tokentab

Getting Started

Guides for using skills like tokentab.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

tokentab

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.

tokentab web dashboard

Installing

Clone the repo and install it into your environment:

git clone https://github.com/wzchav/tokentab
cd tokentab
pip install .
tokentab

That puts a tokentab command on your path. You can also run it without installing at all - see From source.

What it reads

It understands three tools out of the box, plus a Cursor slot that's wired up but not finished (more on that below).

ToolWhere 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.

Using it

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.

The web dashboard

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.

How the numbers are worked out

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.

Adding another tool

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.

From source

git clone https://github.com/wzchav/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.

Reading the output

A few patterns worth knowing when you look at your own numbers:

  • Cache hit under ~80%, consistently - your context probably isn't stable between calls, or caching isn't switched on. One weird session is nothing; weeks of it is worth a look.
  • A big model dominating cost on lots of tiny calls - you might be reaching for the expensive one on work a cheaper model would one-shot.
  • "chat" or "exploring" eating a big share - a lot of the spend went to talking and reading rather than editing. Sometimes that's the job; sometimes it's a sign a session wandered.

These are starting points, not verdicts. The tool shows you the data: you know what the work actually was.

Notes

Prices are best-effort - if you spot a stale one, a one-line PR or an issue is welcome. Everything runs locally.

License

MIT - do what you like with it.

Frequently Asked Questions

What is tokentab?

tokentab is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by wzchav. 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 226 GitHub stars.

Is tokentab safe to use?

Yes. tokentab passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install tokentab?

Clone the repository with "git clone https://github.com/wzchav/tokentab" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is tokentab written in?

tokentab is primarily written in Python. It is open-source under wzchav on GitHub, so you can review or fork the full source.

Are there alternatives to tokentab?

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.

Comments (0)

No comments yet. Be the first to share your thoughts!

ui-ux-pro-max-skill

by nextlevelbuilder

12

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

119,92012,870Python
CLI Toolsai-skillsantigravity
View details

happy

by slopus

Mobile and Web client for Codex and Claude Code, with realtime voice, encryption and fully featured

23,4501,980TypeScript
CLI Tools
View details

claudecodeui

by siteboon

Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.

13,3941,866TypeScript
CLI Tools
View details

CRS-自建Claude Code镜像,一站式开源中转服务,让 Claude、OpenAI、Gemini、Droid 订阅统一接入,支持拼车共享,更高效分摊成本,原生工具无缝使用。

12,5471,869JavaScript
CLI Tools
View details

ccstatusline

by sirmalloc

🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline support, themes, and more.

12,508545TypeScript
CLI Tools
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details