tokentab is a local CLI and web tool that reads token usage logs from AI coding assistants (Claude Code, Codex, Gemini CLI) and displays aggregated costs and usage by model, project, day, and activity type.

Stars

123

7-day growth

+12

Forks

17

Open issues

0

License

MIT

Last updated

2026-07-18

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It requires no API keys or network access, runs entirely offline using existing session logs, and provides a lightweight dashboard built with Python's standard library.

Who it is for

  • Developers using AI coding assistants like Claude Code, Codex, or Gemini CLI
  • Engineering managers tracking team AI tool costs
  • Privacy-conscious users who prefer local-only analytics
  • Developers optimizing prompt efficiency and model selection

Use cases

  • Monthly cost reporting for AI coding assistants
  • Identifying which projects or models consume the most tokens
  • Analyzing activity types (coding, debugging, etc.) to find optimization opportunities
  • Sharing usage summaries in PRs or chats without escape codes

Strengths

  • Zero external dependencies beyond Python's standard library and the `rich` library
  • Reads existing logs without any additional setup or configuration
  • Provides both CLI and web dashboard with automatic charting
  • Deterministic activity classification that is fast and offline

Considerations

  • Pricing table is hand-maintained and may become stale; unknown models show as $0.00
  • Activity classification is heuristic and may not be perfectly accurate
  • Cursor support is not yet implemented (only a stub)
  • Only supports the three/four tools listed; no generic log importer

README quick start

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.

Installing

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.

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 i

Description

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

Related repositories

Similar projects matched by category, topics, and programming language.

0xwilliamortiz
Featured
0xwilliamortiz GitHub avatar

openclaude-improved

OpenClaude is an open-source CLI coding agent that runs on any platform and supports a wide range of LLM providers, offering the same tools and workflows as Claude Code.

AI & Machine LearningLarge Language Models
577
7-e1even
Featured
7-e1even GitHub avatar

learn-agent

A collection of notes on building coding agents, derived from the production development of the desktop agent Reina, with each mechanism simplified into a zero-dependency, single-file Node.js demo.

AI & Machine LearningLarge Language Models
218
makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958