Close the lid. The agent
keeps working.

Agent Awake keeps your MacBook awake with the lid closed only while Codex, Claude Code, OpenCode or Kilo actually work, in the app or in the terminal.

Mac stays awake Codex working · Battery 64% · Lid open

Codex is working.

  • No timers
  • Only during real work
  • Battery safe

Free and open source (MIT). macOS 14+, Apple silicon.

How people get around it today

A Mac sleeps the moment the lid closes, even in the middle of a task. So people improvise.

Ways to keep a Mac awake
Way Lid closed Stops when the agent finishes Watches battery and heat No sudo or hardware Open source
Carry it half opennononoyesno
A lid holdernonononono
pmset pmset by handyesnononono
caffeinate and friendsnononoyesyes
Timer appsyesno, on a timerpartoften sudoersno
Agent Awakeyesyes, after 90 syesyesyes

Set it up once.

Agent Awake does the setup. In Auto the protection starts when an agent gets to work. 90 seconds after the work ends, a closed Mac can sleep again.

Desktop apps and CLIs are supported. A few CLI commands need a small wrapper.

Safety limits

  • Battery floor15%, adjustable
  • Heatprotection lifts and the Mac sleeps
  • Max awake time8 hours in a row
  • Low Power Modeoptional on battery
  • Sleep after work90 s, only our own change is undone
  • External displayleft alone, business as usual

No sudo in Terminal.

No sudoers edits and no password in the command line. One approval in Login Items, like any app with a background service. The service is open: read every line it runs.

Open source, all the way down.

Agent Awake is MIT. The app, the menu bar and the root service that flips the sleep setting live in one repository.

  • The service is daemon/main.swift. Read it before you trust it.
  • No accounts, no license keys, no servers of ours. It only checks GitHub for updates.
  • Bugs and ideas go to GitHub issues. No form, no tracker.

What the service runs

# the only system setting it changes
pmset -a disablesleep 1
# and only while an agent works

Install in one command

Terminal (recommended)

The script verifies the download, installs the app and opens it.

curl -fsSL https://agent-awake.vercel.app/install.sh | bash
See what the script does

Homebrew

Install with Homebrew, then open Agent Awake from Applications.

brew install --cask mchibisov/tap/agent-awake

To update with Homebrew, run brew upgrade --cask agent-awake

Open Agent Awake and press Install service. In System Settings → General → Login Items & Extensions, enable AgentAwake under Background App Activity.

Install from a ZIP

AgentAwake.zip Unzip it and move the app to Applications.

On the first launch, macOS may ask you to approve the app. Open System Settings → Privacy & Security and click Open Anyway.

macOS 14 or newer, Apple silicon (M1 and later).

Questions

Will the Mac really sleep when the agent finishes?

Yes. 90 seconds after the work ends Agent Awake gives sleep back and a closed Mac sleeps. It only undoes the setting it changed. If the service stops or the app is removed, sleep comes back too.

How is this better than caffeinate or timer apps?

caffeinate and similar tools block idle sleep, but a closed lid still puts the Mac to sleep. Apps that hold a closed Mac awake work on a timer: you have to guess how long the agent needs, and the Mac stays awake long after the work is done. Agent Awake follows the work itself and lets the Mac sleep when it ends.

Will it overheat or drain the battery in a bag?

The screen is off and the Mac is locked. If the battery drops to the floor (15% by default), the Mac gets too hot or 8 hours pass, the protection lifts and the Mac sleeps even in the middle of a task. On battery you can turn on Low Power Mode.

Do I need sudo? What does the service change?

No sudo in Terminal. Only a system service can keep a closed Mac awake. You approve it in System Settings, Login Items, like any background service. The service changes one sleep setting for the duration of the work. Uninstall completely removes it and gives sleep back.

Why does macOS say the developer cannot be verified?

The build is ad hoc signed, not notarized by Apple, because the project is free and the developer program is paid. The Terminal install skips the warning; for the zip use Open Anyway. The installer checks the checksum and the signature.

What does Agent Awake send to the internet?

Only update checks: a signed manifest and the build from GitHub. It never sends your files, your code or what the agent is doing.

Is it really free?

Yes. MIT, no account, no license key, no paid tier.

Keep it free.

A star on GitHub helps other people find Agent Awake.

Star on GitHub

Donations are unavailable for now.