claude-code-metrics-analysislisted
Install: claude install-skill kookr-ai/kookr
# Claude Code Metrics Analysis
## When to Use
- Periodically (weekly/monthly) to spot UX friction trends
- After noticing slowness, rate limits, or unexpected costs
- When deciding which permissions to auto-approve or which workflows to optimize
- When investigating whether Claude Code usage patterns are efficient
## Data Sources
All data lives under `~/.claude/`:
| Source | Path | Format | Contains |
|--------|------|--------|----------|
| Stats cache | `stats-cache.json` | JSON | Aggregate usage: daily activity, model tokens, hour distribution, session totals |
| Telemetry | `telemetry/*.json` | JSON lines | Granular events: tool use, errors, stalls, rate limits, session lifecycle, performance |
| History | `history.jsonl` | JSONL | User prompts with timestamps, paste events, session IDs, project paths |
## Analysis Procedure
### Step 1: Load aggregate stats
Read `~/.claude/stats-cache.json` and extract:
- **Usage trends**: daily message/session/tool counts — look for spikes or drops
- **Hour distribution** (`hourCounts`): identify peak hours and potential burnout patterns
- **Model usage**: token consumption by model, cache hit ratios
- **Session extremes**: longest session, avg messages/session
### Step 2: Extract telemetry event counts
Run a frequency count across all `~/.claude/telemetry/*.json` files:
```bash
cat ~/.claude/telemetry/*.json | python3 -c "
import sys, json, collections
events = collections.Counter()
for line in sys.stdin:
try:
d =