Claude Code From Your Phone

I run Claude Code from my phone by SSHing into my Mac. This post covers the setup and how to replicate it.

Prerequisites

You need:

  • A Mac or Linux VM that stays on
  • Claude Code installed on that machine
  • An iPhone or Android phone
  • Tailscale accounts on both devices (free tier works)

A cloud VM works too - Hetzner, DigitalOcean, or a free-tier Oracle instance. The setup is the same, you just skip the Tailscale step since VMs have public IPs. Though I’d still recommend Tailscale to avoid exposing SSH to the internet.

Step 1: Enable SSH on Your Mac

Open System Settings > General > Sharing > Remote Login. Toggle it on.

By default this allows SSH for your user account. Note your username - you’ll need it for the SSH connection.

Step 2: Set Up Tailscale

The problem with SSHing into a home machine is addressing. Most ISPs assign dynamic IPs, and even with a static IP you’d need to punch holes in your firewall.

Tailscale solves this. It creates a WireGuard mesh network between your devices. Each device gets a stable 100.x.x.x IP that works regardless of what physical network it’s on.

Install Tailscale on your Mac:

  1. Download from tailscale.com/download
  2. Sign in with Google/GitHub/etc
  3. Note the IP assigned to your Mac (visible in the menu bar icon)

Install Tailscale on your phone:

  1. Download from App Store or Play Store
  2. Sign in with the same account
  3. Your Mac should appear in the device list

The connection is encrypted end-to-end, NAT traversal is handled automatically. No port forwarding required.

Step 3: Install a Mobile SSH Client

I use Termius on iOS. Alternatives: Blink Shell (iOS), JuiceSSH (Android), Prompt (iOS).

The main thing that matters is persistent sessions. Phone SSH is interrupt-heavy - you switch apps, lose focus, lock the screen. Termius reconnects automatically and restores the session state.

Set up the connection:

  1. Create a new host
  2. Hostname: your Mac’s Tailscale IP (e.g., 100.x.x.x)
  3. Username: your Mac username

Test with password auth first to verify the connection works.

Step 4: Set Up SSH Keys

Password auth works but SSH keys are more secure and save you from typing your password every time.

On your phone (in Termius):

  1. Go to Keychain > Generate Key (use Ed25519)
  2. Copy the public key

On your Mac:

mkdir -p ~/.ssh
echo "your-public-key-here" >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Then disable password auth to lock down the server. Create /etc/ssh/sshd_config.d/hardened.conf:

PasswordAuthentication no
KbdInteractiveAuthentication no

Restart SSH:

sudo launchctl stop com.openssh.sshd
sudo launchctl start com.openssh.sshd

On Linux VMs, use sudo systemctl restart sshd instead.

Now only your phone (with the private key) can connect.

Step 5: Run Claude Code

Once connected, navigate to a project and run claude:

cd ~/dev/your-project
claude

That’s it. You’re running Claude Code from your phone.

Session Persistence with tmux

SSH sessions die when the connection drops. For longer work, run Claude Code inside tmux:

tmux new -s project-name
claude

If the connection drops, the tmux session keeps running on your Mac. Reconnect and reattach:

tmux attach -t project-name

The Claude Code conversation state is preserved. You can start a session from your laptop, leave, and pick it up from your phone.

To list existing sessions: tmux ls

Streamlining with MakerKit CLI

The setup above works, but there’s friction - typing paths, remembering tmux session names, navigating directories on a phone keyboard.

I built MakerKit CLI to eliminate that. It’s a TUI that lists your projects and launches tmux sessions with single keypresses. Optimized for phone input.

The feature I use most is Teleport. It finds your active Claude Code sessions so you can resume them. If I was working on something from my laptop and want to continue from my phone, I press t and I’m back in context.

makerkit        # launch the TUI
# then press:
# t - Teleport (resume sessions)
# 1 - Open a project
# q - Quit

This is optional - the core setup works without it. But when you’re on a phone keyboard, reducing keystrokes matters.

What Works Well

Claude Code is well-suited to phone input because the interaction is conversational. I describe what I want, Claude writes code, I review diffs. The phone keyboard bottleneck matters less than you’d expect - I’m not typing code, I’m typing short instructions.

What Doesn’t

Context switching is painful. Referencing other files, looking up documentation, or switching between terminal and browser doesn’t work well on a phone. I stick to focused, single-task work.

The screen size also limits code review. I can approve small diffs, but large refactors are hard to evaluate. For those I wait until I’m at my laptop.

For narrowly-scoped tasks, this setup works well enough that I use it regularly.

← Back to writing