How to Search, View & Resume Claude Code Sessions
Anthropic's Claude Code CLI gives developers superpowers right inside their terminal. But as you navigate complex repositories, finding past prompt rationales, tool executions, and file diffs from previous sessions can be painful. Here is everything you need to inspect, search, and resume your Claude Code history across macOS, Linux, and Windows.
Want to inspect a transcript.jsonl session right now with zero uploads?
Open our free, client-side session viewer to filter prompts, view tool call diffs, and inspect token consumption in any browser.
Where Does Claude Code Store Transcripts?
Whenever you execute claude in a repository, Anthropic records a complete step-by-step transcript of user inputs, assistant thoughts, tool calls (bash, ripgrep, file edits), and token metrics locally on your filesystem:
macOS & Linux:
~/.claude/projects/<sanitized-project-path>/transcript.jsonl
Windows:
%USERPROFILE%\.claude\projects\<sanitized-project-path>\transcript.jsonl
For example, if your repository is at /Users/you/work/api-server, the transcript file is saved under:
~/.claude/projects/Users-you-work-api-server/transcript.jsonl
Built-in Terminal Flags: Resuming Past Work
Claude Code includes flags to resume recent conversations within your terminal:
# Interactive session picker for the current workspace claude --resume # Short form claude -r
Limitations of the Native CLI Resume:
- Workspace Isolated:
claude -ronly lists sessions from your current active directory. If you ran a command across a different repo or branch earlier today, you cannot search across projects. - No Full-Text Search: You cannot quickly search for specific bash commands, code snippets, or error logs across past transcripts.
- Dense JSONL: Raw JSONL files are hard to parse in standard text editors due to nested JSON payloads and token objects.
How to Parse Claude Code History from Terminal
If you want to quickly grep for past user prompts in a project transcript without opening the file, use jq:
# Extract all user prompts in chronological order jq -r 'select(.type=="USER_INPUT") | .content' ~/.claude/projects/YOUR_PROJECT/transcript.jsonl # Find all bash commands run by Claude Code jq -r 'select(.type=="PLANNER_RESPONSE") | .tool_calls[]? | select(.name=="run_command") | .args.CommandLine' ~/.claude/projects/YOUR_PROJECT/transcript.jsonl
Better Workflow: L2Cache Offline Developer Memory
Rather than manually digging through dotfiles, L2Cache for Mac automatically captures and categorizes your terminal snippets, AI prompts, and code blocks the moment you copy or run them:
- Instant FTS5 Search: Search through months of terminal commands, curl scripts, and prompts in under 1 millisecond.
- Zero-Cloud Privacy: Kept 100% on your Mac using native SQLite and on-device Apple Intelligence.
- Touch ID Encryption: Automatically detects API keys, tokens, and credentials and encrypts them securely.
Supercharge Your Mac Developer Workflow
L2Cache keeps an unlimited, private, instant-searchable history of your terminal commands, code, and AI prompts on macOS.
Download L2Cache on the Mac App StoremacOS 13 Ventura or later · One-time purchase · Lifetime updates
Frequently Asked Questions
Where is the Claude Code config located on Mac?
Global settings, custom tools, and authentication for Claude Code are stored in ~/.claude/config.json and ~/.gemini/config/.
Does the In-Browser Session Viewer upload my transcript?
No. The L2Cache Claude Session Viewer runs entirely client-side using JavaScript File API. Your data never touches any server.
Can I search OpenAI Codex transcripts too?
Yes! Read our companion guide on searching OpenAI Codex rollout history on macOS.