# Guides: keep a Mac awake with the lid closed

Guides for running AI agents and long jobs on a MacBook with the lid closed, steering them from your phone, and choosing a keep-awake tool.

- [How to prevent a MacBook from sleeping when the lid is closed](https://keepmacawake.com/blog/prevent-macbook-sleep-lid-closed.md): A MacBook sleeps when the lid closes unless closed-display mode or the SleepDisabled setting is on. Every method compared, and what to use.
- [Keep-awake apps for AI agents on a Mac, compared](https://keepmacawake.com/blog/best-keep-awake-apps-for-ai-agents.md): 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.
- [Steer your coding agents from your phone while your Mac stays closed](https://keepmacawake.com/blog/steer-ai-agents-from-your-phone.md): Claude Code, Codex and Cursor can be steered from a phone, but each needs your Mac awake and online. How to keep it working with the lid closed.
- [An Amphetamine alternative for running with the lid closed](https://keepmacawake.com/blog/amphetamine-alternative-lid-closed.md): Amphetamine is free and keeps a closed MacBook awake with Closed-Display Mode and Power Protect. When it fits, and when Keep Mac Awake fits better.
- [How to keep Claude Code running with your MacBook lid closed](https://keepmacawake.com/blog/keep-claude-code-running-lid-closed.md): Closing a MacBook's lid puts it to sleep, and Claude Code stops with it. Keep it working with an external display or a Keep Mac Awake session.
- [MacBook still sleeps with the lid closed? How to fix it](https://keepmacawake.com/blog/mac-sleeps-with-lid-closed-not-working.md): Find the sleep reason with pmset -g log, then fix it: caffeinate alone, a lost display or charger, pmset without sudo, a reset setting, battery or heat.
- [Clamshell mode without an external monitor on a MacBook](https://keepmacawake.com/blog/clamshell-mode-without-external-monitor.md): Apple's closed-display mode needs a display, keyboard, mouse and power. How to keep a MacBook awake with the lid closed without them, and the trade-offs.
- [Claude Code Remote Control with the lid closed](https://keepmacawake.com/blog/claude-code-remote-control-lid-closed.md): Remote Control goes offline when your Mac sleeps, and closing the lid sleeps it. Keep the Mac awake with the lid closed to stay reachable.
- [Use Codex from your phone with the MacBook lid closed](https://keepmacawake.com/blog/codex-remote-from-phone-lid-closed.md): Codex remote access needs an awake Mac, and closing the lid puts a MacBook to sleep. Use an external display, or Keep Mac Awake with no display.
- [Why caffeinate does not keep your MacBook awake with the lid closed](https://keepmacawake.com/blog/caffeinate-lid-closed.md): caffeinate only holds power assertions, and a MacBook with no external display still sleeps when the lid closes. What works from Terminal instead.
- [Claude Code Remote Control vs Dispatch: which one keeps working](https://keepmacawake.com/blog/claude-code-dispatch-vs-remote-control.md): Remote Control drives a claude session on your Mac, Dispatch hands a task to the Claude desktop app. Both stop when the Mac sleeps; cloud sessions don't.
- [sudo pmset disablesleep 1: what it does and how to undo it](https://keepmacawake.com/blog/pmset-disablesleep.md): It turns on SleepDisabled: no sleep at all, lid closed or not, even after a restart, until sudo pmset disablesleep 0. How to check it and undo it.
- [Cursor remote control with the MacBook lid closed](https://keepmacawake.com/blog/cursor-remote-control-lid-closed.md): Cursor remote control runs agents on your Mac, so it must stay awake and online, and closing the lid sleeps it. How to keep it working with the lid closed.
- [How to keep a Mac awake without installing an app](https://keepmacawake.com/blog/keep-mac-awake-without-an-app.md): macOS has three built-in ways: System Settings, caffeinate and pmset. Exact menu paths, Terminal recipes for downloads and timers, and their limits.
- [Is a closed MacBook locked while it keeps working?](https://keepmacawake.com/blog/closed-macbook-locked-and-secure.md): Yes, if Lock Screen asks for a password when the display turns off. Agents keep running behind the lock. What the lock, FileVault and Find My cover.
- [Run AI coding agents overnight on a MacBook](https://keepmacawake.com/blog/run-ai-agents-overnight-macbook.md): An overnight agent run needs an awake Mac, power, network and the right permissions. A MacBook can do it lid closed with a timed Keep Mac Awake session.
- [Is it safe to run a MacBook with the lid closed?](https://keepmacawake.com/blog/macbook-lid-closed-heat-and-battery.md): Yes, with airflow: Apple supports closed-lid use. The real risks are bags, soft surfaces, hot rooms and a draining battery. Rules for unattended runs.
- [SSH into a closed MacBook with Tailscale and tmux](https://keepmacawake.com/blog/ssh-into-closed-macbook.md): A closed MacBook sleeps and stops answering SSH. Use Remote Login, Tailscale and tmux, and keep the Mac awake with a Keep Mac Awake session.
- [Run OpenClaw on a MacBook with the lid closed](https://keepmacawake.com/blog/openclaw-macbook-lid-closed.md): OpenClaw answers only while its Gateway runs, and a closed MacBook sleeps. Keep it awake with a display, pmset or Keep Mac Awake, or use an always-on host.
- [Power Nap and Wake for network access do not keep agents running](https://keepmacawake.com/blog/power-nap-wake-for-network-access.md): Power Nap syncs Mail, Calendar and iCloud while a Mac sleeps; Wake for network access serves shared resources. Neither keeps an AI agent working.

Keep Mac Awake: https://keepmacawake.com/ · For AI agents: https://keepmacawake.com/llms.txt
