Ship While You Sleep - Nightly Build Agents on macOS
Ship While You Sleep - Nightly Build Agents on macOS
Shipping while the human sleeps is literally what a good AI agent does. You define the task queue before bed, and the agent works through it overnight - running builds, executing tests, deploying to staging, and logging everything for your morning review.
Why Overnight Hours Matter
Most developers waste 8 hours of compute time every night. Your Mac sits idle while you recharge. A nightly build agent flips that equation. It picks up tasks from a queue, executes them sequentially, and handles failures gracefully so one broken task does not derail the rest.
Setting Up the Loop
The setup is straightforward:
- Define your task queue - a simple JSON file or database table listing what needs to happen
- Schedule with launchd - create a plist that fires your agent at midnight (or whenever you go to sleep)
- Give it scoped permissions - the agent needs access to your terminal, git, and deployment tools, but nothing else
- Log everything - write structured logs so your morning review takes minutes, not hours
What Works Well Overnight
Some tasks are perfect for unattended execution:
- Running full test suites that take 30+ minutes
- Building and deploying to staging environments
- Code formatting and linting across large codebases
- Dependency updates with automated testing
- Database migrations on development environments
What Does Not Work
Anything requiring human judgment mid-execution is a bad fit. If the agent hits an ambiguous error, it should log it and move on - not spin for hours retrying.
The Morning Review
The real productivity gain is waking up to a structured summary: what shipped, what failed, and what needs your attention. A well-configured agent produces a morning report that takes 5 minutes to review.
The overnight hours are free compute. Use them.
- Building Autonomous Agent Loops That Run Overnight on macOS
- Schedule Claude Code Sessions with launchd
- Morning Review of AI Agent Overnight Work
Fazm is an open source macOS AI agent. Open source on GitHub.