---
title: "Claude Code on iPhone with Tailscale, tmux and SSH"
description: "Reach Claude Code in tmux on your Mac or Linux machine from your iPhone: Tailscale, an SSH app or Mosh, tmux tips, and what this setup can’t tell you."
url: https://hoptail.app/guides/iphone-tailscale-tmux
updated: 2026-10-27
---

# Claude Code on your iPhone with Tailscale, tmux and an SSH app

Last updated 27 October 2026

## Short answer

Run Claude Code inside tmux on your Mac or Linux machine. Put the machine and your iPhone on the same Tailscale network, connect from an SSH app such as Termius or Blink, and attach to the tmux session. You’re back in the same session you left at your desk, from anywhere with signal. This setup can’t tell you when an agent is waiting for you. A hook or Hoptail can, on top of the same Tailscale and tmux.

## What you need.

| Piece | On your computer | On your iPhone |
| --- | --- | --- |
| Tailscale | Tailscale, signed in: the app on a Mac, `sudo tailscale up` on Linux | The Tailscale app, same account |
| SSH | Remote Login on a Mac, the SSH server on Linux | An SSH app: Termius, Blink or another |
| tmux | `brew install tmux` or `sudo apt install tmux` | Nothing |
| Claude Code | `claude`, running inside tmux | Nothing |

