What is clamshell mode?
Close your MacBook lid, keep using it through an external monitor. The built-in screen turns off, the external one stays on. Lots of people use their MacBook this way as a desktop.
Apple supports it but never calls it "clamshell mode." There's no toggle in System Settings. It just works when the right pieces are in place. Figuring out what those pieces are is the annoying part.
What you need for clamshell mode
Three things, all required. An external display that macOS recognizes (has to be on and connected before you close the lid). Power (MacBook must be charging, won't do clamshell on battery). And an external keyboard or mouse over USB or Bluetooth so you can still interact with the machine.
Drop any one of those and closing the lid just puts it to sleep.
Does a MacBook sleep when you close the lid with an external monitor?
Not if it's plugged in. With power, an external display and a keyboard or mouse connected, closing the lid switches the MacBook to the external screen and it keeps running. Unplug the charger or the display and closing the lid sleeps it again.
Want the opposite, a MacBook that sleeps when you shut it at your desk? Choose Apple menu โ Sleep before you close the lid, or disconnect the external display first.
One thing still applies with the lid closed: the idle timers. Leave the keyboard and mouse alone long enough and the external screen turns off, then the system can sleep. That's the part the next section is about.
Using Shake It On in clamshell mode
Clamshell mode keeps the Mac awake, but macOS still has its idle timer running. Walk away from the keyboard long enough and it'll sleep even with the lid closed. Not great when you've got an overnight download or a long render going.
Shake It On generates mouse movement on the external display. macOS sees activity, stays awake. The built-in screen being off doesn't matter.
Handy conditions for this setup: run only when an external display is connected. Schedule overnight tasks. Off on weekends if the MacBook lives at a desk Monday through Friday. Configure once, don't touch it again.
Common clamshell mode problems
Sleeps immediately when you close the lid. Check two things: is the charger plugged in, and does System Settings โ Displays show the external monitor? Both need to be true before you shut it.
Display goes black after a few minutes. That's the idle timer, not a clamshell problem. macOS is putting the display to sleep because nothing's happening. This is exactly what Shake It On fixes.
Bluetooth keyboard or mouse won't wake it. Go to System Settings โ Bluetooth, click the info button next to your device, and check "Allow this device to wake the computer." Not all cheap Bluetooth accessories support wake.
Wakes up then immediately sleeps again. One of the three requirements probably isn't fully met. Double-check power, display, input device.
USB-C dock issues. Some docks don't pass through enough power or don't signal the display properly. Try the charger plugged in directly, not through the dock.
Broke after a macOS update. Apple changes clamshell behavior between versions. Reconnect the display and re-pair your Bluetooth stuff after major updates.
Feels warm with the lid shut. That's expected: a closed MacBook driving a display is awake and working, not sleeping. If it's hot when you didn't mean to keep it awake, why a MacBook gets hot when it's closed walks through finding what's keeping it up.