Remote coding: the four patterns, and which one survives a dropped connection

Remote coding used to mean SSH into a box. Since agents arrived it means something more interesting: the work continues whether or not you are connected, so the real question is what your setup survives rather than what it can display.

By the Continuum team. We build a workbench that runs Claude Code, Codex, and their peers, so the model rates quoted here are the ones our own cost analytics ship with.

The short version

There are four patterns. SSH with tmux or mosh gives you a real shell on a real machine and survives a dropped connection. Cloud IDEs and Codespaces move the machine into someone else’s datacentre and survive your laptop. Cloud agents run the work without a connection at all and hand you a pull request. Session continuity keeps one live run addressable from every device you own. They compose: most good setups use two or three at once.

What you need to know
  • Separate compute persistence from connection persistence. tmux keeps the process; mosh keeps the terminal; Tailscale keeps the host reachable. Different layers.
  • SSH plus tmux is the universal baseline and still the cheapest correct answer.
  • Cloud IDEs survive your laptop dying but lose your local services, untracked files, and anything not in the repo.
  • Agents changed the question: the run no longer needs you connected, so continuity beats bandwidth.
  • Never expose an agent control server on a public interface. A Tailnet or an SSH tunnel is the floor.

The question that picks the pattern

Every remote setup answers three failure cases, and most people only think about the first one. What happens when the network drops? What happens when the client device goes away? What happens when the host sleeps?

The four patterns against the three failures.
PatternNetwork dropsClient diesHost sleeps
SSH + tmuxProcess survives, reattachProcess survivesEverything stops
Cloud IDE / CodespacesSession usually survivesSurvivesNot applicable
Cloud agentIrrelevant, it is not connectedSurvivesNot applicable
Session continuityReconnects to the same runPick it up elsewhereStops, unless the host is a server

Pattern one: SSH, tmux, and mosh

The oldest answer and still the most portable. You get a real shell on a real machine with your real toolchain, and every tool you already know works unchanged.

The baseline that survives a dropped connection.
# on the host: a named session that outlives the SSH connection
ssh you@host
tmux new -s work
claude          # or codex, or whatever the agent is

# connection dies. reconnect and pick it up:
ssh you@host
tmux attach -t work

# roaming between wifi and cellular: mosh instead of ssh
mosh you@host -- tmux attach -t work

The three pieces do different jobs and are strongest together. tmux keeps the process alive when the connection dies. mosh keeps the interactive terminal usable across IP changes, which is what actually happens when you walk out of the building. Tailscale makes the host reachable without a public SSH port.

The limits are honest ones: it is a terminal, so no rendered diffs, no clickable file tree, and typing a long prompt on a phone keyboard through a mobile SSH client is genuinely unpleasant. See running Claude Code over SSH for the setup in detail.

Pattern two: cloud IDEs and Codespaces

Move the development machine into a datacentre and reach it with a browser or a thin local editor. GitHub Codespaces, Gitpod, and the browser IDEs bundled with several agent vendors all sit here.

What you gain: a machine that never sleeps, reproducible from a devcontainer definition, reachable from any browser including a locked-down one. What you lose is more specific than people expect.

  • Untracked files. Anything not committed does not exist there. Local scratch scripts, .env files, and half-finished work stay behind.
  • Local services. The database on your laptop, the VPN into staging, the hardware you were testing against.
  • Latency on the inner loop. Fine for an agent run, noticeable when you are typing.
  • Cost while idle. Most bill by the minute the machine is up, not the minute you use it. Set an aggressive idle timeout on day one.

Pattern three: cloud agents

You describe a task, a container spins up somewhere with a clone of the repository, an agent works, and a pull request appears. You were never connected to anything. Cursor background agents, Codex cloud tasks, and Claude Code on the web all work this way.

This is the pattern that made the phrase "remote coding" mean something new. There is no remote session to keep alive, because the unit of work is the run and the artifact is the PR. The trade is that the environment is not yours: it has whatever the setup script installed, no access to your VPN, and no knowledge of the local state that was never committed.

Pattern four: session continuity

