The four options
There are only four things people actually do, and they fail in different ways.
1. Keep the Mac awake. caffeinate -dims stops the display, disk and system from sleeping for as long as it runs. It works, and it is what most people try first, because it costs nothing and takes one command.
Two caveats. With the lid closed, macOS suspends on its own schedule unless the machine is on power and configured not to; the process keeps the system busy but cannot argue with the lid switch forever. And the laptop is now a machine that never sleeps, sitting on a desk with the fan going, which is exactly the thing a laptop is bad at.
# Run an agent with the system kept awake, in a terminal that survives a disconnect
caffeinate -dims tmux new -s agent 'claude'
2. A server and tmux. Move the work to any Linux box you can SSH into and run the agent inside tmux. This is the honest DIY answer: the machine is always on, the agent is a child of a session that outlives your SSH connection, and reattaching is one command.
ssh you@your-server
tmux new -s work
# inside the session
claude
# detach with Ctrl-b then d
# later
tmux attach -t work
The part people get wrong is thinking tmux is what keeps the work alive. tmux keeps the process alive across a disconnect. A reboot, an out-of-memory kill or a sleeping host stops it just as dead as anything else.
3. A cloud session from the agent vendor. Some vendors now offer their own hosted sessions. These are genuinely convenient — nothing to install — but they are temporary by design, the workspace is reclaimed when idle, and the usage counts against the same plan you already pay for. Fine for a task, poor for a project that needs the same machine tomorrow.
4. A computer that stays on. Either a machine at home or a cloud machine dedicated to the work. This is the only option where closing your laptop is genuinely irrelevant, because the machine is not your laptop.
What actually happens when the lid closes
The mechanism is worth knowing, because it explains why most of the advice online does not work. Closing the lid on a Mac triggers a sleep request, and sleep is the operating system suspending the kernel: no process runs, no network stays up, the agent’s event loop stops mid-await. Nothing about the agent is at fault, and no flag passed to the agent changes it.
Power settings can override part of that. On a Mac on AC power, caffeinate can hold
off idle sleep and disk sleep. It cannot hold off a closed lid indefinitely, and it
cannot hold off a low battery, an update that decides to restart, or a kernel panic.
On Windows the equivalent is powercfg /change standby-timeout-ac 0, which again
addresses the timeout and not the lid. On Linux it is the lid switch in
/etc/systemd/logind.conf:
# Ignore the lid entirely: the machine keeps running with the lid shut.
# This is the one setting that genuinely survives a closed lid on Linux.
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
Run sudo systemctl restart systemd-logind afterwards, and know that you have just
told a laptop to keep running with its vents covered.
The part the disconnects people miss
A session that detaches is not the same as a session that dies, and the difference costs people hours. Three distinct failures get conflated:
| What happened | Symptom | What it actually is |
|---|---|---|
| SSH connection dropped | Terminal hangs, then Connection to host closed |
The process may still be alive; only your view of it died |
Shell exited without nohup or tmux |
Agent stops the moment you close the terminal | SIGHUP sent to the process group |
| Host suspended or rebooted | Nothing running when you return | The kernel stopped; no signal was sent to anyone |
Only the third one is fatal to the work in a way you cannot recover from, and only the third one is caused by the laptop rather than by how you started the process. That is why the advice “use tmux” keeps appearing next to the advice “use a server”: they solve different rows of that table, and people recommend whichever one fixed their particular incident.
What a remote agent costs you in attention
There is a cost that does not appear in any pricing table: an always-on agent is producing output while you are not looking, and someone has to read it. An agent that runs for six hours unattended has made hundreds of small decisions you have not reviewed, and the review is the work.
Two habits keep that manageable, and they matter more than which hosting you pick:
- Cap the blast radius per task. One branch and one worktree per task means an
agent that went sideways overnight is a branch you delete, not a repository you
repair.
git worktree add ../task-a -b task-ais the whole setup. - Make the agent write progress to a file, not to scrollback. A
PROGRESS.mdin the repository that the agent updates as it goes survives a crash and is what you read in the morning. A terminal buffer does not, and a resumed session tells you nothing about what happened while it was dead.
Neither habit depends on the machine. They are what make an always-on machine worth having, because an always-on agent without them just produces more to review.
How to choose
Decide by what has to survive.
- A single task finished in an hour, on a machine you are sitting at: keep the Mac awake. Stop reading.
- Work that has to outlive a disconnect but not a reboot: tmux on a server.
- Work that has to outlive you leaving, repeatedly, for days: a machine that stays on.
Most people arrive at option four only after losing an agent’s progress for the third time. That is the expensive way to learn it.
Where the product fits
The fourth option is what this product is. The machine has its own power and network, agents run on it, and every terminal and preview is reachable from a browser, a phone or SSH. Closing the laptop does not pause it; pausing is a thing you choose, and pausing deliberately keeps the disk so nothing is lost.