Your AI should be working while you sleep
If you already write code with a CLI agent like Claude Code or Codex, you've probably noticed something odd: it's the one doing the work, but you're the one who's tied down. This article is about what that tie actually is, why it can be undone, and what your day looks like once it is.
First, see where the time actually goes
A round of work with a CLI agent almost always has the same rhythm:
You talk for 30 seconds → it runs for 5–20 minutes → it needs you to decide something → repeat
Lay a whole day out in those proportions and the conclusion is mildly counterintuitive: what eats the time isn't typing. Those 30 seconds describing what you want are the shortest part of the whole thing. Everything after is pure waiting — waiting while it reads the project, waiting while it edits a dozen files, waiting for the tests. Then it stops to ask "should I handle this migration while I'm here?", you answer in one line, and it's another five minutes, another twenty.
By the end of the day you might have produced less than ten minutes of actual input, and lost several hours. Those hours weren't work. They were standby: you did nothing, but you couldn't leave, because at any moment it was going to need one sentence from you.
The usual setup nails standby to one laptop
The trouble is that in the default arrangement, this standby has a physical location. The agent runs in a terminal window on your laptop, that window is tied to that shell, and that shell is tied to that one machine being awake. Which leaves you two options:
Sit and wait. Stay in the chair, eyes on a screen where nothing happens most of the time, purely so you can answer within thirty seconds when it asks. You spend an hour and get three replies out of it.
Or close the laptop. Shut the lid, the process is suspended or simply dies, the session is gone, and the context the agent had built up — which files it read, how far it got, why it chose this approach — goes with it. Coming back later means opening a new one, explaining the whole thing again, and starting from the top.
Both options pay the same bill. You aren't tied to the work; you're tied to where that machine happens to be.
Three pieces, each undoing one tie
The tie isn't one solid thing. It's three layers stacked up, and each layer has a standard tool, decades old, that takes it apart. Individually all three are unremarkable; the point is what they do stacked together:
| Piece | The tie it undoes |
|---|---|
| CLI | The agent is a plain-text process with no need for a GUI → it can live on another machine |
| tmux | The session is pinned to the server and survives a dropped connection → standby doesn't need you present |
| SSH + Tailscale | Reattach securely from any network, with no public port and no static IP → standby isn't tied to a device or a place |
The order matters. The CLI comes first, because only then can the agent leave your laptop for the Mac mini at home that's never been switched off. tmux comes next, because only then is the session pinned to that machine and able to keep running when your connection drops. SSH plus Tailscale comes last, because only then can you reattach to that same session from the train, from the office, from someone else's Wi-Fi — without opening a single outward port on your router.
Drop any one of them and it falls apart. CLI without tmux and the agent dies on disconnect. tmux without a secure way in and you can only use it on your home Wi-Fi.
The result: standby costs almost nothing
With all three layers gone, the price of standby drops from a laptop plus a fixed location to the phone in your pocket plus fifteen seconds.
That's not a difference of degree, it's a difference in kind. When reattaching takes fifteen seconds, you no longer have to "set aside time to babysit it." You glance at it in a queue, at a crossing, before bed; you reply "use the second approach"; the phone goes back in your pocket. The agent keeps going and you keep living your life.
And since standby no longer requires you to be there, the work can move into the hours when you were never going to be there anyway. Hand it a refactor and go to dinner. Start a test-fixing session before bed and read the results in the morning. That machine of yours was sitting idle all night; now it spends the night working for you.
What about the other approaches?
There's more than one road to reaching your own agent remotely. Line them up against the same criteria and the differences get clear — especially the last column, which is where most people discover they're stuck only after the fact.
| Approach | Cost of standby | Does context survive | Network setup needed | Can it really edit your files |
|---|---|---|---|---|
| Carry the laptop | You need a bag, a seat, and power | Stops when you close the lid | None, but the machine has to travel with you | Yes — the files are local |
| VNC remote desktop | Needs a screen big enough, and a mouse UI driven by finger | Survives as long as the desktop session does | Punch through for VNC, or stand up a VPN | Yes |
| Browser-based agent | Low — just open a browser | Lives on someone else's server | None | It edits a copy in a cloud sandbox, not the one on your machine |
| Cloud environments like Codespaces | Low, but you need a browser | The container gets reclaimed after enough idle time | None, but the project goes to the cloud and you're billed by usage | Yes, but it's the repo inside the cloud container |
| General SSH app | A phone is enough | Holds up, thanks to tmux | Securing the way in is on you | Yes, but the interface is a desktop terminal moved across as-is |
| Agentmux | A phone, fifteen seconds to reattach | tmux is on the server, regardless of the phone | Tailscale, with no public port | Yes — the copy on your own machine |
That last column is the watershed. An agent running in someone else's cloud sandbox is forever editing a copy: your .env isn't there, neither is that internal package you just installed, nor the database that only runs locally. On the SSH-plus-tmux road, the agent sits on your own machine, in your own environment, editing your own files — the only difference being that this time it's your phone watching it.
Not sure where to start? Help me pick a track.