Your Mac goes to sleep when it thinks you have stopped using it. That is a problem during a long download, an export, a backup, a remote session, or an AI agent run.
This guide covers four ways to keep a Mac awake, how to do it with the lid closed, and how to keep a Mac awake for Claude Code and other AI agents.
Quick answer: how to keep your Mac awake
Fastest, built in: open Terminal and run caffeinate. The Mac stays awake until you press Control-C.
Free app with timers: Amphetamine from the Mac App Store.
No extra software: a sleep option in System Settings.
Shotbase is a comprehensive tool designed to capture and manage all your screen-based content effortlessly. With features like stunning screenshot capabilities, recording options that include cinematic effects, and an intuitive organizational structure powered by local AI, you can easily keep your multimedia assets organized and accessible. Shotbase not only allows you to capture specific areas, windows, or full screens on your Mac but also enables you to edit and enhance your captures with backgrounds, frames, and annotations. The integrated AI ensures your captures are automatically named and tagged for easy searching, making it an excellent choice for anyone looking to enhance their productivity and creativity in one seamless workspace.
SoftwareCreativemacOS
DeskMinder
For Easily Distracted Minds
Freemium
DeskMinder is a productivity software application designed for Mac users who struggle with distractions. It provides a straightforward interface for creating desktop pop-up reminders and tasks, helping users manage urgent to-dos, short breaks, and fleeting ideas. With features like full-screen notifications and Apple Reminders integration, DeskMinder aims to enhance focus and time management for i
- With features like easy-to-create desktop pop-ups for reminders and tasks, it simplifies the process of staying on top of urgent to-dos, short breaks, or fleeting ideas.
- Users can benefit from full-screen notifications, Apple Reminders integration, and flexible widget placement, making it ideal for anyone requiring a little extra help to maintain focus.
- The app includes additional shortcuts for quick reminder setups and customizable widget options, along with a history tracking feature to monitor daily progress.
Designed specifically for Mac users, DeskMinder aims to facilitate better time management and productivity for those with attention challenges, providing a seamless user experience without unnecessary complexity.
SoftwareProductivitymacOS
Klack
Satisfying sound with every keystroke
Paid
Klack is a macOS application designed to enhance the typing experience through high-fidelity sound for each keystroke. It provides features such as immersive spatial audio, instant feedback, and customizable sound options, making it suitable for writers, developers, and anyone who values an engaging typing environment. The app is easily accessible from the menubar and offers extensive configuratio
- Provides immersive spatial audio for enhanced typing feedback.
- Allows customization of keystroke sounds, pitch variations, and volume settings.
- Features a menubar interface for quick access to configuration options.
- Supports instant feedback with each keystroke for a more engaging experience.
- Designed for writers and developers seeking auditory feedback while typing.
Klack enhances the typing experience on Mac by providing high-fidelity sound for each keystroke.
SoftwaremacOS
TypoTab
TypoTab, the ultimate AI writing assistant for
Paid
TypoTab is a macOS application that functions as an AI-driven writing assistant. It enhances writing efficiency by providing tools for grammar correction, text rephrasing, and content generation, all accessible from the menu bar without needing to switch applications. This tool is designed for writers, students, and professionals looking to streamline their writing process and improve productivity
- Provides grammar correction and text rephrasing directly from the menu bar.
- Allows text refinement in any application without switching contexts.
- Offers customizable actions to meet individual writing needs.
- Streamlines repetitive writing tasks for improved efficiency.
- Supports a wide range of applications, enhancing workflow across platforms.
TypoTab is a macOS application that enhances writing efficiency by providing grammar correction, text rephrasing, and content generation directly from the menu bar. It allows users to refine text in any application without switching contexts, offering customizable actions to suit individual writing needs.
SoftwareProductivitymacOS
Teebots
Local AI assistant with multiple bots
Free
Teebots is a desktop AI assistant for managing a group of bots with different roles and model providers. It stores conversations, files, and bot memory on your computer while sending model requests directly to your chosen provider.
- Create groups of bots, each assigned to tasks and models
- Compatible with Claude, OpenAI, DeepSeek, Kimi, or any OpenAI-compatible endpoint
- Runs the assistant workspace on your computer without a separate orchestration server
- Bots use your own API keys and make direct requests to providers
- Each bot has private memory and its own file and browser capabilities
- Bots can run commands, manage files, and perform scheduled jobs from the menu bar
Teebots is free to download and use. AI model usage requires users to supply their own API keys and pay for any model provider charges.
SoftwareAImacOS
Kana Speaker
Real-time Japanese kana pronunciation feedback
Freemium
Kana Speaker is an iOS education app that uses real-time speech recognition to help users practice Japanese kana pronunciation, turning speaking practice into muscle memory.
- Provides real-time pronunciation test and instant feedback
- Includes all 104 kana: Hiragana and Katakana (Seion, Dakuon, Yoon)
- Tracks user performance with on-key indicator lights
- Features a 3D retro handheld device-inspired interface
Kana Speaker requires iOS 17.0 or later and uses speech recognition for pronunciation practice. It is free to download, with additional in-app purchases.
SoftwareEducationiOS & iPadOS
Art of Fauna
Puzzle game with historic wildlife art
Freemium
Art of Fauna is a puzzle game featuring natural history illustrations from the 18th and 19th centuries, each paired with a description of the depicted animal.
- Includes artworks by artists such as Joseph Wolf and Elizabeth Gould
- Contains two volumes with 110 puzzles each from five different regions
- First 10 puzzles in each volume are free; additional puzzles available via in-app purchase
- Features picture and text-based puzzle modes
- Accessibility options: simplified texts, dyslexia-friendly fonts, customizable color schemes, content filters, VoiceOver, VoiceControl, and Switch Control support
- Portion of each purchase supports wildlife conservation organizations
Art of Fauna is free to download with optional in-app purchases to unlock additional puzzles. Requires iOS 16.0 or later.
SoftwareCreativeiOS & iPadOS
Ascope
Daily App Store Keyword Ranking Tool
Paid
Ascope is a Mac application for tracking daily keyword rankings for iPhone and Mac apps in the App Store across 50+ countries.
- Tracks daily keyword rankings for any iPhone or Mac App Store app
- Displays Apple’s keyword popularity scores and estimated difficulty
- Compares keyword performance across multiple countries
- Stores all app, keyword, and ranking history locally on your Mac
- Supports tracking of competitor apps identified by Apple
- Includes a local MCP server for integration with Cursor, Claude, Codex, or Gemini
Ascope requires macOS 14 Sonoma or later and supports Apple silicon and Intel Macs. It is paid only, with pricing at $7.50/month (billed annually) or $9.99/month, and includes a 14-day money-back guarantee.
SoftwareDevelopmentmacOS
Joi
Calendar, task, and habit management app
Freemium
Joi is an app that combines a calendar, task manager, and habit tracker into a single timeline, aimed at helping users manage routines and activities efficiently.
- Create and adjust tasks and events quickly.
- Track daily or weekly habits in one place.
- View tasks, habits, and events on a single visual calendar.
- Synchronize with calendar and reminders for task transfer.
- Access and manage tasks and habits from any device.
- Receive notifications for important scheduled tasks.
Joi is free to download with in-app purchases available. The app requires iOS 17.6 or later for use on compatible devices.
SoftwareProductivityiOS & iPadOS
Step 1: Open Terminal.
Step 2: Run caffeinate.
Step 3: Press Control-C when you want your Mac to sleep normally again.
You can also set a timer or attach it to a command. Apple's man page lists these options:
Command
What it does
caffeinate -t 3600
Stays awake for one hour (the timeout is in seconds)
caffeinate -d
Keeps the display from sleeping
caffeinate -i
Prevents idle sleep (the default)
caffeinate -s
Prevents system sleep, but only on AC power
caffeinate -i make
Stays awake only while the command runs
caffeinate -i -w PID
Stays awake until that process ID exits
Flags combine, for example caffeinate -dis. Use -m for the disk and -u to declare the user active.
Method 2: Keep your Mac awake with Amphetamine
Amphetamine is a free keep-awake app on the Mac App Store, with no ads or in-app purchases.
Click its menu bar icon to start a session. You can keep the Mac awake indefinitely, for a set time, until a set time, while a file downloads, or while a chosen app runs. Triggers can start a session automatically, for example when an external display is connected.
Uncheck Allow system sleep when display is closed to keep a closed MacBook running. Image: Amphetamine
AmphetamineFree menu bar app that keeps your Mac awake.Visit WebsiteAmphetamine is a free macOS menu bar app that keeps your Mac awake with manual sessions or automatic Triggers.
- Starts sessions indefinitely, for a set time, or while an app or file download runs.
- Creates Triggers based on displays, power, Wi-Fi, apps, and more.
- Can keep a MacBook awake while its lid is closed.
- Allows the display to sleep while the Mac stays awake.
- Has no ads and no in-app purchases.
Amphetamine is a long-standing free option for anyone who needs precise control over sleep on a Mac.Visit Website
Method 3: Stop your Mac from sleeping in System Settings
MacBook: open System Settings, click Battery, then Options, and turn on "Prevent automatic sleeping on power adapter when the display is off."
Mac mini, iMac, Mac Studio: open System Settings, click Energy, and turn on "Prevent automatic sleeping when the display is off."
Terminal option: run pmset -g custom to save your current settings, then sudo pmset -c sleep 0 to turn off system sleep on the charger. Set the value back to the number you saved to undo it.
The display can still turn off. Change that in Lock Screen settings.
Method 4: Keep your Mac awake with a menu bar app
Amphetamine is the free general choice. For AI coding agents, four apps keep the Mac awake only while an agent works: Agent Caffeine, Hold My Lid, Ajar, and the free, open-source Double Shot.
How to keep your Mac awake with the lid closed
Closing a MacBook lid is a separate sleep trigger. Your options:
Clamshell mode (free): connect power, an external display, and a keyboard and mouse, then close the lid. Our MacBook clamshell mode guide has the full setup.
Amphetamine: uncheck "Allow system sleep when display is closed" in a session. On Apple silicon, it asks you to install a helper script and approve it with admin authentication.
Agent-aware apps: Agent Caffeine, Hold My Lid, Ajar, and Double Shot keep a closed MacBook running without a display, even on battery.
The caffeinate command is not designed to override lid-close sleep, so do not rely on it with the lid shut.
Keep your Mac awake for Claude Code and AI agents
macOS sleeps when its idle timer runs out, and only keystrokes, mouse movement, or an app's power assertion reset it. Claude Code thinking and calling tools does not, so the Mac sleeps and the session drops.
How to keep Claude Code running with caffeinate
Start Claude Code through caffeinate: caffeinate -i claude. When Claude Code exits, the Mac can sleep again. Already running? Find its process ID with pgrep -f claude, then run caffeinate -i -w PID with that number.
Wrapping Claude Code with caffeinate, or attaching it to a running session. Illustration: Macfolio
An idle Claude Code session at a prompt still keeps the Mac awake.
Agent Caffeine vs Hold My Lid vs Ajar: best apps to keep a Mac awake for AI agents
Agent Caffeine
Hold My Lid
Ajar
Price
$19 once (1 Mac), $29 (3 Macs)
$9.99 early-bird, normally $14.99, up to 3 Macs
$10 for 3 Macs, $3 per extra Mac
Agent detection
40+ agents, per session
Hooks for Claude Code, Codex, OpenCode; process detection for others
Hooks for Claude Code, Codex, OpenCode, Gemini CLI
Lid closed on battery
Yes, after a one-time helper approval
Yes, no external display needed
Yes, built-in Lid Lowered rule
Agent Caffeine: keep your Mac awake for Claude Code and 40+ agents
Agent Caffeine tracks each session of Claude Code, Codex, Cursor, Gemini CLI, and more, so only a working session keeps the Mac awake.
Each working session and how long it has run. Image: Agent Caffeine
When an agent asks you something, it stays awake five minutes for your answer. It is $19 once after a 7-day trial.
Agent CaffeineKeep your Mac awake for agentsVisit WebsiteAgent Caffeine is a Mac menu bar utility that prevents sleep while AI coding agents are working, then allows the Mac to sleep when work stops.
- Track activity from agents including Claude Code, Codex, and Cursor.
- Keep the Mac awake with the lid closed during active work.
- Allow a configurable grace period when an agent waits for input.
- Send notifications when agents need attention or finish.
- Pause sleep prevention or stay reachable for a set duration.
Closed-lid operation on battery requires an approved helper. Battery and temperature safeguards can release sleep prevention. Includes a seven-day trial, followed by a one-time purchase with lifetime updates.Visit Website
Hold My Lid: keep Claude Code running with the lid closed
Hold My Lid reads Claude Code, Codex, and OpenCode hooks to know when each session is working. Cursor and Gemini CLI use process detection.
Battery, cut-off, and working agents in one menu. Image: Hold My Lid
It keeps a MacBook awake with the lid shut and no external display, and never reads your code.
Hold My LidClose your MacBook. Your agents keep running.Visit WebsiteHold My Lid is a macOS application designed to keep your Mac awake while coding agents like Claude Code and OpenAI Codex are active, even with the lid closed. This tool helps developers manage their workflow by allowing their laptops to remain operational while stored in a bag, ensuring that tasks are completed without interruption.
- Keeps your Mac awake while coding agents are active, even with the lid closed.
- Utilizes lifecycle hooks to accurately monitor agent activity and manage wake states.
- Configurable settings allow users to set battery thresholds and power modes.
- Provides notifications and sound alerts when agents complete tasks or battery limits are reached.
- Offers a menu-bar dropdown for quick access to status, agent sessions, and control options.
- Supports global shortcuts for toggling the app on or off from any application.
Hold My Lid is a macOS application designed to keep your Mac awake while coding agents operate, even with the lid closed. It offers a one-time purchase model, allowing use on up to three Macs without the need for subscriptions.Visit Website
Ajar: keep your Mac awake with agent and lid-angle rules
Ajar stays awake for each Claude Code, Codex, OpenCode, or Gemini CLI turn, with extra rules for apps, processes, Wi-Fi, disks, and power.
Ajar's Lid Lowered rule keeps the Mac awake at 60 degrees or less. Image: Parcse
AjarLid angle sync and keep-awake rulesVisit WebsiteAjar is a macOS utility designed to enhance user interaction with Mac devices. It features Lid Angle Sync, which automatically adjusts screen brightness, keyboard backlight, and volume based on the MacBook lid's position, accommodating external monitors with individual settings.
- Adjusts screen brightness, keyboard backlight, and volume based on MacBook lid angle.
- Supports per-display offsets for external monitors during lid adjustments.
- Prevents Mac from sleeping during active work with customizable rules.
- Built-in rules for specific applications like Claude Code, Codex, and Gemini CLI.
- Allows user-defined conditions based on apps, networks, external drives, and power sources.
Ajar provides practical solutions for users seeking to optimize their Mac experience. By automating adjustments based on the MacBook lid's position and allowing for customizable settings, it enhances productivity and user comfort.Visit Website
Double Shot: free, open-source app to keep your Mac awake for AI agents
Double Shot is a free, MIT-licensed menu bar app that stays awake while Claude Code, Codex, Gemini CLI, Cursor Agent, Copilot CLI, OpenCode, Amp, or Aider are working, not just open. You can also pick a timer from 15 minutes to 5 hours, or run it until you turn it off.
The panel with quick picks, Lid closed, and AI agents switches. Image: Double Shot
Lid closed mode needs a one-time setup. Double Shot asks for your password once and adds a sudoers rule so it can run pmset disablesleep without asking again. For heat, it stops at the first warm level with the lid closed, turns the dark display off, switches on Low Power Mode on battery, and lets go when the battery gets low (20% by default). It is not notarized by Apple yet, so a browser download needs Open Anyway in Privacy & Security, while Homebrew skips that step: brew install --cask noahelhadedy/tap/double-shot. It needs macOS 14 or later.
Double ShotFree open-source Mac app that keeps your Mac awake for AI agentsVisit WebsiteDouble Shot is a free, open-source macOS menu bar app that keeps your Mac awake, with the lid closed too, and for as long as your AI coding agents are working.
- Detects when Claude Code, Codex, Gemini CLI, Cursor Agent, Copilot CLI, OpenCode, Amp or Aider are actually working, not just open.
- Lid closed mode uses pmset disablesleep, with a one-time password prompt that adds a sudoers rule.
- Stops at the first warm level, turns the dark display off, switches on Low Power Mode on battery, and lets go when the battery gets low.
- Quick picks from 15 minutes to 5 hours, or until you turn it off.
- MIT licensed. Install with Homebrew or download from GitHub. Not notarized by Apple yet, and it needs macOS 14 or later.
Double Shot suits anyone who starts a long agent run, closes the lid and expects the work to carry on.Visit Website
What to check before running an agent with the lid closed
Power and heat. Clamshell mode needs power, an external display, and a keyboard and mouse. Use a stable surface with good airflow, and never run a closed MacBook in a bag.
Battery cut-off. Agent Caffeine sleeps at 20%; Hold My Lid's cut-off is configurable; Double Shot stops at 20% on battery by default.
Permission prompts. A Claude Code approval prompt pauses the agent. Pre-approve safe commands with permissions.allow, and accept macOS helper prompts before closing the lid.
Amphetamine. It works with agents, but its Triggers cannot tell a working agent from an idle one.
On battery with the lid closed, Agent Caffeine asks once for a helper and sleeps at 20%. Image: Agent Caffeine
How to check what is keeping your Mac awake
Run pmset -g assertions in Terminal and look for PreventUserIdleSystemSleep set to 1.
Checking which process keeps the Mac awake (abridged output). Illustration: Macfolio
FAQ
How do I keep my Mac awake?
Run caffeinate in Terminal, install Amphetamine, or change the sleep option in Battery or Energy settings.
What does caffeinate do on a Mac?
It prevents sleep while it runs. With no options it prevents idle sleep, and flags cover the display, disk, system, and user activity.
Is Amphetamine free?
Yes. Amphetamine is free on the Mac App Store, with no ads, in-app purchases, or pro version.
How do I keep my MacBook awake with the lid closed?
Use clamshell mode, or an app with closed-lid support such as Amphetamine, Agent Caffeine, Hold My Lid, Ajar, or Double Shot.
How do I keep my Mac awake while Claude Code runs?
Start it with caffeinate -i claude. For automatic control, use Agent Caffeine, Hold My Lid, Ajar, or the free, open-source Double Shot.
Can my Mac keep running Claude Code with the lid closed?
Yes, with the right setup. Clamshell mode works on power with an external display. Without one, apps like Double Shot, Agent Caffeine, Hold My Lid, and Ajar can hold the Mac awake, and Double Shot needs a one-time password for lid closed mode. Never run a closed MacBook in a bag unless the app has heat and battery limits.
How do I stop my Mac from sleeping on the charger?
Turn on "Prevent automatic sleeping on power adapter when the display is off" in Battery, Options.
Verdict: the best way to keep a Mac awake
For a quick job, caffeinate is enough. For timers and a menu bar switch, use Amphetamine. For all-day AI agent work, Agent Caffeine is the most complete, Hold My Lid is the best value, and Ajar suits rules beyond agents. If you want a free, open-source option, try Double Shot.
A transparent 20,000 mAh power bank with a status display and up to 100W USB-C output.
HardwarePowermacOS & iOS & iPadOS
Teebots
Local AI assistant with multiple bots
Free
Teebots is a desktop AI assistant for managing a group of bots with different roles and model providers. It stores conversations, files, and bot memory on your computer while sending model requests directly to your chosen provider.
- Create groups of bots, each assigned to tasks and models
- Compatible with Claude, OpenAI, DeepSeek, Kimi, or any OpenAI-compatible endpoint
- Runs the assistant workspace on your computer without a separate orchestration server
- Bots use your own API keys and make direct requests to providers
- Each bot has private memory and its own file and browser capabilities
- Bots can run commands, manage files, and perform scheduled jobs from the menu bar
Teebots is free to download and use. AI model usage requires users to supply their own API keys and pay for any model provider charges.
SoftwareAImacOS
Kana Speaker
Real-time Japanese kana pronunciation feedback
Freemium
Kana Speaker is an iOS education app that uses real-time speech recognition to help users practice Japanese kana pronunciation, turning speaking practice into muscle memory.
- Provides real-time pronunciation test and instant feedback
- Includes all 104 kana: Hiragana and Katakana (Seion, Dakuon, Yoon)
- Tracks user performance with on-key indicator lights
- Features a 3D retro handheld device-inspired interface
Kana Speaker requires iOS 17.0 or later and uses speech recognition for pronunciation practice. It is free to download, with additional in-app purchases.
SoftwareEducationiOS & iPadOS
Dynamic Folio for iPad Pro 11″
A folding magnetic folio with viewing and drawing positions for the 11-inch iPad Pro M4/M5.
HardwareAccessoriesiPadOS
Art of Fauna
Puzzle game with historic wildlife art
Freemium
Art of Fauna is a puzzle game featuring natural history illustrations from the 18th and 19th centuries, each paired with a description of the depicted animal.
- Includes artworks by artists such as Joseph Wolf and Elizabeth Gould
- Contains two volumes with 110 puzzles each from five different regions
- First 10 puzzles in each volume are free; additional puzzles available via in-app purchase
- Features picture and text-based puzzle modes
- Accessibility options: simplified texts, dyslexia-friendly fonts, customizable color schemes, content filters, VoiceOver, VoiceControl, and Switch Control support
- Portion of each purchase supports wildlife conservation organizations
Art of Fauna is free to download with optional in-app purchases to unlock additional puzzles. Requires iOS 16.0 or later.
SoftwareCreativeiOS & iPadOS
Ascope
Daily App Store Keyword Ranking Tool
Paid
Ascope is a Mac application for tracking daily keyword rankings for iPhone and Mac apps in the App Store across 50+ countries.
- Tracks daily keyword rankings for any iPhone or Mac App Store app
- Displays Apple’s keyword popularity scores and estimated difficulty
- Compares keyword performance across multiple countries
- Stores all app, keyword, and ranking history locally on your Mac
- Supports tracking of competitor apps identified by Apple
- Includes a local MCP server for integration with Cursor, Claude, Codex, or Gemini
Ascope requires macOS 14 Sonoma or later and supports Apple silicon and Intel Macs. It is paid only, with pricing at $7.50/month (billed annually) or $9.99/month, and includes a 14-day money-back guarantee.
SoftwareDevelopmentmacOS
Nest V2
A portable organizer for desk essentials with a wireless charging pad in the lid.
WorkspaceOrganization
Joi
Calendar, task, and habit management app
Freemium
Joi is an app that combines a calendar, task manager, and habit tracker into a single timeline, aimed at helping users manage routines and activities efficiently.
- Create and adjust tasks and events quickly.
- Track daily or weekly habits in one place.
- View tasks, habits, and events on a single visual calendar.
- Synchronize with calendar and reminders for task transfer.
- Access and manage tasks and habits from any device.
- Receive notifications for important scheduled tasks.
Joi is free to download with in-app purchases available. The app requires iOS 17.6 or later for use on compatible devices.
SoftwareProductivityiOS & iPadOS
Winq
Gaze-based screen and window focus for Mac
One-time
Winq is a macOS application that lets users switch focus between screens and windows using head and eye movements captured by your Mac's camera.
- Allows you to select and focus windows or screens just by looking at them
- Supports multiple monitors and overlapping windows; visible portions are counted and top windows take precedence
- Learns from your gaze patterns and interactions to improve accuracy over time
- Never switches focus while you type or use the mouse and can be paused any time
- Calibration takes about 20 seconds per screen and can be re-centred in two seconds as sitting position changes
- Processes camera data locally with Apple's Vision framework; no images or video are stored or sent anywhere
Winq offers a free trial for one day with full feature access. Continued use requires a one-time purchase per Mac, and all future updates are included. Requires macOS 13 or later and works on Apple Silicon and Intel Macs.