Free · Open sourceCaffeinatormacOS

Keep your Mac awake while your agent works.

I built it so I'd stop moving the mouse every time Claude Code was in the middle of a long task. Pick how long, walk away, and the work keeps going. Even with the lid closed.

macOS 13 or later · Apple Silicon and Intel · Free

Why it exists

I'd come back from coffee and my Mac was asleep

I give an agent a long task. I get up to make a coffee. I come back and the screen is black. The task stopped halfway.

I fixed it by moving the mouse. Every time. Until I noticed I was working so my computer wouldn't stop working.

So I built an app that does it for me. And because I sometimes close the laptop without thinking, it works with the lid closed too.

Caffeinator off: the mascot is asleep
Off
Caffeinator on: the mascot is wide awake
Awake
What it does

One click in the menu bar

Pick a duration

15 minutes, 30, 1 hour, 2, 4, 8 or indefinitely. No window and no Dock icon. The countdown sits next to the icon.

Works with the lid closed

Turn on “Keep awake with lid closed”, close the laptop and the agent keeps going. macOS asks for your password once per session.

Turns itself off

When the time runs out, when you stop it, when you quit the app, or if the battery drops to 15%. Then your Mac sleeps as usual.

Nothing strange installed

Under the hood it runs caffeinate, the tool Apple already ships with every Mac. About 800 lines of Swift you can read on GitHub.

Install

macOS will warn you. That's normal.

I didn't pay for an Apple developer license for a free app, so the first time macOS won't open it. You approve it once and it takes a minute.

  1. Download and move it

    Open Caffeinator.zip and drag Caffeinator.app into your Applications folder.

  2. Open it once

    Double-click it. macOS says it can't verify the developer. Click “Done”. Don't move it to the Trash.

  3. Approve it in Settings

    Open System Settings → Privacy & Security. Scroll to the bottom, click “Open Anyway” next to Caffeinator and enter your password.

  4. Done for good

    The mascot shows up in the menu bar, top right. macOS won't ask again.

Use the terminal? This command does steps 2 and 3 in one go:

xattr -dr com.apple.quarantine /Applications/Caffeinator.app
FAQ

Good to know

Why does macOS say the app isn't safe?

Because it isn't signed with an Apple developer account, which costs $99 a year. macOS shows the same warning for any app that didn't go through that. The code is open: you can read every line before you open it, or build it yourself with ./build.sh.

Why does it ask for my password?

Only in lid-closed mode. Keeping a Mac awake with the lid closed needs administrator rights. The normal mode asks for nothing.

Is it safe to leave it running with the lid closed?

Leave the laptop on a hard surface, not inside a bag. On battery, Caffeinator turns itself off at 15% so you don't run out of charge.

Does “Stop Caffeinate” stop other things too?

Yes. It ends every caffeinate process on the Mac, including ones another app or you started in the terminal. That's on purpose: one click means “you can sleep now”.

Will it run on my Mac?

It needs macOS 13 Ventura or later. It runs on Apple Silicon Macs (M1 and newer) and on Intel Macs.

How much does it cost?

Nothing. It's free and open source under the MIT license. If you want to improve it, send a pull request.

Let the agent work. Go get the coffee.

Free, open source, and about 200 KB.

Hire me for your next project