Skip to content
blakestone-xPublic

About

Claude Code usage dashboard: local desktop, zero dependencies

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Burnrate

A local dashboard for Claude Code usage. It scans the JSONL transcripts Claude Code already writes to ~/.claude/projects/, stores per-turn token counts in SQLite, and serves a browser dashboard that prices your usage at API-equivalent rates. I built it to answer one question: what would my Claude Code habit cost at API prices, and where is it going?

No packages to install. Python 3.8+ standard library only.

What it shows

  • Totals for sessions, turns, input tokens, output tokens, cache reads, cache creation, and estimated cost
  • Daily token usage stacked by model
  • Cost split by model (doughnut) and by project (bar)
  • Tables: cost by model, recent sessions, cost by project, all sortable
  • Filters: 7/30/90-day/all-time ranges and per-model checkboxes
  • CSV export of the filtered turns

Cost is computed from a built-in pricing table (Opus, Sonnet, Haiku, per-million-token API rates). Unknown models fall back to Sonnet rates, so treat the dollar figures as estimates.

Install and run

Clone it, then:

python cli.py dashboard   # scan, serve, open browser
python cli.py scan        # scan only
python cli.py stats       # summary table in the terminal

dashboard starts a server at http://127.0.0.1:9199 and opens it. The page refreshes every 30 seconds and has a Rescan button that re-reads the source files.

On Windows you can put a shortcut to launch.ps1 in shell:startup. It starts the server in the background at login, or just opens the browser if one is already running.

Configuration

Env variable Default Purpose
BURNRATE_HOST 127.0.0.1 Server bind address
BURNRATE_PORT 9199 Server port

How it works

  • scanner.py reads ~/.claude/projects/**/*.jsonl, parses assistant turns, deduplicates by message id, and upserts into SQLite at ~/.claude/usage.db. Scans are incremental: it tracks each file's mtime and line count and only reads new lines.
  • server.py is an http.server app. GET / serves the dashboard, GET /api/data returns the turns as JSON, POST /api/rescan triggers a rescan.
  • dashboard.py is a single self-contained HTML page with the charts and tables.
  • cli.py ties it together.

Privacy

Everything runs on your machine. The Python code makes no outbound network requests; it reads local files and binds to localhost. The one external fetch is your browser loading the Chart.js library from the jsdelivr CDN when the dashboard page opens. Your usage data is never sent anywhere.

Status

Working and in daily use. Pricing table is hardcoded, so update it in scanner.py and dashboard.py when rates change.

License

MIT. See LICENSE.

About

Claude Code usage dashboard: local desktop, zero dependencies

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages