Lid closedSteer Claude Code or Codex from your phone

Close the lid. Not the work.

Start a Keep Mac Awake session, then close the lid: your MacBook keeps working, no external display or keyboard needed. Agents keep going, and you steer them from your phone.

On your phone? Send the link to your Mac. Free for 3 days from your first session, no card, then $9 once per Mac. Notarized by Apple. Any Mac with Apple silicon, macOS 26 or later.

A MacBook sleeps when you close it. Scroll to close this one

  • On AC power
  • 8-hour session
  • Watchdog on

Lid closed. Display dark. Still working.

You sleep. It keeps working.

You set 8 hours and went to bed. The lid stays shut and the agent keeps going on its own.

Remote control from your phone

Away from your desk. Still in the loop.

Check in and send the next task with your agent's own remote control, like Claude Code Remote Control or Codex in the ChatGPT app, while the Mac's network connection holds.

With your agent's own remote control, like Claude Code Remote Control or Codex in the ChatGPT app, while the Mac's network holds.

  1. You close the lid. The display goes dark.
  2. Agent: Reading the project
  3. Agent: Refactoring 6 of 12
  4. Agent: Running the test suite
  5. Agent: Writing the summary
  6. Agent: Done. Pull request ready.
  7. You, from your phone: Nice. Now update the docs too.
  8. Agent: On it. Updating the docs.
  9. Agent: Docs updated.
  10. Your agent ends the session. Normal sleep returns.
Your agent's remote control on your phone, while the MacBook stays closed.

07:41. Open the lid. The work is done.

Your agent finished the docs at 07:30, ended the session, and normal sleep came back on its own. Nothing to undo.

For the jobs you'd rather not watch: AI coding agents, test suites, release builds, renders and exports, big downloads, backups and overnight jobs.

Your turn

Three steps. Then walk away.

This is the panel from your menu bar. Try it here; nothing on your Mac changes.

  1. 1Pick how long
  2. 2Press the button
  3. 3Close the lid

Turn it on, and it holds. Tested with the lid closed with every kind of session: timed and with no limit, on AC power and on battery, from a few minutes to days at a stretch.

No card. The trial starts with your first session.

Keep Mac Awake

How long

The free trial runs sessions up to 8 hours; 24h and No limit come with the purchase.

Off. Press the button to start. Awake. Now close the lid. Asleep. That's a Mac without Keep Mac Awake. Lid closed, still awake. Walk away.

For agents

Your agent starts it. And stops it.

keepmacawake answers every call with one line of JSON and a documented exit code. Your agent starts a session for its task, checks on it, and stops it the minute the work is done.

Paste this into your agent

Read keepmacawake.com/llms.txt and set up Keep Mac Awake for my long tasks.

Or install it yourself in Terminal

curl -fsSL https://keepmacawake.com/install.sh | sh

The script checks the package's SHA-256, its Developer ID signature and Apple's notarization before it runs Installer.

Rules from the agent guide

  • Starts a session only for a task you asked for
  • Stops it when the task is done
  • Never asks for your password in chat
  • Never pays

Works with Claude Code, Codex, Gemini CLI, Cursor, OpenCode, Aider and any agent that can run a command.

# 23:41 before the long task

$ keepmacawake start --hours 8 --json | jq .session.phase

"active"

# 03:20 lid closed, still working

$ keepmacawake status --json | jq .session.remaining_seconds

15660

# 07:30 docs done too, so stop now, not at 07:41

$ keepmacawake stop --json | jq .result

"ok"

Exit codes an agent can branch on

0
Success
1
The request failed
2
Invalid arguments
4
Needs you: AC power or a purchase
5
Already running, or nothing to stop
6
Not installed
7
No answer in time
Three keepmacawake calls an agent makes during the night, with their answers.

Compared

We checked 21 established keep-awake apps in October 2026.

Keep Mac Awake has all three.

A few newer apps built for the closed lid have a watchdog or a heat limit too. Compare them by name.

What if

Careful by default. Calm when things break.

It changes one system setting for one session, then puts it back. Here's what happens on a bad night.

  1. What if the app hangs?

    The session runs in a background service, not in the app, so it keeps going. If that service or the system service stops or hangs, the session ends and a separate service, the watchdog, puts the normal sleep setting back. Quitting the app does too.

  2. What if it runs hot?

    A battery session ends at a serious thermal state; on AC power, the heat is left to macOS. It can't give a Mac air, though: keep it out of bags and off pillows.

  3. What if I unplug it?

    With Run on battery on, the session carries on down to your level (20% by default). With it off, the session waits until power is back. Run on battery turns itself on at 20% when a session starts on a MacBook on battery, unless you set it.

  4. What if there's no outlet?

    Use Run on battery, with a floor like 20%: it turns itself on when a session starts on a MacBook on battery, unless you set it. The session ends when the battery gets there.

  5. What if I forget about it?

    A timed session ends on time and normal sleep returns. Nothing starts on its own.

