claude-code-stats

skill
Guvenlik Denetimi
Uyari
Health Uyari
  • 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 Gecti
  • Code scan รขโ‚ฌโ€ Scanned 3 files during light audit, no dangerous patterns found
Permissions Gecti
  • Permissions รขโ‚ฌโ€ No dangerous permissions requested
Purpose
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.
SUMMARY

๐Ÿ“Š Track and visualize your Claude Code usage, costs, and session statistics with a local HTML dashboard.

README.md

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-memories to exclude project memory content. Press F2 in 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
KPI Dashboard Token & API Value Activity Agents
Projects Sessions Insights

Quick Start

  1. Clone the repository

    git clone https://github.com/AeternaLabsHQ/claude-code-stats.git
    cd claude-code-stats
    
  2. Create your configuration

    cp config.example.json config.json
    

    Edit config.json to match your subscription plan and preferences.

  3. Run the extractor

    python3 extract_stats.py
    
  4. Open 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: null means the plan is currently active
  • billing_day determines 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 metadata
  • claude_dir -- Path to the user's .claude directory
  • dot_claude_json -- (optional) Path to their .claude.json file

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

Yorumlar (0)

Sonuc bulunamadi