Skip to main content

🦍 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, 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.

Metadata

Release files for apeawake 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apeawake 0.5.1
File Size Uploaded Provenance Actions
apeawake-0.5.1.tar.gz 22.6 kB Without provenance Details for apeawake-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apeawake 0.5.1
File Interpreter ABI Platform Actions
apeawake-0.5.1-py3-none-any.whl Python 3 none any Details for apeawake-0.5.1-py3-none-any.whl

Total release size: 49.0 kB

Release files / apeawake-0.5.1.tar.gz

Download URL apeawake-0.5.1.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3a457671965e6c03355fc7d9414ad831987a7a94c50ce3aabf9e21416514f046
BLAKE2b-256 checksum
How to use checksums
16fa9b8c7188e3c347c78984c44bbd1fbf4c0921be7a12f1771129424c88cbe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / apeawake-0.5.1-py3-none-any.whl

Download URL apeawake-0.5.1-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
476e8946f3a6dc8b149143454dedb7dda25bd193b8fcbb1098500c3fab12d57a
BLAKE2b-256 checksum
How to use checksums
6218039b987cd1c9f8aab67972530ad3df304ce0ac4f3b2279f1ae1fad95a5d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for apeawake 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page