← 开源
nateherkai

token-dashboard

See where Claude Code is burning tokens - turn raw JSONL transcripts into local cost analytics, hotspot views, and session-level usage insight.

ApplicationsProductivityPython
在 GitHub 打开
增长势头
+124 小时新增 Star+0.1%
729
Star
197
Fork
+6
本周
1
贡献者
创建于 2026-04-20 · 更新于 2026-10-16 · 今日第 6366 名
主要开发者

nateherkai/token-dashboard 排名第 6,366,有 729 个星标。

同类别比较

nateherkai/token-dashboard 排名第 6,366,此处有 8 个同类条目;bkingfilm/lapian-notes 排名第 6,368。

同类别比较
名称排名指标
agno-agi/scout6,338
语言:
Python
星标数:
746
分叉数:
75
简介:
Open Source Company Brain
notnotype/neuro-book6,343
语言:
TypeScript
星标数:
745
分叉数:
72
简介:
An AI-powered IDE for long-form fiction writing, combining software engineering workflows, modern storytelling methodologies, and multi-agent systems.
ItsssssJack/power-design6,361
星标数:
731
分叉数:
98
简介:
A Claude skill for slides that don't look like AI made them. Brand DNA × 20 codified design principles.
omeryusufyagci/fast-music-remover6,363
语言:
C++
星标数:
730
分叉数:
54
简介:
A C++ based, lightweight music and noise remover for YouTube and other internet media, using DeepFilterNet for audio enhancement.
bkingfilm/lapian-notes6,368
语言:
TypeScript
星标数:
728
分叉数:
74
简介:
AI 辅助的电影拉片工具:AI 拆出剧情泳道时间轴、结构树、情绪曲线,边播边写拉片笔记,免费开源全本地 | AI-assisted film breakdown notebook: story-lane timeline, structure tree, emotion curve. Free, open source, fully local.
ShayneP/local-voice-ai6,372
语言:
Python
星标数:
726
分叉数:
217
简介:
Local voice AI powered by llama-cpp, Kokoro, Nemotron STT, and LiveKit.
EvilBT/ComfyUI_SLK_joy_caption_two6,374
语言:
Python
星标数:
725
分叉数:
45
简介:
ComfyUI Node
balazik/ComfyUI-PuLID-Flux6,375
语言:
Python
星标数:
725
分叉数:
60
简介:
PuLID-Flux ComfyUI implementation
关键参数与规格
关键参数与规格
参数值
语言Python
类别Applications
子类别Productivity
关键词Claude Code, Memory management, Tool use, Visualization
星标数729
分叉数197
贡献者1
创建日期2026-04-20
更新日期2026-10-16
1 天星标数1
7 天星标数6
排名6,366
上次排名18,964
排名变化12,598
7 天星标排名5,258
上次 7 天星标排名5,734
7 天星标排名变化476
总星标排名14,383
上次总星标排名14,390
总星标排名变化7
README 摘录

Token Dashboard A local dashboard that reads the JSONL transcripts Claude Code writes to and turns them into per-prompt cost analytics, tool/file heatmaps, subagent attribution, cache analytics, project comparisons, and a rule-based tips engine. What this is useful for Seeing which of your prompts are expensive (surprise: they usually involve large tool results). Comparing token usage across projects you've worked on. Understanding what a "cache hit" actually saves you. If you're on Pro or Max, confirming you're

getting your money's worth in API-equivalent dollars. If you just installed Claude Code and haven't used it yet, run at least one prompt first. Quickstart On Windows, if isn't on your PATH, substitute for in every command below. Scans (first run can take 20–60 seconds on a heavy user's machine). Leave it running; it re-scans every 30 seconds and pushes updates live. | | | | Where to scan for session JSONL files | | | | SQLite cache location | Pricing lives in . Edit it

directly if model prices change or to add a new plan. The 7 tabs The dashboard is a single page with a hash-router tab bar across the top. Click any row to see the assistant response, tool calls made, and the size of each tool result. The Overview tab also has a built-in "What do these numbers mean? " panel that explains input/output/cache tokens in plain English. Troubleshooting **"No data" or empty charts. ** Run once to populate

the DB, then reload. Delete it and re-run to rebuild from scratch. **Running the dashboard twice at the same time. Stop all instances before starting a new one. Accuracy note Claude Code writes each assistant response 2–3 times to disk while it streams (the same API message gets snapshotted as output grows). The dashboard dedupes these by so the final tally matches what the API actually billed. Tech stack Python 3 (stdlib only) for the CLI, scanner, and

HTTP server. Vanilla JS + ECharts for the UI, no build step. Dark theme, hash-based router, server-sent events for live refresh. Data flow: → → SQLite DB; exposes JSON routes and serves . Short version: fork, before opening a PR, keep it stdlib-only.

常见问题

记录了多少星标和分叉?

nateherkai/token-dashboard 有 729 个星标和 197 个分叉。

仓库排名是多少?

nateherkai/token-dashboard 排名第 6,366。

记录的语言和类别是什么?

nateherkai/token-dashboard 有 729 个星标,语言为 Python,类别为 Applications。

哪个仓库排名最接近?

nateherkai/token-dashboard 与 bkingfilm/lapian-notes 比较,后者排名第 6,368,有 728 个星标。

README

Token Dashboard

A local dashboard that reads the JSONL transcripts Claude Code writes to ~/.claude/projects/ and turns them into per-prompt cost analytics, tool/file heatmaps, subagent attribution, cache analytics, project comparisons, and a rule-based tips engine.

Everything runs locally. No data leaves your machine — no telemetry, no API calls for your data, no login.

