---
title: Keep-awake apps for AI agents on a Mac, compared
description: Nine ways to keep a Mac awake for AI agents as of October 2026, compared on lid closed, method, watchdog, heat and battery, agent interface and price.
date: 2026-10-20
kicker: Compare
section: Comparisons
related: amphetamine-alternative-lid-closed, keep-claude-code-running-lid-closed, macbook-lid-closed-heat-and-battery
order: 1
home: 5
---

> **Short answer:** To keep an AI agent such as Anthropic's Claude Code working with a MacBook's lid closed and no display, a tool has to override lid sleep; macOS's built-in `caffeinate` and KeepingYouAwake do not. As of October 2026, Amphetamine, Caffeinated, lidawake, Lidless, Hold My Lid, Agents Never Sleep and Keep Mac Awake say they keep a closed MacBook awake, and lidawake, Lidless and Keep Mac Awake also describe a watchdog that restores sleep plus limits for heat and battery. Choose by what happens when nobody is watching: the method, the recovery and the limits.

## 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](https://support.apple.com/guide/mac-help/put-your-mac-to-sleep-or-wake-it-mh10330/mac)). Many apps hold power assertions, and for the idle-sleep assertion Apple says the system "may still sleep for lid close" ([Apple](https://developer.apple.com/documentation/iokit/kiopmassertiontypepreventuseridlesystemsleep), and [why caffeinate stops at the lid](/blog/caffeinate-lid-closed)).
- **How.** Lid-closed apps mostly switch the system-wide setting that `pmset disablesleep` controls ([what it does](/blog/pmset-disablesleep)), through a privileged helper you approve once or a sudo rule, which lets any program under an administrator account run that `pmset` command 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 watchdog puts it back.
- **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](/blog/macbook-lid-closed-heat-and-battery)).
- **Agent interface.** The app detects 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 October 2026, seven of these nine say they do; `caffeinate` and KeepingYouAwake do not. The table shows each maker's own claims as of October 2026, from their sites, App Store listings and READMEs; we tested none of them except Keep Mac Awake. 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 |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `caffeinate` (macOS) | No | Assertions | Not needed | `-s` on AC only | Wraps a command | Built in | Part of macOS |
| Amphetamine | Yes | Script, Power Protect sudo rule | Enhancer fail-safe (2020) | Low-battery end | Triggers, AppleScript | Free | Add-ons MIT |
| KeepingYouAwake | No | `caffeinate` | Not needed | Low-battery off | None described | Free | MIT |
| Caffeinated | Yes, since 3.2.0 | Not stated | Not described | Off when unplugged | AppleScript, Shortcuts | $3.99 | 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 |
| Hold My Lid | Yes | Idle-sleep assertion | Not described | Battery cutoff, plugged-in mode | Hooks, process detection | $9.99 early bird, 3 Macs | Not stated |
| Agents Never Sleep | Yes | Not stated | Not stated | Not stated | Not stated | $4.99 | Not stated |
| Keep Mac Awake | Yes | System service | Yes | AC by default; on battery, floor and thermal end | JSON command, Agent Skill | 3 days free, then 9 USD once per Mac | Services source-available (PolyForm Shield) |

Notes, as of October 2026:

