UnIdle Journal
Download

caffeinate, flag by flag

Every Mac ships with a one-word fix for most sleep problems. Here's what each flag does, and where it stops being enough.

The problemYou leave an agent working and walk away. After a few idle minutes, the Mac sleeps and the run stalls.
Without an appPut caffeinate -i in front of the command. It works — if you remember it every time.
What UnIdle addsThe same protection with nothing to type: on when an agent starts working, off when it stops, and a heads-up when it needs you.

The useful form: wrap the command

Put caffeinate in front of the thing you're running. The Mac stays awake until that command exits, then goes back to normal on its own.

caffeinate -i claude

The flags

-iPrevents idle sleep. The one you want for agent runs.
-dKeeps the display on too. Only needed if you want to watch.
-sPrevents system sleep — but only while on AC power.
-mPrevents the disk from idle-sleeping.
-t 3600Gives up after a number of seconds.
-w 4120Stays awake until the process with that PID exits — handy for an agent that's already running.

The three things it can't do

It can't survive the lid. None of these flags hold off sleep when you close the lid on battery. That sleep isn't an idle decision, so the request caffeinate makes doesn't apply. If you need the lid shut, read the 23:52 problem.

It can't tell working from waiting. caffeinate -i claude holds the Mac awake for as long as the session is open — including the hours an agent sits idle at its prompt, waiting for you. Your battery pays for a run that already finished.

It can't tell you anything. If the agent stops to ask for permission at 23:52, caffeinate keeps the Mac awake while the run sits blocked until morning.

Where UnIdle fits

UnIdle does what caffeinate -i does, without the wrapper — and closes the other two gaps. Free:

  • Detects Claude Code, Codex, Aider, Gemini, Cursor and opencode on its own. Nothing to type before each run.
  • Holds sleep off only while an agent is actually working, and lets go the moment it's done.
  • Notifies you when a run finishes — and, for Claude Code, the moment it stops to ask for a yes.

Pro adds the lid: it keeps running with the lid shut on battery.

Download freePro is $12 once, with a 14-day free trial.