caffeinate

Prevent macOS sleep using the built-in caffeinate CLI with flags.

Updated May 18, 2022
One-click install
npx skills add https://github.com/kendreaditya/.config --skill caffeinate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caffeinate
Source: https://github.com/kendreaditya/.config/tree/main/claude/skills/caffeinate
Command: npx skills add https://github.com/kendreaditya/.config --skill caffeinate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

caffeinate prevents macOS from sleeping using the built-in caffeinate CLI to keep the system awake during long tasks, ensuring processes run uninterrupted.

Core Features & Use Cases

  • Keep the display on during long-running tasks.
  • Prevent idle sleep and system sleep, including lid-closed scenarios when powered.
  • Simple command-line control with flags to manage wake behavior (e.g., -i, -d, -s, -t, -w).

Quick Start

Start a long-running task with caffeinate to prevent sleep until completion.

Frequently Asked Questions about caffeinate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to keep a background process running uninterrupted on macOS?

The best way to keep background processes running uninterrupted on macOS is leveraging the built-in caffeinate CLI tool with specific flags to prevent system sleep until task completion.

How do I prevent macOS from sleeping during long-running tasks?

You can prevent macOS from sleeping during long-running tasks by invoking the built-in caffeinate CLI with command-line flags to sustain background processes and keep the system awake until completion.

Can I keep the macOS display on and prevent idle sleep while working?

Yes, you can keep the macOS display on and prevent idle sleep by using caffeinate command-line flags like -d to maintain display power and -i to prevent system sleep during active operations.

Does caffeinate prevent sleep when the MacBook lid is closed and powered?

Yes, caffeinate prevents macOS sleep in lid-closed scenarios when the device is powered, using the -s flag to sustain system wake behavior for extended background processing.

What flags does caffeinate use for deterministic wake behavior on macOS?

caffeinate uses command-line flags including -i, -d, -s, -t, and -w to provide deterministic wake behavior for preventing idle sleep, keeping displays active, and managing process completion.

What is the best way to keep a background process running uninterrupted on macOS?

The best way to keep background processes running uninterrupted on macOS is leveraging the built-in caffeinate CLI tool with specific flags to prevent system sleep until task completion.