Take A Coffee

Claude Code sleep tasks

Unused quota is not the hard part. Trusting the morning result is.

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.

Task

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.

Budget

Fail closed

Cap time, retries, changed files, and failed checks. The overnight agent should stop with context, not improvise across the codebase.

Host

Separate proof

Tmux, launchd, Agent View, and queues can preserve sessions. They do not prove the notebook stayed awake, cool, powered, and reachable.

Host heartbeat

Make the laptop leave evidence outside the agent.

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

Morning receipt fields.

Use tonight

Copy a bounded sleep-task prompt.

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.

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