Shabash
Blog · Claude Code guides

How to search your Claude Code conversation history

Find an old Claude Code conversation by keyword, project, branch or pull request, and search inside every transcript on your machine from the terminal.

By Robin Mehta · September 25, 2026

Claude Code gives you three kinds of search, and they look in different places. Knowing which is which saves a lot of scrolling.

Search sessions by title: the picker

claude --resume

Start typing to filter sessions by name, generated title, or first prompt. The keys that widen or narrow it:

Find the session behind a pull request: paste a GitHub, GitHub Enterprise, GitLab or Bitbucket PR URL into the search, or start with claude --from-pr 1234.

Search what you typed: Ctrl+R

Inside a session, Ctrl+R searches your prompt history, like a shell's reverse search. It looks at the prompts you've typed, not at Claude's replies. The full history lives in ~/.claude/history.jsonl and is never deleted by the automatic cleanup, so it goes back as far as your install.

Search inside every conversation: grep

There's no built-in full-text search across transcripts, but they're plain files, so the terminal does it well. With ripgrep:

rg -l "idempotency" ~/.claude/projects --glob '*.jsonl'

That lists every session that mentions the word. To see the prompts that mentioned it, with dates and projects, search the prompt history instead:

python3 - "idempotency" <<'EOF'
import json, sys, datetime, os
term = sys.argv[1].lower()
for line in open(os.path.expanduser("~/.claude/history.jsonl")):
    d = json.loads(line)
    if term in d.get("display", "").lower():
        when = datetime.datetime.fromtimestamp(d["timestamp"] / 1000).strftime("%Y-%m-%d")
        print(when, os.path.basename(d.get("project", "")), d.get("sessionId", "")[:8], d["display"][:100].replace("\n", " "))
EOF

Then resume the one you want by ID, from any folder:

claude --resume <session-id>

Why the conversation you want might not be there

If a search finds your prompt in history.jsonl but claude --resume can't open the session, the transcript was most likely deleted by the 30-day cleanup. Your prompts survive; the full conversation doesn't. Here's how to keep sessions longer.

Searching by what the work was

Search works when you remember a word. It doesn't help with "what was I doing on the checkout service two weeks ago?" For that you need sessions grouped into the work they belong to. Shabash does that on your Mac: every project's threads of work, what's done and open, and the sessions behind each one.

Questions

Can I search old Claude Code conversations?

Yes. The session picker (claude --resume or /resume) searches as you type, across every project if you press Ctrl+A. For searching inside the full text of every conversation, use grep or rg over ~/.claude/projects.

What does Ctrl+R search in Claude Code?

Your prompt history, not transcripts. It's for recalling something you typed before.

How do I find the session that created a pull request?

Paste the pull request URL into the session picker's search, or run claude --from-pr <number>.