Skip to content

RobinDFeder/ApeAwake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦍 ApeAwake

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.


Prerequisites

  • Python 3.9+
  • Claude Code installed and available on your PATH (claude --version should succeed)

Install

pipx install apeawake

Or install directly from source:

pipx install git+https://github.com/RobinDFeder/apeawake

For local development:

git clone https://github.com/RobinDFeder/apeawake
cd apeawake
pip install -e .

Usage

Default — TUI session mode

apeawake

Launches a three-phase session:

  1. Config screen — pick an approval mode (see below)
  2. Claude session — Claude Code runs in a PTY relay; sleep lock is held; prompts are auto-approved per your chosen mode
  3. 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

Skip the config screen

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 prompt

Legacy watch mode (headless)

Attach 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>

Approval modes

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

Options

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

Diff review keys

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.


How it works

Sleep backends

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>

macOS power management

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.


Contributing

Bug reports and pull requests are welcome. Please open an issue first for any significant change.


License

MIT — see LICENSE.

About

Keep Claude awake and watch it work — a TUI monitor for AI agents

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages