Skip to main content
Code Guide
M03 Intermediate Methodology

Sessions & Continuity

Resuming a session right where you left off

Resuming a Session

Terminal window
# Continue the most recent session
claude --continue # or: claude -c
# Choose a specific session (interactive picker)
claude --resume # or: claude -r
# Resume by ID
claude --resume abc123def
# Resume from a GitHub PR (v2.1.49+)
claude --from-pr 123

Sessions are stored in ~/.claude/projects/<encoded-path>/ as JSONL files.

Searching Sessions

The session-search.sh script (provided in examples/scripts/) is the fastest method: zero dependencies, 15ms to list, 400ms to search.

Terminal window
cs # 10 recent sessions
cs "authentication" # Full-text search
cs "Prisma migration" # AND multi-word
cs --since 7d # Last 7 days
cs -p my-project "auth" # Filter by project

Each result displays the claude --resume <id> command ready to copy-paste.

Critical Limitation: Directory Scope

Claude Code stores sessions by encoding the absolute path of the project. A session in /home/user/myapp will not be found if you move the project to /home/user/projects/myapp.

Solution if you move a project:

Terminal window
cd ~/.claude/projects/
mv -- -old-location-myapp- -new-location-myapp-

Manual migration of the session folder works in the vast majority of cases.

What Resuming Does NOT Do

Resuming a session does not restore:

  • Implicit decisions made during the session
  • Context of files that changed in the meantime
  • Modified environment variables or configs

For important decisions (architecture choices, conventions), note them explicitly in CLAUDE.md rather than relying on session memory. It is more reliable and benefits future sessions.

Sessions and Sub-Agents

Sub-agent sessions (delegated tasks) are stored in a subagents/ subfolder. They do not appear in the normal --resume list. If you migrate sessions manually, copy this subfolder too.

Complementary Tools

ToolUsageInstall
session-search.shFast bash searchCopy from examples/scripts/
cc-sessions.pyIncremental index, advanced filtersPython, same folder
claude-code-viewerRead-only web browsernpx @kimuson/claude-code-viewer

Do not rely on --resume as the primary continuity mechanism for long projects. Prefer a well-maintained CLAUDE.md with key decisions, regular commits, and short targeted sessions. Session resumption is a safety net, not a replacement workflow.