Claude Code session analysis with zero LLM calls by default, opt-in two-pass AI.
A standalone Python CLI that parses ~/.claude/projects/**/*.jsonl session logs
and produces markdown reports. Date-range filtering, toggleable sections, and an optional
two-pass LLM pipeline for qualitative insights.
Download cc-inspect.py · View source
# Last 30 days, all quantitative sections
python3 cc-inspect.py
# Date range
python3 cc-inspect.py --from 2026-03-01 --to 2026-03-31
# Specific sections only
python3 cc-inspect.py --sections tools,tokens,friction
# Write to file
python3 cc-inspect.py -o report.md
# Filter by project
python3 cc-inspect.py --project myapp
12 toggleable report sections, selected via --sections:
| Section | Contents |
|---|---|
summary | Session count, duration, tokens, commits, files touched |
tools | Tool usage ranking with bar charts, error breakdown |
tokens | Input/output/cache token breakdown, per-model stats |
langs | Languages by file touches |
projects | Per-project breakdown (sessions, messages, duration, tokens) |
time | Hour-of-day histogram, day-of-week, session duration distribution |
git | Commits, pushes, branch usage |
friction | Tool errors, user interruptions, high-error and long sessions |
commands | Slash command usage frequency |
multi | Overlapping session detection |
mcp | MCP server and tool usage by server |
facets | LLM-extracted qualitative data (requires --llm) |
The default mode uses zero API calls. For qualitative analysis, an opt-in two-pass pipeline adds narrative insights on top of the quantitative report:
Pass 1 — Haiku extraction. Per-session transcript → structured JSON facets
(goals, outcomes, satisfaction signals, friction types, user instructions). Cached to
~/.claude/cc-inspect/facets/ so you never pay twice for the same session.
Pass 2 — Sonnet synthesis. One call across all facets → interaction style analysis, what's working, friction points, CLAUDE.md suggestions.
# Both passes
python3 cc-inspect.py --llm
# Just extract (cache facets for later)
python3 cc-inspect.py --extract-only
# Just synthesize from cached facets
python3 cc-inspect.py --synthesize-only
# Override models
python3 cc-inspect.py --llm --extract-model claude-haiku-4-5-20251001 \
--synthesis-model claude-sonnet-4-20250514
Set ANTHROPIC_API_KEY in your environment or pass --api-key.
/insightsAnthropic's built-in /insights command fires 8+ Opus calls on every run (~$2–5).
cc-inspect does all quantitative analysis in pure Python. The opt-in LLM passes use Haiku
for extraction (cached) and Sonnet for synthesis — repeat runs on the same date range cost
zero for extraction and ~$0.10 for synthesis.
Python 3.10+. No dependencies (stdlib only, uses urllib for API calls).
Built by studying the leaked Claude Code /insights implementation (3,200 lines of TypeScript)
and redesigning for cost efficiency. The original uses Opus for both extraction and synthesis passes,
has no date filtering, no section toggles, and no caching strategy that survives across runs on
different date ranges.