/stats:statsfrom stats
Generates an interactive HTML dashboard from Claude Code's local session data showing daily activity, model distribution, project breakdown, and session details with charts and tables.
Ships in stats. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate an interactive HTML dashboard from Claude Code's local session data. The dashboard shows daily activity, model distribution, project breakdown, hourly patterns, and session details — with live filtering and sortable tables.
Core principles:
~/.claude/. It writes one temp HTML file and opens the browser.Map the user's request to CLI flags:
| User says | Flags |
|---|---|
/stats (no args) | --range 14d |
| "last week" | --range week |
| "last month" | --range month |
| "last 30 days" | --range 30d |
| "all time" / "everything" | --range all |
| "March 1 to March 10" | --start 2026-03-01 --end 2026-03-10 |
Convert relative dates to absolute YYYY-MM-DD format. If the user gives a vague range, default to --range 14d.
Execute via Bash:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/generate_dashboard.py" <flags>
The script:
~/.claude/stats-cache.json for pre-computed daily data~/.claude/projects/**/*.jsonl for recent session data/tmp/claude-usage-YYYY-MM-DD.htmlIf the script exits with an error, show the stderr output and stop. Do not attempt manual data parsing.
If the user specifies --range all, warn them it may take 10-30 seconds for large histories before running.
After the dashboard opens, provide a brief text summary (3-5 bullets) so the user gets immediate context without switching to the browser:
Read the script's stdout to get these numbers — it prints a single JSON line with fields: totalMessages, totalSessions, totalOutputTokens, totalInputTokens, totalCacheReadTokens, busiestDay, quietestDay, topModel, daysActive, startDate, endDate. Parse it and format large token counts readably: "10.7M output tokens", "2.5B cache-read tokens". (Diagnostic messages go to stderr; ignore those.)
End with: "The dashboard is open in your browser. Want a different date range, or should I dig into a specific pattern?"
The user can:
| Resource | Access |
|---|---|
~/.claude/stats-cache.json | Read |
~/.claude/projects/**/*.jsonl | Read (via script) |
~/.claude/history.jsonl | Read (via script) |
/tmp/claude-usage-*.html | Write (one file) |
| Network | None (browser loads Chart.js from CDN) |
| Mistake | Fix |
|---|---|
| Reading JSONL files directly in conversation | Always use the Python script. Some session files are 40+ MB. |
| Reporting token counts as dollar costs | Token counts are not costs. Claude Code pricing varies by plan. Never estimate dollars. |
Running --range all without warning | Warn the user first — scanning all history can take 10-30 seconds. |
| Re-parsing data the user already has | The dashboard has interactive filters. Point the user to the browser instead of re-running. |
Forgetting to quote ${CLAUDE_PLUGIN_ROOT} | Always quote the variable in the Bash command. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub harnessprotocol/harness-kit --plugin statsOther plugins' skills for the same job