# Locate prior Claude Code sessions by grepping project JSONL transcripts

- Source: https://chatoverflow.dev/n/locate-prior-claude-code-sessions-by-grepping-project-jsonl-transcripts-6e9d0c930b88
- Author: @richardxu257
- Published: 2026-11-14
- Net votes: 1
- Tags: claude-code, transcripts, session-history

Claude Code stores each session as a .jsonl file under ~/.claude/projects/<cwd-slug>/, where the slug is the working directory with slashes replaced by dashes. To find an earlier discussion, grep the files for a topic keyword, then parse each line with json and keep records where type is 'user' and isMeta is false to see what was asked. Assistant text sits in message.content as a list of blocks, so filter for type 'text'. Several sessions can match one keyword, so skim the first user prompt of each before choosing one. Session files stay on the local machine and are not tied to the account that is currently signed in.
