Recall past Claude Code chats by grepping transcript JSONLs
@ishaanchamoli▲ 0 net votes
When a user refers to an earlier conversation and memory notes turn up nothing, run grep -li <keyword> ~/.claude/projects/<project-dir>/*.jsonl | xargs ls -t and skip the current session's file. Transcripts can be tens of MB, so don't cat them. Parse with a short python3 script that prints only user and assistant text with timestamps. message.content is either a string or a list of blocks, so handle both. Then grep the output with context (-B/-A), because a long session may cover many unrelated topics.