Skip to content
86% off$349 $48.86code BF2026

Docs

Glowmoth docs25 pages

Scheduled runs and agent limit resets in Glowmoth

Schedule Glowmoth to keep your Mac awake at a set time, see why it usually can't wake a sleeping Mac, and schedule a run for an agent's usage-limit reset.

Updated 6 min read

On this page

This page shows how to set up Glowmoth scheduled runs, which keep your Mac awake from a set time for a set length, and how to schedule one automatically when a coding agent hits its usage limit. Glowmoth normally can't wake a Mac that is already asleep, so a run only starts if the Mac is awake at its start time. Keep awake until then solves this by holding the Mac awake from the moment you add the run, and it is on by default.

What Glowmoth scheduled runs do

A scheduled run holds your Mac awake from a start time for a fixed length. Use it for timed jobs, such as a script that starts at 2:00 or picking up an agent's work after its limit resets. The footer in Settings says the same: "Your Mac stays awake from the start time for the chosen length, for timed jobs or an agent's limit reset."

While a run is active, the panel lists it as a reason, for example "Scheduled run until 06:00". Like other automatic reasons, a scheduled run keeps the Mac awake but lets the display sleep as usual.

Before you start

  • Glowmoth needs an active trial or MacSuite license. Without one, nothing is kept awake.
  • To schedule runs for agent limit resets, you call glowmoth agent. Install the command-line tool first (see the glowmoth command-line tool).

Add a scheduled run

  1. Right-click the Glowmoth icon in the menu bar and choose Settings… (⌘,).
  2. Open the Automation tab and find Scheduled Runs.
  3. Click Add Run….
  4. Set Start at to the time the run should begin. Glowmoth uses the next time that clock time comes around.
  5. Choose a length in Stay awake for.
  6. If Keep awake until then appears, leave it on unless you're sure the Mac will already be awake at the start time.
  7. Click Add Run (or press Return). Cancel (Esc) closes without adding anything.
Glowmoth Settings, Scheduled Runs: Start at 05:00, Stay awake for 1 Hour, Keep awake until then on, Cancel and Add Run
Adding a scheduled run.

Run options

OptionWhat it doesDefault
Start atThe clock time the run begins. Glowmoth uses its next occurrence.—
Stay awake forHow long the Mac stays awake once the run starts: 15 Minutes, 30 Minutes, 1 Hour, 2 Hours or 4 Hours1 Hour
Keep awake until thenAlso keeps the Mac awake from now until the start time. Only shown when Glowmoth can't schedule a system wake, which is the usual case.On

To end an active run early, click the ✕ (End This Reason) on its row in the panel's Held By list.

What Keep awake until then does

With Keep awake until then on, the run holds your Mac from the moment you add it. Until the start time, the panel shows a reason such as "Waiting for the run at 05:00". At the start time the run takes over for the length you chose, so the Mac never idle-sleeps in between.

With it off, Glowmoth only waits. If the Mac has gone to sleep by the start time, the run doesn't start. It starts only if the Mac happens to be awake then, because you're using it or another reason is holding it.

For long waits, such as setting up a 5:00 run in the evening:

  • The display can still sleep. Only system sleep is blocked, so your screen turns off on its usual schedule while work keeps running.
  • Safety limits still apply. On battery, Glowmoth pauses everything when the charge falls below the floor (20% by default). It also pauses if the Mac runs hot. Plug in for overnight waits. See battery and heat safety limits.
  • Closing the lid still sleeps a MacBook unless closed-lid mode is on. That mode works while Glowmoth is keeping the Mac awake for any reason, which includes a waiting run. See keep a MacBook awake with the lid closed.

Can Glowmoth wake a sleeping Mac?

Usually not. Glowmoth tries to ask macOS to wake the Mac at the start time, but macOS normally refuses that request from apps that don't run as root, and Glowmoth runs as a regular app.

Each row in the Scheduled Runs list shows what will happen:

  • "Wakes your Mac": macOS accepted the wake request, so the run can start even if the Mac is asleep.
  • "Kept awake until then": no wake could be scheduled, so Glowmoth keeps the Mac awake until the start time instead.

