I started a 40GB file transfer to an external drive before heading to a long meeting. When I came back two hours later, the Mac had gone to sleep, the transfer had stalled at 60%, and I had to start over. It wasn’t the end of the world, but it was the kind of preventable waste that sticks with you. I knew I could set Energy Saver to “never sleep,” but I always forget to restore it afterward, and then I wonder why my MacBook Air battery is drained by morning.
This is a common enough problem that a whole category of small menu bar apps exists specifically to solve it. The basic idea: activate sleep prevention for a defined duration or under specific conditions, then let macOS resume normal behavior automatically. No permanent setting changes, no manual cleanup.
The most capable option in this space is Amphetamine (Free), which has been in the Mac App Store since 2014 and has accumulated over 2,800 five-star ratings for good reason. The core feature is a menu bar icon that starts keep-awake sessions by preset duration, until a specific time, or indefinitely. Where Amphetamine earns its reputation is the trigger system: you can configure it to activate automatically while a specific app is running, while an external drive is mounted, or during active downloads. I set up a “keep awake while Handbrake is running” trigger in under a minute, and now I never think about sleep mode during encoding jobs. The app also supports keeping the Mac awake while the display sleeps, which is exactly what overnight tasks require: the screen turns off, the process keeps running, energy use stays low. Resource footprint is negligible at roughly 50MB and 1% CPU. There are no ads, no tracking, no in-app purchases. Developer William Gustafson has maintained it actively for a decade.
For users who want something simpler, KeepingYouAwake (Free, open-source) takes a stripped-down approach. Click the menu bar icon to activate sleep prevention, click again to stop. Preset durations run from five minutes up to indefinite, with a custom interval option. The notable difference from Amphetamine is architectural: KeepingYouAwake wraps Apple’s official caffeinate command-line tool rather than any workaround. The GitHub repository has over 6,000 stars and has been maintained since 2014. There are no triggers or conditional activation, just reliable, transparent sleep prevention when you need it. Installation via Homebrew (brew install --cask keepingyouawake) makes it a natural fit for developer setups where Homebrew is already part of the workflow.
A third option covers an edge case worth knowing about. Jiggler (Free, open-source) takes an unconventional route: instead of using macOS power management APIs, it simulates mouse movement to signal activity to the system. This matters in specific environments—certain corporate VPN setups or remote desktop configurations respond to cursor activity rather than sleep assertions. Version 1.10 introduced a “Zen jiggle” mode that makes imperceptible micro-movements, so the cursor doesn’t visibly wander around your screen. Jiggler also includes triggers for CPU activity, specific running applications, and media playback. The codebase is older Objective-C and isn’t under active development, so I’d reach for it only when the API-based tools don’t behave as expected in a particular environment.
One limitation all three share: none can prevent sleep on a MacBook with a closed lid. That’s a thermal management restriction built into macOS, not something third-party apps can override. For overnight tasks on a laptop, you either need to leave the lid open or work from a desktop.
I keep Amphetamine running on my Mac Mini for automated trigger-based control, and KeepingYouAwake on my MacBook Air for quick manual overrides when I don’t need any conditions. If you only install one, start with Amphetamine. The trigger system is what makes it genuinely useful rather than just a toggle you have to remember to switch off.