SleepSwitch Keeps Macs Awake During Long AI Agent Runs, Lid Closed
A developer has released SleepSwitch, a free macOS menu bar utility that prevents a Mac from sleeping even when the lid is closed. The tool was created after repeated frustration with AI coding agents — such as Claude Code and Codex — failing mid-run because macOS treated the idle-looking machine as unused and put it to sleep. Standard workarounds like the caffeinate command do not block lid-close sleep, which requires a separate system-level setting normally locked behind root access. SleepSwitch handles both sleep layers with a single click by writing a limited sudoers rule at install time, avoiding repeated password prompts. The app also includes a battery guard and clears all sleep-blocking settings automatically when it quits to prevent the laptop from running hot unattended.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in