session-analytics

Aggregate Claude Code JSONL session logs into a queryable DuckDB database.

2|Updated Sep 12, 2016
One-click install
npx skills add https://github.com/paulnsorensen/dotfiles --skill session-analytics-paulnsorensen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-analytics
Source: https://github.com/paulnsorensen/dotfiles/tree/main/claude/skills/session-analytics
Command: npx skills add https://github.com/paulnsorensen/dotfiles --skill session-analytics-paulnsorensen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Query Claude Code's JSONL session logs via DuckDB for usage analytics, tool patterns, error forensics, and routing decisions. Use when the user asks about their Claude usage patterns, tool frequencies, error rates, permission denials, agent routing, skill invocations, MCP server usage, session timelines, or any question about "how has Claude been working". This skill turns ~900MB of raw JSONL into a queryable DuckDB database — use it instead of writing ad-hoc Python scripts to parse logs. Do NOT use for debugging current code issues, reading individual session transcripts, or questions about Claude's capabilities — this skill is for aggregate usage analytics across historical sessions.

Core Features & Use Cases

  • Ingest and consolidate historical JSONL logs into a unified analytics store.
  • Analyze tool usage patterns, error frequencies, and session timelines across sessions.
  • Respond to questions about long-term usage trends and routing decisions using SQL-backed insights.

Quick Start

Run ingestion with python3 scripts/ingest.py to ingest logs, then query the DuckDB database for analytics.

Frequently Asked Questions about session-analytics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze Claude Code JSONL session logs for usage patterns?

Yes, DuckDB can consolidate approximately 900MB of raw JSONL session logs into a unified analytics store, allowing you to run SQL queries for tool usage patterns, permission denials, and agent routing decisions across historical sessions.

What's the best way to query tool frequencies and error rates from Claude logs?

You should use this approach instead of writing ad-hoc Python scripts to parse logs because it ingests and consolidates historical JSONL logs into a unified DuckDB analytics store, providing efficient SQL-backed insights for long-term usage trends.

Can I track MCP server usage and skill invocations from Claude session timelines?

This approach is intended for aggregate usage analytics across historical sessions, so you should not use it for debugging current code issues, reading individual session transcripts, or answering questions about Claude's capabilities.

Do I need Python and DuckDB to parse JSONL logs for Claude usage analytics?

Yes, you need Python to run the ingestion script that parses JSONL logs and consolidates them into a DuckDB database, which serves as the queryable analytics store for generating SQL-backed usage insights.