SleepSwitch is a macOS menu bar toggle that stops your Mac from sleeping — lid closed included. One click, no password prompts, and a battery guard so you don't cook your laptop in a bag.
You kick off a long agent run — Claude Code refactoring half a service, Codex grinding through a test suite, some pipeline that's going to take 40 minutes. You close the lid and walk away.
You come back to a session that died somewhere in the middle. Half the edits applied. The agent's context gone. Whatever it was in the middle of writing, gone with it.
Your Mac went to sleep. That's it. That's the whole bug.
Why caffeinate doesn't save you
The standard answer is caffeinate -dimsu. It works — right up until you close the lid, at which point the Mac sleeps anyway.
Lid-close sleep is a separate setting, it lives behind sudo, and no user-level assertion touches it:
sudo pmset -a disablesleep 1 # the one that actually matters
So the real workflow becomes: remember the f
Discussion
Jump in and comment!
Get the ball rolling with your comment!