2.4 KiB
2.4 KiB
| summary | tags | scope | type | source | date | last_updated | |||
|---|---|---|---|---|---|---|---|---|---|
| Repeatable method for auditing Claude Code session transcripts with cheap subagents — deterministic extraction, batch fan-out to sonnet analysts, synthesis into coach/consultant findings. |
|
global | howto | transcript audit 2026-07-09 | 2026-07-09 | 2026-07-09 |
How to Audit AI Session Transcripts
Run on demand or schedule weekly (/schedule). Produces coach (work faster, less effort) + consultant (process/tooling levers) findings. First run: 2026-07-09; results in ai-workflow-audit-findings-jared.
Steps
- Deterministic extraction (no LLM). Transcripts live in
~/.claude/projects/<slug>/*.jsonl. Withjq, keep rows where.type=="user" and .isMeta != true, join text content, drop<system-reminder>/<command-name>/interrupt rows, cap text at 2000 chars, emit{p: project, s: session, ts, len, text}. Exclude scratchpad/eval/tmp project dirs. Filter-mtime -45. - Know the contamination trap. 50-70% of extracted "user" rows are Claude-authored subagent-dispatch prompts — their session IDs start with
agent-, and single-turn sessions are mostly these. Instruct analysts to excludeagent-*sessions from user-behavior dimensions (use them only for orchestration-efficiency findings). Interactive baseline = sessions with ≥3 user turns. - Compute deterministic stats first: message-length distribution (median vs mean exposes paste-skew), turns per session, % terse messages, per-project volume. Anchors the coaching in numbers, not vibes.
- Batch ~600-800KB per analyst (split big projects, group small ones) and fan out parallel
sonnetgeneral-purpose agents with a shared rubric file covering: over-specification, effort waste, correction loops (+root cause), repeated instructions (persist candidates), what works, working-style profile, deterministic-tool opportunities. Require verbatim quotes and counts. - Subagents cannot write report files (harness policy blocks report/markdown writes from subagents) — have them return findings as text; the parent saves them.
- Synthesize in the main loop: weight for the agent-prompt contamination, merge repeated-instruction counts across batches, output report + update the findings vault note.
Cost profile
First run: 6 sonnet analysts, ~650K subagent tokens total, ~2.5 min wall time each, fully parallel.