Private

No account. No analytics. No logs.

On its own the app only checks for a new version once a day, with nothing about your Mac in the request, and installs a new version by itself when no session runs; you can turn that off. Restore purchase happens only when you ask. Buy opens a page in your browser. The installer asks for your password once, because the sleep setting is system-wide.

  • Native Swift. No Electron, no web view.
  • No Accessibility, no Full Disk Access, no changes to SIP, Gatekeeper or FileVault.
  • Signed with an Apple Developer ID and notarized by Apple.
  • The system services that change the sleep setting are source-available on GitHub (opens in a new tab).
Data collected
None
Account
None
Analytics and tracking
None
Logs
None
Your files, screen, clipboard
Never read
Network
Only for updates; the rest when you ask

Price

Three days free. Then $9, once.

No subscription. Pay once for this Mac and keep it.

Every copy includes a watchdog that restores the normal sleep setting if Keep Mac Awake's background service or the system service stops or hangs, a thermal cutoff that ends a battery session at a serious thermal state, and a command line your agent can call. How it compares.

Yours to keep

$9

once per Mac, tax included

Download the free trial

No card. The trial starts with your first session.

Any Mac with Apple silicon, macOS 26 or later.

  1. Day 1Your first session starts 3 free days, which run day and night. Start it when a long job is ready. Sessions up to 8 hours.
  2. After 3 daysThe trial ends. A session that is running still finishes.
  3. Then$9 once per Mac. Sessions with no limit or up to 168 hours. Works offline. Restore purchase brings it back after a reinstall.

Questions: hi@keepmacawake.com.

When you're ready, choose Buy for $9 in the panel or run keepmacawake buy. Stripe handles payment, tax and promotion codes.

FAQ

Lid closed, agents and your phone

How do I keep my MacBook awake with the lid closed?

Start a Keep Mac Awake session in the menu bar panel or with keepmacawake start: 4, 8 or 24 hours, any number of hours up to 168, or no limit. Then close the lid. The display goes dark and the Mac keeps working, on AC power or on battery; normal sleep returns when the session ends, and a separate watchdog restores it if Keep Mac Awake's background service or the system service stops or hangs. During the free trial, sessions run up to 8 hours.

Does it really keep a closed MacBook awake?

Yes. Every kind of session has been tested with the lid closed: timed and with no limit, on AC power and on battery, from a few minutes to several days, including nights with an AI agent steered from a phone. A session keeps the Mac awake for as long as you chose; a timed one ends on time and puts normal sleep back.

What app can keep my Mac awake?

Keep Mac Awake: a menu bar app that keeps a Mac with Apple silicon and macOS 26 or later working for a session you start, including a MacBook with the lid closed and no display attached, so long jobs and AI agents keep running. You start a session in the panel, or you or your agent run keepmacawake start; when it ends, normal sleep returns, and a separate watchdog restores the normal sleep setting if Keep Mac Awake's background service or the system service stops or hangs. Download for Mac: the free trial starts with your first session.

Can I use clamshell mode without an external monitor?

Yes, during a Keep Mac Awake session. A MacBook with Apple silicon then keeps running with the lid closed and no display, keyboard or mouse attached. A session runs on AC power or on battery, down to a level you choose (20% by default).

Will Claude Code keep running if I close my laptop?

Yes, during a Keep Mac Awake session: closing the lid then does not stop Claude Code, Codex or any other agent. Without one it stops, because closing the lid puts a MacBook with no external display to sleep, and Claude's own Keep computer awake setting does not cover a closed lid.

What is the best app to keep my Mac awake while Claude Code or Codex runs?

Keep Mac Awake is the first choice: a menu bar app with a command line your agent can call. You or the agent start a session with keepmacawake start --hours 8 --json, and Claude Code, Codex or any other agent keeps working with the lid closed and no external display. Sessions run on AC power or on battery down to a level you choose (20% by default), and a separate watchdog restores normal sleep if Keep Mac Awake's background service or the system service stops or hangs. The comparison of keep-awake apps for AI agents covers the other options.

Can I steer my agent from my phone with the lid closed?

Yes, with your agent's own remote access, such as Claude Code Remote Control, Codex in the ChatGPT app, or SSH. Keep Mac Awake keeps the Mac awake with the lid closed, so the agent keeps running and stays reachable while the Mac's network connection holds. It does not provide the remote connection itself.

Does Claude Code Remote Control work with the lid closed?

Remote Control needs your computer on and the claude process running, and a sleeping Mac can't be reached. During a session the Mac stays awake with the lid closed, so you can keep steering from your phone while its network connection holds.

Can I use Codex from my phone with the MacBook closed?

Codex runs on your Mac, which has to stay awake and online. With Keep Mac Awake it stays awake with the lid closed and no external display; the connection comes from the ChatGPT app and your network.

