Hacker Newsnew | past | comments | ask | show | jobs | submit | kageroumado's commentslogin

Claude Code actually uses caffeinate -i -t 300 during Claude’s turn, restarted automatically until the turn finishes.


It’s an Electron app that uses powerSaveBlocker to prevent display sleep. It won’t prevent macOS system sleep on lid close with no power.


Thanks. This one looks much better!


Afinils are cool, and your app is cool too~


Indeed.

Thanks!


This looks beautiful! I hope it works out well for you


Super kind of you, thank you.


In order to get the same behavior with Amphetamine you’ll need to: 1. Install it from the AppStore (no brew, no GitHub) 2. Not forget to enable lock on lid close 3. If you ever connect/disconnect power while the lid is closed without the optional “Power Protect” system, the MacBook will sleep. The system is a script and a configuration file making sudo pmset -a disablesleep passwordless. 4. Add hooks to Claude Code configuration that will use Apple Script to start and stop Amphetamine sessions. For Codex you’ll have to make a script that will watch process activity to know when a turn ends.

It’s not like Amphetamine can’t do the same, it’s that this app is made specifically for AI agents and nothing else.


The dummy display enables “clamshell mode,” which lets your MacBook stay awake even with the lid closed, provided that it’s also on AC power. If the MacBook is not connected to power, the clamshell mode isn’t activated and it will sleep normally.

Adrafinil simply disables the global sleep without spoofing hardware, and re-enables it once the agent is done working, the temperature is too high, or the battery is low.


My requirement was to keep the laptop on with the lid closed. Sleep normally when idle but wake up when a nomachine request comes in.

I will see how this app fits into my specific need.

I have to check this on Mac Sequoia 15.7


The app is built for 26+, as I never tested it on earlier versions. It won’t solve your specific case, though, as it only prevents sleep. It won’t wake it once it’s already sleeping.


This is exactly what the app does, except it ties it to agent activity and re-enables sleep once the turn ends, the laptop is close to overheating, the battery is low, or on a timer.


Nice. I needed this yesterday, and will need it again today.


Caffeinate doesn’t prevent sleep with the lid closed.


Claude Code or Codex (normally) don’t close the terminal window after a turn ends, they wait for the user’s reply.


Probably less irritable than amphetamine~


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: