Open-source local usage inspector

Token Companion

Open-source desktop app for inspecting Claude and Codex token cost from local session records.

See model cost, session attribution, and drilldown details from files already on your machine.

No account, no upload, no closed calculator.

  • Open source
  • Local files
  • Inspectable rules
Token Companion sessions screen

Works with

  • Claude CLI
  • Claude Desktop
  • VS Code
  • Codex CLI

What it does

It keeps the accounting path visible.

The app stays intentionally narrow: read local records, apply known prices, and preserve enough context to check where every number came from.

Reads files on disk

Uses usage fields written by Claude and Codex instead of estimating totals from a partial chat view.

Keeps source attached

Each session keeps its source, model list, and working directory so totals stay tied to a concrete run.

Shows gaps instead of guessing

If a store does not expose token usage, the app leaves the gap visible instead of inventing a cost.

Keeps parser rules explicit

Counting rules stay visible, including dedup behavior and how cumulative session totals are selected.

Keeps pricing editable

Input, output, cache-read, and cache-write prices can be corrected per model from the app.

Handles mixed tool use

Claude CLI, Claude Desktop Cowork/agent modes, VS Code, and Codex CLI records can be viewed in one place.

Views

Follow the total back to the session.

These screens cover the normal audit path: start with session attribution, open the drilldown, then inspect model totals and pricing corrections.

Sessions

Session attribution

The session list keeps agent source, model, cost, and working directory together so totals can be traced back to a concrete run.

  • Useful when several repos share one machine.
  • Global filters narrow the list by date and source.
Token Companion sessions view

Drilldown

Per-session details

A session detail view shows how token usage accumulated across conversation entries, including thinking, tool-use, and tool-result blocks where the records expose them.

  • Claude replay duplicates are deduplicated on message id.
  • Codex cumulative totals come from the last session event.
Token Companion session drilldown

Models

Model totals

The model table ranks cost and keeps token classes separate so missing prices and expensive models are easy to spot.

  • Token classes stay distinct.
  • Missing or unverified prices remain visible.
Token Companion models table

Pricing

Editable rate card

Pricing can be corrected in place when model names or provider prices change.

  • Per-model rate cards persist across restarts.
  • Unverified pricing can be marked before totals are trusted.
Token Companion pricing editor

What it reads

Focused on local records.

If a store exposes token usage, Token Companion counts it. If it does not, the app reports the gap instead of inventing a cost.

SourceLocationToken data
Claude CLI, Claude Desktop agent modes, and VS Code~/.claude/projects/**/*.jsonlPer-message usage records
Claude 1p Cowork sessions~/Library/Application Support/Claude/local-agent-mode-sessions/**/audit.jsonlResult usage and exact reported cost
Claude 3p title-generation logs~/Library/Application Support/Claude-3p/title-gen/**/*.jsonlUsage records
Codex CLI sessions~/.codex/sessions/**/*.jsonlLast cumulative token snapshot per session
Claude and Codex desktop plain chat storesIndexedDB / LevelDB stores on diskConversation discovery only, no token counts exposed

Install

Open the install page and pick the path that fits your machine.

The install page keeps the current version, release links, platform tabs, direct downloads, `npx`, and the wrapper scripts visible in one place. Current release: v0.1.8 (0.1.8).

macOS

Direct, npx, or script

Install instructions include the unsigned DMG, the npx bootstrapper, and the install.sh wrapper script.

Open macOS instructions

Windows

Direct, npx, or script

Install instructions include the unsigned installer, the npx bootstrapper, and the install.ps1 wrapper script.

Open Windows instructions

Linux

Direct, npx, or script

Install instructions include release packages, the npx bootstrapper, and the install.sh wrapper script.

Open Linux instructions

Local records, local calculation

Install Token Companion and scan your existing session history.