Insight Daily

Tech, education, careers and news

A blog by Atobro

How to Resume a Claude Code Session

⚠️ This page connects you to Atovia’s partners and affiliate markets. We may receive a commission from affiliate partners for activities made through these links. Discount offers may change at any time according to policy! Rest assured, there are no additional costs to you! We hope this saves you time in finding the right items!

Every developer who has closed a terminal mid-task knows the frustration of losing hours of accumulated context. Claude Code solves this with two flags, --continue and --resume, that bring an entire session back exactly where it left off, including message history and prior tool results.

Key Points
  • Sessions are saved automatically per project directory, so closing a terminal does not delete a conversation.
  • Use --continue (-c) to reload the most recent session in the current directory with zero setup.
  • Use --resume (-r) to open an interactive picker and choose a specific past session.
  • Both flags restore message history, tool results, and accumulated context, not just chat text.

What Happens When You Close a Claude Code Session

Closing a terminal window or typing /exit does not erase a Claude Code conversation. Each session is saved locally, tied to the project directory it was started in. That saved history is what the resume flags read from, so work can pick up later without re-explaining the project, the files already reviewed, or the decisions already made.

The Two Ways to Resume: Continue vs Resume

There are two distinct approaches to bringing back a previous conversation, and choosing the right one depends on how precisely you need to pick a session.

  • –continue (-c): Automatically reloads the most recent conversation in the current directory. No IDs to remember, no menu to navigate.
  • –resume (-r): Opens an interactive list of past sessions so a specific one can be selected, or accepts a session ID directly.
Developer at a laptop with a terminal window open
Criteria –continue –resume
Setup required None, runs immediately Requires selecting from a list or knowing a session ID
Session selection Always the most recent session in the current directory Any saved session, chosen manually
Best use case Picking up the last task right away Switching between multiple ongoing tasks or branches
Works in scripts/CI Yes, with -p for non-interactive mode Yes, when a specific session ID is passed directly

Step-by-Step: Using –continue

This is the fastest option when the goal is simply to keep working on whatever was last open in the current project.

  • Run claude --continue or the short form claude -c to reload the last conversation.
  • Resume and send a new instruction in a single line with claude -c "check if the tests pass now".
  • Choose this option whenever there is only one active thread of work in the current directory and no need to pick between sessions.
Hand typing a command into a terminal

Step-by-Step: Using –resume

This is the better choice when multiple sessions exist for the same project, such as separate debugging threads or parallel feature branches.

  • Run claude --resume to open the interactive session picker and select a conversation from the list.
  • Alternatively, run claude --resume <session-id> to jump straight into a known session without browsing the list.
  • Choose this option when the most recent session is not the one that needs attention.
Two terminal windows shown side by side

🛒 Recommended Product

Amazon.com 🛒 Recommended Product

Naming and Organizing Sessions

The /rename slash command, run inside an active session, labels that session with a custom name so it is easier to recognize later in the --resume picker. This is useful once several sessions have accumulated and the default auto-generated titles stop being descriptive enough. One limitation worth knowing: a renamed session still cannot be resumed by typing its custom name directly; it can only be resumed by its session ID or by selecting it from the interactive picker, where the custom name is displayed.

Common Problems When Resuming a Session

One known edge case shows up when a session is resumed through the interactive --resume picker and then, later, --continue is used to try to keep going. In some versions, resuming through the picker does not update the record that --continue relies on to find the most recent conversation, so --continue starts a brand-new session instead of continuing the one just resumed.

Developer entering a resume command
  • If --continue unexpectedly starts a fresh session, check whether the previous session was reopened using the interactive --resume picker.
  • As a workaround, resume the same session again directly with --resume <session-id> rather than relying on --continue immediately afterward.

Using Resume Flags in Scripts and Automation

Both resume flags work outside of interactive use, which makes them useful for automated workflows.

  • Add -p for non-interactive, scriptable output, for example claude -c -p "run the test suite and report failures".
  • In a CI/CD pipeline, this pattern allows a pipeline step to continue a prior Claude Code session’s context, such as an earlier code review pass, instead of starting from a blank state on every run.
Developer browsing an interactive session list

Frequently Asked Questions

Does resuming restore file changes and tool results, not just chat text? Yes. Both --continue and --resume are designed to restore the full session state, including prior tool results and accumulated context, not only the raw conversation text.

What happens if the original session’s project directory no longer exists? Since sessions are tied to the project directory they were created in, moving or deleting that directory can prevent --continue from finding the session automatically; resuming by a known session ID is the more reliable fallback in that case.

  1. Claude Code Documentation, docs.claude.com
  2. Claude Code GitHub Issue Tracker, github.com/anthropics/claude-code

Want more comparisons and buying guides?

More at Atovia →

Join our community

Leave a Comment