[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1114":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},1114,"token-dashboard","nateherkai\u002Ftoken-dashboard","nateherkai","See where Claude Code is burning tokens - turn raw JSONL transcripts into local cost analytics, hotspot views, and session-level usage insight.","",null,"Python",569,150,9,6,0,10,23,194,30,92.04,"MIT License",false,"main",[],"2026-06-12 04:00:07","# Token Dashboard\n\nA local dashboard that reads the JSONL transcripts Claude Code writes to `~\u002F.claude\u002Fprojects\u002F` and turns them into per-prompt cost analytics, tool\u002Ffile heatmaps, subagent attribution, cache analytics, project comparisons, and a rule-based tips engine.\n\n**Everything runs locally.** No data leaves your machine — no telemetry, no API calls for your data, no login.\n\n![Overview tab — totals and daily charts](docs\u002Fimages\u002Fdashboard-overview-top.jpg)\n\n![Overview tab — per-project, per-model, top tools, recent sessions](docs\u002Fimages\u002Fdashboard-overview-bottom.jpg)\n\n## What this is useful for\n\n- Seeing which of your prompts are expensive (surprise: they usually involve large tool results).\n- Comparing token usage across projects you've worked on.\n- Spotting wasteful patterns — the same file read twenty times in a session, a tool call returning 80k tokens.\n- Understanding what a \"cache hit\" actually saves you.\n- If you're on Pro or Max, confirming you're getting your money's worth in API-equivalent dollars.\n\n## Prerequisites\n\n- **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.\n- **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.\n- **A web browser.** Any modern one.\n\nNo `pip install`. No Node.js. No build step.\n\n## Quickstart\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fnateherkai\u002Ftoken-dashboard.git\ncd token-dashboard\npython3 cli.py dashboard\n```\n\n> On Windows, if `python3` isn't on your PATH, substitute `py -3` for `python3` in every command below.\n\nThe command:\n1. Scans `~\u002F.claude\u002Fprojects\u002F` (first run can take 20–60 seconds on a heavy user's machine).\n2. Starts a local server at http:\u002F\u002F127.0.0.1:8080.\n3. Opens your default browser to that URL.\n\nLeave it running; it re-scans every 30 seconds and pushes updates live. Stop with `Ctrl+C`.\n\n## Where the data comes from\n\nClaude Code writes one JSONL file per session here:\n\n| OS | Path |\n|---|---|\n| macOS \u002F Linux | `~\u002F.claude\u002Fprojects\u002F\u003Cproject-slug>\u002F\u003Csession-id>.jsonl` |\n| Windows | `C:\\Users\\\u003Cyou>\\.claude\\projects\\\u003Cproject-slug>\\\u003Csession-id>.jsonl` |\n\nThe dashboard never modifies those files — it only reads them and keeps a local SQLite cache at `~\u002F.claude\u002Ftoken-dashboard.db`.\n\nTo point at a different location:\n\n```bash\npython3 cli.py dashboard --projects-dir \u002Fpath\u002Fto\u002Fprojects --db \u002Fpath\u002Fto\u002Fcache.db\n```\n\n### Environment variables\n\n| Var | Default | Purpose |\n|---|---|---|\n| `PORT` | `8080` | Port the local web server listens on |\n| `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). |\n| `CLAUDE_PROJECTS_DIR` | `~\u002F.claude\u002Fprojects` | Where to scan for session JSONL files |\n| `TOKEN_DASHBOARD_DB` | `~\u002F.claude\u002Ftoken-dashboard.db` | SQLite cache location |\n\nPricing lives in [`pricing.json`](pricing.json). Edit it directly if model prices change or to add a new plan.\n\n## CLI reference\n\n```bash\npython3 cli.py scan          # populate \u002F refresh the local DB, then exit\npython3 cli.py today         # today's totals (terminal)\npython3 cli.py stats         # all-time totals (terminal)\npython3 cli.py tips          # active suggestions (terminal)\npython3 cli.py dashboard     # scan + serve the UI at http:\u002F\u002Flocalhost:8080\n\n# dashboard flags\npython3 cli.py dashboard --no-open   # don't auto-open the browser\npython3 cli.py dashboard --no-scan   # skip the initial scan (use cached DB only)\n```\n\nChange the port: `PORT=9000 python3 cli.py dashboard`.\n\n## The 7 tabs\n\nThe dashboard is a single page with a hash-router tab bar across the top. Each tab is backed by its own JSON API under `\u002Fapi\u002F`:\n\n- **Overview** — all-time input\u002Foutput\u002Fcache 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.\n- **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.\n- **Sessions** — turn-by-turn view of any single session, with per-turn tokens and tool calls.\n- **Projects** — per-project comparison: tokens, session counts, and which files were touched most.\n- **Skills** — which skills you invoke most often, and (where we can measure them) their token cost. See [limitations](docs\u002FKNOWN_LIMITATIONS.md#skills-token-counts-are-partial).\n- **Tips** — rule-based suggestions for reducing token usage (repeated file reads, oversized tool results, low cache-hit rate, etc.).\n- **Settings** — switch pricing between API \u002F Pro \u002F Max \u002F Max-20x so cost figures everywhere else reflect your actual plan.\n\nThe Overview tab also has a built-in \"What do these numbers mean?\" panel that explains input\u002Foutput\u002Fcache tokens in plain English.\n\n## Troubleshooting\n\n**\"No data\" or empty charts.** Run `python3 cli.py scan` once to populate the DB, then reload.\n\n**Port 8080 already in use.** `PORT=9000 python3 cli.py dashboard`.\n\n**Numbers look wrong \u002F stuck.** The DB lives at `~\u002F.claude\u002Ftoken-dashboard.db`. Delete it and re-run `python3 cli.py scan` to rebuild from scratch.\n\n**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.\n\n## Accuracy note\n\nClaude 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.\n\n## Privacy\n\nNothing leaves your machine. No telemetry. No remote calls for your data. The browser fetches its JSON from `127.0.0.1`, and all JS\u002FCSS\u002Ffonts are served from that same local server — ECharts is vendored into `web\u002F`, and the UI falls back to system fonts rather than pulling from a font CDN. If you want to verify: `grep -r \"https:\u002F\u002F\" token_dashboard\u002F web\u002F` — you'll find nothing.\n\n## Tech stack\n\nPython 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.\n\nData flow: `cli.py` → `token_dashboard\u002Fscanner.py` → SQLite DB; `token_dashboard\u002Fserver.py` exposes `\u002Fapi\u002F*` JSON routes and serves `web\u002F`.\n\n## Further reading\n\n- [`CLAUDE.md`](CLAUDE.md) — conventions and architecture overview (also picked up automatically by Claude Code)\n- [`CONTRIBUTING.md`](CONTRIBUTING.md) — how to develop and test\n- [`docs\u002FKNOWN_LIMITATIONS.md`](docs\u002FKNOWN_LIMITATIONS.md) — rough edges\n- [`docs\u002Finspiration.md`](docs\u002Finspiration.md) — prior art and how this project diverges\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md). Short version: fork, `python3 -m unittest discover tests` before opening a PR, keep it stdlib-only.\n\n## License\n\n[MIT](LICENSE).\n","Token Dashboard 是一个本地仪表板，用于将 Claude Code 生成的 JSONL 格式对话记录转换为成本分析、热点视图和会话级使用洞察。其核心功能包括按提示计算成本、工具\u002F文件热图、子代理归属、缓存分析、项目比较以及基于规则的建议引擎。所有处理都在本地完成，确保数据安全不外泄。该项目适合需要监控和优化 Claude Code 使用情况的开发者或团队，特别是那些希望了解 API 调用成本、识别浪费模式并确认付费计划价值的用户。技术上，它使用 Python 开发，运行时仅需 Python 环境与现代浏览器支持，无需额外安装依赖。",2,"2026-06-11 02:41:43","CREATED_QUERY"]