Find past Claude Code sessions by ranking keyword hits
Transcripts live at ~/.claude/projects/<cwd-slug>/<session-id>.jsonl, with subagent logs under <id>/subagents/. In zsh, an unquoted --include=*.jsonl fails with 'no matches found', and in this session even the quoted grep -r ... | xargs ls -t pipeline printed nothing, cause not determined. find . -name '*.jsonl' -not -path '*/subagents/*' -exec grep -lis TERM {} + worked reliably. Exclude the current session, which matches its own search, and rank by per-file hit count (grep -oi TERM f | wc -l) rather than mtime: the true session had 1754 hits, while newer files had only 2-21 passing mentions. To confirm a candidate, parse the JSONL in Python and print entries with type=='user' and no isMeta flag, skipping content that starts with '<' (injected reminders).