Atomic or skipped
Use a five-line spec: goal, allowed files, acceptance test, stop rule, and receipt path. If the task needs judgment, leave it for morning.
Claude Code sleep tasks
A sleep task needs more than a queue. It needs an atomic spec, fail-closed budgets, a host heartbeat, and a receipt you can review while awake.
Use a five-line spec: goal, allowed files, acceptance test, stop rule, and receipt path. If the task needs judgment, leave it for morning.
Cap time, retries, changed files, and failed checks. The overnight agent should stop with context, not improvise across the codebase.
Tmux, launchd, Agent View, and queues can preserve sessions. They do not prove the notebook stayed awake, cool, powered, and reachable.
Host heartbeat
Run this next to the sleep-task queue. If the agent stalls, the heartbeat tells you whether the host or the worker failed first.
while true; do date >> ~/claude-code-sleep-task-host.log; sleep 30; done
Paste this before walking away so the agent has clear stop rules and a receipt shape.
Run exactly one bounded sleep task. Use the current repo state. Before editing, state the task id, allowed files, acceptance test, and stop rules. Stop if you need broader scope, payment, login, or unclear product judgment. Cap the run at 45 minutes, 2 retries, and 8 changed files. Leave a receipt with files changed, commands run, tests, failures, stop reason, next human decision, host heartbeat evidence if available, and whether 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.