What this is useful for

  • Seeing which of your prompts are expensive (surprise: they usually involve large tool results).
  • Comparing token usage across projects you've worked on.
  • Spotting wasteful patterns — the same file read twenty times in a session, a tool call returning 80k tokens.
  • Understanding what a "cache hit" actually saves you.
  • If you're on Pro or Max, confirming you're getting your money's worth in API-equivalent dollars.

Prerequisites

  • Python 3.8 or newer — already installed on macOS and most Linux. On Windows: winget install Python.Python.3.12 or download from python.org.
  • Claude Code — installed and with at least one session run. The dashboard reads those sessions. If you just installed Claude Code and haven't used it yet, run at least one prompt first.
  • A web browser. Any modern one.

No pip install. No Node.js. No build step.

Quickstart

git clone https://github.com/nateherkai/token-dashboard.git
cd token-dashboard
python3 cli.py dashboard

On Windows, if python3 isn't on your PATH, substitute py -3 for python3 in every command below.

The command:

  1. Scans ~/.claude/projects/ (first run can take 20–60 seconds on a heavy user's machine).
  2. Starts a local server at http://127.0.0.1:8080.
  3. Opens your default browser to that URL.

Leave it running; it re-scans every 30 seconds and pushes updates live. Stop with Ctrl+C.

Where the data comes from

Claude Code writes one JSONL file per session here:

OS Path
macOS / Linux ~/.claude/projects//.jsonl
Windows C:\Users\\.claude\projects\\.jsonl

The dashboard never modifies those files — it only reads them and keeps a local SQLite cache at ~/.claude/token-dashboard.db.

To point at a different location:

python3 cli.py dashboard --projects-dir /path/to/projects --db /path/to/cache.db

Environment variables

Var Default Purpose
PORT 8080 Port the local web server listens on
HOST 127.0.0.1 Bind address. Keep the default. Setting 0.0.0.0 exposes your entire prompt history to anyone on your local network — don't do this on any network you don't fully control (no coffee-shop Wi-Fi, no coworking spaces).
CLAUDE_PROJECTS_DIR ~/.claude/projects Where to scan for session JSONL files
TOKEN_DASHBOARD_DB ~/.claude/token-dashboard.db SQLite cache location

Pricing lives in pricing.json. Edit it directly if model prices change or to add a new plan.

CLI reference

python3 cli.py scan          # populate / refresh the local DB, then exit
python3 cli.py today         # today's totals (terminal)
python3 cli.py stats         # all-time totals (terminal)
python3 cli.py tips          # active suggestions (terminal)
python3 cli.py dashboard     # scan + serve the UI at http://localhost:8080

# dashboard flags
python3 cli.py dashboard --no-open   # don't auto-open the browser
python3 cli.py dashboard --no-scan   # skip the initial scan (use cached DB only)

Change the port: PORT=9000 python3 cli.py dashboard.

The 7 tabs

The dashboard is a single page with a hash-router tab bar across the top. Each tab is backed by its own JSON API under /api/:

  • Overview — all-time input/output/cache tokens, sessions, turns, estimated cost on your chosen plan, daily work and cache-read charts, tokens-by-project, token share by model, top tools by call count, and recent sessions. This is the landing tab.
  • Prompts — your most expensive user prompts ranked by tokens. Click any row to see the assistant response, tool calls made, and the size of each tool result.
  • Sessions — turn-by-turn view of any single session, with per-turn tokens and tool calls.
  • Projects — per-project comparison: tokens, session counts, and which files were touched most.
  • Skills — which skills you invoke most often, and (where we can measure them) their token cost. See limitations.
  • Tips — rule-based suggestions for reducing token usage (repeated file reads, oversized tool results, low cache-hit rate, etc.).
  • Settings — switch pricing between API / Pro / Max / Max-20x so cost figures everywhere else reflect your actual plan.

The Overview tab also has a built-in "What do these numbers mean?" panel that explains input/output/cache tokens in plain English.

Troubleshooting

"No data" or empty charts. Run python3 cli.py scan once to populate the DB, then reload.

Port 8080 already in use. PORT=9000 python3 cli.py dashboard.

Numbers look wrong / stuck. The DB lives at ~/.claude/token-dashboard.db. Delete it and re-run python3 cli.py scan to rebuild from scratch.

Running the dashboard twice at the same time. Don't — both processes will fight over the SQLite DB. Stop all instances before starting a new one.

Accuracy note

Claude Code writes each assistant response 2–3 times to disk while it streams (the same API message gets snapshotted as output grows). The dashboard dedupes these by message.id so the final tally matches what the API actually billed. If you compare against another tool that sums every JSONL row, expect this dashboard's numbers to be lower — and closer to reality.

Privacy

Nothing leaves your machine. No telemetry. No remote calls for your data. The browser fetches its JSON from 127.0.0.1, and all JS/CSS/fonts are served from that same local server — ECharts is vendored into web/, and the UI falls back to system fonts rather than pulling from a font CDN. If you want to verify: grep -r "https://" token_dashboard/ web/ — you'll find nothing.

Tech stack

Python 3 (stdlib only) for the CLI, scanner, and HTTP server. SQLite for the local cache. Vanilla JS + ECharts for the UI, no build step. Dark theme, hash-based router, server-sent events for live refresh.

Data flow: cli.py → token_dashboard/scanner.py → SQLite DB; token_dashboard/server.py exposes /api/* JSON routes and serves web/.

Further reading

Contributing

See CONTRIBUTING.md. Short version: fork, python3 -m unittest discover tests before opening a PR, keep it stdlib-only.

License

MIT.

排名相邻
同类项目