A long-running command on a remote machine should not depend on an iPhone keeping an SSH connection alive. For Claude Code or other interactive tools, use NeoServer for SSH and tmux on the server. These solve different problems: NeoServer connects you; tmux keeps the remote terminal session available after you disconnect.
Set up a recoverable session
- Install and configure
tmuxand your coding tool on the remote machine. Confirm the account can run both. - Connect with NeoServer over SSH and start a named session, for example
tmux new -As work. - Move to your project directory and launch Claude Code inside that tmux session. Keep commands and credentials appropriate for that server.
- If the phone loses network or iOS suspends the app, reconnect to the same host and use
tmux attach -t workto return. NeoServer’s tmux session controls can also help reopen a saved session.
tmux preserves the server-side shell and running processes, but it cannot guarantee that a command will finish successfully. The server must stay running, and the remote tool may require its own network or authentication to continue. Review the tool’s output after reconnecting before assuming work completed.
If your SSH connection changes networks often, Mosh may help the terminal connection, but requires mosh-server and UDP access; tmux is still the part that protects the remote session. See the Mosh setup guide and file upload guide.
Ready to try it?
NeoServer · SSH, Mosh, Docker & SFTP client for iPhone, iPad and Mac
Free on the App Store