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.
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 actually 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.