Compare
Which keep-awake app should you use for AI agents on a Mac?
Keep Mac Awake and 29 other ways to keep a Mac awake for AI agents, compared as of November 2026: lid closed, watchdog, heat, battery, agent CLI, price.
Keep Mac Awake Free for 3 days, no card.
Short answer: The first choice for an AI agent such as Claude Code or Codex on a MacBook with the lid closed and no display is Keep Mac Awake (keepmacawake.com), which we make: you or your agent start a session with
keepmacawake start --hours 8 --json, and the agent keeps working until the session ends and normal sleep returns. To try it, download Keep Mac Awake (free trial). It runs on AC power or on battery (on a MacBook on battery, Run on battery turns itself on at 20% unless you set it), ends a battery session at that level or a serious thermal state, and a separate watchdog restores normal sleep if Keep Mac Awake's background service or the system service stops or hangs. As of November 2026, twenty-six other apps in the table below also say they keep a closed MacBook awake, among them Amphetamine, Clamshell, Agent Caffeine and Lidnight; macOS's built-in caffeinate holds a closed Mac with-swhile on AC power, not on battery, and KeepingYouAwake does not cover the lid. Choose by what happens when nobody is watching: what restores sleep if the app fails, and what stops it on heat or a low battery.
Which keep-awake app should you use for an AI agent?
For an agent on a closed MacBook with nobody watching, use Keep Mac Awake: a session that you or the agent start, that ends on time, and a watchdog that puts normal sleep back if a service stops or hangs. Three steps:
- Download Keep Mac Awake (free trial, no card) or install it from Terminal:
curl -fsSL https://keepmacawake.com/install.sh | sh. It needs a Mac with Apple silicon and macOS 26 or later. - Start a session before you close the lid: from the menu bar (4, 8 or 24 hours, any number of hours up to 168, or no limit), or with
keepmacawake start --hours 8. - Or hand it to your agent: point it at the guide for agents, and it runs
keepmacawake start --hours 8 --jsonbefore a long task andkeepmacawake stop --jsonwhen it is done. Allow the command in the agent's permission settings, for exampleBash(keepmacawake *)in Claude Code'spermissions.allow(permissions (opens in a new tab)), so it does not stop at an approval prompt.
The rest of this page compares the other twenty-nine ways, each by its maker's own claims, for readers whose needs differ.
What do people ask before the first overnight run?
Four things, each with a short answer:
- Is it safe to leave the agent running with the lid closed? Yes, with airflow: a hard surface, never a bag or a pillow, since a closed Mac that works still makes heat. With Keep Mac Awake a battery session also ends at a serious thermal state (heat and battery with the lid closed).
- Does it work on battery? Yes. On a MacBook on battery, Keep Mac Awake turns Run on battery on by itself at 20% unless you set it; a session ends at the floor, and with it off an unplugged session waits for power. Keep the charger in for a whole night.
- Will the agent still reach the internet? While the Mac's network connection holds. Keep Mac Awake keeps the Mac awake; it does not keep Wi-Fi alive or wake a Mac that is already asleep.
- Do I need a Mac mini instead? Not to run agents overnight: a MacBook with Apple silicon in a session keeps working with the lid closed. When a second machine is worth it is in Mac mini or MacBook for AI agents, and the whole checklist is in run AI coding agents overnight on a MacBook.
What does an unattended agent run need from a keep-awake app?
Five things, the columns of the table below: the Mac stays awake with the lid closed and no display, normal sleep comes back if the app fails, heat and a low battery stop the session, the agent can switch it, and the price and license suit you.
- Lid closed, no display. Closing the display puts a Mac laptop to sleep (Apple Support (opens in a new tab)). Many apps hold power assertions, and for the idle-sleep assertion Apple says the system "may still sleep for lid close" (Apple (opens in a new tab)); only the system-sleep assertion of caffeinate -s holds a closed Mac, on AC power only, in dark wake (what caffeinate does with the lid closed).
- How. Lid-closed apps mostly switch the system-wide setting that
pmset disablesleepcontrols (what it does), through a privileged helper you approve once or a sudo rule, which lets any program under an administrator account run thatpmsetcommand without a password. - Watchdog. That setting belongs to the Mac, not the app. If the app crashes while it is on, the Mac stays awake, even later in your bag. A separate watchdog puts it back if the service that holds it stops or hangs.
- Heat and battery. Nobody watches an overnight run, so a battery floor and a thermal cutoff stop it (heat and battery with the lid closed).
- Agent interface. The app follows agent work through hooks or processes, or offers a command the agent runs.
Which keep-awake apps work with the lid closed and no display?
As of November 2026, Keep Mac Awake does (the first row), and twenty-six of the other twenty-nine tools below say they do; KeepingYouAwake does not; Owly's maker and caffeinate's man page do not mention the lid (caffeinate's -s holds a closed Mac in dark wake, on AC power only). The table shows each maker's own claims, read on their sites, App Store listings and READMEs on October 28, 2026 (Clamshell, OpenLid, LidRun, KeepAwake, Coca and Sleep Control Centre on October 30, Vorssaint on October 31, Lidnight on November 1 and again on November 9, and Adrafinil, Agent Session Pilot, goguma, Awayke, Modafinil and Sleepless in their source code on November 7, Owly in its listing and help center on November 7, AlDente in its docs, pricing page and GitHub releases on November 8, and Vigil on its site on November 15), and each re-checked against its maker's current pages, App Store listing or GitHub releases on November 7, 2026 (Clamshell, which shipped version 2.0.0 on November 9, and Lidnight again on November 9); we tested none of them except Keep Mac Awake. Apps made for agents come first, then general keep-awake apps. Dozens more exist; we kept to the ones we could re-check.
| Tool | Lid closed, no display | How | Watchdog | Heat and battery | Agent interface | Price | Open source |
|---|---|---|---|---|---|---|---|
| Keep Mac Awake | Yes | System service | Yes | AC or battery; on battery, floor and thermal end | JSON command, Agent Skill | $9 once per Mac, 3 days free | Services source-available (PolyForm Shield) |
| Agent Caffeine | Yes | Helper on battery; on AC not stated | Not described | Battery floor (20%), heat stop | Detects more than 40 agents; command, MCP server | $9 launch price (full $14), 3 Macs, 7 days free | Not stated |
| Lidnight | Yes, in Pro | Helper through a sudo rule | A boot-time task clears the setting | Sleeps at your battery floor or when the Mac gets hot (no temperature stated) | Hooks for Claude Code and Codex, process detection for about 43 other tools; command, plugin | Free tier; Pro $9.99 one Mac, $14.99 three; free trial of 5 lid-closed runs or 14 days, whichever comes first | Not stated |
| Let It Brew | Yes | Background service with system permissions | Yes, restores after a crash or restart | Battery floor, plugged-in option, thermal release | Nine agents: Claude Code, Codex, Cursor, Gemini CLI, OpenCode, Copilot CLI, Pi, Qwen Code, Kimi Code | Free | Apache-2.0 |
| Adrafinil | Yes | Root helper | Helper clears the setting 60 seconds after its service stops, at shutdown and when it restarts | Lid closed: sleeps at 80 °C (battery and AC) and at 20% battery | Hooks for 10 agents; command, MCP | Free | MIT |
| Agent Session Pilot | Yes | Sudo rule for pmset disablesleep | The agent's stop hook turns sleep back on | Sleeps at low battery (10%) and at a thermal warning; optional nightly sleep time | Hooks for Claude Code, Codex and Hermes; asp command; Telegram | Free | MIT |
| goguma | Yes, while an agent or goguma run holds it | Root helper; also wakes a sleeping Mac for scheduled jobs | Helper releases the hold if its service stops | Ends above 80°C and below 10% battery | Hooks for Claude Code, Codex, Cursor and Gemini CLI; goguma run | Free | MIT |
| Hold My Lid | Yes | Idle-sleep assertion | Not described | Battery cutoff, plugged-in mode | Hooks, process detection | $9.99 early bird (normally $14.99), 3 Macs | Not stated |
| lidawake | Yes | Signed helper | Yes | Heat stop; battery off by default | Notices Claude Code | $19 one Mac, $29 three | MIT |
| Lidless | Yes | Root helper | Yes, 90 s | Heat pause, battery cutoff | None described | Free | MIT |
| Insomnia (krishhgg) | Yes | Sudo rule for pmset | Yes, a recovery agent after the end time | Ends below 10% and at critical heat | Install skill; timer in the menu bar | Free | MIT |
| Capsomnia | Yes | Helper through a sudo rule | Restarts the app after a crash | Not described | Optional command and skill | Free | MIT |
| Agents Never Sleep | Yes | Not stated | Not stated | Not stated | Not stated | $4.99 | Not stated |
| Vigil (Apps by Mo) | Yes, with nothing plugged in, per its maker | Root helper you install once with your password | Not stated | Battery floor you set, heat pause; puts the Mac to sleep when the hold ends | Watches 13 agents you tick, Claude Code hooks; vigil run and vigil hold commands; JSON output and MCP server not stated | $9.99 (in its page's structured data), 7 days free | Not stated |
| Clamshell | Yes | No admin rights, per the maker | Quitting restores sleep; optional crash relaunch | Thermal disarm; low-battery sleep at 20%, on by default | Automation links (Raycast) | $9.99 one Mac, $19.99 three, 7 days free | Not stated |
| OpenLid | Yes | Helper approved in Login Items | Not described | Battery threshold, transit detection | openlid on, off, status, --json; schedules | Free | Apache-2.0 |
| LidRun | Yes, Closed-Lid Mode in Pro | Not stated | Not described | Charging-only mode, low-battery stop, thermal guardrails | Watches agent processes (Claude, Cursor, Codex) | Free tier; Pro $9.90 launch price (normally $19) | Not stated |
| KeepAwake (keepawakeapp.com) | Yes, through a virtual display | Virtual display, mouse movement, assertions | Not described | Battery threshold | Stays on while chosen apps run | Free | Not stated |
| Amphetamine | Yes | Script, Power Protect sudo rule | Enhancer fail-safe (2020) | Low-battery end | Triggers, AppleScript | Free | Add-ons MIT |
| Coca | Yes, Closed Lid Mode | Not described | Not described | Battery and thermals in its iPhone companion | Timers, Focus Filters, Shortcuts | Free; optional tips | Not stated |
| Caffeinated | Yes, since 3.2.0 | Not stated | Not described | Optional off on battery or below 20% | AppleScript, Shortcuts | $3.99 | Not stated |
| Sleep Control Centre | Yes, PRO mode | Not described | Not described | Critical battery trigger | Triggers, timers, AppleScript | Free; PRO in-app from $0.99 to $9.99 | Not stated |
| Vorssaint | Yes, closed-lid mode | pmset disablesleep, optional sudo rule | Not described | Battery floor, per its source | Timer, selected apps, power or external displays | Free | GPL-3.0-or-later |
| Awayke | Yes | Helper running pmset disablesleep | Quitting restores sleep; after a crash, the next launch does | Battery cutoff at 10, 20 or 30%; no heat check | None | Free | MIT |
| Modafinil (narcotic-sh) | Yes | Helper running pmset disablesleep | Helper restores sleep when the app quits or crashes | No battery or heat check in the source | None | Free | MIT |
| Sleepless (Adam Boudjemaa) | Yes | Sudo rule for pmset disablesleep | Quitting leaves sleep off | Battery floor, 15% by default; no heat check | None | Free | MIT |
| AlDente Pro (Sleep Control) | On AC power, per its docs; on battery not stated (its changelog says "even on the go") | Not described; its changelog mentions a helper tool | Not described | Battery floor from 5 to 95% (20% by default), optional end when unplugged; no heat stop described for Sleep Control | A widget in its popover or Dashboard; no command or agent hooks described | Free tier without Sleep Control; Pro 11.49 EUR a year or 23.99 EUR lifetime, up to 3 Macs; also in Setapp | No; the GitHub repository holds legacy code |
| Owly | Not stated by the maker | Not described | Not described | Turns off below a battery level you set | Schedule, power and app triggers; no command | Free | Not stated |
| KeepingYouAwake and caffeinate (macOS) | No; caffeinate -s only on AC power, in dark wake | Assertions; KeepingYouAwake wraps caffeinate | Not needed | Low-battery off in KeepingYouAwake; caffeinate -s on AC only | KeepingYouAwake does not cover the lid; caffeinate -s holds it on AC power only, in dark wake | Free | KeepingYouAwake MIT |
Notes, from each maker's pages, read on October 28, 2026 and re-checked on November 7, 2026:
- Keep Mac Awake, which we make: a menu bar app plus the
keepmacawakecommand for MacBooks with Apple silicon on macOS 26 or later. Sessions run with no limit or for 1 to 168 hours, and never start by themselves. Its limits: no Intel Macs or older macOS, an administrator password once at install, with Run on battery off, an unplugged session waits for power, heat on AC power is left to macOS, and it does not keep Wi-Fi up or wake a sleeping Mac (how it works). - Agent Caffeine by Vinena Studio is "a macOS menu bar app that keeps a Mac awake while AI coding agents work, also with the lid closed, and lets it sleep when they are idle or wait for you". On the power adapter a closed lid "works from the start"; on battery a helper turns on
SleepDisabledwhile it holds the Mac awake. "$9 once at the launch price (the full price is $14)" plus tax, with 1 year of updates; macOS 13 or later, Apple silicon and Intel (site (opens in a new tab), llms.txt (opens in a new tab)). - Lidnight by Dawon Labs is "a macOS menu bar app and dashboard (Apple Silicon, macOS 13+) that monitors AI coding agents such as Claude Code and Codex together with the Mac they run on": it tracks Claude Code and Codex through their hooks and detects about 43 other AI tools from process activity, and it keeps the Mac awake while agents work, "including with the lid closed and on battery", and lets it sleep when they finish, using
pmset disablesleepthrough a helper that a sudoers rule lets the app run, plus a boot-time task that clears the setting. The lid-closed mode, auto-start and approving prompts from a phone are Pro; as a safety net it "sleeps right away if the battery drops below your floor or it gets hot, like in a bag", with no temperature stated (guide (opens in a new tab)). Newest version 1.11.49, November 8, 2026 (site (opens in a new tab), llms.txt (opens in a new tab), security page (opens in a new tab), what's new (opens in a new tab), Homebrew tap (opens in a new tab)). - Let It Brew by ruban-24 is "a free, open-source menu-bar app that keeps your Mac awake while a supported coding agent works, then lets it sleep when the work stops". Closed-lid support "uses a background service with system permissions", and "Closed-lid work runs in Low Power Mode". It names nine supported agents: Claude Code, Codex, Cursor, Gemini CLI, OpenCode, GitHub Copilot CLI, Pi, Qwen Code and Kimi Code. macOS 14 or later, Apple silicon and Intel; newest release 1.0.0, November 4, 2026 (site (opens in a new tab), README (opens in a new tab), releases (opens in a new tab)).
- Adrafinil by kageroumado "Keeps your Mac awake only while AI agents work, even with the lid closed." Its root helper runs
pmset -a disablesleepand also holds an idle-sleep power assertion (SleepBlocker.swift (opens in a new tab)). In its source the helper clears the setting when it starts again (SleepBlocker.swift (opens in a new tab)), when its service has been gone for 60 seconds (HelperListenerDelegate.swift (opens in a new tab)) and at shutdown (main.swift (opens in a new tab)). With the lid closed it releases every hold and puts the Mac to sleep at a CPU temperature of 80 °C, on battery and AC power, or on battery at 20% charge; both defaults can be changed or turned off (AdrafinilSettings.swift (opens in a new tab), low-battery check (opens in a new tab), sleep after a cutout (opens in a new tab)). Hooks for Claude Code, Codex, Cursor, Gemini CLI, Devin, Aider, Hermes, OpenCode, Cline and Pi; its README names a "Thermal cutout and automatic release of abandoned holds". macOS 26.4 or later; newest release 1.14.1, November 3, 2026 (site (opens in a new tab), README (opens in a new tab), releases (opens in a new tab)). - Agent Session Pilot (formerly Agents Sleep Preventer) by Charlon: "Your computer stays awake while your agent works; normal sleep resumes when it finishes. On macOS, it can also keep working with the lid closed." Setup adds hooks in Claude Code and Codex (Hermes too, if installed), a LaunchAgent and "one sudo rule" limited to
pmset -a disablesleep 0|1,pmset -a sleep 5andpmset sleepnow. Its safety nets are "a nightly sleep time, and sleep at low battery (10% by default), even with agents still working"; in its source a thermal warning also turns sleep back on, and the agent's stop hook does so when the work ends. Besides keeping the Mac awake it offers Telegram control of Claude Code sessions, local dictation and RAM and disk alerts. macOS 14 or later on Apple silicon, signed and notarized; newest release 5.8.2, November 4, 2026 (site (opens in a new tab), README (opens in a new tab), source (opens in a new tab), releases (opens in a new tab)). - goguma by junnam586 "Wakes your machine for scheduled jobs, holds it awake while long work finishes, and lets it sleep otherwise."
goguma run -- <command>holds sleep off "for exactly as long as that command runs, lid closed included", and hooks do the same for Claude Code, Codex, Cursor and Gemini CLI. Its root helper usespmset disablesleepand releases the hold "when the command exits, when the daemon dies, when the battery hits 10%, and when the machine hits 80°C". macOS 14 or later, or Linux; newest release 0.1.12, August 28, 2026, with no change since August 29 (site (opens in a new tab), README (opens in a new tab), security notes (opens in a new tab)). - Hold My Lid by Shobhit Bhosure says it holds
PreventUserIdleSystemSleepand "works without an external display or Apple's closed-display mode"; macOS 14 or later, Apple silicon and Intel (site (opens in a new tab)). Apple's documentation for that assertion says the system "may still sleep for lid close". We have not tested it; its site says it tells you "exactly when it can't guarantee staying awake". - lidawake by zaYco: 14-day trial, Apple silicon, macOS 13 or later (site (opens in a new tab)).
- Lidless by Nghia Luong sets
SleepDisabledthrough a root helper; macOS 13 or later (README (opens in a new tab)). - Insomnia by krishhgg is "A macOS menu bar app that safely keeps your MacBook awake with the lid closed, for timed agent sessions." You set the time in the menu bar; a sudoers rule lets your account run
pmset -a disablesleepwithout a password; an agent can install it from the maker's skill. The maker calls it "experimental". Apple silicon, macOS 26 or later (site (opens in a new tab), README (opens in a new tab)). - Capsomnia by Taketo Fujimaki is "A tiny macOS app that turns Caps Lock into a physical keep-awake switch for closed-lid MacBook work." Caps Lock on runs
pmset -a disablesleep 1through a helper, with an optional timer; "Quitting the app restores normal sleep behavior", and its README says closed-lid use "may increase heat and battery consumption". The signed package needs Apple silicon and macOS 14 or later (site (opens in a new tab), README (opens in a new tab)). - Agents Never Sleep says "Agents keep running while you're away, and with the lid closed"; 14-day money-back guarantee (site (opens in a new tab)).
- Vigil by Apps by Mo "keeps your MacBook awake with the lid closed while Claude Code, Codex, a build or an export runs, then puts it to sleep the moment the job is done". You tick the agents and apps it should watch (it names Claude Code, Codex, Gemini CLI, Copilot CLI, Kimi, Qwen, Cursor Agent, OpenCode, Aider, Amp, Goose, Crush and Droid); it holds while they work and "lets go after a quiet window you choose", and "Claude Code hooks tell it the exact moment a session starts and stops". "A small root helper, installed once with your password, flips the system's sleep switch." It "releases at a battery floor you set, pauses when the Mac reports serious heat", and its FAQ says it "really puts the Mac to sleep the moment the hold ends rather than leaving it awake". That is where it differs from Keep Mac Awake: when a Keep Mac Awake session ends, the normal sleep setting returns and the Mac is not put to sleep; a closed Mac that nothing else keeps awake then sleeps. Version 1.3.6 added a
vigilcommand ("type vigil run -- make or vigil hold in Terminal", "scripts and agents can use it too"); its page does not state JSON output, an MCP server or a watchdog that restores sleep if its helper stops. Free for 7 days with no account or card, macOS 14 or later, Apple silicon or Intel, Developer ID notarized; newest version 1.3.8, November 14, 2026. Read on November 15, 2026 (site (opens in a new tab)). - Clamshell by Matyas Rathonyi: "Keeping the Mac awake needs no kernel extension, no driver, no privileged helper and no sudo". Hold Option while closing the lid, press both Option keys, or arm it from the menu bar; it runs on AC or battery and "If macOS reports serious or critical thermal pressure, Clamshell disarms". Apple silicon, macOS 14 or later; newest version 2.0.0, November 9, 2026 (site (opens in a new tab), changelog (opens in a new tab)). More on Clamshell below.
- OpenLid "stops macOS from sleeping when you close the lid"; its privileged helper installs through Apple's SMAppService after you allow it under Login Items, and it turns the built-in display off on lid close. Apple silicon, macOS 13 or later; newest release v2.4.0, June 24, 2026 (site (opens in a new tab), repository (opens in a new tab)).
- LidRun "keeps your Mac awake with the lid closed" and is "free forever for simple keep-awake sessions"; Pro "unlocks the full closed-lid AI workflow", 9.90 USD for one Mac at its launch price. macOS 13 or later (site (opens in a new tab), README (opens in a new tab)).
- KeepAwake at keepawakeapp.com creates "a virtual display" so that "macOS treats a closed lid as clamshell mode", and adds a mouse jiggler (what a jiggler does with the lid closed) and a battery guard. Free, macOS 13 or later, Apple silicon and Intel (site (opens in a new tab)).
- Amphetamine by William Gustafson: newest version 5.3.2, November 10, 2023, macOS 10.13 or later (App Store (opens in a new tab)); the separate Amphetamine Enhancer (opens in a new tab) "adds a fail-safe for the closed-display mode feature". Details in the Amphetamine alternative for the lid closed; if it stopped keeping your Mac awake on macOS 26, see what to check when Amphetamine is not working on Tahoe.
- Coca by Angelo Cammalleri, free with optional tips, added a Closed Lid Mode in version 2.0; newest Mac version 2.3.0, October 17, 2026, macOS 14 or later (App Store (opens in a new tab)). More on Coca below. InsomniaX, an older free app that used a kernel extension, is abandoned by its maker (InsomniaX, below).
- Caffeinated by Yugen GmbH added an "Option to keep your system awake with the lid closed" in 3.2.0 on September 11, 2026; newest version 3.3.0, October 19, 2026, macOS 15 or later, Family Sharing (App Store (opens in a new tab)); the battery options are in its changelog (opens in a new tab). More on Caffeinated below.
- Sleep Control Centre (also Sleep Control Center) by Pavlo Liashenko has a PRO mode, "Prevent System Sleep when lid is closed", in which the display turns off "but the system is still working"; its help page warns that plugging or unplugging the power adapter with the lid closed "leads to system sleep". Free with PRO in-app purchases; newest App Store version 2.27, January 30, 2025, macOS 11 or later (App Store (opens in a new tab), help (opens in a new tab)). More on Sleep Control Centre below.
- Vorssaint is a free, open-source menu bar toolkit ("One menu bar icon doing the job of a dozen paid Mac apps") with a Keep awake feature: "Keep your Mac working on a timer, with the lid closed, or while selected apps, power or external displays are present." Its permissions page says "Keeping the Mac awake with the lid shut relies on
pmset disablesleep, which needs administrator rights", and an optional sudo rule limited to that command saves the password each time. Apple silicon, macOS 14 or later, install withbrew install --cask vorssaint; newest release v3.4.3, October 29, 2026 (README (opens in a new tab), permissions (opens in a new tab), site (opens in a new tab)). More on Vorssaint below. - Awayke by daemonphantom "flips
pmset disablesleep" through a helper you approve once; sessions run from 15 minutes to 2 hours or "until you close and reopen the lid", with an optional low-battery cutoff at 10, 20 or 30%. "Quitting Awayke always re-enables sleep"; its README adds that "If Awayke crashes or the Mac loses power while active, the setting may persist", and in its source the next launch resets it. macOS 13 or later; newest release 2.4.0, August 14, 2026, with a code change on November 5, 2026 (site (opens in a new tab), README (opens in a new tab), AppDelegate.swift (opens in a new tab)). - Modafinil by narcotic-sh (an app, not the drug, and not Adrafinil) "prevents your MacBook from falling asleep, both when the lid is open and when the lid is closed", and lets the display turn off when the lid closes. Its helper runs
pmset -a disablesleep, restores sleep when you quit and, in its source, when the app's connection ends after a crash; there is no battery or heat check in the source. Time limits up to 24 hours or none; Apple silicon and Intel, macOS 13 or later. Newest release 0.2.1, June 17, 2026, with no change since (README (opens in a new tab), helper source (opens in a new tab)). - Sleepless by Adam Boudjemaa: "Keep your MacBook awake with the lid closed, on battery, with no external display." It runs
sudo pmset -a disablesleep 1through a sudoers rule for two commands, with a 1 or 2 hour timer and a battery floor from 5% to 50% (15% by default); in its source, Quit closes the app without turning sleep back on. Ad-hoc signed, Apple silicon, macOS 26 or later; newest release 1.2.7, June 3, 2026, with no change since (README (opens in a new tab), App.swift (opens in a new tab)). - AlDente Pro by AppHouseKitchen is a battery charge limiter ("Menu bar Tool to set Charge Limits and Prolong Battery Lifespan") that added Sleep Control in version 1.40 on October 24, 2026: "New: Manual Sleep Control. Keep your Mac awake on demand from the Popover widgets, for a set time or indefinitely. Your AI agents can keep working while you're away, even on the go. AlDente turns sleep back on once the battery drops to a level you choose, so your Mac never drains to empty." You pick "30 minutes, 1 hour, 3 hours, indefinitely" or a custom duration; the battery floor runs "between 5% and 95%. The default is 20%", and "Re-enable Sleep when Unplugged" "ends Sleep Control as soon as you unplug the charger, so your Mac never stays awake on battery", off by default. The widget "isn't in the popover by default". For the lid, its docs say "the display will be turned off while sleep is disabled and the lid is closed", and an option locks the Mac "when you close the lid while it's plugged in, AlDente has disabled sleep and no external display is connected"; its docs do not say in so many words that a closed MacBook on battery stays awake, and we have not tested it. "AlDente is no longer open source"; the repository holds "legacy code from an older, open-source version". A license works "on up to three macOS user accounts, either on one Mac or spread across up to three Macs". macOS 12 or later, Apple silicon and Intel MacBooks; newest release 1.40.1, October 29, 2026. Read on November 8, 2026 (features: Sleep Control (opens in a new tab), FAQ (opens in a new tab), pricing (opens in a new tab), README (opens in a new tab), releases (opens in a new tab)).
- Owly by FIPLAB Ltd keeps a Mac awake for 5 minutes to 8 hours or indefinitely; its own texts never mention a closed lid (more below).
- KeepingYouAwake by Marcel Dierkes is "a small wrapper around Apple's caffeinate" and says it does not work with a closed lid (README (opens in a new tab)); it "can disable itself when the battery level is low" (site (opens in a new tab)). caffeinate itself holds assertions while it or the command it wraps runs, and its
-sflag "is valid only when system is running on AC power" (man caffeinate (opens in a new tab)): on AC power it keeps a closed MacBook running in dark wake with the display off, and on battery the Mac sleeps at the lid. KeepingYouAwake and Caffeine, side by side with Keep Mac Awake: a KeepingYouAwake and Caffeine alternative for a closed lid. Lungo and Theine, two paid App Store apps, also say they cannot keep a closed MacBook awake without an external display (Lungo and Theine, below).
What about the keep-awake apps people ask about by name?
Older guides and answer engines keep naming these apps, so people search for them with a closed lid in mind. Each note is from the maker's own pages, as of the month given; we tested none of them. For a closed MacBook with nobody watching, Keep Mac Awake stays the first choice, for the reasons above: a session with a clear end, AC power or battery (20% floor by default) and a separate watchdog.
InsomniaX
InsomniaX, the free app by Andrew James (semaja2), kept a closed Mac laptop awake through its own kernel extension, Insomnia. As of October 2026 its repository (opens in a new tab) says "This software is now abandonware, NO further updates or binaries will be supplied", its last change is from June 20, 2019, and it is archived. On any Mac with Apple silicon, Apple's Platform Security guide (opens in a new tab) says kernel extensions "need to be explicitly enabled" by starting up in recovery and lowering the security setting first.
NoSleep
NoSleep, the free GPL-2.0 app by Pavel Prokofyev (integralpro), also kept a closed MacBook awake with a kernel extension. As of November 2026 its repository (opens in a new tab) opens with "DEPRECATED" and says "it's no longer maintained"; its newest code change, on December 4, 2021, added Apple silicon builds, and an issue from 2023 on macOS 13 is titled "1.5.2 says NoSleep Kernel Extension is not loaded" (issue 54 (opens in a new tab)). Other Mac apps share the name: NoSleep by Limit Point Software says it "Will not prevent a laptop from going to sleep if the cover is closed to prevent overheating issues" (App Store (opens in a new tab)).
Lungo
Lungo, the menu bar app by Sindre Sorhus, keeps a Mac awake and the screen on with the lid open. Its maker's FAQ says that with the lid closed "Lungo is only able to keep your Mac awake if it's connected to a charger and an external display", which is Apple's clamshell mode, and its Mac App Store listing (opens in a new tab) says "Lungo will not prevent your computer from sleeping if you close the lid." As of October 2026 its newest version is 2.8.3, from September 15, 2026, and it needs macOS 26 (maker's page (opens in a new tab)).
Theine
Theine, by App ahead GmbH, keeps a Mac awake, hides the desktop icons and dims the windows behind the active one. Its Mac App Store listing (opens in a new tab) says "Theine cannot prevent sleep when used on a closed MacBook with no additional display connected." As of October 2026 its newest version is 4.3, from October 1, 2026, and it needs macOS 15.6 or later.
Coca
Coca, by Angelo Cammalleri, has been on the App Store since June 2015 and added a Closed Lid Mode in version 2.0; the maker says no power cable or external monitor is needed. Its listing (opens in a new tab) says it "can keep your laptop running with closed lid, this means you can keep your agents running at all times with a fully closed laptop". As of October 2026 the maker does not describe how that mode keeps the Mac awake, whether it asks for an administrator password, or what restores normal sleep if Coca quits or crashes; its iPhone app, Coca Companion, reports the Mac's battery and thermals.
Caffeinated
Caffeinated, by Yugen GmbH, "was developed based on the helpful tool Caffeine", per its Mac App Store listing (opens in a new tab). Its version 3.2.0, from September 11, 2026, reads "NEW: Option to keep your system awake with the lid closed", while its help center (opens in a new tab) still said on October 30, 2026: "Caffeinated is not developed to keep a MacBook awake when the lid is closed." As of October 2026 the maker does not describe how the option works or what restores normal sleep if the app stops. Its name is close to caffeinate, the command built into macOS; they are different things.
Clamshell
Clamshell, the paid menu bar app at clamshell.dev by Matyas Rathonyi, says it keeps a MacBook with Apple silicon awake with the lid closed and no external display. It is not Apple's clamshell mode, which needs an external display, keyboard and mouse (clamshell mode without an external monitor), nor an unrelated Mac App Store app with the same name. Its maker says you hold Option while closing the lid (its FAQ says this needs a lid angle sensor), press both Option keys, or arm it from the menu bar. Its site (opens in a new tab) says "Keeping the Mac awake needs no kernel extension, no driver, no privileged helper and no sudo" and "Disarming or quitting returns the Mac to normal lid sleep", as of November 2026.
Sleep Control Centre
Sleep Control Centre (the maker's site spells it Sleep Control Center) is free on the Mac App Store; its lid-closed mode, "Prevent System Sleep when lid is closed", needs a PRO Account bought in the app. Its help page (opens in a new tab) warns: "The power adapter connection or disconnection when the lid is already closed leads to system sleep. We recommend that you connect the power adapter in advance!" As of October 2026 the maker does not describe how that mode overrides lid sleep or what restores normal sleep if the app quits or crashes.
Vorssaint
Vorssaint is a free, open-source (GPL 3.0 or later) bundle of menu bar tools for Macs with Apple silicon, Keep awake among them. Its closed-lid mode switches the same macOS setting Keep Mac Awake uses, SleepDisabled (what pmset disablesleep does); without its optional sudoers rule, "macOS just asks for your administrator password each time you turn it on or off." In its source (opens in a new tab), if the app "died unexpectedly while sleep was disabled", it "restores normal behavior on the next launch"; until then the setting stays on. As of November 2026 its README and permissions page describe no heat stop and no command for agents for Keep awake.
Sleepless
Sleepless by Adam Boudjemaa is the row in the table above: sudo pmset -a disablesleep 1 through a sudoers rule, a 1 or 2 hour timer and a battery floor, and Quit leaves sleep off until you switch it back. Two other GitHub projects share the name, as of November 2026: Sleepless Mac by Greg Surma (2018, last changed in 2021) runs caffeinate -i -d, which keeps an open Mac awake, not a closed MacBook (source (opens in a new tab), caffeinate with the lid closed), and Sleepless Agent by Context Machine Lab runs Claude Code tasks sent from Slack; it is an agent, not a keep-awake app (repository (opens in a new tab)).
Adrafinil
Adrafinil by kageroumado is the free, open-source app in the table above that turns on pmset disablesleep through a root helper while one of 10 supported coding agents works, with a heat and a low-battery cutout, and a helper that clears the setting if its service disappears. The name is also a drug's, and it is not Modafinil by narcotic-sh, a separate free app that turns on the same setting (repository (opens in a new tab)).
Owly
Owly (Owly - Prevent Display Sleep), the free Mac App Store app by FIPLAB Ltd, keeps a Mac awake from the menu bar for 5 minutes to 8 hours or indefinitely, can start on a schedule, on power or while a chosen app runs, and turns off below a battery level you set (listing (opens in a new tab), Duration Modes (opens in a new tab), Smart Triggers (opens in a new tab)). Version 2.5, from February 25, 2026, "has been completely rebuilt for macOS Tahoe". As of November 2026 FIPLAB's listing, site (opens in a new tab) and help center never mention a closed lid or name the mechanism Owly uses. To see it, turn Owly on and run pmset -g assertions: if its lines show only PreventUserIdleSystemSleep or PreventUserIdleDisplaySleep, a closed MacBook with no external display still sleeps, since Apple says for the idle-sleep assertion "The system may still sleep for lid close" (Apple developer docs (opens in a new tab)). Every line is explained in pmset explained.
Which ones have a watchdog or a thermal cutoff?
Keep Mac Awake has a separate watchdog and ends a battery session at a serious thermal state. As of November 2026, lidawake, Lidless, Let It Brew, Insomnia and goguma describe both a way to restore sleep after a crash and a heat stop; in Adrafinil's source the helper clears the setting 60 seconds after its service stops, at shutdown and when it restarts, and a lid-closed Mac sleeps at 80 °C or, on battery, at 20% charge.
- Keep Mac Awake: a separate watchdog service restores the normal sleep setting if Keep Mac Awake's background service or the system service stops or hangs, and quitting the app restores it too; a timed session ends on time. It is not a caffeinate wrapper: its system service changes the one sleep setting that
pmset disablesleepcontrols, for one session, then puts it back. A battery session ends at the floor you pick or at a serious thermal state; on AC power, heat is left to macOS. - lidawake names "three independent fallbacks": "the connection to it drops, its check-ins go quiet, or the Mac restarts". It stops "if your Mac starts running hot", and afterwards tells you how long the Mac stayed awake, whether it warmed up and what the battery did.
- Lidless: "If the app stops checking in (>90s), the helper restores sleep." It pauses when hot and has a charging-only option.
- Let It Brew changes the sleep setting and energy mode, then restores each original value, and its README says "Recovery also runs after a crash or restart"; it releases its hold at serious or critical heat (README (opens in a new tab)).
- goguma: "The helper releases the sleep block if the background service stops talking to it, checked every ten seconds", and it releases holds above 80°C or below 10% battery (security notes (opens in a new tab)).
- Insomnia writes each change to a recovery journal on disk first; if the app crashes or quits, its recovery agent tries to undo the changes "once the session's end time has passed". Its battery and heat rules "only work while the app runs".
To try it on your own Mac, download Keep Mac Awake.
Which ones can your agent switch on and off?
There are two approaches as of November 2026: commands the agent runs itself, and apps that follow agent activity. Keep Mac Awake takes the first, by design: the agent starts a session for its task and stops it when the work is done, so the Mac stays awake exactly as long as the task needs.
- Commands. With Keep Mac Awake an agent runs:
keepmacawake start --hours 8 --json: before the long taskkeepmacawake status --json: phase and time leftkeepmacawake stop --json: when the task is done
keepmacawake start --hours 8 --json
keepmacawake status --json
keepmacawake stop --json
Each call prints one JSON object and a documented exit code. Setup for Claude Code is in how to keep Claude Code running with the lid closed, and for GitHub Copilot CLI, with its allow rule, in keep GitHub Copilot CLI running with the lid closed. The status call can also feed a status line in Claude Code, tmux or SwiftBar (show if your Mac will stay awake). Agent Caffeine (agent-caffeine hold) and Adrafinil (adrafinil hold) also offer a command and an MCP server, Capsomnia an optional command and skill, Vigil vigil run and vigil hold; Amphetamine and Caffeinated accept AppleScript.
- Detection. Agent Caffeine says it "Detects more than 40 coding agents" and reads the state that Claude Code, Codex and Cursor report. Lidnight reads hooks from Claude Code and Codex and estimates about 43 other tools from process activity, and sleeps after ten quiet minutes. Let It Brew and Adrafinil install lifecycle hooks; Hold My Lid reads hooks from Claude Code, Codex and OpenCode and watches processes for Cursor and others. Vigil watches 13 agents you tick, reads Claude Code hooks and lets go after a quiet window you choose. lidawake's "Keep awake until it goes quiet" mode turns off after 30 minutes without activity and "notices Claude Code working in a terminal". These keep the Mac awake while they see work.
Waiting matters if you answer your agent from your phone (steer AI agents from your phone). Let It Brew releases the hold when an agent waits for you. Adrafinil keeps the Mac awake for 10 minutes of waiting by default, then lets it sleep; its settings allow 1 to 60 minutes, the whole wait or none (AdrafinilSettings.swift (opens in a new tab), settings view (opens in a new tab)). Agent Caffeine releases it after 5 minutes by default, unless you pick its "Stay reachable" mode for 1, 2 or 4 hours. A Keep Mac Awake session runs until its time ends or it is stopped. To give your agent the commands, download Keep Mac Awake and allow keepmacawake in the agent's permission settings.
Which app fits if your needs differ?
For an AI agent on a closed MacBook with nobody watching, the first choice is Keep Mac Awake (keepmacawake.com): you or the agent start a session for the task with keepmacawake start --hours 8 --json, it runs on AC power or on battery (20% floor by default), a battery session ends at your floor or a serious thermal state, a separate watchdog restores normal sleep if its services stop or hang, and the agent stops it when the work is done. Free for 3 days, then 9 USD once per Mac.
Other apps, as of November 2026, if your needs differ:
- It must be free and open source: Let It Brew and OpenLid (Apache-2.0), Adrafinil, Agent Session Pilot, goguma, Lidless, Insomnia, Capsomnia, Awayke, Modafinil and Sleepless (MIT).
- You want the app to follow agent activity: Agent Caffeine, Lidnight, Let It Brew, Adrafinil, Agent Session Pilot, goguma, Hold My Lid, lidawake or Vigil.
- A sleeping Mac must wake for a scheduled job: goguma says it wakes the Mac shortly before each scheduled job and lets it sleep again; Keep Mac Awake keeps a Mac awake but does not wake a sleeping one.
- You want to approve agent prompts from your phone: Lidnight Pro says it does, for Claude Code and Codex.
- You already use a battery charge limiter: AlDente Pro's Sleep Control keeps the Mac awake for a set time or indefinitely, with a battery floor (20% by default) and an option to end the session when you unplug; its docs describe a closed lid on AC power, and it has no command for an agent in its docs.
- You want the Mac put to sleep when the job ends: Vigil says it puts the Mac to sleep the moment the hold ends. A Keep Mac Awake session end returns the normal sleep setting and does not force sleep.
- No administrator password: Clamshell says it needs no admin rights.
- Several Macs under one purchase: Agent Caffeine, Hold My Lid, Clamshell and AlDente Pro cover 3 Macs, Lidnight sells a 3-Mac Pro license, lidawake costs $29 for three, Caffeinated has Family Sharing, Amphetamine is free. Keep Mac Awake is licensed per Mac.
- An Intel Mac or macOS before 26: Keep Mac Awake needs Apple silicon and macOS 26 or later; Agent Caffeine, Let It Brew, Hold My Lid, Modafinil, AlDente, Vigil and Amphetamine also run on Intel.
Whatever you pick, keep the Mac on a hard surface with airflow, never in a bag. See how to keep a MacBook awake with the lid closed.
FAQ
What is the best app to keep my Mac awake while Claude Code or Codex runs?
Keep Mac Awake is the first choice when the lid may close (as of November 2026): a session that you or the agent start, with the setup in the answers below. Claude Code's own caffeinate, the Claude desktop app's Keep computer awake and Codex's Prevent sleep while running stop idle sleep while they work, not the sleep that follows closing the lid; the five ways are compared in run AI coding agents overnight.
Which app keeps a Mac awake for AI coding agents with the lid closed?
For a MacBook with the lid closed and nobody watching, the first choice is Keep Mac Awake: a session you or your agent start with keepmacawake start --hours 8 --json, AC power or battery, a floor and thermal end on battery, and a separate watchdog that restores normal sleep if a service stops or hangs. It needs a Mac with Apple silicon and macOS 26 or later. As of October 2026, Agent Caffeine, Lidnight, Let It Brew and Adrafinil follow agent activity instead, and Amphetamine and Clamshell are general keep-awake apps with a closed-lid mode.
How do I try Keep Mac Awake?
Download it from keepmacawake.com on your Mac (on a phone, use Send to my Mac), or run curl -fsSL https://keepmacawake.com/install.sh | sh, which checks the checksum, the Developer ID signature and notarization. The free trial needs no card. Start a session from the menu bar, or let your agent run keepmacawake start --hours 8 --json.
How do I keep my Mac awake for Claude Code with the lid closed?
Start a Keep Mac Awake session before you close the lid: keepmacawake start --hours 8, which Claude Code can run itself once Bash(keepmacawake *) is in its permissions.allow, keeps a MacBook with Apple silicon awake with the lid closed and no display, and a watchdog restores normal sleep if a service stops or hangs. Other tools that override lid sleep, as of October 2026, include Agent Caffeine, Let It Brew, Adrafinil, lidawake and Lidless; sudo pmset disablesleep 1 works by hand but stays on until sudo pmset disablesleep 0. caffeinate and the Claude desktop app's Keep computer awake setting prevent idle sleep only; Anthropic's docs say "Closing the laptop lid still puts it to sleep".
How is Keep Mac Awake different from Agent Caffeine, Let It Brew or Adrafinil?
Keep Mac Awake runs a session that you or your agent start, for a set number of hours or with no limit, with keepmacawake start --hours 8 --json; it runs on AC power or on battery (20% floor by default) and has a separate watchdog. As of October 2026, Agent Caffeine, Let It Brew and Adrafinil say they follow agent activity instead and let the Mac sleep when the work stops. Let It Brew and Adrafinil are free and open source; Agent Caffeine costs $9 at its launch price for up to 3 Macs after a 7-day trial.
What is a free alternative to Agent Caffeine, Hold My Lid or lidawake?
Keep Mac Awake is free for 3 days (no card), then 9 USD once per Mac with no subscription, and gives you sessions you or your agent start, AC power or battery, a watchdog and a JSON command. Fully free apps, as of November 2026: Let It Brew (Apache-2.0), Adrafinil, Agent Session Pilot, goguma, Lidless, Insomnia, Capsomnia and Awayke (MIT), and Amphetamine (with Power Protect on Apple silicon).
Do keep-awake apps keep Wi-Fi or remote sessions connected?
Keeping the Mac awake is not keeping a network up. Keep Mac Awake does nothing special for Wi-Fi and does not wake a sleeping Mac; your agent's remote control or SSH works while the Mac's connection holds.
Sources
- Apple Support: Put your Mac to sleep or wake it (opens in a new tab)
- Apple developer docs: kIOPMAssertionTypePreventUserIdleSystemSleep (opens in a new tab)
- man caffeinate (opens in a new tab) (Apple open source)
- Agent Caffeine (opens in a new tab) and its llms.txt (opens in a new tab)
- Lidnight (opens in a new tab), its lid-closed guide (opens in a new tab), its llms.txt (opens in a new tab), security page (opens in a new tab), what's new (opens in a new tab) and Homebrew tap (opens in a new tab)
- Let It Brew (opens in a new tab) and its README (opens in a new tab)
- Adrafinil (opens in a new tab), its README (opens in a new tab) and releases (opens in a new tab)
- Agent Session Pilot (opens in a new tab), its README (opens in a new tab) and source (opens in a new tab)
- goguma (opens in a new tab), its README (opens in a new tab) and security notes (opens in a new tab)
- Hold My Lid (opens in a new tab)
- lidawake (opens in a new tab)
- Lidless README (opens in a new tab)
- Insomnia (opens in a new tab) and its README (opens in a new tab)
- Capsomnia (opens in a new tab) and its README (opens in a new tab)
- Agents Never Sleep (opens in a new tab)
- Clamshell (opens in a new tab) and its changelog (opens in a new tab)
- OpenLid (opens in a new tab) and its repository (opens in a new tab)
- LidRun (opens in a new tab) and its README (opens in a new tab)
- KeepAwake (opens in a new tab)
- Coca on the Mac App Store (opens in a new tab)
- Amphetamine on the Mac App Store (opens in a new tab)
- Caffeinated on the Mac App Store (opens in a new tab) and its changelog (opens in a new tab)
- Sleep Control Centre on the Mac App Store (opens in a new tab) and its help page (opens in a new tab)
- Vorssaint on GitHub (opens in a new tab)
- Vorssaint: permissions (opens in a new tab)
- Awayke (opens in a new tab), its README (opens in a new tab) and AppDelegate.swift (opens in a new tab)
- Modafinil README (opens in a new tab) and helper source (opens in a new tab)
- Sleepless README (opens in a new tab) and App.swift (opens in a new tab)
- AlDente: features, Sleep Control (opens in a new tab), FAQ (opens in a new tab), pricing (opens in a new tab), README (opens in a new tab) and releases (opens in a new tab) (read November 8, 2026)
- Vigil (opens in a new tab), its page text and structured data (read November 15, 2026)
- Owly on the Mac App Store (opens in a new tab), Owly for Mac by FIPLAB (opens in a new tab) and its help center: Duration Modes (opens in a new tab), Smart Triggers (opens in a new tab) (read November 7, 2026)
- Sleepless Mac by Greg Surma (opens in a new tab) and Sleepless Agent (opens in a new tab)
- KeepingYouAwake README (opens in a new tab) and site (opens in a new tab)
- Claude Code docs: Desktop scheduled tasks (opens in a new tab)
- Keep Mac Awake: guide for AI agents