Your agent is still working. Your Mac shouldn't clock out.
HoldMyCode blocks sleep only while a coding agent like Claude Code, Codex or Cursor is actually running a task, whether the lid is open, closed, or halfway into your bag. The moment it goes idle, it hands sleep back to macOS and gets out of your way.
Supported agents
Six agents. One lid.
Command line agents and editors report through their own lifecycle hooks, which HoldMyCode installs for you automatically. Claude Cowork is read from the Claude app's task logs.
Claude Code
Lifecycle hooksClaude Cowork
Task logsCodex
Lifecycle hooksGemini CLI
Lifecycle hooksCursor
Lifecycle hooksCline
Lifecycle hooksMore agents
Coming soon
Lifecycle hooks and task logs are a real working / idle signal.
Hooks set themselves up at launch and stay up to date, including for an agent you install
later. Cline is the one exception: its config lives inside ~/Documents, which
macOS guards with a permission prompt, so its hooks are offered rather than installed
silently.
Features
Small app, specific job.
Everything here answers one question: is an agent working right now, and should this Mac stay up for it?
-
Awake only for your agent
Held only while a watched agent is actually working. Idle at a prompt gets no hold.
-
Real state, via hooks
Lifecycle hooks report working and idle per session, so a busy agent is never confused with a process that happens to be running.
-
Battery guardrails
A percentage where the hold gives up, or holds only on power. Low Power Mode is respected, not fought.
-
Display controlComing soon
Planned: whether the display sleeps on lid close, dims during a run, or shuts off after it. Not in the app yet.
-
Notifications
A banner, and an optional sound, when a hold starts, ends, or is cut short by your battery threshold.
-
Menu bar dropdown
Status, elapsed hold, battery, the keep awake mode and a master toggle. Pause for half an hour, or use the hotkey.
-
Claude usage in the panelNew in 2.0
Limit windows, session left, today's turns and an estimated cost — the figures Claude Code itself reports.
-
Limit countdown in the menu barNew in 2.0
While a limit is blocking turns, the icon counts down to the window lifting.
What's new in 2.0
Hooks that set themselves up, and an app that updates itself.
-
Lifted limits stop being reported
And one limit retried several times counts once, not once per retry.
-
Hooks install themselves
Every supported agent is hooked up at launch and kept current. Cline is offered rather than installed, since its config sits in
~/Documents. -
One-click updates
Press Update and the app swaps itself in and reopens.
-
A What's New window
After an update installs, a short page on what changed.
2.0.1 smaller fixes
- The app asks your shell where Claude Code is installed instead of guessing, so version managers (nvm, fnm, mise, asdf) work.
- Usage refreshes every minute in the background, rather than only while the panel is open.
- A usage reading that hangs is abandoned and retried instead of freezing the panel.
- The currency for the cost estimate is picked in Settings.
Full notes for every release are on the releases page.
See it in action
Watch it work.
Under a minute, start to finish. First launch to a closed lid that keeps running, with nothing trimmed out.
The setup itself: drag it to Applications, approve the helper once, then start a task and close the lid.
FAQ
Reasonable questions.
How is this different from Caffeine or Amphetamine?
Those keep your Mac awake for as long as you leave them switched on. The decision is yours, and the classic failure mode is forgetting to flip it off, then finding a hot, flat laptop at the bottom of your bag. HoldMyCode ties the wake lock to the agent instead. The hold exists only while a watched agent is in the middle of a task, and it ends by itself when the work does. Nothing to toggle, nothing to forget.
Why not just run caffeinate?
caffeinate is built into macOS and fine while the lid is open:
caffeinate -i claude keeps the Mac up for as long as that process runs. Two
catches. It holds for the whole session, including the hours an agent sits idle at a
prompt, and it does nothing about the lid: close it and the Mac sleeps anyway.
HoldMyCode holds only while a task is running, and handles the lid as well.
More in keeping Claude Code running with the lid closed.
Does it really keep running with the lid closed and no external display?
Yes. A plain sleep assertion isn't enough for a lid close, so HoldMyCode installs a small privileged helper that disables lid sleep while a hold is active and turns it back on the moment the hold ends. No external display, keyboard, or dongle required. macOS asks you to allow it once, in System Settings under Login Items.
Can it read my code or my prompts?
No. It never reads your code or your prompts, and nothing about your sessions leaves your Mac. Hooks record only whether a session is working, in a small file on your Mac. The usage card counts turns and estimates cost from Claude Code's own local files and asks Claude Code itself for your limit figures; that runs on your Mac and sends nothing anywhere. The app has no account and no analytics inside it. It talks to exactly two servers: GitHub, to check for and download a new version, and, if you leave local currency switched on, a public exchange rate feed once a day, which is sent nothing about you. The only other part that talks to a server is this website, which keeps an anonymous download count and the name you give before downloading.
Which agents work today?
Claude Code, Codex, Gemini CLI, Cursor and Cline through their lifecycle hooks. Since 2.0
those install themselves: every supported agent found on your Mac is hooked up at launch
and kept up to date, and so is one you install later. Cline is the exception, because its
config sits in ~/Documents behind a macOS permission prompt, so it asks
first. Claude Cowork works out of the box from the Claude app's task logs. You can still
remove hooks in Settings › Agents, and nothing puts them back.
What stops it from draining my battery?
A threshold you pick. Below it, the hold releases and a notification tells you why. You can also restrict holds to times when you're on power, and HoldMyCode won't override Low Power Mode. Thermal pressure ends a hold too, rather than cooking the machine in a bag.
Is it actually free, or free for now?
Free. No licence key, no trial timer, no surprise paid tier waiting in the wings. It's a small utility that does one job, and charging for it isn't the plan. The app is closed source, so that's a promise rather than something you can audit, but there's no account to create and nothing to cancel.
< missing your agent? >
if HoldMyCode doesn't notice the agent you run, say which one and it gets detection in the next build. same for a bug that only shows up on your machine *
* every agent it detects today started as one of these.
Download
Free, and about 4 MB.
No account, no licence key, no trial. Drag it to Applications and it updates itself from there.
Just a name before it downloads, so I know how many Macs it’s keeping awake.
Requires
macOS 14 Sonoma or laterApple silicon and Intel
Price
Free, foreverNo licence key, no trial, no tiers
On first launch
One admin promptInstalls the helper that manages lid sleep
Version
2.0.1Updates install themselves from here on