analyze-usage

Loads Claude Code, Codex, and Cursor logs into DuckDB for SQL-based usage analysis.

1|Updated Nov 11, 2012
One-click install
npx skills add https://github.com/fairchild/dotfiles --skill analyze-usage-fairchild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: analyze-usage
Source: https://github.com/fairchild/dotfiles/tree/main/agents/shared/first-party-skills/analyze-usage
Command: npx skills add https://github.com/fairchild/dotfiles --skill analyze-usage-fairchild

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires duckdb, jq, and includes scripts (resource) and references (resource) components.

What problem does it solve? AI coding assistant logs are scattered across Claude Code, Codex, and Cursor in different formats, making it hard to answer questions about tool usage, costs, session history, and productivity patterns without manual digging through JSONL files. ## Core Features & Use Cases - Unified DuckDB Database: Incrementally loads logs from all three harnesses into one persistent database with unified views like interactions, daily_by_source, and repo_activity. - SQL and Search Interface: Run arbitrary SQL queries, search conversation content with ILIKE or BM25 full-text search, and inspect reasoning traces. - Cost Tracking: Pre-calculated cost_usd per invocation with editable model_pricing rates and aggregated cost_summary views. - Use Case: Ask which skills you use most, compare Claude Code versus Codex activity by repository, or find your peak coding hours over the last month. ## Quick Start Ask the agent to analyze your AI coding usage, for example by requesting your most used tools or a cost breakdown by repository for the past week.

Frequently Asked Questions about analyze-usage

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

FAQPage Schema
How do I analyze Claude Code usage statistics?▼

Run the analyze-usage script, which loads logs from ~/.claude/projects into a DuckDB database. Then query views like tool_summary, daily_summary, or session_overview with the query command to see tool usage, trends, and session details.

How can I search my AI coding conversation history?▼

Use the search command with a keyword to run an ILIKE search over conversation content. Add --fts for BM25 full-text search, --thinking to search reasoning traces, and filters like --repo, --user, or --since to narrow results.

Can I compare usage across Claude Code, Codex, and Cursor?▼

Yes, the unified interactions view normalizes data from all three harnesses into one schema. Query it grouped by source to compare interaction counts, or use daily_by_source and weekly_summary for time-based comparisons.

Does analyze-usage track API costs?▼

Yes, it calculates cost_usd per tool invocation using the editable model_pricing table with per-million-token rates. The usage_with_cost and cost_summary views provide pre-aggregated costs by repository and model.

What are the requirements and limitations of analyze-usage?▼

It requires DuckDB installed and optionally jq for Cursor workspace parsing. Cursor data is limited to user prompts and chat history since Cursor does not log tool-level detail, and Cursor and Codex data reload wholesale rather than incrementally.