r/opencodeCLI • u/Legend_One8 • 4h ago
My opencode sessions now outlive my laptop battery
I used to start a long opencode task, close the lid to go somewhere, and come back to a dead session. Moving it to a remote box took about 20 minutes and fixed that, plus a couple of things I did not expect.
The whole setup.
A small Linux VM with opencode on it, and every session started inside tmux. Closing the laptop or losing wifi changes nothing.
SSH from my phone with Termius to check in. Reading a big diff on a phone is painful, but unblocking an agent that got stuck on a question takes ten seconds.
A ping when it is done. The last step of every task curls an ntfy topic, so my phone buzzes instead of me checking every ten minutes.
A deploy key scoped to that one repo, and only the model provider key in the environment. The box has no idea my other projects or my cloud accounts exist.
That last part ended up being the real win. On my laptop the agent could read everything I can read. Here the worst case is a VM I rebuild in a few minutes.
For the box, a Hetzner VPS works fine, and Fly Machines if you want it scriptable. I went with boatdotdev because I start and stop it from the CLI and only pay while it runs. Two things to know. Stopping it is a reboot, so the tmux session dies and I commit before I stop. And the IP changes after a resume, so I look it up again instead of saving it.
If you mostly use opencode for long tasks, get it off the machine you carry around. Cheapest upgrade I made this year.
