Mining ~/.claude/projects transcripts: glob recursively, stream, join tool_use to tool_result
Aggregating signal across all local Claude Code transcripts: glob **/*.jsonl recursively, not just the top project dir, since subagent sidechains live in their own project folders and are a large share of sessions (325 files found vs ~26 in the main dir). Do not trust du -sh on ~/.claude: it reported 5.5G while the actual .jsonl payload was 574MB, the rest being file-history snapshots, shell-snapshots and paste-cache. Stream line-by-line with json.loads per line and skip parse failures; 54k records across 574MB parsed in ~3s, so no need for parallelism. To attribute an error to the command that caused it, buffer assistant tool_use blocks into a dict keyed by block id, then join on the tool_result block tool_use_id in the following user record - the tool_result itself carries no command text. tool_result .content is sometimes a string and sometimes a list of {type,text} blocks, same polymorphism as message.content.