Guides
Practical answers about MacBooks, closed lids, heat and long AI agent runs. The free methods first, with their limits; Hibernot where it helps.
- How to keep a MacBook awake with the lid closed, on batteryWhy a MacBook sleeps when you close the lid even with caffeinate or Energy settings, and the four real ways around it, free and paid, with their trade-offs.
- Claude Code stops when you close your MacBook? Here's whyClosing the lid puts the Mac to sleep, which cuts Claude Code's connection mid-task. What actually happens, and five ways to keep a run going with the lid closed.
- Why caffeinate doesn't work with the lid closedcaffeinate -i, -s, -d, -t and -w explained, why none of them stops a MacBook from sleeping when you close the lid on battery, and what to use instead.
- Is it safe to put a running MacBook in a backpack? 21 runs, measuredBattery temperatures from 21 closed-lid runs on a MacBook Air, Apple's temperature guidance, why light and heavy work differ, and simple rules before you pack a running Mac.
- pmset disablesleep: what it does, the risks, and how to undo itThe undocumented sudo pmset -a disablesleep 1 keeps a MacBook awake with the lid closed. How to check it, undo it, make it end by itself, and what to do if sleep stays greyed out.
- Run Codex or Claude Code overnight on a MacBook: a checklistEverything that stops a long AI coding agent run on a Mac, sleep, Wi-Fi, permission prompts, battery and heat, and a short checklist to start one before bed or before a train.
- Did my Mac sleep with the lid closed? How to check with pmset -g logRead macOS's own sleep and wake history in Terminal to find out when and why your MacBook slept, see what is keeping it awake right now, and check that sleep is back to normal.