I ran a 3-day code refactor while my laptop slept. Here's the trick.
I used to baby-sit my terminal. Kick off a script, keep the laptop awake, check in every hour like I was guarding a campfire. That got old fast after I started running AI coding agents like borg on real projects. The agent didn't just autocomplete a line: it restructured modules, ran the full test suite on each change, and sometimes spent four hours chasing a type error across 40 files. My MacBook Pro was a miserable home for that kind of work.
The laptop that sleeps (and kills your agent)
A laptop is designed to nap. Close the lid, walk away, and macOS or Linux politely suspends processes. That's fine for a text editor. It's death for a long-running AI task. The agent might be 90% through a refactor, and suddenly it's frozen mid-rewrite, leaving your repo in an inconsistent state. Even if you disable sleep, you're now tethered to a charger, fans screaming, while your battery degrades from constant cycling.
Network interruptions add another layer of pain. A flaky coffee-shop Wi-Fi hiccup drops your SSH session. Without a persistent multiplexer, the shell terminates. Your agent's state vanishes. The message is clear: your local machine is not a reliable runtime for multi-hour automation.
The remote shell that never clocks out
The fix is embarrassingly simple: give your AI agent a home on a server that doesn't sleep, doesn't wander away from the power outlet, and sits in a data center with redundant connections. A persistent remote shell session.
Setting it up takes five minutes. SSH into any Linux box, fire up tmux or screen, and you've got a session that outlives your laptop's sleep cycles. Here's how I do it on xShellz, where a shell comes ready for long-lived agents:
# Start a named tmux session
ssh [email protected]
tmux new -s borg-agent
# Inside the session, start borg with a multi-file task
borg "rewrite the auth module to use the new token format and update all imports"
# Detach with Ctrl-b d. Go to sleep, travel, restart your laptop.
# Hours later, reattach:
tmux attach -t borg-agent
The agent never noticed you left. It kept churning through files, running tests, committing cleanly.
Why this matters for AI coding agents
Traditional CI pipelines run on remote servers. Nobody runs a 40-minute test suite on their laptop for every commit. So why should you run a language model that is essentially a software developer on local hardware? AI coding agents are not single-shot commands. They think in long chains: analyze codebase, propose changes, apply patches, verify with tests, and often iterate. A single task can easily span 30 minutes to several hours, or even days if you're doing a deep refactor or migrating a database schema alongside code.
With a persistent remote shell, you can assign a task at the end of your workday and wake up to a clean pull request. I've let borg run on a remote shell for three continuous days on a legacy codebase, modernizing dozens of services. My laptop sat in my bag, turned off half the time. The only sign of progress was the occasional commit notification in Slack.
What to look for in a remote home
Any VPS with SSH access and a decent CPU works. But you'll want a few things to make the workflow painless:
- Always-on guarantee. No hibernation, no power-saving daemons that kill long processes.
- Enough memory. AI agents often run language models alongside tooling. 4 GB is the absolute floor for simple tasks; 8 GB is safer.
- Fast storage. When an agent reads thousands of files, an SSD saves real time.
- Pre-installed tooling. I don't want to spend 20 minutes installing tmux, Python, Node, and the agent each time I provision a box.
At xShellz, we bake borg directly into the shell image so you can ssh in and immediately start a long-running coding session. It's the same for our always-on IRC bouncers. The point is you get a home for persistent terminal workflows that just works. That said, even if you roll your own on a $5 VPS, the principle holds: offload the persistent work from your transient devices.
The moment you'll never go back
Once you experience a detached agent completing work while you're offline, you'll resent every local-only tool. I'll admit I still use a local editor for quick edits, but any task that needs more than five minutes of thinking goes straight to the remote shell. The mental shift is liberating: your machine becomes a thin client, and the real work happens elsewhere, safely, continuously.
Give it a try. Spin up a remote session tonight, kick off a task, detach, and check it in the morning. That first log showing dozens of clean commits while you were asleep? That's the always-on advantage.