Moving Claude and Codex off my laptop

A cloud VM, persistent terminal sessions, and the same Claude Code session on Mac and phone. The friction, the setup, and the open question.


I got hooked on coding with agents, building a few things for our company and for fun.

Often on the move so keeping the laptop open while agents run is super annoying. The sessions get interrupted anyway, connectivity changes.

Can’t check progress from mobile. Can’t give Claude the next thing to do. /remote-control in Claude exists but it sucks. The agent still runs on my laptop, close the lid and it stops.

Some people set up a Mac mini at home. That feels weird. The agents run in the cloud, the repo lives on GitHub. Why pipe all of this through a box in my flat?

A VM in the cloud feels more right. Never sleeps, repo lives there, no desktop dependency, reasonable security.

This Ona piece captured the feeling well: https://ona.com/stories/the-last-year-of-localhost.

I gave plain SSH a try. Half baked. Lag, drops on every network blip, reconnect dance is a disaster.

People often suggest tmux for the persistence side, so I tried that and ended up assembling something with more layers to make it feel smooth.

Here’s the setup:

A simple VM on Google Cloud. Always on. Repo lives in there. Claude Code, Codex, Gemini installed as CLIs.

The agents run inside tmux sessions on the VM. tmux holds the PTY no matter what’s connected — close the laptop, drop wifi, airplane-mode the phone, none of it touches the session.

Both Mac and iPhone connect over mosh. UDP based, roams gracefully across network changes (cellular to wifi, sleep/wake, subway tunnels). On the phone the client is Moshi, which renders the terminal and enumerates tmux sessions in a picker.

The whole thing goes over Tailscale. The VM has no public SSH or mosh ingress — Tailscale carries everything, direct WireGuard when possible, DERP relay over HTTPS when not. One transport, one network plane, zero public terminal exposure.

The point: both clients attach to the same tmux server on the VM. Same scrollback, same prompt, same agent state. Laptop, phone, both at once, all clients of the same long running shell.

The annoying part was scrollback: every Claude repaint used to land in tmux’s history, doubling it on every reconnect. CLAUDE_CODE_NO_FLICKER=1 fixes it — Claude wraps each TUI frame in synchronized-output escapes, tmux treats it as one atomic write, scrollback stays clean.

Moshi shows all the running sessions in its picker. I just tap and swipe between them. Awesome.

A few shell functions hide the layering on the Mac with a few commands and keyboard shortcuts.

Every person I’ve shown this to has the same wtf/wow reaction. They watch me start something on my laptop, close the lid, pull out my phone, pick up exactly where the agent was.

And really, this should be how it works from day one. How did we end up with the bar so low that such a basic flow gets treated as a revelation?

Everything is in the cloud, but somehow agents inherited the localhost assumption from the previous era.

I thought it would be cool to package this so people don’t have to assemble the layers themselves.

So few things I’d love thoughts on:

  1. How are you working with coding agents from outside your laptop? Anyone else ended up here?

  2. What’s your take on this stack? What would you do differently?

  3. Anyone want to collab on turning this into a clean CLI? Open source, no commercial gatekeeping.

Honestly I think Anthropic, OpenAI and Google should ship this themselves at some point. Until they do, here we are.