Repository navigation
Releases
Releases · Jin-hiroo/agent-lid-closed
Agent Lid Closed 2.1
Keep your MacBook awake with the lid closed while Claude Code or Codex works, and let it sleep when every agent is waiting for you.
What's new
- Switch accounts at a usage limit (T3 Code). If you have two Claude (or Codex) accounts in T3 Code, a conversation that hits one account's limit continues on the other right away instead of waiting for the reset. Without T3 Code, or with one account per tool, nothing changes. Turn it off in Settings › Usage Limits.
- Settings window. Open it from the menu bar icon (Settings…, ⌘,). Change sleep timing, the battery level that allows sleep, start at login, usage-limit wakes and account switching, and add or remove hooks for Claude Code and Codex, including a config folder for a second Claude account.
- Works with whatever you use. The installer adds hooks only for the tools you have: Claude Code, Codex, either or both. T3 Code is tracked without hooks. New installer options:
--claude-config-dir DIR(another Claude account),--codex,--no-claude,--no-codex. - Sessions labelled by account, for example "Claude - Second" in T3 Code.
- Fixes: uninstalling finishes even if one settings file is broken; settled or archived T3 conversations can no longer re-arm a wake through old hooks; an explicit T3 auto-resume opt-out is kept on reinstall; unusual stored settings can't crash the app.
What the installer changes on your Mac
It asks for your administrator password once. Then it:
- Builds the app from source and installs it as
~/Applications/AgentLidClosed.app. - Adds
/etc/sudoers.d/agent-lid-closed, which lets the app run onlypmset -a disablesleep 0|1and its wake helper without a password. - Installs a root-owned helper at
/Library/PrivilegedHelperTools/local.AgentLidClosed.wake. It can only set or clear this app's own wake alarms, at most seven days ahead. - Adds hooks to
~/.claude/settings.json(with a status-line wrapper that keeps your existing status line) and/or~/.codex/hooks.json, only for the tools it finds. Each file is backed up to.bakfirst, and every hooked file is listed in~/Library/Application Support/AgentLidClosed/hook-targets.json. - If T3 Code is installed, turns on its "continue after usage limits" setting, unless you turned it off.
- Adds a login agent,
~/Library/LaunchAgents/local.AgentLidClosed.plist, so the app starts at login.
./scripts/uninstall.sh removes all of this and restores your previous status line.
Install
Requires macOS 14 or later and the Command Line Tools with Swift 6.2 or later (xcode-select --install).
git clone https://github.com/Jin-hiroo/agent-lid-closed.git && cd agent-lid-closed && ./scripts/install.shAfter installing, restart open Claude Code sessions. In Codex, open /hooks and trust the Agent Lid Closed hooks.
Update
From the folder you cloned:
git pull && ./scripts/install.shYour settings are kept. To install exactly this release: git fetch --tags && git checkout v2.1 && ./scripts/install.sh.