A developer usually meets Mac power management through a simple need. A build, local server, download, or agent is still running, and idle sleep would interrupt it. The caffeinate command can be enough for that open lid case.
Lid close is a different boundary. An idle sleep assertion does not mean the same thing as a closed display session, and a product should not blur the distinction.
I built Afterlid around three explicit states. Sleepy follows normal sleep. Awake prevents idle system and display sleep while the lid is open. Always On is the lid closed mode, with the display off.
The important engineering work begins after activation. What happens if the app crashes? What happens when the battery is falling or the machine is under thermal pressure? What state is restored after a helper failure?
For Afterlid, Always On ends at 30 percent battery while unplugged, under serious or critical thermal pressure, when the app heartbeat disappears, or after eight hours. When a limit fires, the app drops its wake assertion and returns the Mac to normal sleep behaviour.







