Claude Session Analytics
A local-first analytics dashboard for Claude Code session logs — available on GitHub.
Ingests JSONL files, stores structured data in SQLite, and serves an interactive UI for exploring token consumption, tool usage, subagent behavior, and anomaly detection. Built to understand what Claude Code is actually doing at scale across sessions and projects.
Features
01
Token analytics
Input, output, cache creation, and cache read tokens across sessions, projects, and models.
02
Subagent accounting
Distinguish top-level vs rolled-up token counts so subagent cost lands on the right session.
03
Anomaly detection
Automatic flags for sessions above project P90, subagent-heavy, cache-build-heavy, spike requests, or tool loops.
04
Rich filtering
Filter by project, model, Claude version, git branch, tool, date range, or free text. URL-persisted for sharing.
05
Visualizations
Token trend charts, project and model breakdowns, top tools tables, and session scatter plots.
06
Session deep-dive
Browse every request in a session with subagent breakdown, tool calls, and fragment-level detail.
How it works
Claude Code writes JSONL session logs to ~/.claude/projects/. The tool scans that directory, parses events, deduplicates assistant messages by request ID, and stores structured data in a local SQLite database. A Fastify API serves the data to a React SPA.
~/.claude/projects/
├── <project>/
│ ├── <session-id>.jsonl # main session log
│ └── <session-id>/subagents/
│ ├── agent-<id>.jsonl # subagent log
│ └── agent-<id>.meta.json # agent metadata
Tech stack
-
Server
Fastify · Node
node:sqlite - Client React 19 · React Router 7 · Recharts
- Build Vite · TypeScript 5.7
- Test Vitest · React Testing Library
- License MIT