Skip to content

Local-first desktop app to track token usage and AI costs from Claude Code, Codex CLI, and OpenCode logs.

License

Notifications You must be signed in to change notification settings

chadyi/token-viewer

Repository files navigation

Token Viewer — AI Token Usage & Cost Tracker for Claude Code, Codex CLI, and OpenCode

Release Build License Stars

A local-first desktop app to analyze token usage and estimated AI cost from:

  • Claude Code
  • Codex CLI
  • OpenCode

Built with Tauri v2 + React 19 + TypeScript.

If Token Viewer helps you, please star the repo ⭐

Quick Demo

Token Viewer Demo


English | 简体中文

Why Token Viewer

Most coding-agent users can see logs, but not a clear answer to:

  • How many tokens did I use today/week/month?
  • Which model is expensive?
  • Is cache helping or just noise?

Token Viewer turns raw local logs into a clean dashboard with trend charts and per-model breakdowns.

Key Features

  • Local-only: scans local JSON/JSONL logs, no server required
  • Fast incremental refresh: remembers file offsets for quick updates
  • Token analytics dashboard: requests, input/output tokens, totals, cost
  • Cost estimation: based on LiteLLM pricing tables (supports tiered rates)
  • Date grouping: Day / Week / Month / Year / All
  • Model drill-down: click rows to expand per-model usage details
  • Cross-platform desktop: Windows, macOS (Intel + Apple Silicon), Linux

Screenshots

Dashboard

Dashboard

By Date (expandable)

By Date

By Model (All)

By Model

Download

Pre-built installers are available in Releases:

Platform Format
Windows .msi, .exe
macOS (Apple Silicon) .dmg
macOS (Intel) .dmg
Linux .deb, .AppImage, .rpm

Supported Log Sources

Token Viewer currently scans:

  • Claude Code
    • ~/.config/claude/projects/**/*.jsonl
    • ~/.claude/projects/**/*.jsonl
  • Codex CLI
    • ~/.codex/sessions/**/*.jsonl
  • OpenCode
    • ~/.local/share/opencode/storage/message/**/*.json

Development

Prerequisites

Setup

npm install
npm run tauri dev

Build

npm run tauri build

Search Keywords

AI token tracker, token usage dashboard, token cost viewer, Claude Code token usage, Codex CLI token usage, OpenCode token analytics, local AI cost monitor, Tauri desktop analytics.

License

MIT

About

Local-first desktop app to track token usage and AI costs from Claude Code, Codex CLI, and OpenCode logs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors