๐Ÿฆ‰McAwake

Free ยท open source ยท macOS 13+

Close the lid.
Nothing dies.

McAwake keeps your MacBook awake with the lid closed โ€” no external display, no dock โ€” the thing caffeinate and Amphetamine can't do. Turn the MacBook you already own into an always-on machine for bots, agents, and home servers.

$ brew install --cask taufiqxr/tap/mcawake

No Homebrew? Grab the .pkg installer โ€” or build from source.

tail -f /var/log/mcawake.log
  1. 23:41:07 mode=always disablesleep 1
  2. 23:41:52 lid closed โ€” machine still awake
  3. 00:13:20 watch: port 3000 up (node)
  4. 01:47:33 watch: cloudflared up
  5. 03:22:10 on battery 34% โ€” guard armed
  6. 05:58:41 back on AC โ€” disablesleep 1
  7. 07:30:02 uptime intact. servers never blinked
  8. 07:30:02
A MacBook, shut at 23:41, still serving at breakfast.

The clamshell problem

Keep a MacBook awake with the lid closed โ€” the part other tools can't do

If you run anything on a MacBook that needs to stay alive โ€” a home server, a bot, a long download, a build โ€” closing the lid kills it. Here's the chain, and where every other tool breaks:

macOS force-sleeps on lid closeclamshell sleep
Unless the Mac is docked to both AC power and an external display, shutting the lid always sleeps the machine. That's built into macOS, not a setting.
Keep-awake apps can't stop itcaffeinate ยท Amphetamine
Their power assertions only prevent idle sleep. Forced clamshell sleep ignores assertions entirely โ€” the popular tools are simply not in this fight.
One switch survives the lidpmset disablesleep
macOS's own root-level power switch โ€” powerful, and easy to misuse (a Mac that never sleeps will happily cook in a backpack). McAwake wraps it in three explicit modes, an always-visible status icon, and a low-battery guard.

Three modes, one honest icon

Set it by intent, not by incantation

The menu bar icon reflects the actual system state, checked every 10 seconds โ€” not just what McAwake last did. If anything else touches the sleep setting, you'll see it.

Always Awake

Never sleeps โ€” plugged in or on battery. For the Mac that's become a stationary appliance.

Low-battery guard: below 15% on battery, normal sleep is restored so a forgotten Mac can't run itself flat. Re-arms at 18% or on the charger.

Smart Auto

Awake whenever plugged in, normal sleep on battery. Set-and-forget, and bag-safe by construction: unplugged means it sleeps.

Normal Sleep

The macOS default, one click away. McAwake never makes stock behavior hard to get back.

Not just awake โ€” aware

It knows what it's staying awake for

McAwake menu showing sleep status, three modes, a live Servers list with ports, and the Claude Code session switcher expanded
  • Live server list. Every local service with an open port, grouped by process โ€” open localhost:PORT or copy the URL from the menu. Tunnels (cloudflared, ngrok) detected too.
  • Watch anything. A watched service that goes down triggers a macOS notification โ€” and another when it's back. An always-awake Mac can't silently become a uselessly awake Mac.
  • Claude Code session switcher. Every open session listed by name, busy sessions marked โšก, one click to jump to that terminal.
  • Nothing leaves the machine. Detection is one lsof call when you open the menu. No network access, no analytics.

Transparency

What runs as root โ€” the complete list

A tool that asks for your admin password owes you the full story. McAwake's is short:

  • Always Awake and Smart Auto install one root LaunchDaemon โ€” about 40 lines of shell you can read โ€” that checks power state every 20 seconds and flips pmset disablesleep accordingly.
  • The low-battery guard runs as root precisely so it works unattended โ€” no password prompt when the Mac is forgotten in a bag.
  • Normal Sleep removes the daemon and restores disablesleep 0. Every state change is one line in /var/log/mcawake.log.

Nothing else. No network access, no analytics, no background helpers beyond that one daemon โ€” and the daemon's logic is covered by mock-based tests run in CI on every push. Full write-up โ†’

FAQ

Fair questions

My screen still turns off and locks when I close the lid โ€” is it even working?

Yes โ€” that's the design. The display sleeps and locks; the machine keeps running. Check the menu bar icon (๐Ÿฆ‰ = awake) or run pmset -g | grep SleepDisabled โ€” 1 means every server, download, and script is still going with the lid shut.

Will Always Awake drain my battery?

It will use it โ€” unplugged, the Mac stays fully on. But it won't run itself flat: the guard restores normal sleep below 15% battery and re-arms once you're charging or above 18%. If your Mac travels a lot, Smart Auto is the better fit: normal sleep the moment you unplug.

Why does it need my admin password?

pmset disablesleep is a root-level power switch โ€” macOS itself requires admin rights for it. McAwake asks through the standard macOS dialog, and the section above lists every command it runs with those rights.

Why the Gatekeeper warning on first launch?

McAwake is ad-hoc signed, not notarized โ€” notarization requires a paid Apple developer account, and this is a free MIT project. Right-click โ†’ Open once, or clear the flag with xattr -dr com.apple.quarantine /Applications/McAwake.app. The .pkg installer avoids this entirely: files placed by the macOS installer carry no quarantine flag. The full source is on GitHub if you'd rather build it yourself.