← All writing

Oct 18, 2026

Running local agents on macOS

Running local agents all day has made me a heavy caffeinate user. Every engineer eventually learns the hard way, though, that caffeinate does nothing the second you shut the MacBook lid.

Your processes don't actually SIGTERM. They get suspended in RAM while your active TCP sockets and agent inference loops drop dead on timeout.

caffeinate only holds a user-space assertion against idle sleep. The hinge's Hall-effect sensor triggers a kernel-level clamshell event in IOPMrootDomain that overrides it. Apple intentionally makes this painful to bypass via pmset because an autonomous agent stuck in a reasoning loop inside a zipped backpack with zero airflow will cook the battery and display, and Apple's brand reputation obviously matters more than the needs of 1000x engineers.

The obvious fix for the agent era would be Apple exposing thermally clamped, motion-aware DarkWake APIs(these already exist for certain processes such as iCloud sync) for background CLI runners.

The better architectural play would be not running compute in the backpack at all.

What if Apple extended Handoff and Private Cloud Compute to local execution environments? The moment the hinge sensor fires mid-run, the kernel snapshots the process state and filesystem diff, streams the context over the wire, and resumes the agent in an ephemeral cloud sandbox before the lid even clicks shut.

Handoff, but for background compute.