Show HN: Agents Sleep Preventer – keep your Mac awake only while AI agents work
github.comI run several Claude Code and Codex sessions in parallel and kept coming back to either a sleeping Mac with half-finished work, or a Mac that stayed up all night because I'd left caffeinate on.
Agents Sleep Preventer hooks into the agents' own configs (Claude Code, Codex, Hermes), so it knows when each session is actually working. It keeps the Mac awake only then, lid closed included, and lets it sleep when they're done.
The menu bar lists every session by project and branch: which are working, which need you and why ("Claude needs your permission to use Bash"), and the background commands each one still runs, with a Stop button. "Sleep when done" puts the Mac to sleep once everything finishes, with an optional time limit for agents that poll forever.
It also does local push-to-talk dictation (Whisper or Parakeet, nothing leaves the Mac). Free, MIT, Rust + Swift. macOS 14+ on Apple Silicon, plus a Windows build.
A lot of times I work before I sleep and then I want my Mac to just work during the night. But then it goes to sleep. I know there are like a lot of apps that already do some of this, like sleep prevention, but it doesn't work that well. And the voice dictation is very bad, especially in French. So that's why I created this, and I improved it along the way.
When I close the lid while an agent is working, the Mac plays a little sound, so I know it will keep working during the night.
There are already 3 forks and 13 stars on my project and I'm keen to have more feedback and more people to improve this!