- **`caffeinate`** holds assertions while it or the command it wraps runs; `-s` "is valid only when system is running on AC power" (`man caffeinate`).
- **Amphetamine** by William Gustafson: newest version 5.3.2, November 10, 2023 ([App Store](https://apps.apple.com/us/app/amphetamine/id937984704?mt=12)); the separate [Amphetamine Enhancer](https://github.com/x74353/Amphetamine-Enhancer) "adds a fail-safe for the closed-display mode feature". Details in the [Amphetamine alternative for the lid closed](/blog/amphetamine-alternative-lid-closed).
- **KeepingYouAwake** by Marcel Dierkes is "a small wrapper around Apple's `caffeinate`" and says it does not work with a closed lid ([README](https://github.com/newmarcel/KeepingYouAwake)); it "can disable itself when the battery level is low" ([site](https://keepingyouawake.app/)).
- **Caffeinated** by Yugen GmbH added an "Option to keep your system awake with the lid closed" in 3.2.0 on September 11, 2026, and supports Family Sharing ([App Store](https://apps.apple.com/us/app/caffeinated-anti-sleep-app/id1362171212?mt=12)).
- **lidawake** by zaYco: 14-day trial, Apple silicon, macOS 13 or later ([site](https://zayco.it/lidawake)).
- **Lidless** by Nghia Luong sets `SleepDisabled` through a root helper ([README](https://github.com/nghialuong/Lidless)).
- **Hold My Lid** by Shobhit Bhosure says it holds `PreventUserIdleSystemSleep` and "works without an external display or Apple's closed-display mode", on Apple silicon and Intel ([site](https://holdmylid.app)). 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".
- **Agents Never Sleep** says "Agents keep running while you're away, and with the lid closed"; 14-day money-back guarantee ([site](https://agentsneversleep.app)).

## Which ones have a watchdog or a thermal cutoff?

As of October 2026, lidawake and Lidless describe both and Keep Mac Awake has both; neither is unique to one app.

- **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, which Keep Mac Awake does not.
- **Lidless:** "If the app stops checking in (>90s), the helper restores sleep." It pauses when hot and has a charging-only option.
- **Keep Mac Awake:** a separate watchdog restores normal sleep if anything stops or hangs. Its thermal cutoff applies only on battery; lidawake and Lidless describe heat limits without that restriction.

## Which ones can your agent switch on and off?

There are two approaches as of October 2026: apps that detect agent work on their own, and commands the agent runs itself.

- **Detection.** Hold My Lid reads lifecycle hooks from Claude Code, Codex and OpenCode, watches processes for Cursor and others, and notifies you when agents finish. lidawake's "Keep awake until it goes quiet" mode turns off after 30 minutes without activity and "notices Claude Code working in a terminal". Automatic, but awake only while the app sees work.
- **Commands.** `caffeinate -i <command>` keeps idle sleep away while a command runs, lid open. Amphetamine and Caffeinated accept AppleScript. Keep Mac Awake has no detection, by design; an agent runs:

```sh
keepmacawake start --hours 8 --json   # before the long task
keepmacawake status --json            # phase and time left
keepmacawake stop --json              # when the task is done
```

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](/blog/keep-claude-code-running-lid-closed).

## How do you choose a keep-awake app for AI agents?

Start from where the Mac will be: open on a desk, or closed with nobody watching. With the apps as of October 2026:

- **Lid open, you nearby:** `caffeinate` or KeepingYouAwake, free.
- **Free and open source, lid closed, with a watchdog:** Lidless.
- **Awake only while agents work:** Hold My Lid or lidawake.
- **Several Macs:** Amphetamine is free everywhere; Hold My Lid covers 3 Macs, lidawake $29 for three, Caffeinated has Family Sharing. Keep Mac Awake is licensed per Mac.
- **Intel Mac or older macOS:** Amphetamine or Hold My Lid. Keep Mac Awake needs Apple silicon and macOS 26 or later.

If you want a free, open-source closed-lid app with a watchdog, Lidless fits; if you want the app to follow your agents' activity, look at Hold My Lid or lidawake; if you want sessions that you or your agent start and stop with a command, on AC power by default with a watchdog that restores normal sleep, Keep Mac Awake is built for that.

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

### How do I keep my Mac awake for Claude Code with the lid closed?

Use a tool that overrides lid sleep, such as lidawake, Lidless (as of October 2026) or Keep Mac Awake, or run `sudo pmset disablesleep 1` by hand and `sudo pmset disablesleep 0` afterwards. `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".

### What is a free alternative to Agents Never Sleep, Hold My Lid or lidawake?

As of October 2026, Lidless (MIT, with a watchdog) and Amphetamine (with Power Protect on Apple silicon) are free. Keep Mac Awake is free for 3 days, then 9 USD once per Mac, with explicit sessions, AC power by default, a watchdog and a JSON command.

### 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](https://support.apple.com/guide/mac-help/put-your-mac-to-sleep-or-wake-it-mh10330/mac)
- [Apple developer docs: kIOPMAssertionTypePreventUserIdleSystemSleep](https://developer.apple.com/documentation/iokit/kiopmassertiontypepreventuseridlesystemsleep)
- The `caffeinate` man page on macOS (`man caffeinate`)
- [Amphetamine on the Mac App Store](https://apps.apple.com/us/app/amphetamine/id937984704?mt=12)
- [KeepingYouAwake README](https://github.com/newmarcel/KeepingYouAwake) and [site](https://keepingyouawake.app/)
- [Caffeinated on the Mac App Store](https://apps.apple.com/us/app/caffeinated-anti-sleep-app/id1362171212?mt=12)
- [lidawake](https://zayco.it/lidawake)
- [Lidless README](https://github.com/nghialuong/Lidless)
- [Hold My Lid](https://holdmylid.app)
- [Agents Never Sleep](https://agentsneversleep.app)
- [Claude Code docs: Desktop scheduled tasks](https://code.claude.com/docs/en/desktop-scheduled-tasks)
- [Keep Mac Awake: guide for AI agents](https://keepmacawake.com/agents.md)
