Eran Kampf
Eran Kampf
VP Engineering at Twingate. Founded Monday.com (NASDAQ: MNDY). 20+ years building software.
7 min read

Run Claude Code from Your iPhone with Twingate, Termius, and tmux

iPhone connected to a Mac via a secure tunnel showing a terminal with Claude Code
๐Ÿ“ TL;DR
Use Twingate to securely reach your Mac from anywhere, tmux to keep Claude Code sessions alive across disconnects, and Termius for a usable terminal on your iPhone. The phone becomes a remote control โ€” you steer, Claude builds. Full setup takes less than 15 minutes.

I recently came across Pete Sena’s blog post about accessing Claude Code from mobile and I think he nailed it. Same problem, same solution โ€” three boring tools that feel like a cheat code when you put them together.

I have a similar setup. Except I use Twingate instead of Tailscale.

Full disclosure: I’m VP Engineering at Twingate. So yes, I’m biased. But I also use this setup daily and it’s genuinely how I work. This isn’t a marketing pitch โ€” it’s my actual setup.

The Problem  #

Claude Code lives in the terminal. It has access to your filesystem, your git repos, your toolchain. It’s the most capable coding agent I’ve used (Sorry Codex).

But it runs on your Mac. And sometimes you’re not at your Mac.

The Claude iOS app exists. I use it. It’s great for quick reasoning and planning. But you can’t build with it - My repos, my scripts, my secrets, my tooling โ€” the entire development environment lives on my Mac.
And my work is long-running. The moment you go mobile, networks get flaky. Apps get backgrounded. Sessions drop. If Claude is mid-task when that happens, you lose context. When it comes to agentic coding - output is cheap, context is the expensive part.

So the work needs to happen on a real machine. The phone is just the key.

The Stack  #

Three tools. Free tiers for everything except the Claude subscription.

Twingate gives me secure access to my Mac from anywhere. Not a VPN โ€” more on that in a minute.

tmux keeps terminal sessions alive across disconnects. Start a session, detach, come back later, everything is still running. This is what lets Claude keep working while your phone is in your pocket.

Termius on iOS gives me a sane terminal on a phone. It makes SSH feel normal. Proper keyboard toolbar, snippets, host management.

So Claude Code runs on my Mac, inside tmux. My phone just attaches to that running session.

No screen sharing. No “where was I.” No context resets.

Why Twingate Instead of Tailscale  #

Tailscale works well, but here’s why I reach for Twingate โ€” and not just because I work there.

Tailscale is a mesh VPN. It creates a network where every device can see every other device. Simple and effective. But the security model is broad โ€” once a device is on the network, it has network-level access to everything else.

Twingate takes a different approach: Zero Trust resource access. You don’t expose your network. You expose specific resources. In this case, that means SSH on my Mac โ€” not every port, not every service, not my whole home network. Just port 22 on one machine.

Why does that matter here? Because you’re punching through to a machine running an AI agent that has access to your codebase, your git credentials, your environment. The principle of least privilege isn’t a buzzword โ€” it’s practical.

Twingate also gives you:

  • Granular access policies โ€” who can access what, under what conditions
  • Device trust checks โ€” is the connecting device compliant?
  • Audit logs โ€” who accessed what, when

The free Starter plan covers up to 5 users. More than enough for this.

Okay, I’m biased. But I’m also right.

Step-by-Step Setup  #

1. Enable SSH on Your Mac

System Settings โ†’ General โ†’ Sharing โ†’ turn on Remote Login.
That’s your SSH server.

Enable Remote Login on System Settings

2. Set Up Twingate

  1. Sign up for Twingate (free Starter plan)
  2. Deploy a Connector on your network โ€” this is the bridge Twingate uses to reach your Mac. You can run it as a Docker container on the Mac itself or on another device on your network
  3. In the Twingate admin console, add your Mac as a Resource โ€” specify its local IP or hostname, and restrict access to port 22 (SSH).
    Twingate admin console showing a resource configured for SSH access on port 22
  4. Assign the resource to a group so you can access it.

3. Install tmux

brew install tmux

Enable mouse support (this is a gotcha โ€” without it, scrolling on the phone cycles through command history instead of scrolling output):

printf '\nset -g mouse on\n' >> ~/.tmux.conf.local
tmux source-file ~/.tmux.conf

A more complete config if you want it:

cat << 'EOF' > ~/.tmux.conf.local
set -g mouse on
set -g base-index 1
setw -g pane-base-index 1
set -g history-limit 50000
EOF

4. Set Up Your iPhone

  1. Install the Twingate client from the App Store. Sign in. Turn it on. Confirm your Mac appears as an available resource
  2. Install Termius from the App Store
  3. Create a new host in Termius:
    • Host: Your Mac’s hostname name or local IP.
    • Port: 22
    • Username: Your macOS username
    • Auth: SSH key (recommended) or password

5. Start Claude Code in tmux

# Create a new session
tmux new -s claude -n claude

# Inside the session, start Claude Code
claude

Give it a task. Detach with Ctrl+b, then d. Claude keeps working.

You can create a second window for other work:

# From inside tmux: Ctrl+b, then c
# Or from outside:
tmux new-window -t claude

Switch between windows:

tmux select-window -t claude:claude
tmux select-window -t claude:1

6. Connect from Your Phone

  1. Open Twingate โ†’ connect
  2. Open Termius โ†’ tap your Mac host
  3. Reattach:
tmux attach -t claude

You’re in. Claude has been working while you were away.

My Workflow  #

This setup unlocks three things for me:

Fire and forget, then check in โ€” Give Claude a substantial task: refactor a module, write an integration test suite, investigate a production issue. Walk away. Later, pull out the phone, reattach, review the progress. Approve changes, course-correct, queue up the next task. Detach. Come back when it’s done.

Ideas on the go โ€” Have an idea while walking the dog or waiting for coffee? Connect from the phone, spin up a new Claude session, describe what you want. By the time you’re back at your desk, there’s a branch with a working implementation waiting for review.

Command and control, not coding โ€” The phone isn’t where you write code. It’s where you steer. Review diffs, approve plans, redirect work, unblock a stuck session. Claude builds. You make decisions.

Git Is the Safety Rail  #

I let the agent move fast. I don’t let it be reckless.

My main branch is protected. Force pushes are blocked. Review gates are in place. Everything goes through a feature branch and a PR. Claude Code has a CLAUDE.md in my repos that enforces this โ€” it knows the rules.

So even if an agent gets weird, it can’t rewrite history on main.

Cost  #

  • Twingate: Free (Starter plan, up to 5 users)
  • Termius: Free tier works fine
  • tmux: Free and open source
  • Claude: Claude Max subscription ($100/mo or $200/mo depending on usage tier)

Everything except Claude is free. And if you’re using Claude Code seriously, you probably already have the subscription.

The Future - Code From Anywhere, Really  #

The takeaway from this post isn’t that you should use one tool or another.
It’s about closing the gap between “I should build that” and “here’s the PR”. And if I can secure it with Twingate, well that’s even better 😉

While this setup works well for me it got me thinking - why even depend on my MacBook laptop which isn’t always online? I can set up a development environment with tmux on a remote VM (like a $12/month Digital Ocean droplet) that I can connect to from any device in any location.