Let your agents run with the lid closed.
Nuit Blanche keeps your MacBook working after you shut it, on battery, with no monitor plugged in. Click the moon in your menu bar, close the lid, go.
One click before you leave.
macOS puts a MacBook to sleep the moment the lid shuts, halfway through a four-hour agent run or not. Nuit Blanche adds the switch macOS doesn’t have.
Click the moon
Or press ⌃⌥⌘L. It turns into a sun, and a small pop-up confirms it. Nothing else changes while the lid is open.
Close the lid
The screen goes dark and the Mac keeps working, on battery or plugged in. Set it down somewhere with air, not inside a bag.
Click the sun when you’re back
The moon comes back and your Mac sleeps on lid close, like it always did.
Say yes to the coffee.
The run you started at eleven is still going at one. Your Mac sits shut on the desk, on Wi-Fi, doing the work, and you’re two streets away with an espresso.
Agents, builds, downloads, SSH sessions and long exports all carry on with the lid down. Nothing needs to stay plugged in, and nothing needs a second screen.
It knows when to let your Mac sleep.
A laptop that never sleeps is its own problem, so Nuit Blanche keeps an eye on the clock, the battery and the heat while you’re away.
- A timer, if you want one
- Stay awake for 1, 2, 4 or 8 hours, then sleep like normal.
- A battery floor at 20%
- On battery, it lets the Mac sleep before a long run drains it flat.
- A heat cut-off
- If the battery passes 45°C or macOS reports the Mac is overheating, it lets it sleep.
- No way to forget it
- The sun stays in your menu bar while it’s on, and quitting the app puts normal sleep back.
Your agents can flip the switch themselves.
Nuit Blanche installs a small nuitblanche command. Add two lines to your CLAUDE.md or AGENTS.md and the agent keeps the Mac up while it works, then switches it off once the whole task is done.
Nuit Blanche doesn’t watch your agents, so the agent has to say when it’s finished. If it never does, the timer covers you. With the lid already shut, switching off puts the Mac straight to sleep.
~/shop-api ❯ nuitblanche on 4h Awake with the lid closed for 4h. ~/shop-api ❯ nuitblanche status on (3h 59m left) ~/shop-api ❯ nuitblanche off Sleeps normally again.
When I say I’m heading out, run nuitblanche on 4h.
If you did, run nuitblanche off once the whole task is done.
-
One rule you can read
It asks for your password once, to add a single rule that lets it switch sleep on and off. Read it with
cat /etc/sudoers.d/nuitblanche. -
Online for two things only
Activating your key, once, and checking for updates once a day, which you can turn off in the menu. No analytics, no account, and the free nights are counted on your Mac.
-
Puts a shut Mac to sleep
Turning sleep back on with the lid already shut doesn’t put a Mac to sleep. When the timer or the battery floor switches it off, Nuit Blanche does that part for you.
-
Leaves cleanly
Uninstall Nuit Blanche…, under Nuit Blanche in the menu, removes the rule, the command and the app.
Questions
Why not caffeinate, Amphetamine or KeepingYouAwake?
caffeinate and KeepingYouAwake stop idle sleep while the lid is open. Close the lid on battery and the Mac sleeps anyway (caffeinate -s only holds on a charger). Amphetamine can keep a closed Mac awake through its Closed-Display Mode, with an extra helper to install. Nuit Blanche does the one job: lid closed, on battery, one click.
What does it cost?
Your first 5 nights are free. After that, it’s $6.47, once, for your Mac. There’s no subscription, and every 1.x update is included.
What counts as a free night?
A night counts once Nuit Blanche has kept your Mac awake for 30 minutes with nobody at it: the lid shut away from a monitor, or the screen asleep and untouched. The next 24 hours belong to that night, so the ride home or a check at 3 a.m. doesn’t use another. Trying it while you’re at your Mac doesn’t use one at all.
Does it need my password?
Once. Setup adds a rule in /etc/sudoers.d/ that allows exactly two commands, pmset -a disablesleep 1 and pmset -a disablesleep 0, so it can switch without asking each time. Skip it and macOS asks for your password on every switch instead. Uninstalling removes the rule.
I run several Claude Code sessions. Does one finishing put the Mac to sleep under the others?
No. Each session that runs nuitblanche on holds the Mac awake in its own name, and nuitblanche off releases that session’s hold only. With the Claude Code hooks in, the Mac sleeps ten minutes after your sessions go quiet; without them, when the last hold is gone: every session has said off, closed, or run out its time.
How long will the battery last?
As long as your agents let it. The screen goes off the moment the lid closes (macOS would leave it lit inside the closed lid for ten minutes on battery), so the battery goes to the agents. The menu shows macOS’s own estimate before you close the lid, 36% battery, about 5h 19m at this rate, agents can read the same number with nuitblanche status --json, and the Mac sleeps at 20% unless you untick that guard. Turning it on at 30% or less says so.
What happens when it goes offline?
By default, nothing: it stays awake until the timer, the battery floor or your agent’s off. Tick Offline for 15 minutes under Sleep anyway if in the menu and it sleeps after 15 minutes with no network, since agents that need an API are stalled anyway. Agents can see online in status --json and decide for themselves.
Can I check on it from my phone?
Yes, over SSH on your phone’s hotspot. Turn on Remote Login on the Mac and make an iPhone Shortcut that runs nuitblanche status: it shows what’s holding the Mac awake and the battery. A second Shortcut with nuitblanche off --all puts it to sleep from the bag. The recipe is here.
Will it cook my laptop?
A closed MacBook doing heavy work runs warm, with less air than when it’s open. Put it down on a desk, a table or a car seat. Don’t zip it into a bag while it works. If the battery passes 45°C or macOS reports the Mac is overheating, Nuit Blanche lets it sleep.
Which Macs does it run on?
It’s tested on macOS 26 Tahoe on an Apple silicon MacBook. It’s built for macOS 13 Ventura or later, on Apple silicon and Intel, but older macOS versions and Intel Macs haven’t been tried yet, so if it misbehaves on yours, write to hello@nuitblanche.app. On a desktop Mac it simply keeps the machine from sleeping.
What if I restart or quit the app?
Quitting puts normal sleep back, and so does logging out or restarting. If the Mac crashes or loses power while it’s on, Nuit Blanche switches the setting off the next time it starts.
What happens after the free nights?
The next time you switch it on, Nuit Blanche asks for a key instead. Buy it right there: the key comes back to the app by itself, and it’s under Access purchase in your receipt email too. A session that’s already running carries on. Sure already? Buy it now.
Close the lid tonight.
5 free nights, then $6.47, once.
Every 1.x update is included.
macOS 13 or later. Tested on macOS 26 with Apple silicon.