Understanding Claude Code --continue vs --resume
Overview
When working with Claude Code CLI, it's important to understand the distinction between --continue
and --resume
. Both options help you continue prior work, but they serve different purposes in your workflow.
The --continue Flag
Purpose
Continue the most recent Claude Code interaction in the same working directory.
How it Works
- Uses context from the
.claude/
metadata folder in the current directory - Continues the last executed Claude CLI prompt
- Useful for chaining commands in a linear flow
- Does not require restarting an interactive session
When to Use
- You just ran a prompt and want to build on the result
- You're in the same working directory
- The
.claude/
context is still fresh
Example
claude "Generate a Python script that scrapes headlines from Hacker News"
# Review output, then follow up:
claude --continue "Now add error handling and logging"
The --resume Flag
Purpose
Resume a saved or interrupted Claude Code session with full state.
How it Works
- Reloads session context and conversation history from
.claude/
- Can be used after exiting the terminal or returning later
- Ideal for longer-term, multi-step projects
When to Use
- You closed your terminal or stopped midway through a task
- You're returning to a project directory after a break
- You want to pick up where you left off
Example
# Yesterday, you started work on a Flask API project
cd ~/projects/flask-api
claude --resume
# Resumes where the session left off, with all task memory intact
Quick Comparison
| Command | Use Case | Scope | Requires .claude/
| Interactive session? |
| ------------------- | ------------------------------- | ------------ | ------------------ | -------------------- |
| claude --continue
| Build on recent CLI output | Local folder | ✅ Yes | ❌ No |
| claude --resume
| Reopen stopped or older session | Local folder | ✅ Yes | ✅ Yes (optional) |
Best Practices
- Use
--continue
for short, immediate chains of logic - Use
--resume
for returning to long-running or paused work - If you're not sure which to use, check if the
.claude/
folder exists in your working directory - When returning after a break,
--resume
is usually the safer choice
Common Pitfalls
- Don't use
--continue
if you've closed your terminal - the context may be lost - Don't use
--resume
for simple follow-up questions - it's overkill - Remember that both require the
.claude/
folder to exist in your current directory