---
title: "Use a MacBook with the lid closed: clamshell rules and options · Kilobat Guides"
url: "https://kilobat.app/guides/clamshell-lid-closed-mac"
description: "Learn when a Mac laptop sleeps with the lid closed, how to use it with an external display and accessories, and the safe options for long tasks."
---

Sleep and power

# Keep a Mac laptop working with the lid closed

Closing the lid puts a Mac laptop to sleep. With an external display and accessories connected, you can close the lid and continue to use the Mac.

Applies to: Current macOS versions. Apple lists extra needs for two displays on MacBook Air and MacBook Pro with M3. · Checked: 29 October 2026

## Symptoms

- A download or a long task stops when you close the lid.
- The Mac goes to sleep each time you close the lid.
- `caffeinate` keeps the Mac awake, but closing the lid still puts it to sleep.

## Likely causes

- **The lid puts the Mac to sleep.** Apple lists closing the display as one way to put a Mac laptop to sleep.
- **No external display or accessories.** Apple describes lid-closed use with a connected display and accessories.
- **No power.** For two displays with the lid closed on M3 models, Apple lists power from the display or a power adapter.
- **Assertions do not cover the lid.** The `caffeinate` man page describes idle sleep and system sleep. It does not describe the lid.

## How to check

1. Make sure that an external display is connected and shows the desktop.
2. Make sure that an external keyboard and a mouse or trackpad are connected.
3. Make sure that the Mac gets power from the display or from its power adapter.
4. See which processes hold sleep assertions now.

   ```
   pmset -g assertions
   ```

## How to fix it

1. Connect an external keyboard and a mouse or trackpad.
2. Connect the Mac to power.
3. Connect the external display. Wait until it shows the desktop.
4. Close the lid. Continue to work on the external display.
5. Before you close the lid, remove any camera cover, palm rest or keyboard cover from the Mac.
6. If you do not have a display, keep the lid open while the task runs. Use [caffeinate](https://kilobat.app/guides/caffeinate-keep-mac-awake) to stop idle sleep.
7. Do not put a Mac that is awake into a bag. The Mac can get hot, and the battery can go flat.

## With Kilobat

1. Kilobat can keep a task running with the lid closed and no display. First, open Kilobat Settings › Awake & agents.
2. Turn on Allow running with the lid closed. Approve the helper in System Settings › General › Login Items.
3. Then keep one command running with the lid closed. The hold ends with the command.

   ```
   kilobat awake --lid-closed -- make release
   ```
4. Or hold for a time, 8 hours at most.

   ```
   kilobat awake --lid-closed --for 2h
   ```
5. The helper lets the Mac sleep at your battery floor, 20% by default, or when the Mac gets hot.
6. For AI agents, see [Keep an agent running with the lid closed](https://kilobat.app/guides/recipes/agent-lid-closed).

## Questions

**Does caffeinate work with the lid closed?**

The man page describes idle and system sleep assertions only. Closing the lid still puts the Mac to sleep in usual use.

**Can I use two external displays with the lid closed?**

On MacBook Air and MacBook Pro with M3, Apple describes this setup. It needs an external keyboard and mouse or trackpad, and power.

## Sources

- [Apple Support: Put your Mac to sleep or wake it](https://support.apple.com/guide/mac-help/mh10330/mac)
- [Apple Support: Connect an external display to MacBook Pro](https://support.apple.com/guide/macbook-pro/connect-an-external-display-apd8cdd74f57/mac)
- [Apple Support: Use dual monitors with your MacBook Air and MacBook Pro with M3 chip](https://support.apple.com/en-us/117373)
- [Apple Support: Using a camera cover, palm rest, or keyboard cover on a Mac notebook](https://support.apple.com/en-us/102051)
- caffeinate(8), man page installed with macOS 27.2

Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with `man <name>` in Terminal.

## Related guides

- [Keep a Mac awake from Terminal with caffeinate](https://kilobat.app/guides/caffeinate-keep-mac-awake): The caffeinate command stops a Mac from sleeping while a task runs.
- [Mac sleep stops downloads](https://kilobat.app/guides/mac-sleep-stops-downloads): A Mac that goes to sleep stops most app activity, so a long download can stop or fail.
- [Keep an agent running with the lid closed](https://kilobat.app/guides/recipes/agent-lid-closed): Closing the lid puts a Mac laptop to sleep.
- [Keep your Mac awake until a download finishes](https://kilobat.app/guides/recipes/keep-mac-awake-download): Kilobat keeps the Mac awake while transfers run.
