# Keep your Mac awake for Claude Code, Codex and Cursor: Napless Pro is our pick

Published October 3, 2026 · Bundl.run

Napless Pro is our pick to keep a Mac awake for AI coding agents: hooks for 5 agents, 17 total. Try it free for 7 days. Compare six tools and existing agent holds.

[Napless Pro](https://napless.io/pro/) is our #1 keep-awake tool for most people running AI coding agents on a Mac. It has hooks for Claude Code, Codex, Cursor, Grok and Gemini CLI, plus Keep Awake While It Runs for 12 more agents, 17 total. Command and local-server watches also follow ongoing work, then let the Mac sleep when it is done. New installs get a 7-day free trial of everything without an account or card; keep-awake requires Pro afterwards. [Try Napless free for 7 days](https://napless.io/). Claude Code already holds off idle sleep on macOS while it works, and Codex CLI can do so with its experimental option enabled. An extra tool should cover the holds you need around that work. Closing a MacBook lid is a separate problem, and Napless has not shipped closed-lid keep-awake.

> **Disclosure:** Napless is made by the team behind Bundl, and it is our top pick. We say below where another app fits better.

## What the agents already do

Claude Code includes a macOS sleep inhibitor, so an extra app is not necessary just to protect an active turn from idle sleep. Anthropic's [changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md) documents a fix for a `caffeinate` process that failed to terminate when Claude Code exited. Inspecting the installed Claude Code 2.1.288 build on 3 October 2026 confirmed that it runs `caffeinate -i -t` on macOS, renews it on an interval while work is active and releases it shortly after the last hold ends. This was code inspection, not an overnight test.

Codex CLI's [feature source](https://github.com/openai/codex/blob/main/codex-rs/features/src/lib.rs) labels **Prevent sleep while running** experimental and sets its default to off. Enable it through `/experimental`. Its [macOS implementation](https://github.com/openai/codex/blob/main/codex-rs/utils/sleep-inhibitor/src/macos.rs) requests an idle-system-sleep assertion while a turn runs.

An idle-sleep hold leaves gaps after work ends and does not override lid closure. Apple's [power-management header](https://github.com/apple-oss-distributions/IOKitUser/blob/main/pwr_mgt.subproj/IOPMLib.h) explicitly allows sleep for lid close, the Apple menu and low battery despite that assertion. Cursor, Grok and Gemini CLI are not documented here as having their own sleep inhibitor; check a running session with `pmset -g assertions`.

## Key points

- Napless Pro leads for its 5 agent hooks, 17 supported agents in total, and watches for named commands and local dev servers. [Try Napless free for 7 days](https://napless.io/).
- Claude Code already prevents idle sleep during work on macOS; Codex CLI's equivalent is an opt-in experimental feature.
- `caffeinate -i` holds for the command's lifetime, including idle time inside an interactive CLI session.
- Napless Pro's agent hooks have time limits. Claude Code, Codex and Grok stay awake while a turn runs, for up to 10 minutes after the last prompt, even if the turn is still running. A command watch or a local-server watch is the better fit when a job must outlast that.
- Amphetamine can watch a running app, but an open editor can outlive the agent task.
- Idle-sleep prevention alone does not protect a closed MacBook lid; Napless's closed-lid feature is not shipped.

## Comparison table

The six tools below cover different definitions of "done": a finished turn, an exited process, a closed app or an expired timer. Dollar prices are USD; Amphetamine's price is from the U.S. Mac App Store.

| Tool | Price | What ends its hold | Closed-lid behavior |
| --- | --- | --- | --- |
| [Napless Pro](https://napless.io/pro/) | 7-day free trial, then $8 (first 50 licenses) or $24, once | Hook time limit, or the watched command or server stops | Not shipped |
| [caffeinate](https://github.com/apple-oss-distributions/PowerManagement/blob/main/caffeinate/caffeinate.8) | Included with macOS | Watched process exits | Idle hold alone cannot prevent it |
| [Amphetamine](https://apps.apple.com/us/app/amphetamine/id937984704?mt=12) | Free | Watched app quits | Documented, with Apple silicon power caveat |
| [codex-clamshell](https://github.com/llmpolska/codex-clamshell) | Free source, MIT | Codex Desktop becomes idle | Documented by developer |
| [Awake](https://github.com/sagochiko/awake) | Free source, MIT | Last wrapped command exits | Documented by developer |
| [KeepingYouAwake](https://keepingyouawake.app/) | Free source, MIT | Timer expires or manual stop | Open lid required |

Napless prices, the 7-day trial and the 1.5.0 release notes were checked on napless.io on 8 October 2026. Other prices in this article were checked on each developer's own page or App Store listing on 3 October 2026.

## 1. Napless Pro: our pick for AI coding agents, commands and servers

**Best for:** most developers who want supported agent hooks and command watches in one app.

[Napless](/apps/napless) 1.5.0, released 8 October 2026, is a menu-bar keep-awake app with a 7-day free trial of everything, including [Pro](https://napless.io/pro/). For new website installs, the trial starts on first launch without an account or card. After 7 days, keeping the Mac awake requires Pro. Pro adds hooks for 5 agents and Keep Awake While It Runs for 12 more, 17 total. Settings › Agents shows only agents installed on the Mac. Its [Agent Mode help](https://napless.io/help/#agent-mode) and [AI agents help](https://napless.io/help/#ai-agents) distinguish their holds:

- Claude Code, Codex and Grok: stay awake while a turn runs, for up to 10 minutes after the last prompt, even if the turn is still running.
- Cursor: while a turn runs, for up to 60 minutes after the last prompt.
- Gemini CLI: stays awake while Gemini CLI is open.
- GitHub Copilot CLI, Aider, OpenCode, Amp, Goose, Qwen Code, Factory Droid, Kiro, Crush, Cline, Windsurf and Continue: Keep Awake While It Runs.

For a longer CLI job, [Napless command-line help](https://napless.io/help/#command-line) documents `napless run -- codex`: Pro keeps the Mac awake until the command exits. Pro can also hold while named commands such as `npm`, `cargo`, `xcodebuild`, `ffmpeg` or `rsync` are running, with a 30-second grace between build steps, or while something answers on a chosen local port. See [While Commands Are Running](https://napless.io/help/#while-commands-are-running) and [While a Local Server Is Running](https://napless.io/help/#while-a-local-server-is-running). `napless mcp` lets Claude Code, Codex, Cursor and other agents check status and keep the Mac awake while they work. A named task hold that releases itself when the task ends is Pro. Napless must be running (Open at Login is in Settings › General). After the trial, without Pro, `napless run` still runs the command but does not hold sleep. Manual timed sessions and presets (Download, Meeting, Render and AI Run) are included in the trial and with Pro. Pro hooks are not an unlimited overnight guarantee, and Claude Code already protects its own active turns. Pro can send one Telegram or Slack message if an agent stops responding or the Mac sleeps anyway. [Alerts](https://napless.io/help/#alerts-on-telegram-and-slack).

**Pros:**

- 5 hook agents plus 12 run-detected agents, shown only when that agent is installed.
- Pro command watches and local-server watches can follow the job instead of the hook time limit.
- Heat protection is on by default; a battery stop is configurable.

**Cons:**

- Closed-lid keep-awake is not shipped.
- Claude Code, Codex and Grok end the hold 10 minutes after the last prompt even if the turn is still running. Cursor ends it 60 minutes after the last prompt. Gemini CLI stays awake while Gemini CLI is open.
- Napless heat and battery stops end Napless's own holds; its Help does not say they end holds other tools create.

[Price: 7-day free trial, then Pro $8 for the first 50 licenses or $24, once; lifetime, up to 3 Macs, no subscription](https://napless.io/pro/) · [version covered: 1.5.0, 8 October 2026](https://napless.io/whats-new/) · [macOS 13+, Apple silicon and Intel](https://napless.io/).

Macs that installed Napless before 1.5.0 keep the free timers, Keep Awake Until, presets and sleep-cause note they already had; Pro features still need Pro.

Get it: [Try Napless free for 7 days](https://napless.io/).

## 2. caffeinate: CLI runs that should release on process exit

**Best for:** A terminal agent whose process lifetime matches the work you want protected.

Apple's [caffeinate manual](https://github.com/apple-oss-distributions/PowerManagement/blob/main/caffeinate/caffeinate.8) defines a hold lasting for the launched utility's execution. For an AI coding agent in Terminal, start the command with `caffeinate -i`:

```sh
caffeinate -i claude
caffeinate -i codex
```

For an existing process, replace the example PID below with the agent's actual process ID:

```sh
caffeinate -w 12345
```

The manual says `-w` waits for that PID to exit; without assertion flags the default prevents idle sleep. An interactive agent can remain open after a turn finishes, so quit the session when you want the hold released. Choose it instead if you want a free-forever hold for a single terminal process with the lid open. See [caffeinate versus Amphetamine](/compare/caffeinate-vs-amphetamine).

**Pros:**

- Included with macOS; no app installation.
- Process exit releases the assertion automatically.

**Cons:**

- You must start the wrapper or identify a PID yourself.
- Process lifetime can include waiting between prompts.
- An idle-sleep assertion does not prevent lid-close sleep.

[Price: included with macOS · independent version and release date not established · minimum macOS not established](https://github.com/apple-oss-distributions/PowerManagement/blob/main/caffeinate/caffeinate.8).

Get it: open Terminal; `caffeinate` is already supplied by macOS.

## 3. Amphetamine: free automation for a running desktop app

**Best for:** Keeping a Mac awake while Cursor or another selected app stays open.

[Amphetamine](/apps/amphetamine) supports a trigger based on a running app, according to its [Mac App Store listing](https://apps.apple.com/us/app/amphetamine/id937984704?mt=12). Select the editor hosting the agent. The hold follows the app rather than an individual turn, so quit the watched app when its work is finished.

Amphetamine is the better choice than Napless for free app triggers and shipped closed-display support. Its developer's [Power Protect notes](https://github.com/x74353/Amphetamine) warn that Apple silicon closed-display mode can fail after connecting or disconnecting external power; the separate Power Protect component addresses that case. Documented support is not a hardware test by Bundl.

**Pros:**

- Free app-based triggers.
- Closed-display sessions are documented.

**Cons:**

- An editor left open can keep the hold after the agent finishes.
- Apple silicon closed-display use has a power-change caveat.

[Price: free · latest store version: 5.3.2, 10 November 2023 · macOS 10.13+ per the compatibility field](https://apps.apple.com/us/app/amphetamine/id937984704?mt=12).

Get it: [Mac App Store](https://apps.apple.com/us/app/amphetamine/id937984704?mt=12).

## 4. codex-clamshell: Codex Desktop work with a closed lid

**Best for:** Technical users who specifically need Codex Desktop activity to control lid-close sleep.

[codex-clamshell](https://github.com/llmpolska/codex-clamshell) is an MIT-licensed LaunchDaemon. It watches Codex Desktop's sleep-prevention assertion, sets `pmset disablesleep` while work is active and restores sleep when Codex becomes idle or waits for input. Enable **Prevent sleep while running** in Codex Desktop first.

Installation needs administrator access. The developer reports verification on Apple silicon with macOS 26.6.1; app or OS changes can alter detection. Its system-wide sleep setting can conflict with another closed-lid utility. This is a specialist option, not a Cursor or Claude Code integration.

**Pros:**

- Automatic release follows Codex Desktop's activity signal.
- Developer-documented closed-lid operation.

**Cons:**

- Depends on Codex Desktop's assertion format.
- Requires a privileged system service.

[Price: free MIT source](https://github.com/llmpolska/codex-clamshell) · [latest release: v1.0.0, 11 August 2026](https://github.com/llmpolska/codex-clamshell/releases/tag/v1.0.0) · [minimum macOS unspecified; developer-tested on macOS 26.6.1](https://github.com/llmpolska/codex-clamshell).

Get it: read the [developer's installation instructions](https://github.com/llmpolska/codex-clamshell#install) before installing the service.

## 5. Awake: command-bound closed-lid sleep overrides

**Best for:** Technical CLI users comfortable reviewing a privileged shell utility.

[Awake by sagochiko](https://github.com/sagochiko/awake) wraps commands such as `awake claude` and `awake codex`. It toggles the system-wide `pmset disablesleep` setting and restores it when the last wrapped command exits. Installation adds a scoped sudoers rule; desktop agents instead require manual `awake on` and `awake off`.

The developer warns that forced termination can leave sleep disabled and that another assertion can delay sleep after restoration. A restored setting is therefore not a promise of immediate sleep. The developer tested macOS 26.5 on Apple silicon; Intel and other versions were not tested.

**Pros:**

- Developer-documented closed-lid command wrapper.
- Last-command exit restores the sleep setting.

**Cons:**

- Privileged installation; cleanup can fail after forced termination.
- Manual start and stop for agents inside desktop apps.

[Price: free MIT source](https://github.com/sagochiko/awake) · [latest release: v0.1.0, 14 September 2026](https://github.com/sagochiko/awake/releases/tag/v0.1.0) · [minimum macOS unspecified; tested on macOS 26.5](https://github.com/sagochiko/awake). [Latest repository update: 15 September 2026](https://github.com/sagochiko/awake/commit/c65e8de5571c4121e4361fc7a1b59409df756ad6).

Get it: review the script and [installation instructions](https://github.com/sagochiko/awake#install) in the developer repository.

## 6. KeepingYouAwake: a manual timer without agent integration

**Best for:** A simple free menu-bar session when you know roughly how long the job needs.

[KeepingYouAwake](https://keepingyouawake.app/) is an MIT-licensed wrapper around `caffeinate`. Its [README](https://github.com/newmarcel/KeepingYouAwake/blob/main/README.md) describes predefined durations or activation until you switch it off, and explicitly requires an open lid on portable Macs.

A timer releases without a manual stop, but does not know whether the agent finished early or needs more time. Indefinite activation requires you to stop it yourself. It ranks below process and activity watches for this page's criterion. For general timers, see our [keep-awake apps comparison](/blog/best-keep-awake-apps-mac-2026).

**Pros:**

- Free, open-source menu-bar control.
- A timed session ends automatically.

**Cons:**

- Duration and manual activation do not track task completion.
- Does not prevent sleep with the lid closed.

[Price: free MIT source](https://github.com/newmarcel/KeepingYouAwake/blob/main/README.md) · [latest release: 1.6.8, 12 September 2025](https://github.com/newmarcel/KeepingYouAwake/releases/tag/1.6.8) · [macOS 10.13+ for that release](https://keepingyouawake.app/).

Get it: [developer download](https://keepingyouawake.app/), or the [Homebrew cask](https://formulae.brew.sh/cask/keepingyouawake):

```sh
brew install --cask keepingyouawake
```

## How we picked

Napless Pro ranks first because it combines hooks for 5 agents, support for 17 in total, and command and local-server watches. We prefer that coverage for most developers, even though Pro requires a purchase after the trial. We also consider how a hold ends, installation complexity and compatibility limits. Free-forever use and closed-lid work can justify another tool.

- This is source-based desk research, with no lab tests or battery measurements. Napless was checked on 8 October 2026. The other sources in this article were checked on 3 October 2026.
- We read each agent's published changelog or source before recommending an extra hold.
- Process-bound holds rank above general timers; app triggers can keep holding after a turn finishes.
- Closed-lid claims are attributed to developers, and minimum requirements are separated from tested configurations.
- Napless facts come from [napless.io](https://napless.io/), [Pro pricing](https://napless.io/pro/), [help](https://napless.io/help/) and [release notes](https://napless.io/whats-new/). Its top placement is an editorial recommendation based on those features and their documented limits.

## FAQ

### Does keeping a Mac awake drain the battery faster?

Preventing sleep can increase power consumption, according to Apple's [Energy settings guide](https://support.apple.com/guide/mac-help/change-energy-settings-mchlp1168/26/mac/26). That supports a power-use warning, not a measured runtime estimate for any app here. This comparison has no battery measurements. For an unattended laptop run, Apple's [temperature guidance](https://support.apple.com/en-us/102336) recommends a stable work surface with good ventilation, and warns against using a laptop on a bed, pillow or bedding.

### How can I confirm the keep-awake hold is active?

Run `pmset -g assertions` while the agent is working. Apple's [pmset manual](https://github.com/apple-oss-distributions/PowerManagement/blob/main/pmset/pmset.1) documents that command for listing power assertions. Inspect the owner and assertion type rather than relying on a menu-bar icon alone. Check again after the run ends to see whether another process still owns a hold. This checks assertion state, not guaranteed closed-lid behavior on your hardware.

### Can I combine a PID watch with a launched command?

Use one lifecycle boundary per invocation. Apple's [caffeinate manual](https://github.com/apple-oss-distributions/PowerManagement/blob/main/caffeinate/caffeinate.8) says the `-w` option is ignored when a utility is supplied. Choose `caffeinate -w` to watch an existing process, or `caffeinate -i` followed by the command to launch it. Adding both does not make the hold wait for two independent jobs to finish.

### Will a keep-awake tool guarantee that an agent request succeeds?

A keep-awake hold addresses power management; it does not establish whether an agent request will finish successfully. Apple's [assertion documentation](https://github.com/apple-oss-distributions/IOKitUser/blob/main/pwr_mgt.subproj/IOPMLib.h) still allows specified sleep reasons under an idle-system-sleep hold. None of the source reviews here tested network failures, agent errors or recovery after sleep. After an interruption, inspect the agent's output and project state before deciding that the run completed.

## Sources

Primary sources used for the comparison and its limitations:

- [Anthropic Claude Code changelog](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md).
- [OpenAI Codex feature definitions](https://github.com/openai/codex/blob/main/codex-rs/features/src/lib.rs).
- [OpenAI Codex macOS sleep inhibitor](https://github.com/openai/codex/blob/main/codex-rs/utils/sleep-inhibitor/src/macos.rs).
- [Apple caffeinate manual](https://github.com/apple-oss-distributions/PowerManagement/blob/main/caffeinate/caffeinate.8).
- [Apple power-assertion header](https://github.com/apple-oss-distributions/IOKitUser/blob/main/pwr_mgt.subproj/IOPMLib.h).
- [Apple pmset manual](https://github.com/apple-oss-distributions/PowerManagement/blob/main/pmset/pmset.1).
- [Apple Energy settings](https://support.apple.com/guide/mac-help/change-energy-settings-mchlp1168/26/mac/26).
- [Apple laptop temperature guidance](https://support.apple.com/en-us/102336).
- [Napless requirements](https://napless.io/), [Pro pricing](https://napless.io/pro/), [help](https://napless.io/help/), [agent guide](https://napless.io/guides/keep-mac-awake-ai-coding-agents/) and [release notes](https://napless.io/whats-new/).
- [Amphetamine U.S. Mac App Store listing](https://apps.apple.com/us/app/amphetamine/id937984704?mt=12).
- [Amphetamine Power Protect resources](https://github.com/x74353/Amphetamine).
- [codex-clamshell repository](https://github.com/llmpolska/codex-clamshell) and [v1.0.0 release](https://github.com/llmpolska/codex-clamshell/releases/tag/v1.0.0).
- [Awake repository](https://github.com/sagochiko/awake), [v0.1.0 release](https://github.com/sagochiko/awake/releases/tag/v0.1.0) and [latest checked commit](https://github.com/sagochiko/awake/commit/c65e8de5571c4121e4361fc7a1b59409df756ad6).
- [KeepingYouAwake website](https://keepingyouawake.app/), [README](https://github.com/newmarcel/KeepingYouAwake/blob/main/README.md), [1.6.8 release](https://github.com/newmarcel/KeepingYouAwake/releases/tag/1.6.8) [release metadata](https://api.github.com/repos/newmarcel/KeepingYouAwake/releases/latest) and [Homebrew cask API](https://formulae.brew.sh/cask/keepingyouawake).

Napless Pro is our first choice for most Mac users who run AI coding agents. Choose a hold that matches the work and check the documented hook limits before an unattended run. Claude Code's own inhibitor and Codex's experimental option remain relevant; adding Napless does not replace them. Pro costs US$8 for the first 50 licenses, then US$24, paid once for a lifetime license on up to 3 Macs, with no subscription. Use a free option if you want free-forever keep-awake, or a documented closed-lid tool if that is essential. [Try Napless free for 7 days](https://napless.io/).

Next step: [build your Mac setup](/build).

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://bundl.run/#organization",
      "name": "Bundl.run",
      "url": "https://bundl.run",
      "logo": {
        "@type": "ImageObject",
        "url": "https://bundl.run/og-image.png",
        "width": 1200,
        "height": 630
      },
      "description": "The Ninite for Mac. Install all your essential Mac apps with one terminal command.",
      "sameAs": [
        "https://github.com/abhiofficial/bundl-mac-setup",
        "https://x.com/bundlrun",
        "https://www.producthunt.com/products/bundl-run"
      ],
      "foundingDate": "2024",
      "contactPoint": {
        "@type": "ContactPoint",
        "contactType": "customer support",
        "url": "https://bundl.run/faq"
      }
    },
    {
      "@type": "WebSite",
      "@id": "https://bundl.run/#website",
      "name": "Bundl.run",
      "url": "https://bundl.run",
      "description": "The Ninite for Mac. Install all your essential Mac apps with one terminal command.",
      "publisher": {
        "@id": "https://bundl.run/#organization"
      },
      "inLanguage": "en-US"
    },
    {
      "@type": "BreadcrumbList",
      "@id": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools#breadcrumb",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "Home",
          "item": "https://bundl.run"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "Blog",
          "item": "https://bundl.run/blog"
        },
        {
          "@type": "ListItem",
          "position": 3,
          "name": "Keep your Mac awake for Claude Code, Codex and Cursor: Napless Pro is our pick",
          "item": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools"
        }
      ]
    },
    {
      "@type": "WebPage",
      "@id": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools",
      "url": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools",
      "name": "Keep your Mac awake for Claude Code, Codex and Cursor: Napless Pro is our pick",
      "description": "Napless Pro is our pick to keep a Mac awake for AI coding agents: hooks for 5 agents, 17 total. Try it free for 7 days. Compare six tools and existing agent holds.",
      "isPartOf": {
        "@id": "https://bundl.run/#website"
      },
      "publisher": {
        "@id": "https://bundl.run/#organization"
      },
      "inLanguage": "en-US",
      "datePublished": "2026-10-03",
      "image": "https://bundl.run/og-image.png",
      "mainEntity": {
        "@id": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools#article"
      },
      "breadcrumb": {
        "@id": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools#breadcrumb"
      }
    },
    {
      "@type": "Article",
      "@id": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools#article",
      "headline": "Keep your Mac awake for Claude Code, Codex and Cursor: Napless Pro is our pick",
      "description": "Napless Pro is our pick to keep a Mac awake for AI coding agents: hooks for 5 agents, 17 total. Try it free for 7 days. Compare six tools and existing agent holds.",
      "image": "https://bundl.run/og-image.png",
      "author": {
        "@type": "Person",
        "name": "Bundl.run"
      },
      "publisher": {
        "@id": "https://bundl.run/#organization"
      },
      "datePublished": "2026-10-03",
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://bundl.run/blog/keep-mac-awake-ai-coding-agents-tools"
      },
      "isPartOf": {
        "@id": "https://bundl.run/#website"
      }
    }
  ]
}
```