GitHub - CharlonTank/claude-code-sleep-preventer: Keep your Mac awake while Claude Code is working

2 min read Original article ↗

Keep your Mac awake while Claude Code is working

Close your laptop lid. Walk away. Come back to finished work.

Download DMG

macOS Rust License: MIT GitHub release


The Problem

You ask Claude to refactor your codebase. It's going to take 10 minutes. You close your MacBook lid to grab coffee...

💀 Mac sleeps. Claude stops. Work lost.

The Solution

Install this tool. Now your Mac stays awake while Claude works, even with the lid closed. When Claude finishes, normal sleep resumes.

Before After
😴 Lid closed = Mac sleeps ☕ Lid closed = Claude keeps working
🔄 Come back to interrupted work ✅ Come back to finished work

Installation

🍎 Download DMG (Easiest)

  1. Download the latest DMG
  2. Drag ClaudeSleepPreventer.app to Applications
  3. Launch the app - it will auto-configure on first run
  4. Restart Claude Code

🍺 Homebrew

brew tap CharlonTank/tap
brew install claude-sleep-preventer
claude-sleep-preventer install

🦀 Build from Source

git clone https://github.com/CharlonTank/claude-code-sleep-preventer.git
cd claude-code-sleep-preventer
cargo build --release
./target/release/claude-sleep-preventer install

How It Works

You send a prompt
       ↓
   Claude starts working → 🔒 Sleep disabled
       ↓
   Claude finishes → 🔓 Sleep re-enabled

That's it. No configuration needed.


Commands

claude-sleep-preventer status     # Check current state
claude-sleep-preventer cleanup    # Clean up after interrupts
claude-sleep-preventer uninstall  # Remove completely

FAQ

Does it drain my battery? No more than usual. Your Mac just stays awake instead of sleeping.

What if I interrupt Claude with Ctrl+C? Run claude-sleep-preventer cleanup or the tool auto-detects idle sessions after 10 seconds.

Does it work with multiple Claude instances? Yes! Mac stays awake until ALL instances finish.