Tailscale works through firewalls and NAT, so you don’t forward a port on your router. Sources: [What is Tailscale](https://tailscale.com/docs/concepts/what-is-tailscale), [Tailscale CLI](https://tailscale.com/docs/reference/tailscale-cli), [Tailscale on iOS](https://tailscale.com/docs/install/ios), [Tailscale on macOS](https://tailscale.com/docs/concepts/macos-variants), checked on 27 October 2026.

## Set it up.

1. Install Tailscale on your computer and your iPhone and sign in with the same account. With MagicDNS, on by default in tailnets created since October 2022, your computer gets a name such as `mac-mini`, or `mac-mini.yak-bebop.ts.net` in full. On a Mac, click the Tailscale icon in the menu bar to see its `100.` address; the Machines page of the Tailscale admin console lists it too. On Linux, run:

   ```
   tailscale ip -4
   ```
2. Turn on SSH. On a Mac: System Settings → General → Sharing, then turn on Remote Login and choose who may log in. On Ubuntu or Debian:

   ```
   sudo apt install openssh-server
   ```
3. In your SSH app, add a host with the MagicDNS name and your user name, then make a key for it. In Termius on iPhone: Keychain → + → Generate Key, then tap the key, choose the host and tap Export. It adds the public key to `~/.ssh/authorized_keys` on your computer. Blink has its own key manager.
4. At your desk, start Claude Code in a named tmux session. `-A` attaches to the session if it already exists:

   ```
   tmux new -A -s main
   ```

   Then run `claude` in it.
5. On your iPhone, connect to the host and run the same command. You land in the session Claude is working in. Detach with Ctrl-b then d; the session keeps running.

   ```
   tmux new -A -s main
   ```

Sources: [Remote Login on Mac](https://support.apple.com/guide/mac-help/allow-a-remote-computer-to-access-your-mac-mchlp1066/mac), [MagicDNS](https://tailscale.com/docs/features/magicdns), [Tailscale addresses](https://tailscale.com/docs/concepts/ip-and-dns-addresses), [Termius keys](https://docs.termius.com/keychain/ssh-keys-and-certificates), [tmux manual](https://man.openbsd.org/tmux), checked on 27 October 2026.

## Make it nicer on a phone.

- ### Mosh for a connection that drops.

  Mosh keeps the session through a change of network or a dead spot, and on a slow link shows your typing before the computer answers. It logs in over SSH, then uses a UDP port between 60000 and 61000, which Tailscale carries. Install it on the computer (`brew install mosh` on a Mac) and turn on Use Mosh for the host in Termius, or run `mosh` in Blink. Mosh only keeps what’s on screen, so scroll back in tmux.

  On a Mac, Mosh doesn’t find a Homebrew `mosh-server` on its own. Give the full path: in Termius, as the Mosh command,

  ```
  /opt/homebrew/bin/mosh-server new -s -l LANG=en_US.UTF-8
  ```

  and in Blink, `mosh --server=/opt/homebrew/bin/mosh-server mac-mini`.
- ### Scroll with your finger.

  tmux ignores touch scrolling until you turn the mouse on. Add this line to `~/.tmux.conf`:

  ```
  set -g mouse on
  ```
- ### Window size.

  With your phone and your desk attached to the same session, tmux sizes the window to whichever you typed in last (the default since tmux 3.1). Back at your desk, press a key and the window grows again.
- ### Claude Code inside tmux.

  For a new line in a message, use Ctrl+J from your SSH app’s extra keys. On a hardware keyboard in tmux, Shift+Enter sends the message, unless you apply Claude Code’s [tmux settings](https://code.claude.com/docs/en/terminal-config).
- ### Tailscale SSH, on Linux.

  On a Linux machine, `sudo tailscale set --ssh` lets Tailscale handle the login, so you don’t manage keys. With the default access rules, the first connection, and again later, asks you to confirm in a browser. A Mac with the App Store or standalone Tailscale app can’t be a Tailscale SSH server, so use Remote Login there.

Sources: [Mosh](https://mosh.org/), [Termius hosts](https://docs.termius.com/organize-and-connect-to-hosts/connecting-to-a-server), [Blink with Tailscale and Mosh](https://docs.blink.sh/integrations/tailscale+mosh), [Tailscale SSH](https://tailscale.com/docs/features/tailscale-ssh), checked on 27 October 2026.

## Where this setup stops.

Claude Code stops whenever it needs permission or has a question, and nothing on your phone tells you. The session waits until you look. To know that, you open the SSH app, connect, attach and read the screen. iOS stops an app’s background activity within about 20 to 30 seconds, [Termius notes](https://docs.termius.com/help-center/faq/how-can-i-keep-termius-sessions-alive-in-the-background-on-ios-ipados), so each check usually starts with a reconnect.

Answering means typing in a terminal on a phone keyboard. With several sessions, you switch between them with tmux keys to see which one is waiting.

A Claude Code hook can send a push when an agent stops: [Claude Code notifications on your iPhone](https://hoptail.app/guides/notifications-on-iphone) compares the ways to do it.

## Add Hoptail on top.

Hoptail uses the Tailscale network and the tmux sessions you already have. Your iPhone talks to a small program on your computer, the Hoptail daemon, over your tailnet, without SSH. Keep your SSH app and its keys for everything else you do in a shell.

1. Hoptail needs a Mac with Apple silicon and macOS 15 or later, or a 64-bit Linux with systemd, and an iPhone with iOS 26. Install it with Homebrew. On Linux you can also [install it from the release archive](https://hoptail.app/setup-linux).

   ```
   brew install hoptail-app/tap/hoptail
   ```
2. Run setup. It checks tmux, Tailscale and Claude Code and adds Hoptail’s hooks. It doesn’t install or upgrade tmux, so your running sessions stay as they are.

   ```
   hoptail setup
   ```
3. Pair your iPhone. Run this and scan the QR code with the Hoptail app.

   ```
   hoptail pair
   ```

Your tmux sessions show up in the app, with the agents that are working and the ones that are waiting. When an agent needs permission, has a question or is done, your iPhone gets a notification; Allow or Deny right from it, and open the real terminal with one tap.

[Full setup guide for Mac →](https://hoptail.app/setup) [For Linux →](https://hoptail.app/setup-linux)

## Troubleshooting

- **The SSH app can’t reach the host?** Check that Tailscale is on and signed in to the same account on both devices. Try the computer’s `100.` address instead of the name.
- **Permission denied on a Mac?** In Remote Login, check that your user is allowed, and that the public key is in `~/.ssh/authorized_keys` of that user.
- **The session is gone after you reconnect?** Run `tmux ls`. If Claude wasn’t started inside tmux, it ended with the SSH connection; start it in tmux next time.
- **Mosh won’t connect?** `mosh-server` has to be installed on the computer and found without a login shell. On a Mac, give its full path as above.
- **Nothing answers away from home?** Your computer needs to be awake and connected to Tailscale.

## FAQ

### Do I need to open a port on my router?

No. Tailscale works through firewalls and NAT without port forwarding, from home Wi-Fi or mobile data.

### Termius or Blink?

Both do SSH and Mosh. Termius has a free plan with Mosh included. Blink is a subscription with a free trial. Use the one whose keyboard you like.

### Does Hoptail replace my SSH app?

For Claude Code in tmux, Hoptail shows which agent waits, lets you answer it and opens its terminal. Keep the SSH app for other machines and for anything outside tmux.

### Is Hoptail free?

Yes, during the beta. You’ll need your own Claude Code and Tailscale accounts.

Product details reflect publicly available information on the date shown. Product names are trademarks of their owners. Hoptail isn’t affiliated with them. Spotted a mistake? Email [feedback@hoptail.app](mailto:feedback@hoptail.app).

## Try it on your own agents.

[Join the beta on TestFlight](https://testflight.apple.com/join/HDr5YEtZ) [Set up your Mac](https://hoptail.app/setup)

On Linux? [Set up a server →](https://hoptail.app/setup-linux)

---

Hoptail is made by Dmitrii Emelianov PR Računarsko programiranje Novi Sad, a sole proprietorship registered in Serbia (APR registration no. 67225627, tax ID 113970406), Novi Sad, Serbia. Contact: [feedback@hoptail.app](mailto:feedback@hoptail.app)

Hoptail isn’t made or endorsed by Anthropic, Apple or Tailscale. Trademarks belong to their owners. [Details](https://hoptail.app/terms#17-trademarks)
