macOS treats idle sleep and lid-close sleep as two different problems, which is why the usual caffeinate trick doesn’t survive a closed lid. Clamshell handles the second one on Apple Silicon with no external display and no admin access: arm it from the menu bar, a shortcut, or by holding Option as you close. A battery cutoff stops it flattening the machine. $9.99, once.
Featured in: The week's catch — August 10–16