Keep your Mac awake while coding agents are working
Close your laptop lid. Walk away. Come back to finished work.
The Problem
You ask your coding agent to refactor your codebase. It's going to take 10 minutes. You close your MacBook lid to grab coffee...
💀 Mac sleeps. The agent stops. Work lost.
The Solution
Install this tool. Now your Mac stays awake while your agent works, even with the lid closed. When it finishes, normal sleep resumes.
| Before | After |
|---|---|
| 😴 Lid closed = Mac sleeps | ☕ Lid closed = agent keeps working |
| 🔄 Come back to interrupted work | ✅ Come back to finished work |
Installation
🍎 Download DMG (Easiest)
- Download the latest DMG
- Drag
AgentsSleepPreventer.appto Applications - Launch the app - it will auto-configure on first run
- Restart Claude Code or Codex
The menu bar app uses Sparkle for in-app updates and can download + install new signed releases directly.
🍺 Homebrew
brew tap CharlonTank/tap brew install agents-sleep-preventer asp install
🦀 Build from Source
git clone https://github.com/CharlonTank/agents-sleep-preventer.git
cd agents-sleep-preventer
cargo build --release
./target/release/asp installHow It Works
You send a prompt
↓
Agent starts working → 🔒 Sleep disabled
↓
Agent finishes → 🔓 Sleep re-enabled
That's it. No configuration needed.
Commands
asp status # Check current state asp cleanup # Clean up after interrupts asp uninstall # Remove completely
FAQ
Does it drain my battery? No more than usual. Your Mac just stays awake instead of sleeping.
What if I interrupt an agent with Ctrl+C?
Run asp cleanup or the tool auto-detects idle sessions after 30 seconds.
Does it work with multiple agent instances? Yes! Mac stays awake until ALL instances finish.
How do app updates work?
The menu bar app uses Sparkle. Use Check for Updates... from the menu bar app, or let Sparkle check automatically in the background. New signed releases are installed through Sparkle instead of just opening a DMG download.