Problem and context
macOS puts MacBooks to sleep when the lid is closed unless connected to an external display. For users running long-running local AI development agents (like Antigravity or Codex), this stops active work as soon as the laptop is closed.
Existing utilities require manual toggles and keep the built-in screen active when closed, wasting energy and causing heat issues inside the closed laptop.
The goal was to build a lightweight Swift menu bar app that detects active AI agents, dynamically blocks sleep, and forces screen brightness to zero only while the lid is closed.