claude-code-stats
Health Warn
- No license รขโฌโ Repository has no license file
- Description รขโฌโ Repository has a description
- Active repo รขโฌโ Last push 0 days ago
- Community trust รขโฌโ 14 GitHub stars
Code Pass
- Code scan รขโฌโ Scanned 3 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions รขโฌโ No dangerous permissions requested
This tool parses your local Claude Code session transcripts to calculate hypothetical API costs and generate an interactive, local HTML dashboard for tracking usage statistics and visualizing session activity.
Security Assessment
The tool inherently accesses highly sensitive data, including source code snippets, file paths, and full conversation histories from your local session transcripts. However, the light code audit found no dangerous patterns, hardcoded secrets, or unexpected network requests. It generates a local HTML file, and the developers explicitly warn users not to host this output publicly, providing a built-in anonymization mode (F2) to redact sensitive information for safe screenshots. Overall risk is rated as Low, provided you keep the generated dashboard strictly local and offline.
Quality Assessment
The project appears well-maintained and actively developed, with its most recent push occurring today. It has garnered 14 GitHub stars, indicating a small but growing level of community trust and user validation. The main downside is the complete absence of a formal open-source license. Without a license, strict copyright laws technically apply, meaning users do not have legal permission to modify, distribute, or use the code outside of personal consumption.
Verdict
Safe to use locally, but be aware it processes highly sensitive chat transcripts and lacks a formal software license.
๐ Track and visualize your Claude Code usage, costs, and session statistics with a local HTML dashboard.
Claude Code Usage Statistics
A comprehensive analytics dashboard for Claude Code usage data. Parses your local Claude Code session transcripts, calculates hypothetical API costs, and generates an interactive HTML dashboard.
Disclaimer: This is an unofficial, community-built tool. Not affiliated with or endorsed by Anthropic.
[!WARNING]
This dashboard may contain sensitive data: source code snippets, file paths, API keys, project memories, conversation history, and internal notes. Do NOT publish the generated output to the public internet or any unsecured location. Use authentication or keep it local. Use--no-memoriesto exclude project memory content. PressF2in the dashboard to toggle anonymization mode for screenshots.
Features
- Time Range & Project Filter -- Global pill buttons (All / 7D / 30D / 90D / 1Y) and project search to filter the entire dashboard; plan costs adjust proportionally to the selected range
- KPI Dashboard -- Total API-equivalent cost, messages, sessions, token breakdown with hover tooltips explaining each metric
- Session Flow Visualization -- Interactive canvas-based session replay with node graph, particle animations, auto-play timeline, and fullscreen mode
- Token & API Value -- Daily costs, cumulative costs, model distribution
- Activity -- Message patterns, hourly distribution, weekday distribution
- Agents -- Subagent type distribution, error breakdown by category and tool, task management
- Projects -- Top projects by cost, detailed project pages with memories and workflow timeline
- Sessions -- Filterable/searchable session details with chat replay and subagent prompt viewer
- Plan & Billing -- Cost savings analysis vs. your subscription plan, split into monthly billing cycles
- Insights -- Tool usage, storage breakdown, git ops, telemetry, performance metrics
- Privacy -- F2 anonymization mode, configurable display name, empty session filter
- Mobile Responsive -- Dashboard layout adapts to mobile screens
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Quick Start
Clone the repository
git clone https://github.com/AeternaLabsHQ/claude-code-stats.git cd claude-code-statsCreate your configuration
cp config.example.json config.jsonEdit
config.jsonto match your subscription plan and preferences.Run the extractor
python3 extract_stats.pyOpen the dashboard
open public/index.html # macOS xdg-open public/index.html # Linux start public/index.html # Windows
Configuration
See config.example.json for all options:
| Key | Type | Default | Description |
|---|---|---|---|
language |
string |
"en" |
UI language ("en" or "de") |
plan_history |
array |
[] |
Your subscription plan history |
migration.enabled |
bool |
false |
Enable data from a migration backup |
migration.dir |
string |
null |
Path to migration backup directory |
additional_sources |
array |
[] |
Extra ~/.claude directories to merge (multi-user) |
Plan History
Each entry in plan_history represents a subscription period:
{
"plan": "Max",
"start": "2026-01-23",
"end": null,
"cost_eur": 87.61,
"cost_usd": 93.00,
"billing_day": 23
}
end: nullmeans the plan is currently activebilling_daydetermines billing cycle boundaries for cost analysis
Migration Support
If you migrated Claude Code data from another machine, you can include that historical data:
{
"migration": {
"enabled": true,
"dir": "~/backups/old-machine",
"claude_dir_name": ".claude-windows",
"dot_claude_json_name": ".claude-windows.json"
}
}
The script deduplicates sessions across both sources automatically.
Multi-User / Additional Sources
To include Claude Code data from other users on the same machine (or any additional ~/.claude directory), add them to additional_sources:
{
"additional_sources": [
{
"label": "alice",
"claude_dir": "/home/alice/.claude",
"dot_claude_json": "/home/alice/.claude.json"
}
]
}
label-- Identifies the source in session metadataclaude_dir-- Path to the user's.claudedirectorydot_claude_json-- (optional) Path to their.claude.jsonfile
The running user needs read access to the referenced directories. Sessions are deduplicated and all data (sessions, plans, todos, telemetry, etc.) is merged into the dashboard.
Output
The script generates files in the public/ directory:
index.html-- Self-contained interactive dashboard (open in any browser)dashboard_data.json-- Raw aggregated data (for custom analysis)
Automation
To auto-refresh the dashboard periodically:
*/10 * * * * cd /path/to/claude-stats && python3 extract_stats.py 2>&1 >> update.log
Requirements
- Python 3.8+
- No external dependencies (stdlib only)
- Claude Code installed with session data in
~/.claude/
Localization
The dashboard supports English and German. Set "language": "en" or "language": "de" in your config.json.
To add a new language, create a file in locales/ following the structure of locales/en.json.
License
MIT
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found