The newest pattern and the one that fits how agent work actually behaves. The agent runs wherever it should, and every device you own is a client onto the same live run rather than a separate copy of it.

This matters because agent work is bursty in a way that human work is not. You start a twenty-minute run, walk away, and the interesting moment arrives while you are somewhere else. What you need at that moment is not a terminal, it is a decision: approve this plan, read this diff, kill this run, answer this question.

01

Start it at the desk

Open a session in a git worktree on your Mac, put the agent in plan mode, and let it read the codebase. Nothing is written yet.

02

Approve from the phone

The plan lands while you are out. You read it on the iPhone app and approve. The same session picks up writing with the accepted plan carried forward. This is not a second conversation started from mobile; it is the same run.

03

Review anywhere with a browser

Open the diff in the web client, stage or revert individual hunks, create the pull request, watch checks, and merge, without opening a laptop.

04

Return to the desk

The Mac session is still the same session, with the full transcript, the terminal, and the worktree exactly where the phone left it.

The catch is the one from the first section: a paired Mac that goes to sleep stops working, phone app or not. If you want a run that continues regardless, the host has to be something that stays awake.

Security, briefly and non-negotiably

Remote coding in the agent era exposes something categorically worse than a shell: a service that runs arbitrary commands inside your repositories, often with credentials attached. T3 Code’s own documentation puts it as plainly as anyone: bind to "a trusted private address, such as a Tailnet IP, instead of exposing the server broadly," and "treat pairing URLs and pairing tokens like passwords."

  • No public bind. Never --host 0.0.0.0 on a machine with a public IP. Bind to loopback behind an SSH tunnel, or to a Tailnet address.
  • Keys, not passwords. Disable password auth on SSH entirely and use keys with a passphrase.
  • Treat pairing tokens as credentials. They usually grant session creation until revoked, which is equivalent to shell access.
  • Scope the agent’s permissions. A remote surface multiplies the blast radius of an over-permissive allow list. See agent security.
  • Assume the phone will be lost. Whatever the mobile client can approve, someone holding the unlocked phone can approve.

Questions people ask

What is remote coding?

Writing and shipping code on a machine that is not the one in front of you. In 2026 it covers four patterns: SSH into a host with tmux or mosh, a cloud IDE such as Codespaces, a cloud agent that works without you connected, and session continuity where one live run is addressable from every device you own.

Can I code from my phone?

Yes, as a controller rather than as the machine. A phone can hold an SSH session into a real host, drive a cloud agent, or act as a client onto a live session running on your Mac. What it cannot practically do is host a full toolchain and repository. See Claude Code on mobile for every route in detail.

What is the difference between mosh and tmux?

tmux keeps the process alive on the host when your connection dies, so you can reattach later. mosh keeps the interactive terminal usable while your IP changes, which is what happens when you move between wifi and cellular. They solve different layers and are best used together: mosh to the host, tmux attach on arrival.

Is remote coding secure?

It can be, but the agent era raised the stakes: you are often exposing a service that executes arbitrary commands in your repositories. The floor is binding to a private address such as a Tailnet IP or a loopback behind an SSH tunnel, key-only SSH auth, and treating any pairing token as a password. Never bind an agent control server to a public interface.

Do cloud agents replace SSH?

No, they cover a different case. Cloud agents are best for well-specified tasks in a repository with working CI, because the container has no access to your VPN, your local services, or anything you never committed. SSH is still the answer when the work needs your network or your machine.

Sources

Every figure above was read from these pages on August 2026. Vendors reprice without notice; if you find a stale number, tell us.

  1. T3 Code remote access docs security warnings quoted, Tailscale binding guidance
  2. git-worktree manual isolation primitive behind per-session branches
  3. Claude Code documentation terminal agent behaviour and headless mode
  4. Tailscale documentation Tailnet addressing and Tailscale Serve
  5. GitHub Codespaces documentation devcontainers, idle timeout billing
Try it

Run every agent
from one place.

Continuum drives Claude Code, Codex, and peers under your own subscriptions, with live quota gauges and spend by repo. The app is free. Mac is stable; Windows and Linux desktop are beta.

free app · your subscriptions · local-first