Back to Writing
July 6, 2026·5 min read·macOS · SwiftUI

My Mac kept falling asleep on the job, so I built AwakeMate

Overnight AI agent runs, long builds, big uploads - and a Mac that dozed off in the middle of all of them. After one too many mornings finding a stalled session behind a black screen, I built the utility I actually wanted: awake exactly while my tools are running, asleep the moment they finish.

0
Setup permissions
3
Additive modes
1
One-time license

The pain

My Mac does most of its real work when I'm not looking at it. I kick off a long Claude Code run and go make tea. I start a release build with notarization and step out. I leave an upload running overnight. And macOS, very reasonably, decides that since nobody is touching the keyboard, it must be nap time.

The morning-after routine got old fast: wake the screen, find the agent stalled mid-task hours ago, the SSH session dead, the upload at 43%. The work didn't fail loudly - it just quietly stopped when the lid decided it was done for the day.

The existing options all had the same flaw:

  • caffeinate in a terminal works, but only if you remember to start it - and then remember to kill it, or your laptop stays hot and drains all night for nothing.
  • Flipping 'prevent sleep' in System Settings is all-or-nothing. Nobody toggles a settings pane before every build and after every download.
  • Most keep-awake utilities are a manual on/off switch. The whole problem is that I forget - a switch I have to remember doesn't fix forgetting.

The idea

The fix I wanted was embarrassingly simple to say out loud: the Mac should stay awake while the tools I care about are running, and go back to sleeping normally the moment they finish. Not awake always. Not awake when I remember. Awake exactly when it matters.

So AwakeMate's core is an auto mode: you pick the apps and tools that matter - Claude Code, Xcode, Terminal, your uploader - and it watches for them. The moment one is running, sleep is held off. The moment the last one exits, your Mac is free to doze. It reads the process list the same way Activity Monitor does, so it needs zero permissions to work: no Accessibility prompts, no screen recording, nothing to grant. The only thing it can ever ask for is Notifications - and only if you turn alerts on.

What it grew into

Auto mode

Watches the apps and tools you pick and keeps the Mac awake exactly while they run. No Accessibility or Screen Recording prompts.

Manual & timed modes

One click for 'just stay awake', or a timer for 'give me two hours'. All three modes stack.

Notch widget

A glanceable notch surface that shows what's keeping the Mac awake right now, with stats and toasts.

Guardrails

Quiet hours and low-battery protection force sleep when staying awake would do more harm than good.

How it helped me

Before

Kick off a run, hope I remembered caffeinate, come back to a coin flip: either a stalled agent behind a black screen, or a Mac that stayed awake all night for a job that finished in twenty minutes.

After

I just walk away. Overnight agent runs finish. Builds and uploads complete. The notch tells me what's holding the Mac awake and for how long - and when the work is done, it sleeps like nothing happened.

The part I didn't expect: the anxiety went away. I used to keep half an eye on long-running work because I didn't trust the machine to stay up. Now "start it and leave" is the default, which is exactly what long-running AI work needs from a laptop.

Under the hood

It's a fully native Swift + SwiftUI menu-bar app. One reconciler owns the power assertion, so there's a single place where "should the Mac be awake right now?" is decided from all the inputs: manual, timer, detected processes, quiet hours, battery. The notch widget is a custom surface, updates ship via Sparkle, and licensing is a one-time purchase with a fully unlocked 14-day trial - because a utility this small should not be a subscription.