One narrow job
Define the allowed files, expected test, max retries, and stop condition before sleeping. Skip anything that needs judgment.
Claude Code while sleeping
The useful version is not an unlimited overnight prompt. It is a short queue of atomic jobs, a host heartbeat, and a restore step when local awake mode is no longer needed.
Define the allowed files, expected test, max retries, and stop condition before sleeping. Skip anything that needs judgment.
Run a heartbeat outside Claude Code. It separates model/runtime failures from MacBook or Windows notebook sleep failures.
Closed-lid local work should be temporary. The morning receipt should say whether normal sleep behavior is back.
Host heartbeat
If timestamps stop, debug the host before debugging Claude Code.
while true; do date >> ~/claude-code-while-sleeping-host.log; sleep 30; done
Choose a local sleep run when the task needs this notebook's files, browser profile, desktop apps, local servers, device state, or a logged-in account you cannot move.
If the task is pure repo work with no local-only state, a cloud runner or VM is usually simpler than keeping a laptop awake.
Do not leave broad product choices, money movement, destructive actions, or unclear requirements to an unattended sleep run.
Use this when the goal is progress without unbounded overnight drift.
Work while I sleep only on one bounded task. Before editing, state the task, allowed files, acceptance test, time cap, retry cap, and stop rule. Stop if you need broader scope, login, payment, or product judgment. Leave a morning receipt with changed files, commands, tests, failures, stop reason, host heartbeat evidence if available, and whether normal sleep settings were restored.
Take A Coffee gives Codex temporary awake mode, battery and heat checks, restore step, and a receipt for local macOS and Windows runs.
Paste this on the notebook that needs the awake-mode receipt.
I authorize the $1 Take A Coffee lifetime access. Open https://takeacoffee.club/takeacoffee/hosted-checkout?cta=while_sleep_install_prompt&from=claude-code-work-while-you-sleep, complete the paid flow if my browser/payment method is available, download the ZIP from the paid session, install it, run takeacoffee on, verify status, and leave a restore receipt.