Keepresso
Keepresso
Using Keepresso

Keep your Mac awake during long builds and compiles

György
Reviewed by
György
Updated Jul 23, 2026 4 min

A long Xcode archive, a cargo build --release, a Gradle or npm install, or a local CI run is the classic moment macOS decides the machine is idle. The screen dims, the system sleeps, and the build stalls or dies. Keepresso keeps the Mac awake for the job, then lets it rest when the work is done.

Pick the approach that matches the job

1. Timed session (simplest)

If you know the build usually finishes within a window:

  1. Click the Keepresso cup in the menu bar.
  2. Pick a duration (1 hour, 4 hours, custom, or Until a Time).
  3. Start keep-awake and start the build.

When the timer ends, Keepresso stops holding the system awake. Details: timed sessions.

2. Process trigger (hands off)

Stay awake only while the build tool is actually running:

  1. Open Preferences → Triggers.
  2. Turn trigger gating on.
  3. Add a Process running condition and match the command, for example xcodebuild, swift, cargo, rustc, gradle, java, node, npm, pnpm, make, ninja, or cmake.
  4. Combine with any if you use more than one tool.

When the process exits, Keepresso drops the session (after any grace period you set) and the Mac can sleep again. See smart triggers.

3. CPU-load trigger (tool-agnostic)

If the tool name changes but the machine is clearly working:

  1. Add a CPU above a threshold condition (50% or 75% is a good starting point).
  2. Keep the smoothing: a brief spike will not open a session; sustained load will.

This is ideal for mixed toolchains or IDE builds that spawn different child processes under different names.

4. Media Render / AI Agent presets

Built-in presets cover common long jobs:

  • Media Render holds while ffmpeg runs.
  • AI Agent holds while a coding agent (claude, codex, gemini, and friends) is actually working, not just open, so an overnight agent run on a laptop finishes and the Mac still sleeps once the work is done.

Apply a preset from the condition menu; it replaces the current rule set and turns triggers on.

Want to know the moment the job is done? An event hook under Preferences, Automation can run a Shortcut, POST a webhook, or run a shell command when the session ends or the agent goes idle, a push to your phone included. And if the job starts before you wake up, a scheduled wake from the same tab gets the Mac up in time.

Optional: screen off, lid closed

Builds do not need a lit panel.

  • Turn off prevent display sleep if you only care about the system staying up. Guide: Keep the Mac awake with the screen off.
  • On a MacBook, enable closed-display mode so the machine keeps compiling in a bag or on a shelf, with the internal panel put to sleep when the lid closes. Guide: Lid closed.

Battery safety

On a laptop, pair keep-awake with battery auto-pause so a forgotten session does not drain the pack. Set a floor (for example 20%) under Preferences; Keepresso pauses when charge drops below it. More: smart triggers.

Scripts and CI machines

For headless build machines or scripted pipelines:

# Hold the Mac awake exactly as long as the build runs (app not required)
your-build-command & keepresso -w $!

# Or drive the running app
keepresso start --for 120
keepresso stop

For unattended pipelines, an automation lease is safer than a start-and-stop pair: it is a bounded grant the script keeps renewing, so a crashed job cannot pin the Mac awake, the lease just expires.

ID=$(uuidgen)
keepresso lease acquire --id "$ID" --tool ci --task "release build" --ttl 600
# ... heartbeat on a loop while the build runs ...
keepresso lease release --id "$ID"

If the job is driven by an AI agent, you do not even write this yourself: a bundled skill and an MCP server teach the agent the whole protocol. See let AI agents keep your Mac awake.

Install and PATH notes: keepresso CLI. On a Mac mini used only for builds, also run the Headless Setup checklist so login and sleep policies match an always-on machine.

Get Keepresso

Free and open source, for macOS 14 and newer. Install it and keep your Mac awake on your terms.

Human-led and verified · AI-assisted content · AI tools may help draft, edit, maintain, and improve grammar or clarity. Nothing is published automatically; every change is reviewed by the human maintainer.