| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
How much have you actually spent on Claude Code? Which projects burn the most tokens? Which tools is Claude calling for you most often? Which single prompt cost you $1.50?
This is a small Rill project that turns the local Claude Code session logs on your laptop into interactive dashboards. No data leaves your machine — Rill reads the JSONL transcripts directly out of ~/.claude/projects/.
Two dashboards on the same data:
Claude Code Usage Overview (canvas) — an at-a-glance report
Claude Code Cost & Usage Explorer (explore) — slice and drill
You need Rill installed locally. If you don't have it:
curl https://rill.sh | shThen:
rill start https://github.com/rilldata/claude-usage.gitThat's it. Open http://localhost:9009. The first time you run, Rill reads every JSONL file under ~/.claude/projects/ and materializes a DuckDB table — takes a few seconds. After that, navigate to Claude Code Usage Overview or Claude Code Cost & Usage Explorer in the sidebar.
Whenever you want fresher data, save any file in the project (or click "Refresh model" in the UI) and Rill reloads the JSONL files.
models/
claude_messages.yaml Reads ~/.claude/projects/*/*.jsonl, extracts every
user/assistant message with full text, tool calls,
thinking, tokens, and cost.
claude_model_pricing.yaml Per-model price table (input/output/cache rates).
Edit this if Anthropic changes prices.
metrics/
claude_usage.yaml ~25 dimensions and ~17 measures including
total_cost_usd, max_cost_per_message,
avg_cost_per_user_prompt.
dashboards/
claude_usage_canvas.yaml The overview canvas.
claude_usage_explore.yaml The drill-down explore.
The cost figures match Anthropic's actual API charge within a few percent. Known gaps:
Claude Code writes one JSONL file per session under ~/.claude/projects/<project-slug>/<session-id>.jsonl, with one event per content block. The claude_messages model reads all of them with DuckDB's read_json glob, extracts message content, tokens, and metadata, joins to a small pricing lookup table on a longest-prefix match, computes cost per row, then collapses streaming-chunk duplicates by grouping on request_id (merging text and summing block counts, taking cost once per API call). The metrics view sits on top of the model and powers both dashboards.
| Back | FazBrowse Home | New Git URL |