I saw a post by @0xMassi about pocketdev: one command that gives you a cheap cloud server running Claude Code, reachable only through your own private VPN, that you can drive from your phone. An hour later I was giving Claude tasks from my couch while my laptop was closed. This post is the complete setup, every command included, plus the things that tripped me up so they don't trip you up.

Why not just run Claude Code on your laptop?

You can, and I did. But a laptop session dies when you close the lid. The whole point of an agent like Claude Code is that it can work without you, and for that it needs a machine that never sleeps:

  • Tasks keep running. Give Claude a refactor at 23:00, check the result at 8:00. The box worked the night shift; your laptop slept.
  • Every device is the same session. Phone, laptop, iPad all attach to one shared terminal. Start a task at your desk, answer Claude's question from the supermarket queue.
  • Your subscription, no extra AI costs. Claude Code on the box logs into your existing Claude Pro/Max plan. The only new cost is the server: ~€5-8/month.
  • Safe by construction. The server has zero open ports to the internet. SSH only works over your private Tailscale network. Key-only login, and the dev user has no sudo.

There's also Claude's own cloud option you can drive from your phone, but it runs in a fresh sandbox per task, which is less great: no persistent state, not your installed tools, and none of the context from your last session. This box is the opposite. It's your machine, always on, exactly where you left it.

What you need

  • A Hetzner Cloud account (the server, ~€5-8/month)
  • A Tailscale account (free tier, the private network)
  • A GitHub account (repos are how the box and your laptop stay in sync)
  • A Claude Pro or Max subscription (or another supported agent: Codex, Cursor, Gemini…)
  • An iPhone or Android with the free Tailscale and Termius apps

Part 1: On your Mac

1. Install pocketdev

Grab the binary for your platform from the releases page. On an Apple Silicon Mac:

cd /tmp
curl -sLO https://github.com/0xMassi/pocketdev/releases/download/v0.1.0/pocketdev_0.1.0_darwin_arm64.tar.gz
curl -sLO https://github.com/0xMassi/pocketdev/releases/download/v0.1.0/checksums.txt
shasum -a 256 -c <(grep darwin_arm64 checksums.txt)   # should say: OK
tar xzf pocketdev_0.1.0_darwin_arm64.tar.gz
mv pocketdev /opt/homebrew/bin/
pocketdev version

2. Install Tailscale

brew install --cask tailscale

Open the Tailscale app, sign in (I used GitHub login), and make sure the menu-bar icon shows connected. Your Mac is now on your private network.

3. Get your two keys

Hetzner API token: in the Hetzner Console, open your project → Security → API tokens → Generate API token, permission Read & Write. Copy it immediately; it's shown once. Don't create a server in the console; pocketdev does that.

Tailscale auth key: at login.tailscale.com/admin/settings/keysGenerate auth key, toggle Reusable on. (If Tailscale keeps showing you an onboarding wizard, click "Skip this introduction" at the bottom.)

4. Run it

pocketdev

A terminal wizard asks for both keys and a few choices. Mine: create a new box, name devbox (keep the default, it becomes your hostname), Shared resources (cheap and plenty for agents), a small instance in Nuremberg, clone my portfolio repo as the starting project, agent: Claude Code. Two minutes later the box existed, firewalled shut, on my tailnet. Say Yes when it offers to add devbox to your SSH config.

Nice detail: your Hetzner token and Tailscale key never leave your laptop; the box only gets a single-use, 30-minute Tailscale key.

5. One-time setup on the box

ssh devbox
pocketdev setup

This logs the box into GitHub (pick HTTPS as the git protocol, so the gh CLI then handles all auth for clone/push, private repos included) and into Claude Code via a paste-code flow with your existing subscription. It clones your repo and you're done.

Part 2: On your phone

1. Tailscale app

Install from the App Store, sign in with the same account, flip the VPN toggle on. Without this, your phone can't even resolve the box's address. I learned this via an "unknown node or service" error in Termius.

2. Termius (the free plan is enough)

Termius will offer you a ~€15/month Pro trial at signup. You don't need it; plain SSH with keys is free. Dismiss the upsell.

Give your phone a key the box trusts. Easiest is pocketdev's own flow: run pocketdev mobile on your Mac and follow it. The free-plan route: in Termius, Keychain → + → New Key (ed25519), then paste the public half into pocketdev when it asks. The private key never leaves your phone.

Then create the host: Hosts → +, address devbox.<your-tailnet>.ts.net, username dev, attach your key. There is no password anywhere in this setup. If you see a password prompt, the username or key is missing from the host config.

3. Two settings that matter

  • Startup command: edit the host and set it to tmux new -A -s main. Now every tap drops you straight into the shared session.
  • Turn off Termius's AI bar. By default the input field "helpfully" rewrites what you type into shell commands, which is chaos when you're actually talking to Claude. Tap the ABC button on the keyboard toolbar for direct typing.

Part 3: The glue, tmux

This is the piece that makes the magic work, and it's one command. On any device:

ssh devbox
tmux new -A -s main     # attach if it exists, create if not
cd ~/your-project && claude

tmux is a terminal that lives on the server. Your phone and laptop are just two windows into the same screen: type on one, watch it appear on the other. Close everything, reconnect tomorrow, and it's exactly where you left it. The mental model that finally made it click for me:

your device        <- disposable window
  ssh devbox       <- the always-on box
    tmux main      <- the session that never dies
      claude       <- the agent doing the work

The tmux crash course: Ctrl+b c new window, Ctrl+b n next window, Ctrl+b d detach. One window per project, each with its own Claude. That's how you run three projects in parallel.

How I actually work with it

  • Scoped tasks, clear finish line. "Add dark mode, test it, commit and push when done" beats "improve the site". End every prompt with commit and push when done. Results land on GitHub before you even reconnect.
  • Run /init once per repo so Claude writes itself a CLAUDE.md and starts every session knowing your stack.
  • Git is the bridge. Pull before you start, push when you stop, on both box and laptop. That's the entire sync strategy.
  • Live previews from anywhere: pocketdev publish 3000 opens an outbound Cloudflare tunnel and hands you a public URL for whatever runs on port 3000. No account, no open ports, great for checking Claude's work from your phone browser.
  • Check-ins take 30 seconds. Open Termius → read what Claude did → answer its question or queue the next task → pocket. Repeat between sets at the gym.

Cost and safety, honestly

Total: the Hetzner box (~€5-8/month, billed afterwards, per hour). Tailscale free, Termius free, pocketdev free and open source, Claude via the subscription you already pay for. A stopped Hetzner server still bills; pocketdev destroy deletes it when you want out.

And the part that makes me comfortable leaving an AI agent running unattended on the internet: it isn't on the internet. Empty inbound firewall, access only via your tailnet, key-only SSH, non-sudo user, unattended security updates. The attack surface is close to zero.

Credit where due: pocketdev by @0xMassi, inspired by @levelsio's phone-coding posts. If you already run a plain devbox (I wrote about setting one up by hand), pocketdev can also adopt an existing server instead of creating a new one.

Now if you'll excuse me, Claude and I have a site to ship. From the couch.