Close the lid.
The jobs still run.

Prefer the terminal? Install with Homebrew.

It automatically finds all your jobs.

Claude, Codex, hermes, crontab, launchd, whatever else you run. It reads them all and knows when to wake for each one.

Finder File Edit View Window Help 🍠 Sat 8 Aug 09:41
Hermes Hermes
Claude Claude
Codex Codex
Terminal Terminal
goguma 🍠
01:15
Time Machine to NAS daily at 01:15
02:00
Overnight inbox triage daily at 02:00
04:00
Dependency bump PR Sundays at 04:00
06:00
Calendar sync every 6h
07:30
Weekly repo digest Mondays at 07:30
08:45
Standup notes from Slack weekdays at 08:45
09:00
Morning briefing: AI/Tech daily at 09:00
12:00
Repo test sweep twice daily
~/.hermes/cron/jobs.json3 jobs ~/Library/Claude/cron.json2 jobs ~/.codex/cron.toml2 jobs /Library/LaunchAgents1 job

Install

One command
and it's running.

macOS 14 or newer, and a password prompt for the root helper. Or download the app, which carries the same tools inside it.

$ brew install junnam586/tap/goguma
$ goguma install
→ wakes for the jobs it finds, and nothing else

Open source on GitHub. Get updates.

How it works

Awake for the job.
Asleep for the rest.

It reads the schedule already on the machine, wakes a moment before each job, holds sleep off until that job finishes, then lets go.

Without goguma stays awake all night
Finder File Edit View Sat 8 Aug
Time Machine to NAS
launchctl start com.apple.backupd
Overnight inbox triage
hermes cron run inbox-triage
Dependency bump PR
codex cron run dependency-bump
23:00
07:00 100% 93% 87% 80% 73% 67% 60% 53% 47% 40% 33% 27% 20% 13% 7% 0%
With goguma wakes three times
Finder File Edit View 🍠 Sat 8 Aug
Time Machine to NAS
launchctl start com.apple.backupd
Overnight inbox triage
hermes cron run inbox-triage
Dependency bump PR
codex cron run dependency-bump
23:00
07:00 100% 100% 99% 99% 99% 98% 98% 98% 97% 97% 96% 96% 96% 95% 95% 94%

Long work

Wrap it.
Walk away.

A coding agent runs for as long as it runs. Shut the laptop halfway through and the machine sleeps underneath it. Wrap the command and sleep is held off for exactly as long as it takes, lid closed included, then released.

$ goguma run -- claude -p "refactor the auth module"
→ holding sleep off while claude runs
→ released, 41m 12s

Inside an editor there is no command to wrap, so the editor says so instead — set up for you, for Claude Code, Codex, Cursor and Gemini CLI.

Questions.

Every line of goguma is open source on GitHub.

What does it do?

Wakes the machine 90 seconds before a job is due, blocks sleep while it runs, lets go when it's done.

Does it run my jobs for me?

No. Your existing scheduler still fires them. Running a second one would just mean everything executes twice.

Isn't this just caffeinate?

No. caffeinate stops a Mac sleeping, so you have to leave it running all night for a 3am job. goguma lets it sleep and wakes it at 2:58.

It also can't hold a closed lid awake. caffeinate blocks idle sleep, and shutting the lid isn't idle sleep, so it stops the moment you close the laptop. That is the case an agent or a long build needs most.

Can I keep a coding agent running with the lid shut?

Yes, and it is set up for you. Claude Code, Codex, Cursor and Gemini CLI are configured to say when they are working, so the Mac stays awake until they finish and sleeps once they do. It is a setting, so one switch takes it back out. goguma hooks shows what is in place; goguma hooks remove undoes it.

It stops when the agent stops, not on a timer, and two editors open hold separately so the one that finishes first doesn't sleep the machine under the other. For anything you start yourself, wrap it: goguma run -- claude -p "...".

This is needed because an agent can't be recognised from outside: its process is there whether or not it's working, and processor use doesn't separate the two, because an agent waiting on a model is a process waiting on a socket.

Why not just sudo pmset -a disablesleep 1?

That is the mechanism goguma uses, and for one run you are sitting next to, it is enough.

It is a global setting that outlives the process that set it, and logout, and reboot. Forget to clear it and the Mac never sleeps again. goguma guarantees the other half: released when the command exits, when the background service dies, at 10% battery, and at 80°C.

Does it need root?

A small helper does, and only because macOS lets nobody but root schedule a wake or keep a closed lid awake.

It can do exactly two things: set the wake time, and hold sleep off. It can't read your jobs, your files, or anything else, because it is never told about them. Everything else runs as you. --no-helper installs without it, and lid-closed jobs stop working.

Does anything leave my machine?

Nothing about you. There's no account, no sign-in and no analytics. Your jobs, your commands and your schedules never leave the Mac.

goguma does fetch one small file from this site once a day, to tell you if a bug has been found or a fix is out. It's a plain download with no identifier attached, not even which version you're running, and what comes back is signed, so it can show a message and nothing else. It can't change a setting or run anything. Turn it off with goguma config set advisory_checks off, or get an email instead.

Will it keep the machine awake?

Only while a job is running. Holds expire on their own ceiling, five minutes by default, so a job that hangs can't pin the machine open all night.

What about a laptop in a bag?

It lets go. Above 80°C or below 10% battery, every hold is dropped and the Mac sleeps normally.

It also won't wake for a job it can't afford, measured against what that job has actually been costing.

Let it sleep.

or install with Homebrew · get updates