Remote Claude Code: iPhone + Termius → Mac (Tailscale + tmux + SSH)
Remote Claude Code from your iPhone is one of the most liberating setups I've built: keep Anthropic's terminal-based coding agent running 24/7 on your MacBook Air, then jump in from anywhere (train, café, bed) using just your phone + Termius.
No rented VPS, no ngrok hassle, no port forwarding nightmares. Here's the exact flow that works for me in 2026.
Core Pieces
- Claude Code runs persistently inside tmux on your Mac (so it survives disconnects/sleep).
- Tailscale gives secure, always-on access to your Mac from your iPhone (mesh VPN, free tier is perfect).
- Termius (free Starter plan) is the iOS SSH client — great tmux support, key auth, Touch ID.
- SSH username: yours is
jack(confirmed via Terminal promptjack@Jacks-MacBook-Air).
Step-by-Step Setup
Enable SSH on Mac
System Settings → General → Sharing → Remote Login ON.
Allow your user (or all users for simplicity).Install & Connect Tailscale (both devices)
- Download Tailscale app on iPhone (App Store) and macOS app.
- Sign in with the same account on both → status green/connected.
- Your Mac is now reachable at its Tailscale hostname (e.g.
jacks-macbook-airor100.x.x.x).
MagicDNS makes it hostname-based — super convenient.
Install tmux & Claude Code on Mac
brew install tmux npm install -g @anthropic-ai/claude-code # or current install command
Start persistent Claude Code session
In Mac Terminal:tmux new -s claude claude # or claude-code — start your agent here
Detach:
Ctrl+bthend.
It keeps running/editing/thinking even if Mac sleeps lightly (use Amphetamine app to prevent deep sleep if needed).Set up Termius on iPhone
- Install Termius (free).
- New Host:
- Address: your Mac's Tailscale hostname/IP
- Username:
jack(runwhoamiin Mac Terminal if unsure — it prints your exact username instantly) - Auth: SSH key (generate in Termius, add public key to Mac's
~/.ssh/authorized_keys) or password.
- Connect → type
tmux attach -t claude(ortmux a).
You're now inside the same Claude Code session from your phone. Prompt, watch it code, detach with Ctrl+b d when done — reconnect anytime.
Pro Tips
- Username check: Always run
whoamion your Mac to confirm — mine showsjack. Use this exact string in Termius (not your display name 李思睿 or email). - Connection drops? Reconnect + re-attach tmux — Claude Code never loses state.
- Termius tmux perks: enable "Tmux control mode" in host settings for easier splits/scroll.
- Security: Tailscale + key auth = zero public exposure. Never open port 22 to the internet.
- Bonus: Split tmux windows (
Ctrl+b %) so you can watch Claude Code in one pane and run git/commit in another from phone.
This setup turns any downtime into productive Claude sessions — vibe-coding from the couch in Tokyo. ʕ•ᴥ•ʔ
Questions or tweaks? Hit me up.
Stay remote.