For an ordinary SSH terminal workflow, run Claude Code inside tmux on the remote machine before disconnecting. tmux keeps the terminal session separate from your viewing connection. It does not keep a sleeping computer awake, recover a dead process, or approve Claude's requests for you.
This guide assumes SSH access already works and Claude Code is installed and authenticated on the remote host. If Claude actually runs on your laptop, start with what happens when you close the laptop.
Check the host before starting
In your remote shell, check:
Confirm that the host and project are the intended ones. If tmux is missing, install it through your system's supported package manager with the machine owner's approval. Do not assume a rented Mac or hosted workspace includes it.
These are documented command examples, not a claim that every remote environment has been tested. Managed desktops and cloud sessions can have different lifecycle rules.
Start, detach, and reconnect
The tmux getting-started guide documents named sessions and how to detach and attach to them.
On the remote machine, create a session:
Inside it, enter your project's actual directory and start Claude Code:
The path is an example; replace it. Start with a bounded task, such as identifying the repository's existing test command without running or changing anything.
Press Ctrl+B, release both keys, then press D. This detaches your view rather than exiting the program. After reconnecting by SSH to the same host with the same operating-system user, run:
Check the visible output. Do not start a second Claude process in the same working directory merely because your first connection disappeared.
Test the connection boundary before a long task
For a simple terminal-only check, use a separate tmux session and run this inside it:
Detach, close the SSH connection, then reconnect and inspect that session. Seeing the completed command checks terminal continuity in that environment; it does not prove a paid model request, external tool, or multi-hour coding task will complete.
If work still stops, identify which part stopped
Anthropic also discusses keeping the host process alive in its Remote Control documentation. Remote Control and SSH are different viewing paths; neither makes saved conversation history equivalent to a live process. See the persistent-session guide.
Choose a separate computer only if you need one
If your existing remote machine meets the requirement, a disconnect alone is not a reason to rent another. If you need an independent macOS environment for Claude Code, check Agent.Space Dedicated Mac specifications and rental conditions, then follow the computer connection instructions.
Keep hardware availability, model access, and task permissions separate. A dedicated computer gives the work a separate host; it does not guarantee uninterrupted execution or authorize unattended changes.
