$npx skillfedfor your agent
REPO

tokentab gives AI coding tools the spend visibility they should have shipped with

on: crwdla/tokentab

Most AI coding tools give you no visibility into what they're actually spending. tokentab fixes that by reading the session logs that Claude Code, Codex, and Gemini CLI already write to disk, then summing up token counts and costs broken down by model, project, day, and inferred activity type. Nothing leaves your machine; there's no account, no API key, no network call of any kind.

The token counts come directly from the logs each tool produces - nothing is estimated. The one genuine accounting problem is caching: Claude separates cache reads from writes, and Gemini reports input totals that include cached tokens, so tokentab strips those out before pricing to avoid double-counting. Prices live in a hand-maintained table in dollars per million tokens, matched fuzzily so a model with a date suffix in its name still resolves correctly. When a model name doesn't match anything, the tool says so explicitly rather than silently treating it as free.

Activity classification - coding, debugging, refactoring, testing - is inferred from which tools a session used and the wording of its first message. The README is honest about this: it's deterministic, makes no model calls, and should be treated as a hint rather than a reliable label.

The web dashboard at localhost:4747 re-reads from disk on every request, uses only system fonts, and is built entirely on Python's standard-library HTTP server. The only third-party dependency in the whole project is rich, for terminal table rendering.

Extending it is straightforward: each provider is a single module exposing a collect() function that returns a flat list of typed records. Add the module, register it, and the dashboard and CLI pick it up automatically. Cursor support is stubbed but unfinished.

The README closes with a few diagnostic patterns worth internalizing: a cache hit rate consistently below roughly 80% suggests unstable context or disabled caching; an expensive model dominating cost on many small calls suggests over-provisioning; sessions classified as "chat" or "exploring" eating a large share of spend might indicate sessions that wandered. These are framed as starting points, not conclusions - the tool surfaces the numbers, and you supply the judgment about what the work actually required.

Offline token accounting for Claude Code, Codex, and Gemini CLI, built entirely on standard-library Python with one dependency.

Install it

Sources & links