← Back to blog
Tutorial Feb 18, 2026

I Ran Claude Code from My Phone on a Train

Matteo Lombardi
Feb 18, 2026

I was on a train. A deployment needed checking. I pulled out my phone and was inside my Mac Mini in under two minutes.

No laptop. No hotspot workaround. No scrambling.

Here’s the stack that made it happen — and it costs nothing.

Key Takeaway: Full Claude Code terminal sessions from an iPhone using 4 free tools: Termius (SSH) → Tailscale (mesh VPN) → tmux (persistent sessions) → Claude Code. tmux is the critical piece — it keeps sessions alive when your connection drops. Less “coding from your phone” and more “dispatching tasks from your phone.”

What You Need

  • iPhone (any model with Termius installed — free)
  • Mac Mini or any Mac that stays on when you’re away
  • Claude Code installed and configured on the Mac
  • 10 minutes for one-time setup

The Stack

iPhone → Termius → Tailscale → Mac Mini → tmux → Claude Code
ToolWhat It DoesCost
TermiusSSH client for iPhoneFree
TailscaleMesh VPN — Mac accessible from anywhereFree
tmuxKeeps terminal sessions aliveFree
Claude CodeThe CLI agentPay-per-use API

Setup (One Time)

Step 1 — Install Tailscale on both devices

Download Tailscale on your Mac and iPhone. Sign in with the same account. They’ll join the same private mesh network automatically. Find your Mac’s Tailscale IP in the Tailscale app (Settings → Devices).

Step 2 — Configure Termius on iPhone

In Termius, add a new host. Use your Mac’s Tailscale IP as the address. Save your SSH credentials. Test the connection once on WiFi.

Step 3 — Install tmux on your Mac

brew install tmux

Step 4 — Start a persistent session

On your Mac, before you leave:

tmux new -s main
# start Claude Code inside the tmux session
claude

Leave it running. The session persists even when you disconnect.

Using It from Your Phone

Open Termius → tap your Mac connection → connect. Then:

tmux attach -t main

You’re back in your Claude Code session exactly where you left off. Same conversation, same file state, same context.

If your connection drops on the train: reconnect, run tmux attach again. The session never died — it was running on your Mac the whole time.

Why tmux Is the Critical Part

SSH alone isn’t enough for mobile. Your connection will drop on a train. Without tmux, that kills the session. With tmux, the session runs on your Mac regardless of your connection state. tmux is what turns “SSH from phone” from a frustrating experiment into something actually usable.

Why Tailscale Beats the Alternatives

The alternative: static IP from your ISP (costs money, not always available), port forwarding (firewall config, security exposure), or a self-hosted VPN (maintenance overhead).

Tailscale just works. Same Mac address every time. LTE, WiFi, any network. Zero config after setup.

The Honest Take

The phone keyboard is brutal for anything serious.

Writing real code, doing complex edits, navigating files fast — all painful on a touchscreen. I use a Bluetooth keyboard shortcut app when I need to type more than a few commands, but it’s still not a great experience.

Where this actually shines: checking status, reading outputs, running a quick command, or asking Claude to handle something autonomously while you’re away from your desk. You delegate the work to Claude, it runs on your Mac Mini, you check back later.

Less “coding from your phone” and more “dispatching tasks from your phone.” That distinction matters.

When to Use It

  • You’re away from your laptop and something urgent comes up
  • You want to kick off a long Claude Code task and check progress later
  • Quick read — did that deployment work? What’s in that file?
  • You trust Claude to execute something while you handle other things

It is not a replacement for a proper dev environment. But as a remote control for your machine? It’s surprisingly solid.


Stack links: Termius / Tailscale / tmux / Claude Code


Frequently Asked Questions

Can you run Claude Code on an iPhone?

Not directly — Claude Code is a CLI tool that runs on macOS/Linux. But you can SSH from your iPhone into a machine that runs it. The stack is Termius (SSH app) → Tailscale (VPN) → your Mac at home → tmux → Claude Code. You’re controlling Claude Code remotely, not running it on the phone itself.

What happens when your SSH connection drops on mobile?

Without tmux, you lose the session. With tmux, the session keeps running on the Mac regardless of your connection state. You reconnect, type tmux attach, and you’re back exactly where you left off — same conversation, same files, same context. This is essential for mobile use where dead spots are inevitable.

Is Tailscale free?

Yes, Tailscale’s personal plan is free for up to 100 devices. You install it on your phone and your Mac, they join the same mesh network, done. No port forwarding, no static IP, no firewall config. Your Mac gets a stable private address that works from any network.