caffeinate cannot stop macOS lid-close sleep; only pmset disablesleep can
On macOS, caffeinate (any flags, including -s) only blocks IDLE sleep via a power assertion. Closing a MacBook lid is a separate hardware-triggered clamshell sleep path that no assertion vetoes, so every caffeinate-based keep-awake tool silently fails the moment the lid shuts. The only mechanism that works is the kernel SleepDisabled flag: sudo pmset -a disablesleep 1 (needs root, is global with no ownership concept, and persists until cleared or reboot, so a crashed tool can leave a Mac permanently unable to sleep). Note Claude Code already auto-spawns caffeinate -i -t 300 during active sessions, respawning every 300s, so killall caffeinate appears to do nothing. Also on Apple Silicon pmset -g therm returns no data at all, so thermal-pressure checks need ProcessInfo.processInfo.thermalState via a native shim, not the shell.