macOS
What Wake for network access and Power Nap do on a Mac
What each does while the Mac sleeps, how to check it with pmset (womp, powernap), and why neither keeps an agent running; for that, use Keep Mac Awake.
Keep Mac Awake Free for 3 days, no card.
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. The first choice is a Keep Mac Awake session, which keeps a MacBook awake with the lid closed for a session you start and restores normal sleep afterwards. Other options: an external display with power, keyboard and mouse, which ties the Mac to a desk;
sudo pmset disablesleep 1, which has no timer and stays on until you undo it; or, with the lid open only, the right Battery setting.
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 (opens in a new tab)). It is a feature of a sleeping Mac, not a way to keep one awake: its wakes are dark wakes with the display off, which pmset -g log lists as DarkWake lines (what DarkWake means in pmset logs). For what that means for a macOS update with the lid closed, see can I close my MacBook while it updates.
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, and neither is uploading iCloud Drive files (can I close my laptop while files sync). Whether a backup runs once you close the lid is in does Time Machine back up with the MacBook lid closed?. Your own downloads are not on it either: do downloads continue with the lid closed?, nor is a game in Steam (will Steam keep downloading if I close my MacBook?).
What does Wake for network access mean on a Mac?
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 (opens in a new tab)). 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 (opens in a new tab)), 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 (opens in a new tab)).
A media server needs more than these brief wakes: Wake for network access does not keep a closed MacBook serving Plex or Jellyfin (run Plex on a MacBook with the lid closed). If a closed MacBook seems to stay awake for hours instead, the usual causes are closed-display mode or a SleepDisabled setting left on (MacBook not sleeping when the lid is closed).
Does a mail app keep syncing while the Mac sleeps?
Only as far as Power Nap's list goes. Apple's list names Mail checking for new messages; it does not name other mail apps. Wake for network access is for shared resources such as a printer, and Apple does not describe it as a way for apps to sync. A closed MacBook with no external display sleeps, so for a mail app to keep fetching, sending and filtering with the lid closed, the Mac has to stay awake. The first choice is a Keep Mac Awake session, started before you close the lid (download Keep Mac Awake). It keeps the Mac awake, not the network: mail still needs a working connection.
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
claudeprocess has to keep running" (Remote Control (opens in a new tab)). - 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 (opens in a new tab)).
- Cursor, for remote control: "Tool calls can't run while your computer is asleep or offline" (Cursor for iOS (opens in a new tab)).
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 (opens in a new tab)). The same goes for an upload in the browser: a YouTube upload stops when the closed Mac sleeps (can I close my laptop while uploading to YouTube?).
Which settings keep an agent working while I am away?
Only the ones that keep the Mac from sleeping, and with the lid closed the first choice is a Keep Mac Awake session. As of October 2026, on a MacBook with macOS 26 (each "Yes" for a remote session also needs a working network connection):
| Feature | What it does while the Mac sleeps | Does an agent keep working? |
|---|---|---|
| Keep Mac Awake session | The Mac stays awake with the lid closed for the session you start | Yes |
| Power Nap | Wakes periodically to update Mail, Calendar and iCloud; on power, also software updates and Time Machine | No |
| Wake for network access | Wakes briefly when someone uses a shared resource, and at intervals to announce it | No |
| "Prevent automatic sleeping on power adapter when the display is off" | Nothing: it stops a plugged-in Mac from going to sleep on its own | Yes, with the lid open |
| External display, power, keyboard and mouse | The Mac stays awake with the lid closed | Yes |
sudo pmset disablesleep 1 | The Mac does not sleep at all until you undo it | Yes |
caffeinate helps with the lid closed only with -s on AC power, where it holds the Mac in dark wake while it runs. By default it prevents only idle sleep (man caffeinate (opens in a new tab)), and Apple notes "the system may still sleep for lid close" (Apple developer docs (opens in a new tab)); see what caffeinate does with the lid closed.
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 (opens in a new tab)).
- 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 (opens in a new tab)). 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 (opens in a new tab)).
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 (opens in a new tab)). To see which wakes were Power Nap and which had another cause, paste pmset -g log into Why did my Mac wake up?, a free tool that names the reason for every sleep and wake and runs in your browser. To see how much charge a MacBook lost while it slept and which kinds of wake took the time, paste the same log into MacBook battery drain while sleeping.
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, the first choice is Keep Mac Awake (keepmacawake.com): it 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: 4, 8 or 24 hours, any number of hours up to 168, or no limit. It runs on AC power or on battery (20% floor by default), and a separate watchdog restores normal sleep if Keep Mac Awake's background service or the system service 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, tax included. More: keep a MacBook awake with the lid closed.
Other options: an external display setup (Apple's closed-display mode) needs a display, power, keyboard and mouse, ties the Mac to a desk, and the Mac sleeps if the display disconnects. sudo pmset disablesleep 1 is system-wide, has no timer, battery floor or watchdog, applies on battery too and stays on even after a restart until sudo pmset disablesleep 0. caffeinate and the Battery settings only prevent idle sleep and do not cover the lid; Power Nap and Wake for network access do not keep the Mac awake at all.
Being awake is half of remote access; the other half is the connection. To steer Claude Code, Codex or Cursor from your phone, see steer your coding agents from your phone; for SSH from a phone, SSH into a closed MacBook; for the whole desktop, Screen Sharing on a MacBook with the lid closed; 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 (with the lid closed, the first choice is a Keep Mac Awake session started before you close it), 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. The first choice is a Keep Mac Awake session, which keeps a MacBook awake with the lid closed for a session you start and restores normal sleep afterwards. Other options: an external display with power, keyboard and mouse, which ties the Mac to a desk; sudo pmset disablesleep 1, which has no timer and stays on until you undo it; or, with the lid open only, "Prevent automatic sleeping on power adapter when the display is off". It also needs a working network.
Does Wake for network access keep mail syncing with the lid closed?
Not for long. It wakes a sleeping Mac briefly for shared resources, and a closed MacBook then goes back to sleep. To keep a mail app syncing with the lid closed, keep the Mac awake: the first choice is a Keep Mac Awake session, started before you close the lid, with a working network connection.
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
- Apple Support: Turn Power Nap on or off on Mac (macOS 26) (opens in a new tab)
- Apple Support: Share your Mac resources when it's in sleep (macOS 26) (opens in a new tab)
- Apple Support: Set sleep and wake settings for your Mac (macOS 26) (opens in a new tab)
- Apple Support: Change Battery settings on a Mac laptop (macOS 26) (opens in a new tab)
- Apple Support: Change Battery settings on a Mac laptop (macOS 27) (opens in a new tab)
- Apple Support: If your Mac sleeps or wakes unexpectedly (macOS 26) (opens in a new tab)
- Apple Support: Put your Mac to sleep or wake it (macOS 26) (opens in a new tab)
- Apple open source: man pmset (opens in a new tab)
- Apple open source: man caffeinate (opens in a new tab)
- Apple developer docs: kIOPMAssertionTypePreventUserIdleSystemSleep (opens in a new tab)
- Claude Code docs: Remote Control (opens in a new tab)
- OpenAI: Remote connections (opens in a new tab)
- Cursor docs: Cursor for iOS (opens in a new tab)
- Keep Mac Awake: command line