Guide · updated November 5, 2026
How to let Claude Code agents work overnight, and stop safely
Yes, Claude Code can work overnight: run it headless and keep the Mac awake (how). The harder part is making an unattended night end well. Give it a time window, a cap per agent, a pause after errors, a written handoff before the window closes, and rules about what it may never do without you.
The five safety stops
- A time window. Agents only start runs inside it (for example 00:00–07:00), and messages that arrive outside it wait until the next window.
- A daily cap per agent. Each agent gets a maximum number of runs (we start at 12). An agent with nothing useful to do stops instead of looping, and how much of your plan the night uses stays predictable.
- Back-off after errors. If a run fails (a rate limit, a crash, a network drop), wait several minutes before the next one instead of retrying in a tight loop.
- A wrap-up prompt before the window ends. About 30 minutes before the end, tell each agent to finish its current step and write a handoff: done, in progress, and a prioritized backlog. The next window starts from it.
- Rules for what needs you. Unattended agents should queue anything risky (deploying, sending, spending, deleting) as a question for the morning rather than doing it.
Keep context across the night
Give each agent one session per day: start it with --session-id and continue later runs with --resume. If the machine or the runner restarts, resume the same session id rather than starting over, and check the actual state of anything that was mid-step (a build, a deploy) before continuing.
Read the night in the morning
You want three things when you wake up: each agent's handoff, a short team log of what they told each other, and a list of the decisions only you can make. Nothing else should need your attention.
Where Elco Console fits
Elco Console has all five stops built in: a workday window you set (a night window works the same way, within one day such as 00:00–07:00), auto-continue with a per-agent daily cap, error back-off, a wrap-up prompt and handoffs, plus one session per agent per day and reattaching to runs after a restart. $99 once, 14-day refund.
Elco Console runs Claude Code, Anthropic's command-line tool, on your own plan. It isn't made by, affiliated with or endorsed by Anthropic. Several agents running all night use much more of a plan than one person typing; set caps you're comfortable with and check your plan's limits.