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

How to restart Claude Code without losing the chat (/restart)

Short answer

After an update, type /restart to restart into the new version in the same conversation. Otherwise type /exit, then run claude --continue in the same folder to reopen the latest conversation, or claude --resume to pick one. Nothing is lost. Settings, hooks, plugins and skills reload without a restart. hivemux's Update Claude restarts every session in its own conversation.

By · · 5 min read

“Restart” in Claude Code means two steps: end the running claude process, then start a new one that loads the same conversation from disk. After an update, /restart does both for you. In every other case the two steps take a few seconds and keep the whole conversation.

The quick way after an update: /restart

When Claude Code has installed an update, type:

Terminal window
/restart

It restarts Claude Code into the new version and resumes the session you were in (/update is the same command, and the footer offers it after an update). Per the commands reference it needs a Pro, Max or Ultra plan and the native installer on macOS or Linux (not WSL). If it is not available to you, use the two steps below.

Step 1. Exit the running session

At the prompt, type:

Terminal window
/exit

/quit does the same. From the keyboard, Anthropic’s interactive mode reference gives two ways:

  • Ctrl+D on an empty prompt: the first press shows a hint, a second press within 800 ms exits. (With text in the prompt, Ctrl+D deletes a character instead.)
  • Ctrl+C: interrupts a running operation. With nothing running, the first press clears the prompt and a second press exits.

So if Claude is in the middle of something, Ctrl+C stops the task first; press it again (twice on an empty prompt) to leave.

Step 2. Start Claude again in the same conversation

Stay in the same folder and run:

Terminal window
claude --continue # or: claude -c (most recent conversation in this folder, not counting claude -p or SDK runs)
claude --resume # or: claude -r (pick one from a list)
claude --resume login-bug # a named session, or a session ID

Per the sessions docs, a resumed session restores the conversation history, the model it was using and, when you resume with --continue or by ID or name from a terminal, its permission mode. Picker shortcuts, worktrees and resuming after a reboot are covered in How to resume Claude Code sessions; finding a session’s ID is in How to find a Claude Code session ID.

Two things do not come back on their own. Background Bash and monitor tasks end with the old process, and a tool that was still running is not rerun. And if you started the session with flags such as --mcp-config, --settings, --plugin-dir, --add-dir, --allowedTools or a system prompt flag, pass them again. The regular settings.json files are watched and reloaded while Claude runs, so those need nothing.

When do you actually need to restart?

Less often than you might think. Claude Code reloads much of its configuration while it runs. Each row below comes from Anthropic’s docs: setup, settings and commands.

What changed Restart needed? What to do
Claude Code updated (auto-update, claude update, brew upgrade) Yes, the new version takes effect the next time Claude starts /restart, or /exit then claude --continue
settings.json: permissions, hooks, apiKeyHelper No, settings files are watched and reloaded nothing
model or effortLevel in a settings file Read only at start /model or /effort in the session
A plugin installed or changed No /reload-plugins
A skill added or edited on disk No /reload-skills
An MCP server failed or needs login No /mcp reconnect <server> or /mcp reconnect all
Managed settings from your admin They arrive on a schedule; restart to get them sooner /exit, then claude --continue
Session started with --mcp-config, --settings and similar Flags are not restored on resume add the same flags to claude --resume

Updating is the main case. Native installs update themselves in the background; Homebrew installs do not, so run brew upgrade claude-code (the stable channel; claude-code@latest for the latest) and then restart. Either way, every session already open keeps running the old version until it is restarted.

Restarting many sessions with hivemux

With one session, the two steps above are all there is. With five or ten running in tmux, an update means visiting every pane, waiting for each to finish its turn, exiting, and resuming.

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. Its Update Claude item (right-click anywhere in the sidebar, or run hivemux update-claude) does the whole round:

  1. It checks for a newer version and asks before updating. Homebrew installs are upgraded with brew, others with claude update. If you are already up to date, it only offers to restart the Claudes still running an older version.
  2. Every pane whose Claude runs an older binary is marked for restart.
  3. A marked Claude restarts once it is free: not working, not waiting for you, and its window not on any screen, so it never stops mid-task or under your cursor. It is stopped and claude --resume <id> is typed in the same pane, in the folder the session was started in.
  4. Restarts run in the background, so closing the popup does not leave a Claude stopped halfway.

Because the new Claude starts in the same tmux pane, its line returns to the same place in the sidebar, and a task that was finished but not yet seen stays marked that way.

Restarting one session by hand works the same: /exit in the pane, then claude --continue, and its line comes back when the session starts. Note that hivemux treats /exit as “I am done with this one”, so a session you exit and do not start again is not resumed after a reboot. See How to keep Claude Code running for what survives closing the terminal.

Install:

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

or

Terminal window
brew install hivemux/tap/hivemux
hivemux setup

FAQ

Does restarting Claude Code lose my conversation?

No. Claude Code saves each session to a transcript file as you work, so claude --continue or claude --resume brings back the messages, tool calls and results. A tool that was still running when the old process ended is not rerun, and background Bash commands do not come back.

Do I need to restart Claude Code after updating it?

Yes. Anthropic's setup docs say updates install in the background and take effect the next time you start Claude Code. Type /restart (or /update) to restart into the new version and resume the same session; it works on Pro, Max and Ultra plans with the native installer on macOS or Linux. Otherwise exit and run claude --continue.

How do I restart Claude Code in tmux without losing the session?

Exit Claude inside the pane with /exit, then run claude --continue in the same pane. The tmux pane and window stay open while Claude is gone, and the conversation picks up where it stopped. With hivemux, its line comes back in the same place in the sidebar.

How do I restart all Claude Code sessions at once?

Claude Code has no command for it, so without a tool you exit and resume each one. hivemux's Update Claude (or hivemux update-claude) updates Claude Code and restarts every pane still on an older version with claude --resume <id>, each in its own conversation.

What does not carry over when I restart?

Launch flags such as --mcp-config, --settings, --plugin-dir and --add-dir must be passed again, and folders added with /add-dir are not restored. Settings in settings.json are watched and reloaded while Claude runs, so they need nothing extra.