muningis.lt

Claude Code over Tailscale

tailscale
claude
ai

I kept hearing good things about Tailscale was always curious to try it out, but never found the occasion. Until one of mandatory PTO day towards end of December. Recently, I’ve been trying to get in some steps after lunch (20 - 30 minutes, you know, healthy stuff). At the same time, I was experimenting with Claude Code and ran into a dilemma: do I stay and vibe, or go for a walk? Only if I could do it from my phone...

And then it hit me - but I can, using tooling or features I've never used.

At a high level, this is what the setup looks like:

copy
Phone └─ SSH (over Tailscale) ─────────────> MacBook └─ zellij session

To pull this off, you really only need three things:

  • Tunnel, to access one device from another - that's where Tailscale comes in.
  • Terminal multiplexer - default, and probably most popular one is tmux but I personally prefer zellij. This is purely personal preference - I’m not going to debate which one is “better.” The best tool is the one that fits you.
  • Terminal emulator on your phone. As I'm using iOS, I use Termius - I'm quite confident that Androids beat iOS and there are many much better choices.

I’d only ever used a terminal multiplexer locally - splitting panes, tabs, or re-attaching after a restart. I’d never actually used one while SSHing into another device.

Setting up Tailscale is pretty straightforward: install it on your devices, create an account, and log in. Connect to your tailnet on both, and voila - your devices can access each other (and nobody else - unless they join your team) even if they are on different networks.

And that's where my first issue popped up... I was unable to connect. A quick macos remote connect ssh search on DuckDuckGo led me to Mac User Guide for allowing remote connections - duh, should've been obvious that will be required. Oh well.

Enabled it, second attempt to SSH into my MacBook and this time it worked! Quick zellij a home and here I am accessing zellij's session on my computer from my phone. Perfect! Let’s put on some shoes, head out, and get some steps in - while I occasionally instruct Claude what to do next. The only thing I still need to set up is notifications - so my phone can ping me when Claude is done. But that is for another time.

Enabling remote access on macOS

As described above, unless you do this, you won't be able to connect remotely.

  1. Go to Settings
  2. General -> Sharing
  3. Scroll down to Advanced and toggle on Remote Login