Show HN: NoSleepAgent – keep your MacBook awake until your agents finish

garymiklos1 pts0 comments

GitHub - gergomiklos/nosleepagent · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

gergomiklos

nosleepagent

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>9 Commits<br>9 Commits

.gitignore

.gitignore

LICENSE

LICENSE

MenuBar.swift

MenuBar.swift

README.md

README.md

build.sh

build.sh

ctl.sh

ctl.sh

install.sh

install.sh

nosleep.sh

nosleep.sh

uninstall.sh

uninstall.sh

View all files

Repository files navigation

NoSleepAgent

Keeps your Mac awake while your agents are working — close the lid and the job keeps running. Once they are idle, normal sleep comes back.

Works with Claude Code and Codex .

How it works

Claude Code / Codex hooks stamp a "last activity" time on every prompt and tool<br>call. A root daemon checks it every 30s:

active in the last 10 min → pmset disablesleep 1 (stay awake, lid open or closed)

idle → pmset disablesleep 0 (sleep normally)

A timestamp drives everything — no state machine.

Menu bar

An icon shows the live state so you can check before closing the lid:

⚡️ Awake — safe to close the lid, the job keeps running

🌙 Will sleep — closing the lid now sleeps the Mac

Click it to pause/resume keep-awake or quit.

Install

git clone https://github.com/gergomiklos/nosleepagent.git<br>cd nosleepagent<br>./install.sh

Wires up the hooks for both Claude Code (~/.claude/settings.json) and Codex<br>(~/.codex/hooks.json), backing up each first, installs the daemon, and adds a<br>/nosleep command. Needs sudo (flipping disablesleep is root-only). Works on<br>any Mac.

Afterward: restart open Claude Code sessions; in Codex, run /hooks and trust<br>the new hooks.

Use

Nothing — it just runs. To turn it off: ./ctl.sh off (on / status), or<br>/nosleep off inside Claude Code.

Uninstall

./uninstall.sh

Removes the daemon and re-enables normal sleep.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Readme

License

MIT license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

star

Watchers

watching

Forks

forks

Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Shell<br>70.5%

Swift<br>29.5%

You can’t perform that action at this time.

nosleepagent code reload license claude awake

Related Articles