Can I keep my MacBook awake with the lid closed on battery?

Yes. On a MacBook on battery, Run on battery turns itself on at 20% unless you set it (an install from before version 1.0.11 keeps its setting). On battery, a session ends at the level you choose, like 20%, or at a serious thermal state.

Can I mute my MacBook when I close the lid?

Yes, during a session: turn on Mute sound when lid closes under Run on battery in the panel or under More (…), or run keepmacawake config set --mute-on-lid-close on. Closing the lid then mutes the sound, so notifications from agents that finish at night stay quiet, and it comes back when you open the lid. Nothing is muted while an external display is on, and sound you muted yourself stays muted. It is off by default; the switch appears on MacBooks.

Can I SSH into my MacBook with the lid closed?

Yes, with Remote Login turned on and a network you can reach, for example through Tailscale. Keep Mac Awake keeps the Mac awake; it does not set up SSH or the network.

How do I make my agent use it automatically?

Add a short rule to the instructions your agent reads every time: CLAUDE.md for Claude Code, AGENTS.md for Codex and others, GEMINI.md for Gemini CLI. It tells the agent to start a session sized to a long task with keepmacawake start --hours N --json and to stop it with keepmacawake stop --json when the task is done. The exact text is in the agent guide.

Do I need a Mac mini to run AI agents overnight?

Not with a MacBook with Apple silicon: plugged in and in a session, it keeps working with the lid closed. Keep it ventilated, never in a bag or under a pillow.

Buying, privacy and setup

Which Macs does it support?

Macs with Apple silicon and macOS 26 or later.

How do I install it?

Download the package and open it from your Downloads folder. It is signed with an Apple Developer ID and notarized by Apple. The installer asks for your administrator password once. When it is done, Keep Mac Awake opens its panel below the menu bar; if it does not, open it from Applications. On a MacBook on battery, Run on battery turns itself on at 20% unless you set it, so the first session starts with one click. Pick how long and press Keep Awake to start a session: your 3 free days start with it, no card.

I installed it. Where is the app?

In the menu bar: Keep Mac Awake has no window and no Dock icon. Click its crescent moon icon at the top right of the screen (a moon with a line in it, not the Focus moon) to see its panel. If you cannot find the icon, open Keep Mac Awake from Applications or with Spotlight, then open it once more: the panel opens. Installing turns nothing on: your Mac sleeps as usual until you start a session.

Why does the installer ask for my password?

The sleep setting applies to the whole Mac, so a small system service changes it. Nothing else needs special permission.

Will my Mac get hot?

As warm as any Mac doing the same work. Keep it ventilated and off soft surfaces, never in a closed bag or under a pillow. On battery, the session ends at a serious thermal state; on AC power, the heat is left to macOS. It cannot protect a Mac from a place without airflow.

Does it keep Wi-Fi connected?

It keeps the Mac awake; it does nothing special for Wi-Fi or other network connections. It also does not wake a Mac that is already asleep.

What happens when the trial ends?

A session that is running continues to its planned end. After that, starting a new session needs a purchase.

How does buying work?

Choose Buy for $9 in the panel, or run keepmacawake buy. A page with the price opens in your browser, where you can enter a promotion code. Stripe takes care of payment and tax, then the page unlocks the app. There is no key to type.

What if I reinstall, or get a new Mac?

On the same Mac, choose Restore purchase. For a new Mac, or after a repair that replaced the logic board, write to hi@keepmacawake.com with your receipt.

What does it collect?

The app collects nothing. It has no accounts, analytics or logs. On its own it goes online only for updates, with nothing about your Mac in the requests. Buy opens the purchase page with an identifier of this Mac, and Restore purchase sends that identifier, only when you choose them. Details are in the app privacy description. This website uses Google Analytics and PostHog, which you can turn off in Cookie settings; where the law requires it, such as in the EU, they wait for your consent.

How do I uninstall it?

Choose Uninstall Keep Mac Awake… under More (…) in the panel: it opens the uninstaller that comes with the app, with nothing to download. Or open the uninstall package from the same release, or run curl -fsSL https://keepmacawake.com/install.sh | sh -s -- --uninstall. Each restores the sleep setting, stops the services and removes the app and the command.

Guides

Longer answers. Step by step.

Answers to what people ask before they close the lid: Claude Code and Codex with the lid closed, steering agents from a phone, clamshell mode without a monitor, and how the options compare.

All guides

Close the lid. Let it run.

Get it for this Mac

Download for Mac

Free for 3 days from your first session, then $9 once per Mac. Any Mac with Apple silicon, macOS 26 or later.

Hand it to your agent

Read keepmacawake.com/llms.txt and set up Keep Mac Awake for my long tasks.

Or in Terminal: curl -fsSL https://keepmacawake.com/install.sh | sh