tmux on iOS: keep Claude Code running through disconnects
2026-07-17
iOS suspends apps that leave the foreground, and mobile connections drop. If your Claude Code session runs directly in the SSH connection, either one ends it. A train going into a tunnel is enough to stop a 40-minute refactor at minute 38.
The standard fix is tmux: a terminal multiplexer that keeps your shell and everything in it running on the server, whether or not anyone is connected. The SSH connection can drop and reconnect without affecting the session.
The manual workflow
With any generic SSH client, the drill looks like this:
ssh dev@your-server
tmux new -A -s claude # create or attach
cd ~/projects/app
claude # start the agent
# ... connection drops on the train ...
ssh dev@your-server
tmux attach -t claude # everything still running
This works fine. The problem on a phone is the amount of typing: after every drop you reconnect and re-attach by hand, you have to remember the session name for each project, parallel runs mean several named sessions to keep track of, and there is no notification when a run finishes, so you end up re-attaching just to check.
What ServerCC automates
ServerCC does these steps for you. When you open a workspace and start Claude Code (or Codex):
- The agent starts inside a tmux session. You don’t name the session or type
new -A - After a reconnect, ServerCC attaches back to that workspace’s session
- Parallel sessions each get their own tmux session, and all of them are listed in the Running tab
- When a session running in the background stops and waits for input, ServerCC sends a notification, so you don’t have to attach just to check
You can close the app and the work keeps going. Details in Persistent Sessions.
Tips if you roll your own
tmux new -A -s nameis idempotent, so it can be your only connect command- Put PATH setup in
.bashrc/.zshrc, not only in.bash_profile. tmux inner shells are interactive non-login shells, so a PATH set only in the profile gives "claude not found" - Add
set -g mouse onso you can scroll back with touch
The full mobile setup is covered in Claude Code on iPhone.