macOS

Power Nap and Wake for network access do not keep agents running

Power Nap syncs Mail, Calendar and iCloud while a Mac sleeps; Wake for network access serves shared resources. Neither keeps an AI agent working.

Short answer: Power Nap and Wake for network access are things a Mac does while it sleeps. Power Nap wakes it now and then to update Mail, Calendar and iCloud (and, on power, to download software updates and run Time Machine backups); Wake for network access wakes it briefly when someone uses a shared resource such as a printer, and at intervals to announce those resources. Neither keeps Claude Code, the Codex CLI or a Cursor agent working, or a Remote Control or SSH session connected. For that the Mac has to stay awake: lid open with the right Battery setting, or lid closed with an external display, sudo pmset disablesleep 1 or a Keep Mac Awake session.

What does Power Nap do on a Mac?

Power Nap lets a sleeping Mac stay up to date: "When your Mac goes to sleep, Power Nap activates periodically to update information" (Apple Support). It is a feature of a sleeping Mac, not a way to keep one awake.

Apple's macOS 26 guide lists what it does:

  • On battery: checks for new messages in Mail, updates events in Calendar and updates other iCloud events.
  • On a power adapter, it "can also do activities such as downloading software updates and performing Time Machine backups".

"If your Mac supports it, Power Nap is on by default when your Mac is plugged into a power adapter." Running your own apps or commands is not on Apple's list.

What does Wake for network access do?

Wake for network access lets a sleeping Mac wake so other computers can use what it shares, such as "a shared printer or Music playlist" (Apple Support). Apple says that when it is on, your Mac wakes at these times:

  • "When a user at another computer accesses your computer's shared resources."
  • "At regular intervals so that your Mac can notify other computers on the network that its resources are available."

Apple's sleep settings page describes it as letting the Mac "wake briefly so users can access shared services" (Apple Support), and the help page about shared resources says it needs "an Apple wireless device that supports 802.11n" with the latest firmware. In pmset, the same setting is called womp, wake on Ethernet magic packet (man pmset).

Why don't they keep a coding agent running?

Because the Mac is still asleep. Both features cover a short list of system jobs during sleep, and a coding agent is your own long-running process that needs the Mac awake for the whole task. The agent makers ask for a Mac that stays awake, as of October 2026:

  • Anthropic, for Claude Code Remote Control: "your computer has to stay on and the claude process has to keep running" (Remote Control).
  • OpenAI, for Codex remote access: "If that computer sleeps, loses network access, or closes the app, remote access stops until it's available again" (remote connections).
  • Cursor, for remote control: "Tool calls can't run while your computer is asleep or offline" (Cursor for iOS).

On a MacBook, the lid is the usual reason the Mac is asleep in the first place: Apple lists closing the display as a way to put a Mac laptop to sleep (Apple Support).

Which settings keep an agent working while I am away?

Only the ones that keep the Mac from sleeping. As of October 2026, on a MacBook with macOS 26 (each "Yes" for a remote session also needs a working network connection):

FeatureWhat it does while the Mac sleepsDoes an agent keep working?
Power NapWakes periodically to update Mail, Calendar and iCloud; on power, also software updates and Time MachineNo
Wake for network accessWakes briefly when someone uses a shared resource, and at intervals to announce itNo
"Prevent automatic sleeping on power adapter when the display is off"Nothing: it stops a plugged-in Mac from going to sleep on its ownYes, with the lid open
External display, power, keyboard and mouseThe Mac stays awake with the lid closedYes
sudo pmset disablesleep 1The Mac does not sleep at all until you undo itYes
Keep Mac Awake sessionThe Mac stays awake with the lid closed for the session you startYes

caffeinate -i is a lid-open option too: it prevents idle sleep (man caffeinate), and Apple notes "the system may still sleep for lid close" (Apple developer docs); see why caffeinate stops at the lid.

Where are Power Nap and Wake for network access on macOS 26?

On a MacBook, both are in Apple menu > System Settings > Battery > Options; on a desktop Mac such as a Mac mini, they are in System Settings > Energy (Apple Support).

  • MacBook: click Options in Battery, then use the pop-up menu next to Enable Power Nap and the one next to Wake for network access. For Wake for network access you choose to wake "always, when plugged into a power adapter, or never" (Battery settings). The same pane has Prevent automatic sleeping on power adapter when the display is off.
  • Desktop Mac: in Energy, turn on Wake for network access or Prevent automatic sleeping when the display is off. Apple notes that Enable Power Nap there "is only available on Intel-based Mac computers".
  • Not every Mac: Apple says "some of the options may not be available, depending on your Mac". As of October 2026, Apple's guide for macOS 27 no longer lists Enable Power Nap among the Battery options (macOS 27 Battery settings).

To read both settings from Terminal:

pmset -g | grep -E "powernap|womp"

powernap 1 means Power Nap is on and womp 1 means Wake for network access is on; 0 means off. Turning them on does not keep an agent working, and you do not need to turn them off for one. If your Mac wakes when you do not expect it, Apple suggests setting Wake for network access to Never (Apple Support).

What to use

To keep a coding agent working, or a Remote Control or SSH session connected, with the MacBook lid closed and no external display, Keep Mac Awake (keepmacawake.com) keeps a MacBook with Apple silicon on macOS 26 or later awake for a session you start, for example with keepmacawake start --hours 8, and restores normal sleep afterwards; unlike Wake for network access, it does not wake a Mac that is already asleep, so start the session before you close the lid.

Keep Mac Awake is a menu bar app plus the keepmacawake command, so your agent can start a session with keepmacawake start --hours 8 --json and end it with keepmacawake stop --json. A session lasts as long as you pick: no limit, 1 hour, 8 hours or a custom number of hours up to 168. It runs on AC power by default, and a separate watchdog restores normal sleep if anything stops or hangs. It does not keep Wi-Fi or any network connection alive. It is free for 3 days (sessions up to 8 hours, no card), then 9 USD once per Mac plus tax. More: keep a MacBook awake with the lid closed.

Being awake is half of remote access; the other half is the connection. For SSH from a phone, see SSH into a closed MacBook; for a whole night, run AI coding agents overnight on a MacBook. A closed Mac still makes heat: keep it on a hard surface with airflow, never in a bag or under a pillow.

FAQ

Does Power Nap let apps run while my Mac is asleep?

No. As of macOS 26, Apple lists what Power Nap does: Mail, Calendar and iCloud updates, plus software updates and Time Machine backups on power. Running your own apps, such as Claude Code or the Codex CLI, is not on the list.

Can I SSH into a sleeping Mac with Wake for network access?

Do not count on it. Apple describes Wake for network access as a brief wake for shared resources such as printers and Music playlists, not as a way to keep a Mac awake for a session. Keep the Mac awake before you connect, and run long tasks inside tmux.

Should I turn off Power Nap for Claude Code?

You do not need to. Power Nap only acts while the Mac sleeps, and Claude Code needs the Mac awake. What matters is keeping the Mac from sleeping while the agent works.

How do I keep my Mac awake for remote access?

Keep it on power and stop it from sleeping: with the lid open, turn on "Prevent automatic sleeping on power adapter when the display is off"; with the lid closed, use an external display, sudo pmset disablesleep 1 or a Keep Mac Awake session. It also needs a working network.

Does Keep Mac Awake wake my Mac when I connect?

No. It keeps an awake Mac from sleeping for a session you start, and it does not wake a Mac that is already asleep. Start the session before you close the lid.

Sources