Take A Coffee

Claude Code while sleeping

Wake up to a receipt, not a mystery terminal.

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.

Queue

One narrow job

Define the allowed files, expected test, max retries, and stop condition before sleeping. Skip anything that needs judgment.

Host

Prove the machine lived

Run a heartbeat outside Claude Code. It separates model/runtime failures from MacBook or Windows notebook sleep failures.

Restore

Undo awake mode

Closed-lid local work should be temporary. The morning receipt should say whether normal sleep behavior is back.

Host heartbeat

Keep a timestamp outside the agent.

If timestamps stop, debug the host before debugging Claude Code.

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

When the machine matters

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.

Use cloud

When it can run elsewhere

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.

Use neither

When judgment is needed

Do not leave broad product choices, money movement, destructive actions, or unclear requirements to an unattended sleep run.

Paste before bed

Copy a sleep-run prompt.

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.

Want Codex to handle the local host mode?

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

Run it with Codex
Use with Codex

Let the local agent run the install.

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.