Skip to content

Latest commit

 

History

64 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentinel

Keep your Mac awake while Claude Code, Codex, Claude Desktop, or Claude Cowork is doing work.

Sentinel is a macOS menu bar app and CLI helper. It prevents system sleep while supported coding agents are active, including lid-closed sessions, then restores normal sleep behavior when the work is finished.

What It Supports

  • Claude Code CLI through Claude Code hooks.
  • Codex CLI through Codex hooks.
  • Claude Desktop and Claude Cowork through process monitoring.
  • Lid-closed keep-awake behavior through pmset disablesleep.
  • Optional privacy lock for CLI sessions using the real macOS lock screen.
  • Claude Desktop/Cowork stays awake without privacy-locking by default, so Chrome/computer-use tasks have the best chance to keep using the graphical session.

Important Behavior

The target state is awake, not asleep.

  • If the Mac is awake and Sentinel is running, active agents can continue.
  • If the Mac is locked but awake, CLI agents and many background tasks can continue.
  • If the Mac is actually asleep, local Claude/Codex/Cowork work stops.
  • If Claude Desktop/Cowork needs Chrome UI control, avoid auto-locking Claude Desktop. This is the default.

Installation

Option 1: DMG Installer

  1. Download the latest DMG from the releases page: Sentinel latest release
  2. Open the DMG.
  3. Drag Sentinel.app into /Applications.
  4. Launch Sentinel.app.
  5. Approve the setup prompt. Administrator permission is required to configure pmset.
  6. Restart Claude Code, Codex, or Claude Desktop.

Option 2: Homebrew

brew tap CharlonTank/tap
brew install sentinel
sentinel install

Option 3: Build From Source

git clone https://github.com/Aravindargutus/sentinel.git
cd sentinel
git checkout main
cargo build --release
./target/release/sentinel install

After installation, launch the app:

open /Applications/Sentinel.app

Required macOS Permissions

Sentinel may ask for these permissions depending on enabled features:

  • Administrator permission: required to configure passwordless pmset access.
  • Input Monitoring: used for idle detection and dictation shortcuts.
  • Accessibility: used for dictation text injection and related automation helpers.
  • Microphone: used only by the dictation feature.

For keep-awake behavior, the most important setup step is sentinel install, which configures pmset access and agent hooks.

How It Works

Claude Code and Codex

sentinel install adds lifecycle hooks:

  • When an agent starts work, hooks call sentinel start.
  • Sentinel records the active agent PID.
  • The menu bar app/background agent disables sleep while any active PID exists.
  • When the agent finishes, hooks call sentinel stop.
  • Sleep is re-enabled only when no protected work remains.

Claude Desktop and Cowork

Claude Desktop does not use the same hook lifecycle as Claude Code. Sentinel monitors the main Claude.app process instead.

  • When Claude Desktop is running, Sentinel treats it as protected activity.
  • Sleep stays disabled while Claude Desktop is open.
  • When Claude Desktop quits, Sentinel restores normal sleep if no CLI agent sessions are active.

Privacy Lock

Privacy lock uses the real macOS lock screen:

CGSession -suspend

Defaults:

  • CLI agent sessions: privacy lock enabled.
  • Claude Desktop/Cowork: privacy lock disabled.
  • Idle delay: 60 seconds.

This default avoids interrupting Claude Desktop tasks that need an unlocked graphical session, such as Chrome/computer-use workflows.

Usage

Run the menu bar app:

open /Applications/Sentinel.app

Check current state:

sentinel status

List active sessions as JSON:

sentinel list

Clean up stale interrupted sessions:

sentinel cleanup

Force reset sleep prevention:

sentinel reset

Uninstall:

sentinel uninstall

Keep Whisper/dictation model data during uninstall:

sentinel uninstall --keep-model

Settings

Open settings from the menu bar app or run:

sentinel settings

Available settings include:

  • Enable or disable sleep prevention.
  • Enable or disable Claude Desktop monitoring.
  • Enable or disable privacy lock.
  • Choose whether privacy lock applies to CLI agents.
  • Choose whether privacy lock applies to Claude Desktop.
  • Set the privacy-lock idle delay.
  • Configure speech-to-text language and vocabulary.

Settings are stored in:

~/Library/Application Support/Sentinel/settings.json

Development

This repository uses the main branch.

Run tests:

cargo test --workspace

Format code:

cargo fmt

Build release binary:

cargo build --release

Build a local DMG:

cargo xtask build-dmg --skip-notarize

Clean the local installed app/test state:

cargo xtask clean --keep-model

Full local test package flow:

cargo xtask complete-test --skip-notarize --keep-model

Limitations

Sentinel can prevent sleep, but it cannot override every macOS, hardware, power, or security policy.

It cannot guarantee work continues if:

  • The Mac is already asleep before Sentinel is active.
  • Battery dies or power is lost.
  • macOS thermal protection forces sleep or throttling.
  • Enterprise/security policy blocks pmset disablesleep.
  • Claude Desktop is closed.
  • A Chrome/computer-use task requires a visible unlocked display and macOS does not provide one while the lid is closed.

The intended reliable state is:

Agents active + Sentinel running + Mac awake = work can continue

License

MIT. See LICENSE.

About

Sentinel – macOS menu bar agent that keeps AI coding sessions alive and your screen locked when idle

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages