| name | analyze-usage |
| description | Analyze local AI coding-assistant activity across Claude Code, Codex, Cursor, and Pi. Use when the user asks about coding usage, tool or skill statistics, activity patterns, repositories, sessions, token costs, conversation history, or wants to query their AI coding logs. Triggers include "usage", "how much have I used", "most used tools", "skill popularity", "coding stats", "activity patterns", and "session history". |
| license | Apache-2.0 |
AI Coding Usage
Use scripts/analyze-usage to load local Claude Code, Codex, Cursor, and Pi logs into DuckDB, then answer usage questions with explicit scope and freshness. Treat the database as an activity ledger—not a productivity score or authoritative provider bill.
Required workflow
- Run
scripts/analyze-usage update before current-state analysis. Stop if it fails; updates are atomic, so a failure leaves the prior database intact.
- Run
scripts/analyze-usage --schema when constructing unfamiliar queries.
- Choose a metric whose unit matches the question. Read
references/analysis-guide.md for query patterns and interpretation boundaries.
- Report the database refresh time, time window, included harnesses, and any unknown-priced models with the result.
- For shareable or repeatable reporting, use
report with explicit UTC boundaries. Verify pricingCoverage, reconcile the provider/model totals, and keep the generated aggregate JSON private unless the user chooses a publication surface.
Do not compare raw interactions counts across harnesses as if they were equivalent: Claude Code, Codex, and Pi rows are tool calls, while Cursor rows are prompts. Use messages, sessions, active days, or per-source trends for cross-harness comparisons.