Clamshell Sentinel is a tiny macOS menu bar app for developer laptops: close the lid normally when nothing important is running, but keep the machine awake when an agent or long terminal job is active.
It watches local processes such as Codex, Claude, aider, OpenClaw, Hermes, Cursor Agent, OpenHands, Goose, opencode, SWE-agent, Gemini CLI, Amp, and Docker CLI jobs. The menu bar has one Enabled toggle and one Always Awake on Close override.
One line:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/jonathanpopham/clamshell-sentinel/main/scripts/install.sh)"That installs Clamshell Sentinel.app into ~/Applications, starts the menu bar app at login, and creates:
~/.config/clamshell-sentinel/watchlist.txt~/.config/clamshell-sentinel/config.json
Or build from source:
git clone https://github.com/jonathanpopham/clamshell-sentinel.git
cd clamshell-sentinel
./scripts/install.shVerify:
~/Applications/Clamshell\ Sentinel.app/Contents/MacOS/ClamshellSentinel --scan-oncemacOS has two relevant mechanisms:
pmset disablesleep: when accepted by the OS, this is the setting that can keep a MacBook awake through lid close. Changing it requires admin permission, so macOS may show a password prompt the first time Sentinel needs to enable or disable it.caffeinate -dimsu: a fallback power assertion. It prevents idle/display sleep while Sentinel is active, but it is not a complete lid-close guarantee on every Mac.
Sentinel tries pmset -a disablesleep 1 while a watched process is running or manual mode is enabled. When the process exits, or the app is disabled, it restores pmset -a disablesleep 0 and stops the fallback assertion.
Run a local capability report with:
~/Applications/Clamshell\ Sentinel.app/Contents/MacOS/ClamshellSentinel --diagnoseEdit:
~/.config/clamshell-sentinel/watchlist.txtUse one simple line per thing you want to watch:
my-agent
command: make release
docker compose up
Save the file. Sentinel reloads it automatically within a few seconds.
Rules:
my-agentwatches an executable or path containingmy-agent.command: make releasewatches the full command line.- A line with spaces, like
docker compose up, is treated as a command line. regex: ...andcommand-regex: ...are available when a literal line is not enough.
The menu bar item also has Edit Watchlist, which opens the file directly. Advanced settings stay in ~/.config/clamshell-sentinel/config.json; see docs/config.example.json.
make check
make power-smoke
make app
make installUseful commands:
swift run ClamshellSentinelChecks
swift run ClamshellSentinel --scan-once
swift run ClamshellSentinel --print-default-configmake power-smoke does not change power settings. It only checks that this Mac recognizes pmset disablesleep, rejects unknown pmset settings, and has caffeinate available.
./scripts/uninstall.shUse --purge-config to remove ~/.config/clamshell-sentinel.
This project is intentionally macOS-only. It is designed around pmset, caffeinate, LaunchAgents, and a native AppKit menu bar item.
