# StayAwake > StayAwake is a free macOS menu bar app (macOS 14+, Apple Silicon) that keeps a closed MacBook awake on battery so AI coding agents (Claude Code, Codex and similar) keep working while the laptop is in your bag and you steer from your phone, and lets it sleep again when it gets too warm, the battery runs low, the network drops or the time is up. Made by René Weteling (https://www.weteling.com). ## AI on the go - Start your agents, arm StayAwake, connect from your phone with your agent tool's remote or mobile option (phone hotspot for the network), close the lid and put the Mac in your bag - The agents keep running on battery. StayAwake stops safely on heat, a low battery, a dropped network or the schedule ## What it does - One click in the menu bar runs pmset -a disablesleep 1 through a small root helper (SMAppService launchd daemon) - Shows CPU, GPU and battery temperature, battery level, time held and which rule is closest to tripping - Alerts when the power cable comes out while it is armed ## Safety rules - Defaults: battery temperature 43 °C for 60 s, CPU 100 °C as a 60 s average for 2 min, GPU 95 °C, macOS thermal pressure serious for 5 min, battery below 40%, no network for 15 min, lid closed on battery for 90 min, idle CPU under 10% for 15 min, an 8 hour cap, and allowed hours per weekday. Every limit is a setting - Unreadable sensors count as a trip - The helper holds a lease the app keeps renewing. A crash, hang or force quit restores sleep within 60 seconds, a reboot restores it at boot, and a 12 hour ceiling applies no matter what - The helper can run exactly two commands, pmset -a disablesleep 1 and 0, and only accepts the signed StayAwake app ## Facts - Price: free for noncommercial use, PolyForm Noncommercial 1.0.0 - Distribution: signed and notarized DMG on GitHub releases, not the Mac App Store (it needs a root helper) - Privacy: no sensor data leaves the Mac; only crash reports go to Sentry, without paths, and they can be switched off ## Compared with other options - caffeinate and Amphetamine use power assertions, which macOS does not honor for a closed lid on battery. They are the simpler tool when the lid stays open - pmset -a disablesleep 1 does keep a closed lid awake on battery, but by hand nothing watches heat, charge or network and you must undo it yourself - StayAwake runs that command through a root helper and adds the rules above and a fail-safe ## Manual restore - sudo pmset -a disablesleep 0 (check with pmset -g | grep SleepDisabled) ## Links - Full version: https://reneweteling.github.io/stayawake/llms-full.txt - Website: https://reneweteling.github.io/stayawake/ - Download: https://github.com/reneweteling/stayawake/releases/latest/download/StayAwake.dmg - Source: https://github.com/reneweteling/stayawake - Maker: https://www.weteling.com