Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

What breaks when Claude Code runs overnight with nobody watching

Description and use

Implementing the outlined steps reduces silent failures, prevents unintended destructive actions, conserves usage quota, and provides clear post‑run documentation, enabling reliable overnight agent execution.

Problem

Unattended overnight runs of Claude Code often fail silently or produce unwanted side effects due to scheduling, environment, and permission issues.

Outcome

Implementing the outlined steps reduces silent failures, prevents unintended destructive actions, conserves usage quota, and provides clear post‑run documentation, enabling reliable overnight agent execution.

Workflow

  • 1. Configure launchd (or systemd) to start the agent at the desired time. 2. Ensure the machine stays awake during the run window (e.g., use caffeinate on macOS). 3. Use a terminal multiplexer (tmux) or keep the session alive so it survives terminal closure or sleep. 4. Prefix the agent prompt with "--" so YAML front‑matter is treated as text, not an option. 5. Include an explicit allow/deny list in the brief to prevent unintended actions (e.g., merge, deploy, force‑push). 6. Enable sandboxing (sandbox.enabled: true, allowUnsandboxedCommands: false) and maintain a backup of the machine. 7. Before each run, query the usage API and abort if the remaining quota is below a threshold. 8. After the run, check that expected output files exist and contain data. 9. Append a short report to reports/<date>.md summarizing changes, assumptions, and any required follow‑up. 10. In the morning, review the reports and only open transcripts if a report indicates an issue.

Evidence

Desktop scheduled tasks only fire while the app is open on that machine, and recurring runs start a few minutes late on purpose

Source

The terminal went away. Several people in the tmux thread said session persistence was the reason they started using a multiplexer at all

Source

The runbook was handed to the agent CLI as an argument, it started with YAML frontmatter, and the CLI parsed --- as an unknown option and quit with exit code 1

Source

The author had Claude Code working on an iOS app overnight in auto mode, where a classifier answers the permission prompts. A subagent asked to add a home-directory guard to a script that runs rm -rf ran the test before writing the guard, the test was given the real home directory, and about 9 days of unpushed commits went with the local .git

Source

A commenter who had burned a whole usage window in minutes more than once wrote a hook that stops subagents from spawning past 80% of the window

Source

  • Record date: 2026-10-26T16:26:08.802Z