Back to blog
June 9, 2026

I Shipped Code from My Phone While Lying on the Couch. Here's the Exact Setup.

No staging environment and no laptop—just an iPhone, a Mac, SSH, tmux, and an AI coding agent. This is the exact setup and daily workflow.

No staging environments. No laptop. Just an iPhone, a Mac sitting in the other room, and an AI coding agent running over SSH.


The short version

Mac has Remote Login (built-in SSH server). iPhone connects to it. AI agent runs on the Mac, not on the phone. The phone is just a thin terminal, but with tmux persistence, one-tap project launchers, and background tasks that survive disconnects. You can literally start a multi-minute build, close the app, and check the output later.

If this sounds like a toy, I thought so too. Then I refactored a Next.js app from bed at 2 AM and it actually worked.


Step 1: Turn your Mac into an SSH server

This is the foundation. No third-party server, no cloud VM needed.

On your Mac:

# 1. System Settings > General > Sharing > Remote Login → ON
# 2. Allow only your dev account
# 3. Find your LAN IP
ifconfig | grep "inet " | grep -v 127.0.0.1
# → look for 192.168.x.x or 10.x.x.x, that's your LAN address

On your iPhone:

  1. Open the app, go to Launch → Add Host
  2. Tap "Discover Local Devices" (it scans your LAN for SSH hosts)
  3. Or enter manually: Host 192.168.1.23, Port 22, your Mac username, your Mac password
  4. Connect → you now have a real terminal session into your Mac
Redock Host configuration for connecting an iPhone to a Mac over SSH
Screenshot Redock Host configuration for connecting an iPhone to a Mac over SSH Create a Host with the Mac address, SSH port, username, and authentication method.

That's it. You're now SSH'd into your Mac from your phone. Navigate to a project, fire up nvim, run git status — it all works. Latency on LAN is around 2–5 ms.


Step 2: Add Tailscale so it works from anywhere

LAN is great for the couch, but useless when you're on cellular or at a coffee shop. Tailscale puts your phone and Mac on the same virtual network without exposing SSH to the public internet.

# On Mac
brew install tailscale
tailscale up

# On iPhone: install Tailscale from App Store, sign in to same account

Now your Mac has a 100.x.y.z Tailscale IP. Use that as the Host instead of the LAN IP. Same Port 22, same credentials. Works from cellular, office Wi-Fi, other countries — wherever.

Don't use Tailscale SSH. Use Tailscale for the network layer, and keep macOS Remote Login as the SSH server with your normal credentials. Much simpler, fewer moving parts.

Other options if you prefer: ngrok TCP tunnel for temporary access, or direct port forwarding if you have a public IP. But Tailscale is the zero-config sweet spot for most people.


Step 3: The workflow that makes mobile coding actually usable

Raw SSH from a phone is painful. Typing long commands, remembering project paths, losing sessions when you switch apps — it adds up. Here's what makes it fast:

Projects + Actions = one-tap launch

Define your project once (working directory, default host). Then create Actions — saved commands with a run mode.

Redock Project and Action configuration on iPhone
Screenshot Redock Project and Action configuration on iPhone Bind a Project to its Host and working directory, then save frequently used commands as Actions.

Three run modes matter:

  • Terminal Interactive: opens a live terminal session. Use this for AI agents (Claude Code, Codex, OpenCode), REPLs, or anything you need to talk to.
  • Quick Task: runs a command over SSH, captures the output, saves it as a Run record. Perfect for git status, npm test, health checks.
  • Background Long Task: starts the command inside remote tmux, keeps running after you close the app. For builds, long tests, batch jobs.
A Redock Background Long Task Action configured on iPhone
Screenshot A Redock Background Long Task Action configured on iPhone Use Background Long Task for builds, test suites, and other commands that should survive disconnects.

tmux persistence (built-in, not manual)

Install tmux on the Mac:

brew install tmux

Then enable tmux in the host settings. The app handles session create, attach, and restore automatically. You don't type tmux new or tmux attach — when you reconnect, it shows existing sessions and lets you pick one.

One pane for the AI agent, another pane for watching logs or running tests. If your phone disconnects mid-session, the work is still running on the Mac.

Opening an AI coding agent in a persistent tmux session with one tap
Screenshot Opening an AI coding agent in a persistent tmux session with one tap Launch an agent inside tmux and reconnect to the same session after the phone goes offline.

The realistic daily loop

Here's what a typical evening looks like:

  1. Open phone, tap "My Project" from Launch
  2. Tap the "Claude Code" action → terminal opens, agent is already in the project directory
  3. Describe a change, agent starts working
  4. Switch to terminal connection 2, run git diff to review
  5. Agent finishes, git add . && git commit -m "..." from the snippet bar
  6. git push

Total taps: maybe 6. Total time on the keyboard: mainly the prompt and the commit message. Everything else is one-tap or snippet driven.

The trick isn't the terminal—dozens of iOS SSH clients exist. The trick is that the project, action, and tmux layer eliminates all the friction around the terminal: remembering paths, retyping setup commands, losing sessions, and digging through history to find old task output.


Q&A

Q: Is this a gimmick or do you actually ship this way?

I use it for real work: quick fixes, PR reviews, starting long builds before bed, and checking CI failures from brunch. It won't replace my desk setup for deep flow-state work, but it covers the other 60% of development moments when I'm not at my desk.

Q: What AI agents work?

Anything that runs in a terminal: Claude Code, Codex, OpenCode, aider, cursor-agent. The agent runs on your Mac; the phone is just the display and keyboard. No mobile app SDK integration needed.

Q: What about latency?

On LAN: 2–5 ms, literally instant. On Tailscale over cellular: 30–80 ms, perfectly fine for terminal interaction. Mosh is also supported if your network is truly terrible.

Q: Security?

Your SSH credentials never leave your phone (stored in Apple Keychain). For Tailscale, the connection stays inside the tailnet. For public access, use SSH keys; the app supports key generation and importing existing keys. Never expose password-auth SSH to the public internet.

Q: Does it work on iPad?

Yes. Same app, bigger screen. Even better for split-pane tmux layouts.

Q: Can I use it with a VPS instead of a Mac?

Yes. Linux VPS works the same way. SSH in, enable tmux, set up projects. If it has a public IP, skip Tailscale entirely and connect directly.

Q: What's the difference between Quick Task and Background Long Task?

Quick Task waits for completion and shows you the output immediately. Good for commands that finish in seconds. Background Long Task fires off in remote tmux and keeps going after you close the app. Check the Run log later. Good for npm run build or test suites that take minutes.


Further reading

Try Redock on iPhone or iPad

Steer coding agent and work on your phone.

Get Redock Free