Close the lid.
Your AI keeps working.

Keeps your laptop awake while Claude Code or Codex works with the lid shut, then lets it sleep when the work is done.

brew install --cask 12alexanderbell-graham/nocturnal/nocturnal

Or download the app. Not notarized yet, so allow it once in Privacy & Security.

Free and open source · Connect your agent →

Nocturnal's menu on the Mac: Keeps working, battery and hours left, Off / When Busy / Always, Approve all, Phone and Lid shut
The Nocturnal iPhone app, coming sooniPhone app · soon
Nocturnal's phone page: Keeps working, battery, watts and hours left, and Off / When Busy / Always

Agents work for hours. Closing the lid still puts the laptop to sleep. Nocturnal keeps it working, then lets it sleep when the work is done.

Your agent is working.

Claude Code is mid-refactor, and you need to leave.

Close the lid anyway.

The screen goes off, idle apps pause, Low Power Mode comes on.

When it's done, it sleeps.

Open the lid and everything is as you left it.

18.3W
Lid open · agent working

Measured on an M5 Max MacBook Pro with iOS simulators open. Yours will differ; Nocturnal measures your own.

How it works

Awake while

  • Claude Code works
  • Codex or any other agent works
  • An app you pick is busyBlender, ffmpeg, Xcode
  • Or always, or for a set time

With the lid shut

  • Keeps working, screen off
  • Pauses idle apps, turns on Low Power Mode
  • Sleeps when the work is done
  • Puts it all back when you open it

Sleeps at your battery limit, or the moment it gets too hot.

Approve everything and agents run without asking, until the work is done.

Measures what each saving is worth on your own Mac.

Connect your agent

A minute of setup, then your agent keeps the laptop awake on its own.

  1. Run this, or on a Mac use Settings › Agents:
    nocturnal connect claude
  2. Paste the setup prompt into Claude Code.
Read it first
Nocturnal is installed on this laptop. It keeps the machine awake with the lid closed while you work, and cuts power use while the lid is shut. You can control all of it through the nocturnal MCP tools (or the nocturnal command). Set it up for me:
1. Read Nocturnal's settings and power report to see every setting and what is using power right now.
2. Ask me, in one short message: which apps must keep running at full speed with the lid shut (music, calls, a local model, Docker...), and whether it should stay awake only while agents work or always.
3. Apply the strongest savings that don't touch what I named: preset max_battery, pausing simulators and background audio, low power, and per-app rules.
4. If my lid is closed, run Nocturnal's power test and tell me what the savings are worth in watts.
5. From now on, keep the laptop awake through Nocturnal before long work and release it when done.
Never turn off the heat guard or lower the battery limit; Nocturnal won't let you, and that's on purpose.
The phone page's main screen The phone page's settings: agents, apps that keep it awake, and what happens with the lid shut

Control it from your phone

Check on it, change it or wake it, from anywhere.

  • Open nocturnal.tools/remote and add it to your Home Screen.
  • On your computer, choose Pair a Phone and scan the code. End‑to‑end encrypted.

iPhone app, coming soon

Native, and it pairs the same way.

The Nocturnal iPhone app: Keeps working, battery, watts and hours left, this week's savings, and the keep-awake band The iPhone app's settings: what keeps it awake, agents, apps and every setting

Questions

Is it safe in a bag?

It sleeps if it gets hot or the battery reaches your limit. The heat guard and battery limit can't be loosened by an agent or the phone.

What does it change?

Sleep, Low Power Mode, screen brightness and idle apps, only while the lid is shut. Opening the lid puts it all back.

Can my AI agent control it?

Yes, through its MCP tools or the nocturnal command. See Connect your agent.

Windows and Linux?

Both work, in beta: the same engine as the Mac, with a tray icon instead of the menu bar panel. If Windows warns when you open it, choose More info › Run anyway.

Why does macOS say it can't verify Nocturnal?

Nocturnal isn't notarized by Apple yet. The first time you open it, macOS blocks it: open System Settings › Privacy & Security, scroll down, click Open Anyway next to Nocturnal and confirm. You only do this once.

Chrome says the download is suspicious?

It's a new file Chrome hasn't seen many people download yet. Choose Keep, or install with brew, which doesn't go through Chrome.

Why does it ask for a password?

Once, on the Mac, to allow only the few commands that switch sleep and Low Power Mode. Delete the app and that permission removes itself.

Lost internet with the lid shut?

On an iPhone hotspot, set System Settings › Wi‑Fi › Ask to join hotspots to Automatic.

Is it free?

Yes, and open source under the MIT licence.

Close the lid.
Your AI keeps working.

brew install --cask 12alexanderbell-graham/nocturnal/nocturnal

Or download the app.