Claude InsightsLocal-first dashboard
Overview
  • Dashboard
Activity
  • Sessions
  • Projects
Insights
  • Tools
  • Models
  • Costs
Help & support
  • Documentation
  • Data sources
  • From the developerFollow & support ✨
Overviewdocs
v0.1.0Reading from /home/sbx_user1051/.claudeLast parsed now

Command Palette

Search for a command to run...

Documentation

Claude Code Insights

A local-first analytics dashboard for Claude Code. It parses your ~/.claude/projects/**/*.jsonl session logs in-process and surfaces token usage, cache savings, cost breakdowns, tool patterns, and session timelines — all without sending any data off your machine.

Overview

What this dashboard does

Six surfaces, one source of truth: your Claude Code JSONL session files.

Overview

KPIs (cost, sessions, messages, cache hit rate), the cache donut + hit-rate trend, daily cost areas, activity heatmap, and top tools/projects.

Sessions

Sortable, filterable list of every parsed session. Responsive table on desktop, card list on mobile. Click into per-session timelines.

Projects

Roll-ups by project key with sparklines, last-active dates, and detail pages.

Tools

Most-used tools with call counts, error rates, and per-tool drill-downs.

Models

Per-model token share and cost breakdown across your sessions.

Costs

Daily area chart split by category (input/output/cache create/cache read), with a CSV export.

Architecture

How it works

Three layers: a streaming parser, a memoised aggregator, and the Next.js App Router UI.

01

Parser

src/lib/parser

  • Walks your CLAUDE_DIR for *.jsonl session files.
  • Streams each line through a Zod-validated event schema.
  • Extracts assistant usage (tokens, model, tools).
  • Filters out malformed lines without aborting the file.
02

Aggregator

src/lib/aggregations

  • Folds events into per-day, per-project, per-tool, per-model buckets.
  • Prices usage with the strict universal converter (Bedrock/Vertex/regional aware).
  • Caches aggregates by file mtime — re-uses across requests.
  • Exposes a single typed Aggregates object to the UI.
03

App

src/app

  • Server components fetch aggregates via getCachedAggregates().
  • Client components own filters (nuqs), tables (TanStack), charts (Recharts).
  • Tailwind v4 + theme-aware Sellzy palette in globals.css.
  • POST /api/revalidate clears the cache; GET /api/export emits CSV.
Cost model

How costs are calculated

Strict per-message pricing using public API list rates — works for Anthropic API, Bedrock, Vertex, and regional clones.

For each assistant message, the aggregator pulls model and usage and runs them through priceUsage(). Model IDs are normalised to a canonical key first, so any provider format collapses to the same rate row.

Provider inputCanonical key
claude-sonnet-4-5-20250929claude-sonnet-4-5
anthropic.claude-opus-4-7-v1:0claude-opus-4-7
us.anthropic.claude-haiku-4-5-20251001-v1:0claude-haiku-4-5
claude-opus-4@20250514claude-opus-4
claude-sonnet-4-latestclaude-sonnet-4

Service-tier multipliers are applied uniformly — standard = 1.0, batch = 0.5, priority = 1.25. The "without cache" baseline reprices every cache read/create token at the input rate to expose savings.

Max plan note: The shown "cost" is a list-price equivalent, not what you're billed under Claude Max. Treat it as "what this usage would cost on pay-as-you-go" — usually how you measure the value of your subscription. Set STRICT_PRICING=true to zero unknown models instead of using fallback rates.
Setup

Getting started

It's a Next.js 16 app — clone, install, run.

Local development
Three commands and you're running.
pnpm installpnpm dev# open http://localhost:3000
Environment
Drop these into .env.local.
# Where to read JSONL session files from.CLAUDE_DIR=~/.claude# Use the bundled fixtures instead of ~/.claude.FIXTURES_MODE=false# Live-tail new sessions as they're written.WATCH_CLAUDE_DIR=false# Strict pricing: unknown models cost $0 instead of fallback.STRICT_PRICING=false# Override fallback rates / 1M tokens (USD).RATE_INPUT=15RATE_OUTPUT=75RATE_CACHE_READ=1.5RATE_CACHE_CREATE=18.75# Repo link used by the GitHub button in the header.NEXT_PUBLIC_GITHUB_URL=https://github.com/your-user/your-fork
Privacy

Local-first by design

Your session logs never leave the machine.

JSONL files are read directly from your filesystem by the Next.js server process.

No telemetry, no analytics, no third-party SDKs in the runtime bundle.

Aggregates live in-memory keyed by file mtime — they're rebuilt automatically when files change.

Keyboard

Shortcuts

Power-user navigation across every page.

Open command palette⌘K
Go to overviewgo
Go to sessionsgs
Go to projectsgp
Go to toolsgt
Go to modelsgm
Go to costsgc
Show shortcuts help?

Need to tweak something at runtime? Hit the Settings button in the header for the live config snapshot.