Choose your setup method
Claude Analytics offers two ways to get started:- Local mode — Run the development server and automatically load your
~/.claude/data - Hosted mode — Export your data and upload it to the hosted version for client-side processing
Both modes are completely privacy-focused. Local mode gives you direct filesystem access, while hosted mode processes everything client-side in your browser.
Local mode (recommended)
Local mode reads your Claude Code data directly from~/.claude/ and provides the most seamless experience.
Install dependencies
Install the required packages using npm or bun:
The project uses bun as the default package manager, but npm and yarn also work.
Start the development server
Run the development server:The application will start at
http://localhost:3000 and automatically load your ~/.claude/ data.Explore your analytics
Open your browser and navigate to
http://localhost:3000. You’ll see:- Activity heatmap showing daily message activity
- Session explorer with expandable message threads
- Model breakdown with token usage and costs
- Tool usage charts and statistics
- Searchable prompt history
Your dashboard is now running! All data is loaded from your local
~/.claude/ directory.Hosted mode
Hosted mode lets you use Claude Analytics without running a local server. Export your data and upload it to the hosted version.Clone the repository
You only need to clone the repository to access the export script:
No installation required for the export script — it uses only Node.js built-ins.
Export your data
Run the export script to generate a JSON file with your Claude Code data:The script will:
- Read
~/.claude/stats-cache.jsonfor aggregated statistics - Collect all session metadata from
~/.claude/usage-data/session-meta/*.json - Parse
~/.claude/history.jsonlfor prompt history - Extract account information from
~/.claude/statsig/ - Include project memory files from
~/.claude/projects/*/memory/*.md
You’ll see output showing what data was found:
Upload to the hosted version
Visit the hosted application and drag-and-drop the generated
claude-analytics-export.json file.The dashboard will load with all your data, providing the same features as local mode.Switch between profiles (optional)
You can upload multiple export files to compare different accounts or time periods:
- Click the profile switcher in the top navigation
- Upload additional export files
- Switch between profiles to compare analytics
Each profile maintains its own data and state. You can analyze multiple accounts side-by-side.
Available npm scripts
Thepackage.json includes several useful scripts:
package.json
npm run dev— Start the development server with hot reloadnpm run build— Build the production applicationnpm run start— Start the production servernpm run export-data— Export your Claude Code data to JSONnpm run lint— Run ESLint on the codebase
What data is included?
The export script collects comprehensive data from your~/.claude/ directory:
Stats cache
Stats cache
Aggregated statistics from
stats-cache.json:- Total sessions and messages
- Daily activity and token usage
- Model usage breakdown with costs
- Hour-by-hour session distribution
- Longest session metadata
Session metadata
Session metadata
Individual session files from
usage-data/session-meta/*.json:- Session ID and project path
- Start time and duration
- Message counts (user and assistant)
- Tool usage and language statistics
- Git commits and pushes
- Token usage (input and output)
- Lines added/removed and files modified
Prompt history
Prompt history
Complete prompt log from
history.jsonl:- Display text of each prompt
- Timestamp and project association
- Pasted contents and attachments
Account information
Account information
Account details from
statsig/ cache:- Account UUID
- Organization UUID (if applicable)
Project memories
Project memories
Memory files from
projects/*/memory/*.md:- Project-specific context
- Memory file contents (truncated to 5000 characters)
Next steps
Explore features
Learn about all the analytics features available in the dashboard
Setup guides
Detailed setup instructions for both local and hosted modes
Understanding data
Deep dive into Claude Code’s data structure and how it’s used
Privacy & security
Learn about Claude Analytics’ privacy-first architecture