[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-708":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":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":31,"discoverSource":32},708,"claude-usage","phuryn\u002Fclaude-usage","phuryn","A local dashboard for tracking your Claude Code token usage, costs, and session history. Pro and Max subscribers get a progress bar. This gives you the full picture.","https:\u002F\u002Fwww.productcompass.pm\u002F",null,"Python",1771,332,17,2,0,41,89,270,123,20.57,"MIT License",false,"main",true,[27],"claude-code","2026-06-12 02:00:17","# Claude Code Usage Dashboard\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg?style=flat-square)](LICENSE)\n[![claude-code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fclaude--code-black?style=flat-square)](https:\u002F\u002Fclaude.ai\u002Fcode)\n\n**Pro and Max subscribers get a progress bar. This gives you the full picture.**\n\nClaude Code writes detailed usage logs locally — token counts, models, sessions, projects — regardless of your plan. This dashboard reads those logs and turns them into charts and cost estimates. Works on API, Pro, and Max plans.\n\n![Claude Usage Dashboard](docs\u002Fscreenshot.png)\n\n**Created by:** [The Product Compass Newsletter](https:\u002F\u002Fwww.productcompass.pm)\n\n---\n\n## What this tracks\n\nWorks on **API, Pro, and Max plans** — Claude Code writes local usage logs regardless of subscription type. This tool reads those logs and gives you visibility that Anthropic's UI doesn't provide.\n\nCaptures usage from:\n- **Claude Code CLI** (`claude` command in terminal)\n- **VS Code extension** (Claude Code sidebar)\n- **Dispatched Code sessions** (sessions routed through Claude Code)\n\n**Not captured:**\n- **Cowork sessions** — these run server-side and do not write local JSONL transcripts\n\n---\n\n## Requirements\n\n- Python 3.8+\n- No third-party packages — uses only the standard library (`sqlite3`, `http.server`, `json`, `pathlib`)\n\n> Anyone running Claude Code already has Python installed.\n\n## Quick Start\n\nNo `pip install`, no virtual environment, no build step.\n\n### Windows\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fphuryn\u002Fclaude-usage\ncd claude-usage\npython cli.py dashboard\n```\n\n### macOS \u002F Linux\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fphuryn\u002Fclaude-usage\ncd claude-usage\npython3 cli.py dashboard\n```\n\n---\n\n## Usage\n\n> On macOS\u002FLinux, use `python3` instead of `python` in all commands below.\n\n```\n# Scan JSONL files and populate the database (~\u002F.claude\u002Fusage.db)\npython cli.py scan\n\n# Show today's usage summary by model (in terminal)\npython cli.py today\n\n# Show the last 7 days (per-day breakdown + by-model totals)\npython cli.py week\n\n# Show all-time statistics (in terminal)\npython cli.py stats\n\n# Scan + open browser dashboard at http:\u002F\u002Flocalhost:8080\npython cli.py dashboard\n\n# Custom host and port via environment variables\nHOST=0.0.0.0 PORT=9000 python cli.py dashboard\n\n# Scan a custom projects directory\npython cli.py scan --projects-dir \u002Fpath\u002Fto\u002Ftranscripts\n```\n\nThe scanner is incremental — it tracks each file's path and modification time, so re-running `scan` is fast and only processes new or changed files.\n\nBy default, the scanner checks both `~\u002F.claude\u002Fprojects\u002F` and the Xcode Claude integration directory (`~\u002FLibrary\u002FDeveloper\u002FXcode\u002FCodingAssistant\u002FClaudeAgentConfig\u002Fprojects\u002F`), skipping any that don't exist. Use `--projects-dir` to scan a custom location instead.\n\n---\n\n## How it works\n\nClaude Code writes one JSONL file per session to `~\u002F.claude\u002Fprojects\u002F`. Each line is a JSON record; `assistant`-type records contain:\n- `message.usage.input_tokens` — raw prompt tokens\n- `message.usage.output_tokens` — generated tokens\n- `message.usage.cache_creation_input_tokens` — tokens written to prompt cache\n- `message.usage.cache_read_input_tokens` — tokens served from prompt cache\n- `message.model` — the model used (e.g. `claude-sonnet-4-6`)\n\n`scanner.py` parses those files and stores the data in a SQLite database at `~\u002F.claude\u002Fusage.db`.\n\n`dashboard.py` serves a single-page dashboard on `localhost:8080` with Chart.js charts (loaded from CDN). It auto-refreshes every 30 seconds and supports model filtering with bookmarkable URLs. The bind address and port can be overridden with `HOST` and `PORT` environment variables (defaults: `localhost`, `8080`).\n\n---\n\n## Cost estimates\n\nCosts are calculated using **Anthropic API pricing as of April 2026** ([claude.com\u002Fpricing#api](https:\u002F\u002Fclaude.com\u002Fpricing#api)).\n\n**Only models whose name contains `opus`, `sonnet`, or `haiku` are included in cost calculations.** Local models, unknown models, and any other model names are excluded (shown as `n\u002Fa`).\n\n| Model | Input | Output | Cache Write | Cache Read |\n|-------|-------|--------|------------|-----------|\n| claude-opus-4-7 | $5.00\u002FMTok | $25.00\u002FMTok | $6.25\u002FMTok | $0.50\u002FMTok |\n| claude-opus-4-6 | $5.00\u002FMTok | $25.00\u002FMTok | $6.25\u002FMTok | $0.50\u002FMTok |\n| claude-sonnet-4-6 | $3.00\u002FMTok | $15.00\u002FMTok | $3.75\u002FMTok | $0.30\u002FMTok |\n| claude-haiku-4-5 | $1.00\u002FMTok | $5.00\u002FMTok | $1.25\u002FMTok | $0.10\u002FMTok |\n\n> **Note:** These are API prices. If you use Claude Code via a Max or Pro subscription, your actual cost structure is different (subscription-based, not per-token).\n\n---\n\n## Files\n\n| File | Purpose |\n|------|---------|\n| `scanner.py` | Parses JSONL transcripts, writes to `~\u002F.claude\u002Fusage.db` |\n| `dashboard.py` | HTTP server + single-page HTML\u002FJS dashboard |\n| `cli.py` | `scan`, `today`, `stats`, `dashboard` commands |\n","Claude Code Usage Dashboard 是一个本地仪表盘，用于跟踪 Claude Code 令牌使用情况、成本和会话历史。该项目的核心功能包括展示详细的使用日志、成本估算以及图表化数据呈现，特别为 Pro 和 Max 订阅用户提供进度条显示，从而提供全面的使用概览。该工具仅依赖 Python 标准库实现，无需额外安装第三方包，适用于 API、Pro 和 Max 计划下的用户。通过读取本地 JSONL 文件并生成易于理解的数据视图，它为开发者提供了比 Anthropic 官方界面更丰富的信息展示，尤其适合需要密切监控 Claude Code 使用情况和成本控制的场景。","2026-06-11 02:38:48","CREATED_QUERY"]