Intelligent wrapper for Claude Code. ApeAwake launches Claude, keeps your laptop awake for the full session, auto-approves permission prompts based on your preference, and presents a PR-style diff review when Claude finishes.
Works on macOS and Linux. Windows supports legacy watch mode only.
- Python 3.9+
- Claude Code installed and available on your PATH (
claude --versionshould succeed)
pipx install apeawakeOr install directly from source:
pipx install git+https://github.com/RobinDFeder/apeawakeFor local development:
git clone https://github.com/RobinDFeder/apeawake
cd apeawake
pip install -e .apeawakeLaunches a three-phase session:
- Config screen — pick an approval mode (see below)
- Claude session — Claude Code runs in a PTY relay; sleep lock is held; prompts are auto-approved per your chosen mode
- Diff review — when Claude goes idle or you terminate that session, a side-by-side diff lets you keep or revert changes file by file
apeawake --mode all # auto-approve every Claude prompt
apeawake --mode edits # auto-approve file edits; pause on shell commands
apeawake --mode ask # never auto-approve; you handle every promptAttach to an already-running process by PID and hold the sleep lock until it exits. No TUI, no diff review. Works on Windows.
apeawake --watch <PID>| Mode | Behavior |
|---|---|
all |
Auto-answers every Claude permission prompt with yes |
edits |
Auto-approves file edits; pauses on bash/shell commands |
ask |
Never auto-approves; every prompt requires your input |
| Flag | Description | Default |
|---|---|---|
--mode / -m |
Skip config TUI; use all, edits, or ask |
— |
--idle SECONDS |
CPU-idle seconds before declaring Claude done | 60 |
--watch PID / -w |
(Legacy) watch an existing process by PID | — |
--interval SECONDS / -i |
Poll interval in seconds | 2.0 |
After Claude finishes, the diff screen shows each changed file:
| Key | Action |
|---|---|
K |
Keep current file |
R |
Revert current file |
A |
Keep all files |
D |
Discard all files |
Q |
Quit |
If you don't interact with the diff screen for 10 minutes, the sleep lock is released so your laptop can sleep normally. The screen stays open — interacting with it re-acquires the lock.
| OS | Mechanism |
|---|---|
| macOS | caffeinate -dims -s + pmset power settings (requires sudo) |
| Linux | systemd-inhibit --what=sleep:idle:handle-lid-switch |
| Linux (fallback) | xdg-screensaver reset loop (screensaver only, no lid-close) |
| Windows | Legacy watch mode only — use apeawake --watch <PID> |
On macOS, ApeAwake uses sudo pmset to disable standby, hibernate, and battery sleep for the duration of the session — so closing the lid on battery won't interrupt Claude mid-task. Your original settings are restored automatically when the session ends. You'll be prompted for your password once at startup; ApeAwake keeps the sudo token alive in the background for the full session.
Bug reports and pull requests are welcome. Please open an issue first for any significant change.
MIT — see LICENSE.