AI Coding While You Sleep
Queue up work before bed. Wake up to pull requests.
Yes — with amux you can run 10 to 50 Claude Code sessions overnight and wake up to completed features and open pull requests. amux's self-healing watchdog handles every failure mode automatically: context overflow triggers /compact, tool-approval prompts are auto-accepted via YOLO mode (now the default), crashed sessions restart and replay the last message, and idle hangs receive a continue signal. In the morning you review the board from your phone, peek at any session, and merge the PRs. No babysitting required.
Updated July 2026 — reflects YOLO mode as the default for new sessions, the new per-session plan strip, and saved messages for one-tap phone interaction. See the changelog for details.
What goes wrong at 3 AM — and how amux fixes it
DIY overnight setups using raw tmux fail silently. You wake up to a screen full of paused prompts and zero commits. amux's watchdog runs continuously and handles each failure mode before it can stall progress.
| Problem | What DIY setups do | What amux does |
|---|---|---|
| Context window fills up | Session blocks, waits for manual /compact |
Watchdog detects overflow signal, auto-sends /compact with 5-min cooldown between compactions |
| Thinking-block corruption | Session hangs in unrecoverable state | Detects corrupted pane output, kills and restarts session, replays last message |
| Tool-approval prompt | Session blocks until you type y | YOLO mode (default since July 2026) auto-approves every prompt — no human input needed |
| Silent hang / no output | Stays frozen until morning | Idle detector fires after configurable inactivity threshold, sends continue signal |
| Process crash / tmux pane dies | Work stops, you never know | Watchdog detects missing pane, relaunches the session and replays the last message |
| Two agents claim the same task | Duplicated work, merge conflicts | SQLite compare-and-swap board claim — atomically assigned, impossible to double-book |
| No visibility into what's done | SSH in, scroll through tmux panes | Board shows todo / doing / done per session; peek at any session's output from phone |
| Task deadline tracking | External spreadsheet or calendar | iCal sync exports board due dates directly to Google Calendar or Apple Calendar |
How to set up AI coding agents to run overnight
Setup takes under ten minutes. You need Python 3, tmux, and a valid Anthropic API key. No Docker, no cloud account, no external services required — amux is a single Python file with zero external dependencies.
Step 1 — Install amux
git clone https://github.com/mixpeek/amux && cd amux && ./install.sh
The install script adds amux to your PATH. See the getting-started guide for OS-specific notes.
Step 2 — Register your project with YOLO mode
amux register myproject --dir ~/Dev/myproject --yolo
YOLO mode is now the default for new sessions. It auto-approves every tool-approval prompt Claude Code raises — file writes, shell commands, web fetches. Without it, a session that hits a prompt at 2 AM will sit frozen until morning. If you want to restrict auto-approval to specific tool categories, see the YOLO mode configuration guide.
Step 3 — Load tasks onto the board
amux board add "Implement OAuth refresh token rotation"
amux board add "Add rate limiting middleware to /api/v2"
amux board add "Write integration tests for payment webhook handler"
amux board add "Refactor UserService to use repository pattern"
Each task becomes a board card with a unique ID. When a session starts, it calls amux board claim TASK-ID which atomically marks the task as owned by that session. No two sessions can claim the same task — the underlying SQLite compare-and-swap operation makes this a hard guarantee, not a race condition waiting to happen.
Step 4 — Start sessions
amux start myproject # start one session
amux start myproject # start another — each claims its own task from the board
Each session opens in its own tmux pane, initializes Claude Code in the project directory, pulls the next unclaimed board task, and begins working. The watchdog activates immediately. Check the live dashboard at https://localhost:8822 before you close your laptop — you'll see all sessions in the "doing" column within 30 seconds.
Start the server if it isn't already running: amux serve
Step 5 — Go to sleep
That's it. Sessions run until their tasks complete, then pull the next available task from the board. If you have 20 tasks and 5 sessions, each session will work through 4 tasks sequentially through the night. The board is updated in real time as tasks move from todo to doing to done.
Want to dig deeper? Read the full overnight agent configuration guide and the self-healing configuration reference.
What to check in the morning
Your morning review takes about five minutes from your phone. Open the amux PWA at https://localhost:8822 or launch the native iOS app.
1. Scan the board
The board's three columns — todo, doing, done — tell you everything at a glance. A healthy overnight run has zero cards in "doing" and most cards in "done." Any cards still in "doing" means that session is still running (or got stuck — check next).
2. Check the plan strip
New in July 2026: each session card now shows a plan strip — a read-only view of the agent's current internal task list. If an agent is still running you can see exactly which sub-step it's on without reading raw terminal output. This makes it much faster to tell the difference between "agent is making good progress" and "agent has been on step 2 of 8 for three hours."
3. Peek at session output
Tap any session to view its last 100 lines of output. Look for error messages, stuck git operations, or ambiguous spec questions the agent left as comments. If something needs a quick human answer, use saved messages (new July 2026) — per-session canned prompts you can send with one tap. For example, you might pre-save "focus on the happy path only, skip edge cases for now" or "push what you have and open a draft PR."
4. Review pull requests
Sessions that completed their tasks will have opened pull requests (if your project's agent prompt includes that instruction). Jump to GitHub from the session output link, review the diff, and merge — or set the PR into your normal review queue.
5. Verify CI
Check that CI is green on each open PR before merging. A green board does not mean production is safe — that requires a passing pipeline and a prod smoke test. Board status done means implemented; verified means confirmed working in prod after CI and deployment.
How many agents can run overnight?
The practical ceiling depends on RAM and API rate limits, not CPU:
| Machine | RAM | Comfortable parallel sessions | Notes |
|---|---|---|---|
| MacBook Pro (M3/M4) | 16 GB | 5–8 | Fine for focused overnight sprints on one codebase |
| MacBook Pro (M3/M4 Max) | 32–64 GB | 10–20 | Sweet spot for most solo developers running an agent fleet |
| Mac Studio (M4 Max/Ultra) | 64–192 GB | 20–50 | Run a full AI engineering team; multiple codebases simultaneously |
| Mac Pro | 192 GB | 50+ | API rate limits become the binding constraint before RAM does |
Each Claude Code session uses roughly 1–2 GB of RAM at peak (during large diffs or test suite runs). Disk I/O throughput matters for repos with large test suites — an SSD is effectively mandatory above 10 parallel sessions. Network bandwidth for API calls is negligible; the Claude API uses text tokens, not large payloads.
The real ceiling for most setups is the Anthropic API rate limit. A Tier 4 or 5 account (typically reached after sustained monthly spend) gives you enough throughput for 20–30 active sessions. If you hit rate limits, amux sessions back off gracefully and retry — they do not crash or lose work.
What if an agent gets stuck?
Most stuck states are handled automatically before you need to intervene:
- Context overflow — auto-compacted with a 5-minute cooldown. The session continues with a fresh context window summarizing prior work.
- Tool-approval prompt — auto-approved by YOLO mode. The session never blocks on these.
- Process crash — watchdog detects the dead pane within seconds, restarts the session, and replays the last message. Restart takes under 30 seconds.
- Thinking-block corruption — watchdog detects the malformed state from Claude's output stream, kills the session cleanly, and relaunches.
- Idle hang (genuinely stuck) — the idle detector fires after a configurable threshold (default: a few minutes of no output). It sends a nudge prompt to break the session out of any reasoning loop.
The one case that still requires human judgment is a genuine ambiguity in the spec — where the agent correctly identifies that two valid interpretations exist and needs a decision. Well-written agents (and Claude Code is good at this) will write a comment in the code, open a draft PR noting the ambiguity, mark their board task done, and move on to the next task rather than spinning. In the morning you'll see a draft PR with a question — answer it and the agent can finish in minutes.
If you see a session that's been in "doing" for hours with no output, use the peek view from your phone to read the last 100 lines. You can send a saved message directly to that session — "summarize what you're stuck on and open a draft PR with what you have" is a useful recovery prompt to pre-save.
For advanced self-healing tuning, see the self-healing configuration guide.
amux vs. DIY tmux — what you actually get
Many developers start with raw tmux and shell scripts before switching to amux. Here's what the comparison looks like in practice:
| Capability | DIY tmux + shell scripts | amux |
|---|---|---|
| Context overflow recovery | Manual — you run /compact when you notice |
Automatic, with 5-minute cooldown to prevent thrashing |
| Tool-approval prompts overnight | Session blocks until you SSH in and type y | YOLO mode auto-approves; default for new sessions as of July 2026 |
| Crash recovery | Custom watchdog script (usually buggy) | Built-in watchdog: detects dead pane, restarts, replays last message |
| Thinking-block corruption | Usually undetected until you read output | Detected from output stream, clean kill + restart |
| Task distribution to agents | Shared file or Slack message | SQLite CAS board claim — atomically assigned, no race conditions |
| Parallel session count visibility | tmux list-panes; hard to read at a glance | Live dashboard: all sessions, statuses, and current task in one view |
| Morning review from phone | SSH into laptop, navigate tmux panes | PWA board + session peek; native iOS app available |
| Plan strip (current sub-task view) | Not available | Read-only view of agent's internal task list per session (July 2026) |
| Saved messages (one-tap prompts) | Not available | Per-session canned prompts; send from phone with one tap (July 2026) |
| Deadline tracking | External calendar or spreadsheet | iCal sync: board due dates exported to Google / Apple Calendar automatically |
| Setup complexity | Hours of scripting; breaks when Claude Code updates | 10-minute install; single Python file, zero external dependencies |
| License | Your own scripts (unmaintained) | MIT open source |
Frequently asked questions
Can Claude Code run overnight without supervision?
Yes. With amux, you register your project sessions with YOLO mode enabled (now the default for new sessions), add tasks to the shared kanban board, start your sessions, and go to sleep. The self-healing watchdog monitors every session for idle hangs, context overflow, and process crashes — handling each automatically without any human input. The morning review takes about five minutes from your phone.
What is YOLO mode and is it safe?
YOLO mode makes amux auto-respond "yes" to every tool-approval prompt Claude Code raises — file writes, shell commands, web fetches, MCP tool calls. Without it, any prompt blocks the session until a human responds. As of July 2026 it is the default for new sessions registered with amux. It is safe to use on a machine and project directory dedicated to agent work; scope your project directory carefully and run with a non-root user as you would any automated process. Disable per-session with --no-yolo. See the YOLO mode guide for per-tool-category restriction options.
What happens if a session runs out of context while I'm asleep?
amux's watchdog detects the context-overflow signal in the session output and automatically sends /compact to the session. A 5-minute cooldown prevents repeated compactions from thrashing. Claude Code's /compact command summarizes the full conversation into a compressed context, then continues from where it left off. If the session enters a thinking-block corruption state — a different failure mode where Claude's output stream becomes malformed — the watchdog detects it, kills the session, restarts it cleanly, and replays the last message.
How do I check on my agents from my phone in the morning?
Open the amux PWA at https://localhost:8822 from Safari on your phone (add to home screen for a native feel), or use the native iOS app. The board tab shows which tasks each session completed, is still working on, or failed. Tap any session to peek at its last 100 lines of output. From there you can send a one-tap saved message to redirect an agent, or tap through to GitHub to review the pull requests it opened overnight. Full walkthrough in the mobile management guide.
How many AI coding agents can run in parallel overnight?
On a Mac with 32 GB of RAM you can comfortably run 10–20 parallel Claude Code sessions. A Mac Studio or Mac Pro with 64–192 GB supports 30–50 sessions. Each session uses roughly 1–2 GB of RAM at peak. The practical ceiling is usually your Anthropic API rate limit (a Tier 4/5 account handles 20–30 active sessions comfortably) and disk I/O throughput during large test suite runs, not CPU or RAM alone.
What happens if a Claude Code agent makes a bad commit overnight?
Agents working from well-scoped board tasks open pull requests rather than pushing directly to main — this is standard practice and easy to enforce with branch protection rules. If you also run CI on the PR branch, any breaking change is caught before merge. The morning board review includes checking CI status on each open PR before you approve. If an agent does push bad code (on a development branch), git revert is the safe recovery; the board card will be in "done" and you can see exactly which commits the session made by reading its output in the peek view.
Run your AI engineering team tonight
Install amux in ten minutes. Queue tasks before bed. Wake up to pull requests. Open source, single Python file, MIT licensed.
git clone https://github.com/mixpeek/amux && cd amux && ./install.sh
amux register myproject --dir ~/Dev/myproject --yolo
amux board add "Your first overnight task"
amux start myproject
amux serve # → https://localhost:8822