# How to keep agents running when your MacBook is in your bag

Published: 2026-07-19T00:00:00.000Z
Canonical: https://wow.pjh.is/journal/dont-sleep

Normally, if you close your MacBook and disconnect the power, it goes to sleep, and your agents stop working.

The ["don't sleep"](https://github.com/HartreeWorks/dont-sleep) script fixes this. If your agents are working, your Mac will stay awake until they finish, or your battery goes below 50%, or your machine gets too hot.[^1]

So now I can walk to the café, with my phone hotspot active, and my agents still hard at work.

Of course, the better solution is to host long-running agents in the cloud, or at least your Mac Mini. I do this for some stuff, but it's not my default for most work. With Fable and Sol, which run autonomously for longer, this needs to change.

The era of doing a bunch of work in local markdown files looks set to end soon.[^2] Unless, that is, Apple ships something like "don't sleep" in the next version of macOS...[^3]

[^1]: It's harder for a MacBook to shed heat in your bag. I've added a conservative safety threshold, to complement the native heat management system.

[^2]: Pieter Levels [does all his work in VMs](https://x.com/levelsio/status/2071162399864889705)—one per project. Given that AIs can manage your VMs, this strikes me as not at all crazy.

[^3]: Thanks to [JP Addison](https://www.jpaddison.net/) for the "don't sleep" script idea, and its [original implementation](https://github.com/jpaddison3/dotfiles/blob/master/keep-awake.sh).
