How to Vibe Code on iPhone with Claude Code
Sometimes you are away from your desk but an idea hits, you want to fix a quick bug, or you just want to poke at a side of your project. Wouldn’t it be nice to carry a real terminal in your pocket? In this post we will do exactly that. With Tailscale + Termius + tmux + Claude Code we will vibe code from an iPhone.
What You Need
You need a machine you can reach remotely and actually do development on. Two options:
- Your own computer: Mac, Linux, or Windows. Your home or office machine works fine. In this case Tailscale is essential because you will be hopping between networks.
- A VPS: If you already have a cloud server, you can SSH directly to its public IP. No Tailscale needed.
I mostly work on iOS apps, so I do my remote development on a Mac mini. Xcode builds need to run on macOS anyway, so this is the most natural setup for me.
Step 1: Install Tailscale and Enable SSH
Install Tailscale on the machine you want to reach. Tailscale is a WireGuard based VPN that makes two devices behave as if they were on the same local network. Install it on both your iPhone and your dev machine with the same account, and your devices can see each other from anywhere.
Then enable SSH on the host:
- macOS: Go to System Settings > General > Sharing and turn on Remote Login. Without this, SSH connections will be refused.
- Linux: openssh-server is usually already installed. If not,
sudo apt install openssh-server.
Step 2: Install tmux
Install tmux on the dev machine. tmux is what keeps your work alive after the SSH connection drops. Without it, every disconnect would kill whatever Claude Code was doing.
# macOS brew install tmux # Ubuntu/Debian sudo apt install tmux
I am assuming Claude Code is already installed. If not, grab it from the Claude Code docs.
Step 3: The Auto Session Script
Now the fun part. We will set up a shortcut so that connecting from Termius drops you straight into Claude Code. Close the Termius window and your work keeps running in the background. Reconnect later and you are right back where you left off.
First add an alias to ~/.zshrc:
alias claude-session='~/bin/claude-session.sh'
Then create ~/bin/claude-session.sh:
#!/bin/bash
# Claude Code session manager
# Reuses a single tmux session named claude-dev
SESSION_NAME="claude-dev"
WORKSPACE_DIR="$HOME/Workspace"
if tmux has-session -t $SESSION_NAME 2>/dev/null; then
echo "Attaching to existing Claude session..."
tmux attach-session -t $SESSION_NAME
else
echo "Starting new Claude session..."
tmux new-session -s $SESSION_NAME -c "$WORKSPACE_DIR" 'claude --dangerously-skip-permissions'
fi
The logic is simple. Check whether a tmux session called claude-dev already exists. If yes, attach to it. If no, create one and start Claude Code inside it. That way you always come back to the same long lived session no matter how long you were gone.
Make the script executable and reload your shell:
chmod +x ~/bin/claude-session.sh source ~/.zshrc
Step 4: Configure Termius
Open Termius on your iPhone. Termius is genuinely one of the best mobile SSH clients. Keyboard shortcuts and snippets are great, and you can store credentials in a vault that syncs across devices.
Add a new host:
- Address: Your Tailscale IP (e.g. 100.x.x.x) or your VPS IP
- Username: Your user on the dev machine
- Authentication: SSH key or password (key recommended, store it in the vault)
- Startup command:
claude-session
The startup command is the magic part. The moment SSH connects, our script fires and the tmux session opens. No commands to type, no setup ritual. Tap, and you are coding.
Wrapping Up
Now on the subway, in a cafe, or in bed, you can open Termius on your iPhone, tap once, and Claude Code is waiting for you. Anything you left half done is still there because the tmux session has been running on your machine the whole time.
The best part of this setup: you can hand Claude Code a long task, lock the phone, and put it in your pocket. The connection can drop, the screen can sleep, the work keeps going. Come back an hour later and check what it did.
This is what mobile vibe coding looks like. Try it.