Close the Lid. Your Agent Keeps Going.
Lidless keeps your Mac awake with the lid closed while your coding agent is working. When it finishes, the Mac sleeps.
macOS 13 or later · Apple Silicon and Intel
downloads
What it does
No Timer.
Your Agent Decides.
Keep-awake apps make you pick a duration. Lidless watches your agent instead. While an agent is working it holds pmset disablesleep, the setting that covers lid-close sleep. When the work stops, it lets go.
How it knows
Your Agent Starts.
Lidless Knows.
Claude Code and Codex: exact
Lidless adds hooks to ~/.claude/settings.json and ~/.codex/hooks.json in the background. UserPromptSubmit starts a hold; Stop, SessionEnd and, for Codex, Interrupt end it. Works across every session and terminal. Codex asks to review new hooks once the next time it opens. Until then, Codex is tracked by activity.
Other agents: by activity
Everything else is detected by process. An agent counts as working while it or anything it spawned is using CPU. Lidless waits two quiet minutes before letting go, so a slow model response is not mistaken for done.
Anything else: wrap it
Put lidless run in front of any command and the Mac stays awake until it exits. lidless status shows what is holding it.
Alternatives
One Thing,
Done for Your Agent.
| Lidless | Amphetamine | caffeinate | Cloud agents | |
|---|---|---|---|---|
| Awake with lid closed | ✓ | buried | ✗ | ✓ |
| Ends when your agent ends | ✓ | ✗ | -w pid | ✓ |
| Sleeps once done, lid shut | ✓ | ✗ | ✗ | - |
| No timer to pick | ✓ | ✗ | ✗ | ✓ |
| Your machine, your setup | ✓ | ✓ | ✓ | ✗ |
| Free | ✓ | ✓ | ✓ | metered |
Amphetamine does far more. Lidless does one thing: keeps a closed Mac awake while an agent works, then lets it sleep.
Install
Set Up Once.
Your Agent Does the Rest.
Download Lidless.zip from GitHub Releases and drag Lidless to Applications.
Open it and click Set Up. macOS asks for your password once.
Start an agent. Close the lid.
/etc/sudoers.d/lidless, which lets your user run two commands without a password: pmset -a disablesleep 1 and pmset -a disablesleep 0. Nothing else. It also links the lidless command into /usr/local/bin. Hooks for Claude Code and Codex are added in the background when either is installed, with a backup of each config file kept first. Uninstall in the menu removes all of it.Safety
Your Agent Finishes.
Your Mac Sleeps.
Use at your own risk. Two rules: keep the Mac on a hard surface while an agent runs, and never put it in a bag mid-run. It will overheat.
Lidless lets go on its own when the battery drops to 20% on battery power, when macOS reports a critical thermal state, or when the app quits. Plug in for long runs.
FAQ
Questions About
Your Agent.
Can a timer be set?
No. Your agent decides. For anything else, use lidless run.
Does it work without an external monitor?
Yes. pmset disablesleep covers lid-close sleep directly.
What happens when your agent finishes with the lid closed?
Lidless restores normal sleep and puts the Mac to sleep within a few seconds, unless an external display is attached.
What if Claude Code is waiting on a permission prompt?
A permission prompt is not a finished turn, so the Mac stays awake waiting for an answer. For unattended runs, use auto mode or allow rules so nothing blocks. If a session goes fully quiet for 15 minutes without finishing, Lidless lets it go anyway.
Does it drain battery faster?
Only while an agent is working, about the same as using it with the lid open.
Does Lidless send any data anywhere?
No. No network access, no telemetry, no account.
Which Macs and macOS versions?
macOS 13 Ventura and later, including Tahoe. Universal binary for Apple Silicon and Intel.
Close the Lid.
Your Agent Keeps Going.
macOS 13 or later · Apple Silicon and Intel
downloads