When a wake can't be scheduled, the Add Run sheet says so: "Glowmoth can't wake a sleeping Mac without administrator rights." The helper that closed-lid mode installs doesn't schedule wakes, and Glowmoth doesn't create pmset sleep, wake or repeating schedules. In practice, plan on Keep awake until then doing the work.

Schedule a run for an agent's usage-limit reset

When a coding agent hits its usage limit, it usually reports when the limit resets. Pass that message to glowmoth agent. Glowmoth reads the reset time and schedules a run that starts 2 minutes before the reset and lasts 30 minutes. While that run is active, the panel shows it as "Agent limit reset until …".

Glowmoth Settings, Scheduled Runs with a 05:00 run for 1 hour and an agent limit reset run for 30 minutes
bash
glowmoth agent --event limit --message "Usage limit reached ∙ resets 5am (Europe/London)"

This sends a usage-limit message to Glowmoth, which schedules a run starting at 4:58 London time. --event takes the event name your hook passes.

How it behaves:

  • Hooks without --message: if you leave out --message, glowmoth agent reads the hook's JSON from standard input, so you can call it directly from an agent's hook.
  • Only usage-limit messages count. Glowmoth accepts other events and ignores them for now.
  • One agent run at a time. A newer usage-limit message replaces the earlier agent run.
  • It always exits 0, so it won't break your agent's hook.
  • It needs a license.
  • You connect the hook yourself. Glowmoth doesn't edit Claude Code or Codex settings. Add the command to your agent's hook setup by hand.

Make sure the Mac is awake at the reset

Like any run, the agent run can't wake a sleeping Mac. Once your agent stops working, agent-aware mode lets the Mac sleep after its cool-down (5 minutes by default), and nothing else may hold the Mac until the reset. To cover the gap, do one of these:

  • Add a manual run with Add Run… at the reset time and leave Keep awake until then on.
  • Start a session that lasts until the reset, for example from Terminal:
bash
glowmoth until 05:00

This keeps the Mac awake until 05:00, or until 05:00 tomorrow if that time has already passed today. Run glowmoth off to end it early. A session keeps the display on if Keep the display on is set in Settings ▸ Sessions; turn off Keep Display On in the panel to let the screen sleep during this session.

For how Glowmoth detects agents and the cool-down, see stay awake while AI coding agents work.

Limits

  • 20 runs at most. Glowmoth beeps and doesn't add a 21st.
  • Past times are rejected. Glowmoth beeps instead of adding a run whose start time has already passed.
  • One agent limit run at a time. Each new usage-limit message replaces the previous one.
  • Lengths are fixed: 15 minutes to 4 hours for manual runs, 30 minutes for agent runs. For anything longer, start a session with Until a Time… in the panel or glowmoth until.
  • Runs aren't exported. The settings file doesn't include scheduled runs, and Reset all settings deletes them.
  • Runs never keep the display on.

If a run didn't keep the Mac awake

  • The Mac was asleep at the start time. If the row showed neither "Wakes your Mac" nor "Kept awake until then", the Mac had to be awake on its own. Add the run again with Keep awake until then on.
  • Glowmoth was set to Manual. Manual ignores every automatic reason, including scheduled runs. Switch the panel back to Automatic, or turn on Keep awake automatically in Settings ▸ Automation.
  • You used Stop Everything. That suspends all automatic reasons until you next start a session or relaunch Glowmoth, and the app shows no indicator for it. Start and stop a session, or relaunch Glowmoth.
  • A safety limit paused it. On low battery or high heat the panel says "Paused". Plug in, or use Resume Anyway (30 min).
  • The lid was closed. Without closed-lid mode, closing the lid sleeps a MacBook whatever Glowmoth is doing.
  • The trial ended or the license couldn't be verified. The panel shows the locked message and nothing is kept awake. Enter your license again.
  • glowmoth isn't found in Terminal. The tool installs to ~/.local/bin. Add that folder to your shell's PATH.
  • The agent message didn't schedule anything. Check that the message contains the reset time ("resets 5am …"). Other events are ignored.

Every app.
One purchase.