Newhivemux swarm: Claude Code’s builds and tests run on your other Macs →

Claude Code resume: --continue, --resume and /resume explained

Short answer

In the folder you worked in, run claude --continue (-c) to reopen the latest conversation, or claude --resume (-r) to pick one from a list; inside a session, /resume does the same. Pass a session ID or name to --resume to open one directly. After a reboot, tmux-resurrect restores the tmux layout and hivemux runs claude --resume <id> in each pane.

By · · 5 min read

Claude Code saves every conversation as you work, so a session you closed is never far away. Most of the time you only need one command, run in the folder you worked in:

You want Run
the latest conversation in this folder claude --continue (or claude -c)
to pick from a list claude --resume (or claude -r)
a specific session claude --resume <name> or claude --resume <session-id>
to switch from inside a running session /resume

The harder case is a reboot or a closed terminal with several sessions open: the conversations are still on disk, but which folder and window each one ran in is gone. This guide covers the everyday commands first, then that case.

Step 1. Resume a conversation with Claude Code itself

Claude Code stores sessions per project directory, so start from the folder you worked in.

Terminal window
cd ~/code/api
# the most recent conversation in this folder
claude --continue # or: claude -c
# pick from a list, or name a session directly
claude --resume # or: claude -r
claude --resume login-bug
claude --resume 550e8400-e29b-41d4-a716-446655440000

Inside a running session, /resume switches to another conversation, and /resume <name> opens an exact match. In the picker, use the arrow keys and Enter, type to search, and press Space to preview a session. The current worktree is shown by default; Ctrl+W widens it to all worktrees of the repository and Ctrl+A to all projects. Ctrl+B filters by git branch and Ctrl+R renames the selected session. Pasting a pull request URL into the search finds the session that made it, and claude --from-pr <number> does the same from the shell.

A resumed session brings back the conversation history, the model it was using and, when you resume from the terminal by ID, name or --continue, its permission mode. Flags such as --mcp-config, --settings or --add-dir are not restored, so pass them again if the session needed them.

Two habits make this much easier:

  • Name sessions. claude -n login-bug (or /rename during a session) gives the conversation a name you can pass to --resume and recognise in the picker. Unnamed sessions get a generated title, which --resume also accepts.
  • Resume in the right folder. --continue only looks in the current directory. With an ID, --resume searches the current project and its worktrees first, then every other project on the machine. How to get the Claude Code session ID shows where to find the ID.

One caution from Anthropic’s docs: if you resume the same session in two terminals without forking, both write to the same transcript, and messages from one of them can be missing when you resume it later. Use --fork-session if you want a copy instead.

To restart Claude Code on purpose, for example after an update, and come back to the same conversation, see How to restart Claude Code.

Step 2. Stop losing sessions when the terminal closes

Run Claude inside tmux and closing the terminal no longer stops it. The tmux server keeps the process running; reattach with:

Terminal window
tmux attach # the most recent tmux session
tmux attach -t api # a session by name; tmux ls lists them

This covers the most common case: you closed the window by accident, or quit the terminal at the end of the day while a task was still working. See How to use Claude Code with tmux for the setup and for reattaching by name.

tmux does not survive a reboot, though. When the Mac restarts, the tmux server and every process in it are gone.

Step 3. Restore the tmux layout after a reboot

tmux-resurrect saves sessions, windows, panes and their working folders to disk; tmux-continuum saves automatically and restores on the next start. With both, a reboot brings back your windows in the right folders, but each pane comes back as an empty shell. Resurrect does not know which Claude conversation was running where, so you would still go pane by pane typing claude -c or picking from claude --resume.

Step 4. Let hivemux resume each pane

hivemux is a tmux sidebar that shows every Claude Code session — running, waiting for you, or done — and lets you jump to the one that needs you. It also fills the gap above.

How it works:

  1. Claude Code hooks registered by hivemux setup write each session’s id and folder onto its tmux pane whenever a session starts.
  2. Every time tmux-resurrect saves (continuum does it every 5 minutes), hivemux saves the matching pane-to-session list.
  3. After a reboot, opening Ghostty runs hivemux-attach. With no tmux server running, it starts one and tmux-resurrect recreates sessions, windows, panes and folders.
  4. hivemux-panes restore reads the saved list and, in each pane that sits at a shell prompt, changes to the folder that Claude was started in and types claude --resume <id>.
  5. You land on the session you were last looking at before the reboot.

Sessions you ended with /exit (or Ctrl+D) are not resumed. With Remote Control turned on, each resumed conversation registers again and shows in the Claude app.

hivemux sidebar after a restore, with each project’s Claude Code sessions back in their panes

Install:

Terminal window
curl -fsSL https://hivemux.dev/install.sh | bash

or

Terminal window
brew install hivemux/tap/hivemux
hivemux setup

Setup downloads tmux-resurrect and tmux-continuum, or uses yours from ~/.tmux/plugins.

What survives what

Event tmux sessions and layout Claude conversation
Close a terminal window or quit the app kept keeps running
Mac sleeps kept pauses, then continues
Reboot or crash restored from the last save resumed by hivemux
End with /exit or Ctrl+D window stays not resumed

Useful commands

Terminal window
hivemux-panes list # panes hivemux will resume after a reboot
cat ~/.local/share/hivemux/panes.log # what happened at the last restore
touch ~/tmux_no_auto_restore # skip restore on the next start
tmux set-environment -g HIVEMUX_NO_RESUME 1 # restore the layout but do not resume Claude

Autosave runs every 5 minutes. After opening something important, save at once with prefix Ctrl+S; prefix Ctrl+R restores the last save by hand.

In the log, busy means a pane was not at a shell prompt and was skipped, and pane missing means the layout changed and the pane no longer exists. In both cases run claude -c in that folder. More in /docs/troubleshooting/, and the full flow in /docs/how-it-works/.

FAQ

How do I resume my last Claude Code session?

cd to the folder you worked in and run claude --continue (or claude -c). It opens the most recent conversation in that folder with its history, model and permission mode.

What is the difference between claude --continue and claude --resume?

--continue (-c) loads the most recent conversation in the current directory (sessions run with claude -p or the Agent SDK are skipped). --resume (-r) resumes a specific session by ID or name, or shows an interactive picker.

Can I resume a session from a different folder?

With its ID, yes. claude --resume <id> searches the current project and its worktrees first, then every other project on the machine. In the picker, Ctrl+A shows sessions from all projects. --continue only looks in the current folder.

Where does Claude Code store its sessions?

Per project directory, as ~/.claude/projects/<project>/<session-id>.jsonl, where <project> is the working directory path with non-alphanumeric characters replaced by -. By default transcripts are kept for 30 days (the cleanupPeriodDays setting).

Why did one Claude not come back after a reboot with hivemux?

Run hivemux-panes list and read ~/.local/share/hivemux/panes.log. A session ended with /exit is not resumed, one started after the last save is not in the list, and busy means the pane was not at a shell prompt; run claude -c in that folder.

Does tmux-resurrect restore Claude Code conversations?

It restores sessions, windows, panes and their folders, but it knows nothing about which Claude conversation ran in each pane. hivemux adds that link through Claude Code hooks.