How to Resume and Search Claude Code Sessions
Published August 12, 2026 · by the AQ team
Claude Code saves every conversation automatically, so nothing is lost when you close the terminal. To get back in: claude --continue resumes the most recent session in the current directory, claude --resume opens a searchable picker of past sessions (type to filter, Ctrl+A to widen to every project on the machine), and /resume switches conversations from inside a running session. /recap summarizes where a session left off. Transcripts are stored as JSONL files under ~/.claude/projects/ and deleted after 30 days by default. Everything below is verified against Anthropic's documentation as of August 2026.
The doors back into a session
A session is a saved conversation tied to a project directory. Claude Code writes it to disk continuously as you work, so a crash, a /clear, or a closed terminal does not lose it. There are several ways back in:
| Command | What it does |
|---|---|
claude --continue (or -c) | Resumes the most recent session in the current directory |
claude --resume (or -r) | Opens the interactive session picker |
claude --resume <name-or-id> | Resumes a specific session directly |
claude --from-pr <number> | Opens the picker filtered to sessions linked to that pull request |
/resume | Switches to a different conversation from inside an active session |
Resuming by session ID works from any directory: since v2.1.223, Claude Code searches the current project and its git worktrees first, then every other project on the machine. Sessions created non-interactively with claude -p or the Agent SDK do not appear in the picker, but you can still resume one by passing its session ID.
A resumed session restores the full conversation history, including tool calls and results, plus the model it was using, the agent it was started with, and its permission mode (with safety exceptions: plan mode and the permission-skipping mode are never restored automatically). Launch flags like --mcp-config and --add-dir are not restored, so pass them again if the session depended on them.
You can also branch instead of resuming in place: /branch inside a session, or claude --resume <id> --fork-session from the command line, copies the conversation into a new session ID so you can try a different approach while leaving the original intact.
Searching past sessions with the picker
Run claude --resume with no arguments, or /resume inside a session, to open the picker. Each row shows the session's name (or an AI-generated title summarizing the first prompt), time since last activity, git branch, and transcript file size. The picker is where the search features live:
| Shortcut | Action |
|---|---|
/ or any character | Enter search mode and filter sessions by text |
| Paste a PR URL | Finds the session that created that GitHub, GitLab, or Bitbucket pull request |
Ctrl+A | Widen to sessions from every project on this machine |
Ctrl+W | Widen to all worktrees of the current repository |
Ctrl+B | Filter to sessions from the current git branch |
Space | Preview the highlighted session without entering it |
Ctrl+R | Rename the highlighted session |
By default the picker scopes to the current worktree, which is why Ctrl+A matters: a session you started in another repository is invisible until you widen the view. When you select a session from an unrelated project, Claude Code copies a cd-and-resume command to your clipboard rather than switching directories out from under you.
Name sessions so future search works
Search is only as good as what it can match. Name sessions at startup with claude -n auth-refactor, mid-session with /rename, or from the picker with Ctrl+R. A named session becomes a direct resume handle: claude --resume auth-refactor jumps straight in, and name resolution works across the repository's worktrees. Unnamed sessions get an AI-generated title from the first prompt, which helps you recognize them in the list but is not a resume handle.
Catching up: /recap and resume from summary
Getting back into a session is half the problem; remembering what happened in it is the other half. Claude Code has two features for that as of August 2026:
Session recap. When you return to the terminal after stepping away, Claude Code shows a one-line recap of the session so far. It generates in the background once the terminal has been unfocused for at least three minutes since the last completed turn, appears only for sessions with at least three turns, and never fires twice in a row. Run /recap to generate one on demand, and disable the automatic version under Session recap in /config.
Resume from summary. On a Pro or Max plan, resuming a session that has been inactive for over about an hour and has grown past 100,000 tokens opens a dialog: resume from a summary (the history is compacted, so later requests cost less but lose detail), resume the full session as-is, or stop asking. This is a cost-versus-fidelity tradeoff, and the right answer depends on whether the old detail still matters.
Where transcripts live, and when they disappear
Transcripts are JSONL files at ~/.claude/projects/<project>/<session-id>.jsonl, where the project directory name is derived from your working directory path. Two things are worth knowing before you rely on them:
# Every session for a project, newest first
ls -lt ~/.claude/projects/-home-you-yourrepo/
# Keep transcripts for a year instead of the 30-day default
# (settings.json) "cleanupPeriodDays": 365
First, retention: Claude Code deletes transcripts after 30 days by default. Set cleanupPeriodDays in settings.json to keep them longer. Second, the JSONL format is internal and changes between releases, so scripts that parse it directly can break on any update. For durable copies, /export writes a rendered plain-text transcript; for programmatic access, claude -p --resume <session-id> --output-format json can ask an existing session a question and return structured output.
The boundaries: one machine, one pair of eyes
All of this machinery is local and personal, and Anthropic's docs are explicit about the edges. The terminal CLI, the VS Code extension, the desktop app, and Claude Code on the web each maintain their own separate session history, so a session started in one surface is not in another's picker. Transcripts live on the machine where the session ran: there is no built-in cross-machine sync as of August 2026, so a session started on your desktop is not resumable from your laptop. And history is per-user: a teammate cannot search your sessions, resume one, or watch one in progress, because the transcript sits in your home directory.
The standard workaround for the machine problem is to run Claude Code somewhere durable in the first place, typically a tmux session on a server you can SSH into from anywhere. That pattern is covered step by step in keeping Claude Code running after closing your laptop. The teammate problem has no local workaround: files in one person's home directory are simply not a team surface, which is where a harness comes in. For an overview of the CLI itself, see Claude Code on AQ.
Where AQ fits
AQ is the multiplayer coding harness where engineering teams run AI coding agents like Claude Code and Codex together: shared live terminals, a code editor, and app previews, in your own cloud. It attacks exactly the two boundaries above. Agents run as real CLIs in persistent tmux sessions on your team's VM, streamed live to the browser: sessions survive a closed laptop and resume from any device, so "which machine has my session" stops being a question. And sessions become visible to the people who need them: teammates open the same workspace and watch the same live session, and typing into someone else's terminal is delegated, with the owner approving a control request in one click. Workspace visibility stays owner-managed: team-visible, or private and shared with specific people.
The rest of the session's context travels with it. Each workspace gets its own isolated git worktree, pull requests the agent opens are tracked per workspace, and everyone signs into the CLIs with their own Claude or OpenAI account (AQ never marks up model usage). If your team is asking not just "how do I resume my session" but "how do we see and review each other's sessions", that second question is the subject of reviewing Claude Code sessions.
Plainly: for one engineer on one machine, the native features on this page are excellent and you should learn them, especially naming and the picker's search mode. AQ earns its place when sessions need to outlive your laptop and be findable by your team, not just by you. The Free plan is a personal sandbox (AQ creates a private machine in an isolated network, nothing to install, no time limit), and the Team plan is $50 per user per month in early access (standard $200, billed monthly), covering VMs you connect from your own cloud or a dedicated always-on AQ-managed VM, with your rate locked for your first 12 months.
Frequently asked questions
How do I resume my last Claude Code session?
Run claude --continue (short form claude -c) in the project directory: it loads the most recent session there, with the full conversation history, tool results, and model restored. To pick an older session instead, run claude --resume and choose from the interactive picker.
How do I search across all my past Claude Code sessions?
Open the picker with claude --resume, then just start typing to filter. Press Ctrl+A to widen the list from the current project to every project on the machine, Ctrl+W for all worktrees of the current repository, and Ctrl+B to filter by git branch. You can also paste a pull request URL to find the session that created that PR, or use claude --from-pr <number> directly.
How long does Claude Code keep session history?
30 days by default. Transcripts are JSONL files under ~/.claude/projects/, and Claude Code cleans them up on the schedule set by cleanupPeriodDays in settings.json: raise it to keep sessions longer. For copies that outlive retention, export a readable transcript with /export.
Can I resume a Claude Code session on a different computer?
Not with the built-in tools as of August 2026: transcripts are stored locally and there is no cross-machine sync, so the session exists only where it ran. The practical pattern is to run sessions on a machine that is always reachable, such as a VM with tmux, and connect to it from wherever you are. AQ productizes that pattern: sessions run in persistent tmux on your team's VM and resume from any device in the browser.
What does /recap do in Claude Code?
/recap generates a one-line summary of the current session on demand, so you can re-orient after time away. Claude Code also produces one automatically: after the terminal has been unfocused for at least three minutes, a recap is drafted in the background and shown when you return, for sessions with at least three turns. It is on by default and can be disabled under Session recap in /config.