Take A Coffee

Claude Code 24/7 hooks

A hook can restart work. It cannot prove the host stayed awake.

If the loop depends on this MacBook, treat power state, heat, battery, and network reachability as part of the supervisor contract.

Supervisor

Restart is not enough

Record when the hook fired, what it launched, and whether the previous run exited cleanly or got paused by the host.

Host

Watch power state

Log sleep/wake, battery, thermal state, and network reachability. A loop that cannot observe host sleep is not truly 24/7.

Restore

End with an off switch

Temporary awake mode should leave a receipt and restore normal sleep settings when the local run no longer needs the notebook.

Host heartbeat

Give the supervisor a separate host signal.

Run this beside the Claude Code loop to prove the machine kept moving during closed-lid or unattended periods.

while true; do date >> ~/claude-code-247-host.log; sleep 30; done

Minimum receipt for a local 24/7 loop.

Want Codex to handle the host mode?

Take A Coffee gives Codex a temporary awake mode, host checks, restore step, and receipt for local loops.

Run it with Codex