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 --resumeStart typing to filter sessions by name, generated title, or first prompt. The keys that widen or narrow it:
Ctrl+A: every project on this machine, not just the current oneCtrl+W: every worktree of the current repositoryCtrl+B: only sessions from your current git branchSpace: preview a session before opening 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", " "))
EOFThen 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.