Skip to main content
Hosted mode lets you use Claude Analytics without running a local server. Simply export your data and upload it to the hosted web app — all processing happens entirely in your browser.
Privacy guarantee: Your data never touches any server. The upload is processed 100% client-side using the Web File API.

How It Works

  1. Export: Run a script locally that reads your ~/.claude/ directory and generates a single JSON file
  2. Upload: Drag and drop the file into the hosted app at claude-analytics.vercel.app
  3. Process: Your browser parses the JSON and renders the dashboard
The hosted app is a static Next.js site. There is no backend server — just HTML, CSS, and JavaScript delivered via CDN.

Step 1: Export Your Data

Quick Export (No Installation)

The export script uses only Node.js built-ins, so you don’t need to install any dependencies:
git clone https://github.com/1shanpanta/claude-analytics.git && cd claude-analytics
node scripts/export.mjs
Output:
Claude Code Analytics — Data Export

  stats-cache.json ✓
  session-meta/ ✓ (127 sessions)
  history.jsonl ✓ (1,543 entries)
  account info ✓ (a1b2c3d4...)
  memories ✓ (23 files across 5 projects)

Exported to: /path/to/claude-analytics-export.json (2.4 MB)
Upload this file at: https://claude-analytics.vercel.app

What Gets Exported

The export file contains:
DataSourcePurpose
Stats cache~/.claude/stats-cache.jsonAggregated metrics, daily activity, model usage
Session metadata~/.claude/usage-data/session-meta/*.jsonPer-session duration, tools, tokens, commits
History~/.claude/history.jsonlAll prompts with timestamps
Project memories~/.claude/projects/*/memory/*.mdProject-specific context files
Account info~/.claude/statsig/Account UUID (optional, for multi-profile support)
The export does not include full conversation messages. Those are only available in local mode.

Export File Structure

{
  "stats": { /* StatsCache */ },
  "sessions": [ /* SessionMeta[] */ ],
  "history": [ /* HistoryEntry[] */ ],
  "memories": [ /* ProjectMemory[] */ ],
  "account": {
    "accountUUID": "a1b2c3d4-...",
    "organizationUUID": "org-..."
  },
  "exportedAt": "2026-03-04T12:34:56.789Z"
}

Step 2: Upload to Hosted App

Drag and Drop

  1. Visit claude-analytics.vercel.app
  2. Drag claude-analytics-export.json onto the upload zone
  3. Wait for the processing indicator (usually < 1 second)
  4. Your dashboard appears

Click to Browse

Alternatively, click the upload zone and select the file from your file picker.

Client-Side Processing

Here’s how the hosted app processes your upload:
// From: src/components/upload-zone.tsx
const processFile = useCallback(async (file: File) => {
  setLoading(true);
  setError(null);
  try {
    const text = await file.text();
    const data = JSON.parse(text) as DashboardData;

    if (!data.sessions && !data.stats) {
      setError("Invalid file format. Please use the export script to generate the data file.");
      return;
    }

    // Ensure arrays exist
    data.sessions = data.sessions || [];
    data.history = data.history || [];
    data.memories = data.memories || [];

    // Normalize old memory format (string[] → {name, content}[])
    for (const mem of data.memories) {
      if (mem.files?.length && typeof mem.files[0] === "string") {
        mem.files = (mem.files as unknown as string[]).map((f) => ({
          name: f,
          content: "",
        }));
      }
    }

    onDataLoaded(data);
  } catch {
    setError("Failed to parse file. Make sure it's a valid JSON export.");
  } finally {
    setLoading(false);
  }
}, [onDataLoaded]);
Key features:
  • Validates JSON structure before loading
  • Normalizes legacy export formats
  • Provides clear error messages for invalid files
  • Never sends data over the network

Multi-Profile Support

You can upload multiple export files and switch between them:
1

Upload First Profile

Drop your primary export file (e.g., work account)
2

Add Another Profile

Click the profile switcher in the top-right corner and select Upload Another
3

Switch Between Profiles

Use the dropdown to instantly switch dashboards
Profiles are stored in browser localStorage. They persist across sessions but are device-specific.

Profile Storage

Each profile is stored as:
interface Profile {
  id: string;               // UUID
  name: string;             // Account UUID or "Profile 1"
  data: DashboardData;      // Full export data
  uploadedAt: string;       // ISO timestamp
}
Profiles are saved to localStorage.getItem('claude-analytics-profiles').
Browser storage limits vary (usually 5-10 MB). Large exports (> 5 MB) may fail to save.

Privacy and Security

No Network Requests

The hosted app makes zero network requests with your data:
  • No analytics/tracking (no Google Analytics, Mixpanel, etc.)
  • No error reporting (no Sentry, LogRocket, etc.)
  • No CDN uploads (everything processes in-memory)

Browser Console Verification

You can verify this yourself:
  1. Open DevTools (F12) → Network tab
  2. Upload your file
  3. Check that no network activity occurs

Data Deletion

To remove your data from the browser:
// In browser console:
localStorage.removeItem('claude-analytics-profiles');
location.reload();

localStorage Risks

While data stays local, be aware:
  • Browser extensions can access localStorage
  • Shared computers may expose data to other users
  • localStorage is not encrypted at rest
For maximum privacy, use local mode instead of hosted mode. See Local Mode Setup.

File Size Optimization

If your export is too large (> 5 MB), consider:

1. Filtering Old History

Modify scripts/export.mjs to only include recent prompts:
// Keep only last 1000 entries
history = history.slice(-1000);

2. Excluding Memories

Comment out the memory export section (lines 74-99 in export.mjs):
// let memories = [];
// try { ... } catch { ... }

3. Compressing the File

The export script doesn’t compress JSON. You can manually compress:
gzip claude-analytics-export.json
Then decompress before upload:
gunzip claude-analytics-export.json.gz

Troubleshooting

Check that the file:
  • Is valid JSON (run cat file.json | jq to validate)
  • Contains either stats or sessions field
  • Was generated by scripts/export.mjs (not manually edited)
Try re-exporting:
node scripts/export.mjs
Your export may contain valid JSON but no actual data. Check the file size:
ls -lh claude-analytics-export.json
If it’s < 1 KB, you likely haven’t used Claude Code enough to generate data.
Clear old profiles:
  1. Open DevTools → ApplicationLocal Storage
  2. Delete claude-analytics-profiles entry
  3. Refresh and re-upload
Ensure you’re using a modern browser:
  • Chrome 90+
  • Firefox 88+
  • Safari 14+
Older browsers may not support required JavaScript features.

Comparison: Local vs Hosted

FeatureLocal ModeHosted Mode
SetupClone + install + runExport + upload
Data accessDirect filesystem readsUpload JSON file
Conversation messages✓ Available✗ Not included
Privacy100% offlineClient-side only
Multi-profileManual switchingBuilt-in UI
PerformanceFast (< 200ms load)Instant (pre-loaded)
PortabilityMachine-specificWorks anywhere

Next Steps

Export Script Deep Dive

Understand what the export script does under the hood

Features Overview

Explore all available analytics features

Multi-Profile Guide

Learn how to manage multiple Claude accounts

Privacy & Security

Deep dive into data security guarantees

Build docs developers (and LLMs) love