Stu Mason
Stu Mason

Running Claude Code from Your Phone

Stu Mason3 min read

Set up SSH access to my laptop so I can run Claude Code from my phone. ZeroTier was the answer after port forwarding and Tailscale failed me.

Running Claude Code from Your Phone

Pushed to main, went out, got an email saying the build was broken. This helplessness annoyed the shit out of me.

So I set up remote SSH access to run Claude Code from my phone using Terminus. From anywhere in the world.

The Easy Part

Static IP - Dynamic IPs change, making remote connections unreliable. Set the laptop to static:

sudo networksetup -setmanual "Wi-Fi" 192.168.1.100 255.255.255.0 192.168.1.1
sudo networksetup -setdnsservers "Wi-Fi" 8.8.8.8 8.8.4.4

Local SSH Testing - Verified SSH works locally: ssh [email protected]

Discovered the claude command wasn't available in terminal. Root cause: nvm was lazy-loaded in .zshrc. Fixed by changing to auto-load:

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

Now claude, npm, node available immediately.

The Struggle

Attempt 1: Port Forwarding (FAILED)

Tried forwarding port 22 through the router. Router access was a mess - 192.168.1.1 redirected to https://myrouter.io which failed to load. Added it to /etc/hosts, set up port forwarding, tested from outside.

Port still showed as closed. Likely cause: Sky router is dogshit.

Attempt 2: Tailscale (ABANDONED)

Installed Tailscale. Required additional app on phone. Balls started to ache. Abandoned.

Attempt 3: ZeroTier (SUCCESS)

Fully open source, free tier, works through firewalls.

brew install zerotier-one

Setup:

  1. Created account at my.zerotier.com
  2. Created new network
  3. Installed ZeroTier app on phone
  4. Joined both devices to same network
  5. Critical: Manually authorized both devices in web dashboard

Initial problem: ACCESS_DENIED status. Solution was authorizing devices in the web interface.

Took a few minutes for connection to establish. Laptop got assigned a 172.22.x.x IP.

Power Management

Can't SSH to a sleeping laptop. Fixed with System Preferences → Battery → "Prevent automatic sleeping on power adapter when the display is off".

Security

ZeroTier CAN see: which devices are connected, timing, bandwidth, topology.

ZeroTier CANNOT see: SSH commands, files transferred, passwords. All encrypted end-to-end.

What Works Now

  • SSH access from anywhere in the world
  • Claude Code CLI available remotely
  • Full development environment via phone
  • Real-time code editing, git ops, deployments

The Holy Shit Moment

Successfully running claude /init remotely, making code changes, and pushing to production from a phone while away from the laptop.

Complete game-changer for idiots like me who push up crap code at the last minute when I've promised the wife I'll be 2 minutes and it's taking 20.

If ZeroTier Doesn't Work For You

  • Different port: use 2222 or 8022 instead of 22
  • ngrok: ngrok tcp 22 for temporary access
  • Cloudflare Tunnel: free tunneling
  • WireGuard: self-hosted VPN

Now I can make ANY non-work environment into a work environment. No more being present at meals, with my child, or at a beach - just Claude Code 24/7/365.

...what have I done?

Get the Friday email

What I shipped this week, what I learned, one useful thing.

No spam. Unsubscribe anytime. Privacy policy.