Follows each agent’s hooks
Claude Code and Codex report every prompt, tool call and stop through hooks. T3 Code’s own database is read every 5 s.
Free and open source, for macOS 14 or later
Close the lid while Claude Code, Codex or T3 Code works. The Mac stays awake with the screen at 0%, then may sleep once every agent is waiting for you.
The installer adds hooks for Claude Code and Codex, and Settings shows each file that holds them; T3 Code is read directly. The status command prints every session in a terminal, with the decision under it.
See which tools reportClaude Code and Codex report every prompt, tool call and stop through hooks. T3 Code’s own database is read every 5 s.
Brightness goes to 0% and comes back, at least 10%, when you open the lid. With an external display, macOS keeps control.
By default a waiting Codex session gets 10 s. When Claude finishes or asks a question, it usually gets 70 to 90 s, so its notification still goes out.
Low battery or serious heat brings normal sleep back, even during a hold by hand. A silent or exited session stops counting.
Why it exists
Closing a MacBook’s lid puts it to sleep, even with caffeinate running. Agent Lid Closed keeps it awake while an agent has work, or while you ask it to, then gives sleep back.
When a live Claude or Codex session stops at a subscription limit whose reset is known, the Mac can sleep, then wakes two minutes before the reset: within 24 hours in a terminal, seven days in T3 Code. A closed-lid wake is best effort.
With its auto-resume on, T3 Code continues the conversation at the reset, and with two accounts of one tool it can move it to the free one at once. Terminal Claude continues when its own setting for that is on.
Read what wakes itThe installer adds hooks only for the tools it finds. One tool is enough; a second Claude Code account can be added later in Settings.
Wakes before resets with version 2.1.234 or later.
Once you trust its hooks under /hooks. A wake does not start a new Codex turn.
No hooks needed. T3 continues the conversation at the reset and can switch accounts.
Loads the same settings, so it should appear like a terminal session.
Claude Code on the web, Chat and Cowork run off your Mac.
Needs Swift 6.2 or later from the Command Line Tools and your administrator password once. Then restart open sessions, and trust the hooks in Codex under /hooks.
$ git clone https://github.com/Jin-hiroo/agent-lid-closed.git && cd agent-lid-closed && ./scripts/install.sh
Needs Node.js 22.16 or later and no administrator rights. Then restart open sessions, and trust the hooks in Codex under /hooks. The menus are in Japanese.
> git clone https://github.com/Jin-hiroo/agent-lid-closed.git; cd agent-lid-closed
> powershell -ExecutionPolicy Bypass -File .\windows\install.ps1
Something else, or a result from the Claude desktop app? Open an issue on GitHub.
Open an issueIt sets pmset disablesleep while an agent works and clears it once all of them wait, after a short grace period. Quitting restores normal sleep and brightness.
Yes. Keep Mac Awake holds sleep off until you turn it off, or for 30 min, 1, 2 or 4 h, or a time you type, up to 7 days. Low battery and heat still let it sleep.
Only on your Mac: hook events, Claude’s status-line usage and reset times, the usage-limit fields of Codex’s event log, a Claude transcript to spot an interrupted turn, and T3 Code’s database, read-only. No conversation text or account tokens are kept or sent.
A root-owned helper that can only schedule this app’s wake alarms, within the next seven days. A closed-lid wake is best effort, so test it plugged in.
From the clone, run ./scripts/uninstall.sh on a Mac, or powershell -ExecutionPolicy Bypass -File .\windows\uninstall.ps1 on Windows. Each removes the app and every hook it added; T3 Code’s auto-resume setting stays as you left it.