← Back to all posts

Claude Code Stats Merger - Visualize Your AI Coding Activity

Looking to merge and visualize your Claude Code CLI statistics? If you use Claude Code across multiple machines, your usage data gets scattered across separate stats-cache.json files. That's why I built the Claude Code Stats Merger — a minimalist tool that combines all your activity data into beautiful visualizations.

Why Do You Need a Stats Merger?

Claude Code CLI tracks your usage locally, but it doesn't merge data across machines. If you code on a desktop at work, a laptop at home, and maybe a server for remote work — you end up with fragmented statistics.

The Claude Code Stats Merger solves this by:

  • Combining multiple stats-cache.json files into unified analytics
  • GitHub-style contribution heatmaps showing your coding activity over 365 days
  • Token usage tracking across different AI models
  • Hourly activity patterns to identify your most productive hours
  • Export capabilities for further analysis or reporting

Key Features

Drag-and-Drop File Upload

Simply drag your stats-cache.json files into the upload zone. The tool validates each file and shows you a summary before merging.

Looking for your stats files? They're typically located at:

  • Windows: %USERPROFILE%\.claude\stats-cache.json
  • macOS/Linux: ~/.claude/stats-cache.json

GitHub-Style Contribution Heatmap

The tool implements GitHub's exact contribution graph algorithm:

Feature Description
53 columns × 7 rows Represents one full year of activity
Quartile-based colors Dynamic thresholds (0-25%, 25-50%, 50-75%, 75-100%)
Responsive sizing Auto-adjusts to fill container width
Hover details Shows exact date and message count

The heatmap provides an instant visual summary of your coding consistency over the past year.

Multi-Dimensional Analytics

Summary Statistics at a glance:

  • Total messages and sessions
  • Combined token usage (input + output)
  • Active days out of 365
  • Date range of activity
  • Peak usage hour

Hourly Activity bar chart showing when you're most productive throughout the day.

Token Trend line chart tracking token consumption over time by model.

Smart Data Merging

The tool intelligently combines data from multiple sources:

  • dailyActivity: Accumulates messageCount, sessionCount, and toolCallCount by date
  • dailyModelTokens: Sums tokens by date and model
  • modelUsage: Aggregates all model statistics
  • hourCounts: Combines hourly activity patterns

Same dates and properties are merged (summed), ensuring no data duplication.

Export Options

  • ⬇ Export JSON: Download merged data as a JSON file for custom analysis
  • 📷 Screenshot: Capture the visualization panel as a high-resolution PNG (2x scale)

Privacy First

All processing happens locally in your browser. No data is sent to any server. Your usage statistics stay private.

How to Use the Claude Code Stats Merger

Step 1: Locate Your Stats Files

Find your stats-cache.json files from each Claude Code CLI installation:

# Windows
echo %USERPROFILE%\.claude\stats-cache.json

# macOS/Linux
echo ~/.claude/stats-cache.json

Step 2: Upload Files

  1. Open the Claude Code Stats Merger
  2. Drag and drop your stats-cache.json files into the upload zone
  3. Alternatively, paste JSON content directly into the textarea

Step 3: Merge & Visualize

Click the "Merge & Visualize" button to process your data. The tool will:

  • Validate all uploaded files
  • Merge statistics intelligently
  • Render interactive visualizations
  • Enable export options

Step 4: Explore & Export

  • Hover over heatmap cells for daily details
  • Check hourly activity to identify peak productivity times
  • Review token trends by model
  • Export merged data or screenshots as needed

Use Cases

Multi-Environment Tracking

Merge stats from home, work, and multiple dev machines. Get a complete picture of your AI-assisted coding activity across all environments.

Activity Review

See your Claude Code CLI usage patterns over the past year. Identify streaks, gaps, and overall consistency in your AI-powered development workflow.

Token Analysis

Understand token consumption across different AI models (Opus, Sonnet, Haiku). Track costs and optimize your model selection for different tasks.

Productivity Insights

Identify peak usage hours and active development days. Correlate your AI assistant usage with your most productive coding sessions.

Understanding the Data Structure

The tool expects stats-cache.json files generated by Claude Code CLI:

{
  "version": 1,
  "lastComputedDate": "2026-01-19",
  "dailyActivity": [
    {
      "date": "2025-11-25",
      "messageCount": 2,
      "sessionCount": 1,
      "toolCallCount": 0
    }
  ],
  "dailyModelTokens": [
    {
      "date": "2025-11-25",
      "tokensByModel": {
        "claude-opus-4.5": 9060
      }
    }
  ],
  "modelUsage": {
    "claude-opus-4.5": {
      "inputTokens": 112432,
      "outputTokens": 8912,
      "cacheReadInputTokens": 819456
    }
  },
  "totalSessions": 51,
  "totalMessages": 4571,
  "hourCounts": {
    "9": 7,
    "18": 15
  },
  "firstSessionDate": "2025-11-25T06:46:34.382Z"
}

Technical Design

The Claude Code Stats Merger is built with modern web standards:

  • Pure HTML/CSS/JavaScript — No frameworks, no build process
  • Chart.js 4.4.0 — For token trend line charts
  • html2canvas 1.4.1 — For screenshot capture
  • Fast loading — Minimal code for instant page loads
  • Offline capable — Once loaded, works without internet
  • Responsive design — Works on phones, tablets, and desktops
  • Dark mode — Full theme support with automatic detection

Try the Claude Code Stats Merger

Ready to visualize your AI coding activity? Open the Claude Code Stats Merger and upload your stats files. No signup, no server uploads — just clean, private analytics that work.


Have feedback or feature requests? Let me know.