Take A Coffee

Claude Code 5-hour wake

Wake the model only if the notebook can finish the run.

A 5-hour wake script can keep a usage window useful. For local work, the Mac still needs host proof: awake state, battery, heat, network, and restore.

Window

Do not wake blindly

Record the last real Claude Code interaction and skip the wake if the window was already used. The goal is useful continuity, not a timer for its own sake.

Task

Make the wake do one bounded thing

Use a small task with an acceptance test, time cap, and stop rule so the wake produces a receipt instead of another open terminal.

Host

Prove the Mac stayed available

If the task needs local files, browser state, Xcode, or desktop tools, log battery, heat, network, sleep/wake, and a heartbeat outside Claude.

Cap

Do not burn weekly budget

If your weekly allowance is tight or the window is already active, skip the wake. A no-op ping can waste the same capacity it was meant to preserve.

Signal

Record why it ran

Log the last real interaction, the reason for waking, and whether the scheduled task produced a useful diff, test result, or receipt.

Exit

Stop after the useful slice

End the pty, restore sleep behavior, and leave a short note when the scheduled window does not need this notebook anymore.

Host heartbeat

Add proof beside the wake loop.

This tells you whether the notebook kept running through the scheduled window, not merely whether Claude Code had a session later.

while true; do date >> ~/claude-code-5hr-host.log; sleep 30; done
Copy prompt

Give the schedule a real stop rule.

Paste this before relying on a 5-hour wake loop for local work.

Audit this 5-hour Claude Code wake schedule before I trust it. Check whether the usage window was already active and skip if the weekly cap is tight; do not use a no-op ping. Pick one bounded useful task, set a time cap and stop rule, write host heartbeat timestamps outside Claude, record battery/heat/network state, and restore normal sleep settings when done. Stop if the task needs login, payment, broad product judgment, destructive actions, or unsafe battery/heat state.

Minimum receipt for a wake schedule.

Want Codex to handle the host layer?

Take A Coffee gives Codex a temporary awake mode, host checks, restore step, and receipt for local scheduled runs on macOS and Windows.

Run it with Codex