Home/Q&A/How do I get back to my Claude Code session after a remote disconnect?

How do I get back to my Claude Code session after a remote disconnect?

Updated · airankrush

Direct answer

You can get back, working through three layers. First see whether the terminal window is still on the desktop. If not, reattach with tmux. If tmux is gone too, use Claude Code's own resume commands to pick the conversation back up.

Basis

  • Layer one, the desktop: a dropped remote connection does not affect the desktop on the far end. After reconnecting, the terminal window is usually where you left it, with Claude Code inside. If you see the lock screen, enter the Mac login password, not the UU verification code.
  • Layer two, the terminal: if the window was closed but the task was started inside tmux, list sessions with tmux ls and reattach with tmux attach -t <name>. The process was never interrupted.
  • Layer three, the conversation: if the process is gone, the conversation history is still stored locally on that machine. The official documentation says claude --continue opens the most recent session in the current directory and claude --resume opens a session list to choose from (checked 2026-11-12, source: the sessions page of the code.claude.com docs).
  • Sessions are stored per project directory, so cd into the directory you started from before running the command. In the list, pressing Ctrl+A shows sessions from every project on that machine (checked the same day, same source).

Information as of .

Boundaries: when the answer is different

Getting the conversation back is not getting the process back: the documentation states that a resumed session does not re-run tool calls that were in progress when it was interrupted, and background commands are not restored, so you need to ask it to run them again. Do not resume the same conversation in two terminals; the documentation warns that messages from both would then be mixed into the same record. If you want to branch, add --fork-session. Conversation history has a default retention period and is cleaned up after it expires; see the official documentation for specifics. If the machine has restarted, the first two layers no longer exist and only the third is available; for what to do after a restart, see Can I still connect after a restart?.

How to do it

  1. Reconnect to the remote desktop and look for the original terminal window first.
  2. Not there: open a new terminal, run tmux ls, and attach if a session exists.
  3. No tmux session: cd into the project directory and run claude --continue.
  4. If that is not the conversation you wanted: use claude --resume and pick from the list.
  5. Once you are back in, have it review the changes in the working tree before giving further instructions.

Use case

This question belongs to the use case: Remote Mac mini for heavy Claude Code use: an always-on workstation, not account insurance

Other questions in the same use case:

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All Q&A