How to Resume Claude Code Sessions 2026

The Workflow

Resume interrupted Claude Code sessions to continue where you left off without losing context. Use the --resume flag to recover from crashes, continue multi-step tasks across terminal restarts, and manage your conversation history.

Expected time: 2 minutes to learn, immediate use Prerequisites: Claude Code CLI installed (v1.0+)

Setup

1. Understand Session Storage

# Claude Code stores sessions in:
ls ~/.claude/sessions/
# Each session is a JSON file with full conversation history

Sessions are automatically saved after every interaction, so even crashes preserve your work.

2. Resume Your Most Recent Session

# Resume the last session (most common usage)
claude --resume
# This restores:
# - Full conversation history
# - File context that was loaded
# - Any pending operations

The --resume flag picks up exactly where you left off.

3. Resume a Specific Session by ID

# List available sessions
claude --list-sessions
# Resume a specific session
claude --resume "session_2026-04-21_143022"

4. Create Named Sessions for Long Tasks

# Start a named session for a multi-day task
claude --session "refactor-auth-module"
# Later, resume it by name
claude --resume "refactor-auth-module"

Named sessions make it easy to juggle multiple ongoing tasks.

5. Verify

# Start a session, ask something, then exit
claude
> What is 2 + 2?
> /exit
# Resume and verify context is preserved
claude --resume
> What was my last question?
# Expected output:
# Your last question was "What is 2 + 2?"

Usage Example

A real-world workflow for a multi-session refactoring task:

# Day 1: Start the refactoring
claude --session "migrate-to-drizzle"
> I need to migrate our database layer from Prisma to Drizzle ORM.
> The schema is in prisma/schema.prisma. Let's start by analyzing
> the current models and creating equivalent Drizzle schemas.
# Claude Code analyzes your schema and starts generating Drizzle files
# ... 30 minutes of work ...
# You need to leave for a meeting
> /exit
# Day 1 (later): Resume after meeting
claude --resume "migrate-to-drizzle"
> Let's continue. We had the users and posts tables done.
> Now handle the many-to-many relationships (tags, categories).
# Claude Code remembers all prior context:
# - The original Prisma schema
# - Files already generated
# - Decisions made earlier in the session
# Day 2: Continue the migration
claude --resume "migrate-to-drizzle"
> Yesterday we finished the schema definitions. Now let's
> update the repository layer in src/repositories/ to use
> the new Drizzle client instead of PrismaClient.

Managing multiple concurrent tasks:

# Work on different features in different sessions
claude --session "feature-search"
# ... work on search feature ...
> /exit
claude --session "bugfix-auth-timeout"
# ... fix auth bug ...
> /exit
# Switch between them freely
claude --resume "feature-search"
# or
claude --resume "bugfix-auth-timeout"

Session cleanup for completed work:

# View all sessions with timestamps
claude --list-sessions
# Output:
# migrate-to-drizzle     2026-04-20 14:30 (3 messages)
# feature-search         2026-04-21 09:15 (12 messages)
# bugfix-auth-timeout    2026-04-21 11:00 (5 messages)
# session_2026-04-21_... 2026-04-21 13:45 (1 message)
# Delete old sessions you no longer need
claude --delete-session "migrate-to-drizzle"

Using resume with the --continue flag for automated scripts:

# In a script, resume and add a new prompt
claude --resume "nightly-review" --print \
  "Review any new commits since yesterday and summarize changes"
# This appends to the session, maintaining full history
# Useful for daily standup summaries or recurring tasks

Common Issues

  • Session not found after OS update: Sessions are stored in ~/.claude/sessions/. If your home directory changed or was migrated, copy the sessions directory to the new location.
  • Resume shows stale file content: Claude Code re-reads files on resume, but if file paths changed, explicitly tell it: “The auth module moved from src/auth/ to src/modules/auth/”.
  • Session too large (slow resume): For very long sessions (100+ messages), start a fresh session and paste a summary of prior decisions. Context windows have limits.

Why This Matters

Long development tasks spanning multiple days no longer require re-explaining context. Resume eliminates the 5-10 minutes typically spent re-establishing project context at the start of each coding session.

Set it up → Build your permission config with our Permission Configurator.

Try it: Paste your error into our Error Diagnostic for an instant fix.

Frequently Asked Questions

What is the minimum setup required?

You need Claude Code installed (Node.js 18+), a project with a CLAUDE.md file, and the relevant toolchain for your project type (e.g., npm for JavaScript, pip for Python). The CLAUDE.md file should describe your project structure, conventions, and common commands so Claude Code can work effectively.

How long does the initial setup take?

For a typical project, initial setup takes 10-20 minutes. This includes creating the CLAUDE.md file, configuring .claude/settings.json for permissions, and running a test task to verify everything works. Subsequent sessions start immediately because the configuration persists.

Can I use this with a team?

Yes. Commit your .claude/ directory and CLAUDE.md to version control so the entire team uses the same configuration. Each developer can add personal preferences in ~/.claude/settings.json (user-level) without affecting the project configuration. Review CLAUDE.md changes in pull requests like any other configuration file.

What if Claude Code produces incorrect output?

First check that your CLAUDE.md accurately describes your project conventions. Incorrect or outdated context is the most common cause of wrong output. If the output is still wrong, provide feedback in the same session — Claude Code learns from corrections within a conversation. For persistent issues, add explicit rules to CLAUDE.md (e.g., “Always use single quotes” or “Never modify files in the config/ directory”).

Best Practices

  1. Start with a clear CLAUDE.md. Describe your project structure, tech stack, coding conventions, and common commands in under 300 words. This single file has the largest impact on Claude Code’s accuracy and efficiency.

  2. Use skills for domain knowledge. Move detailed reference information (API routes, database schemas, deployment procedures) into .claude/skills/ files. This keeps CLAUDE.md concise while making specialized knowledge available when needed.

  3. Review changes before committing. Always run git diff after Claude Code makes changes. Verify the edits are correct, match your project style, and do not introduce unintended side effects. This habit prevents compounding errors across sessions.

  4. Set up permission guardrails. Configure .claude/settings.json with explicit allow and deny lists. Allow your standard development commands (test, build, lint) and deny destructive operations (rm -rf, git push –force, database drops).

  5. Keep sessions focused. Give Claude Code one clear task per prompt. Multi-step requests like “refactor auth, add tests, and update docs” produce better results when broken into three separate prompts, each building on the previous result.