Mosh vs SSH on your phone: which one to use to follow your agent
You start Claude Code on a long task, close the laptop and head out. The train goes into a tunnel, your phone drops from Wi-Fi to cellular and loses signal for a minute, and when you look again the SSH session is dead. That's expected: SSH was never designed for a client that changes networks every few minutes, and Mosh and Eternal Terminal exist for exactly that.
This is what each one does, what happens on a phone, and how to choose. If you want the whole picture of running an agent from your pocket, start with How to use Claude Code from your phone.
What happens to SSH on a phone
SSH runs over a TCP connection, and that connection is tied to one IP address and one pair of sockets. When your phone moves from Wi-Fi to cellular, its IP changes and the server never finds out. The connection hangs until a timeout kills it. The same thing happens when iOS or Android puts the app's network to sleep to save battery, or kills the app because it needs the memory.
You lose more than the screen. A process hanging off that SSH session can get a SIGHUP and die with it. That's why an agent started straight from an SSH shell is fragile, and why the companion to this article, tmux for coding agents, is close to mandatory.
Mosh: UDP and silent reconnection
Mosh (mobile shell) only uses SSH to get started. It authenticates over SSH, launches mosh-server on your computer, and from then on talks over UDP. With no TCP connection to break, the client can change IP, lose signal or sleep, and when the network comes back the session is still there.
In practice:
- You switch from Wi-Fi to cellular and the session doesn't notice.
- If the server stops answering, the app tells you instead of closing the session.
- Local echo with prediction: what you type is drawn immediately, underlined, and confirmed once the server replies. On a laggy cellular link you'll feel the difference.
What it costs:
- UDP 60000–61000 has to be open on your computer (each session takes one port from that range).
- No scrollback. Mosh only syncs what's on screen. If you want to scroll up and read what the agent printed, work inside tmux.
- If the OS kills the app, the Mosh session ends and can't be resumed.
Eternal Terminal: TCP, but it resumes
Eternal Terminal (ET) goes the other way. It runs over TCP, on port 2022 by default, but keeps its own session state, so when the connection drops it rebuilds it and resends what was missed. It needs etserver running on your computer and etterminal on the PATH of the SSH session.
On a phone, its advantage is that it's the only transport in Wendo that survives the app being closed. The session shows up in Home and picks up where it was when you open it. Wendo labels ET as experimental, so keep that in mind before you lean on it.
Quick comparison
| | SSH | Mosh | ET |
|---|---|---|---|
| Transport | TCP | UDP | TCP (2022) |
| Wi-Fi ↔ cellular | Drops | Survives | Survives |
| Phone asleep | Drops | Survives | Survives |
| App killed by the OS | Drops | Lost | Resumes |
| Scrollback | Yes | No | Yes |
| With a Jump Host in Wendo | Yes | No | No |
Installing mosh-server
On the computer where the agent runs:
# macOS
brew install mosh
# Debian / Ubuntu
sudo apt install mosh
# Fedora
sudo dnf install mosh
Check that it's on the PATH of a regular SSH connection, not just your interactive terminal:
ssh my-server 'which mosh-server'
On an Apple Silicon Mac, Homebrew puts it at /opt/homebrew/bin/mosh-server, which isn't always on the PATH of a non-interactive session. If that happens, Wendo lets you set the mosh-server path in the connection.
Firewall notes
Mosh needs inbound UDP 60000–61000. On Linux with ufw:
sudo ufw allow 60000:61000/udp
With firewalld:
sudo firewall-cmd --permanent --add-port=60000-61000/udp
sudo firewall-cmd --reload
If your computer is behind a router, forward that UDP range the same way you'd forward port 22. For ET, open TCP 2022 the same way (sudo ufw allow 2022/tcp).
If your SSH goes through a proxy or a load balancer, Mosh's UDP could be sent to the wrong IP. Wendo has a "Use server IP for UDP" option for that case.
Picking one in Wendo
When you edit a connection, the Transport field offers Auto, SSH, MOSH and ET. With Auto, Wendo tries Mosh first, then ET, and falls back to SSH if neither is available. Start with Auto.
A practical rule of thumb:
- You'll be walking around with the phone and sessions last minutes: Mosh.
- You want to close the app, come back an hour later and find the session in Home: ET.
- You connect through a Jump Host: SSH. Neither Mosh nor ET works with a Jump Host in Wendo.
- Your computer can't open UDP ports: ET or SSH.
Mosh and Eternal Terminal are Wendo Pro features; without Pro the connection goes over SSH. The fields are described in the sessions docs.
Whichever transport you pick, start the agent inside tmux. The transport keeps the screen alive; tmux keeps the process alive and gives you the scrollback Mosh lacks. The usual combination is Mosh or ET for the wire and tmux for the work, and here's the minimum tmux you need. To get alerts when the agent asks for permission, see hooks.