29 comments

  • chopete36 hours ago
    This is great. Will check it.<p>Recently I bought a usb-c empty external monitor card to prevent mac from going to sleep. There are many of these external monitor simulators on Amazon.<p>I still see the laptop go to sleep many times with the external monitor simulator.<p>This is the one I bought.<p>4K 60Hz USB-C Type-C Virtual Display Adapter DDC EDID Dummy Plug Headless Ghost Display Emulator 2K 60hz1080P@120Hz
    • kageroumado5 hours ago
      The dummy display enables “clamshell mode,” which lets your MacBook stay awake even with the lid closed, provided that it’s <i>also</i> on AC power. If the MacBook is not connected to power, the clamshell mode isn’t activated and it will sleep normally.<p>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.
      • chopete35 hours ago
        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.<p>I will see how this app fits into my specific need.<p>I have to check this on Mac Sequoia 15.7
        • kageroumado4 hours ago
          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.
    • bluedino6 hours ago
      Can&#x27;t you just use a hot corner configured as &quot;prevent sleep&quot;?
      • fragmede5 hours ago
        How does it sleep when the agent is done working with the hot corner?
        • doubled1125 hours ago
          Have the agent write an app that moves the cursor our of the hot corner and trigger it when done.
  • 473 hours ago
    I have been using the builtin macOS `caffeinate` command for this.<p>For example:<p>caffeinate -dimsu<p>That keeps the Mac awake so I can use Claude remotely from phone.<p>You can also wrap your command as well, but I rarely use it.<p>caffeinate -dimsu your-agent-command
    • zxexz2 hours ago
      Caffeinate is burned into my muscle memory at this point. I attribute that to the realization that you could repeat opt flags. There&#x27;s something catchy about<p>caffeinate -dimsum
    • kageroumado1 hour ago
      Claude Code actually uses caffeinate -i -t 300 during Claude’s turn, restarted automatically until the turn finishes.
    • steve-atx-76001 hour ago
      The new wave apps named after speed &#x2F; modifinil must be hard core?
  • exabrial3 hours ago
    Amphetamine is what I use. It has a robust set of triggers, like if you ip address changes to a certain subnet (like private IPs on a work network)<p><a href="https:&#x2F;&#x2F;apps.apple.com&#x2F;us&#x2F;app&#x2F;amphetamine&#x2F;id937984704?mt=12">https:&#x2F;&#x2F;apps.apple.com&#x2F;us&#x2F;app&#x2F;amphetamine&#x2F;id937984704?mt=12</a>
  • aqme285 hours ago
    Thank goodness. I can’t leave my laptop for a second unattended because my cat loves nothing more than to dance on the keyboard. I’ve need something like this.
  • processunknown6 hours ago
    Does it also make my Mac irritable?
    • loeg1 hour ago
      I guess we are getting the entire modafinil, R-modafinil extended universe.
    • kageroumado6 hours ago
      Probably less irritable than amphetamine~
  • kylehotchkiss9 minutes ago
    `sudo pmset -a sleep 0`
  • lellow4 hours ago
    Interesting. Kind of similar in purpose, but I created a simple app to schedule and type the &quot;continue&quot; word in my terminal after X time has passed, since I have to wait for my usage to be restored. =)
  • rancar25 hours ago
    For MacOS, keep awake with:<p>sudo pmset -a disablesleep 1<p>Reset back:<p>sudo pmset -a disablesleep 0
    • kageroumado5 hours ago
      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.
      • xbar5 hours ago
        Nice. I needed this yesterday, and will need it again today.
    • hamza_q_2 hours ago
      This works great. Only downside is display doesn&#x27;t turn off when you close the lid. Made a little status bar utility to wrap the disablesleep command and address that downside:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;narcotic-sh&#x2F;modafinil" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;narcotic-sh&#x2F;modafinil</a><p>(yes, I know, another *afinil named Mac sleep prevention app? but hey, I was first :P)
      • kageroumado2 hours ago
        Afinils are cool, and your app is cool too~
  • AussieWog932 hours ago
    How does this differ from <a href="https:&#x2F;&#x2F;github.com&#x2F;samber&#x2F;cc-caffeine" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;samber&#x2F;cc-caffeine</a>?
    • kageroumado2 hours ago
      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.
  • mr_toad4 hours ago
    I’ve often wondered about the thermal performance or running a MacBook with the lid closed. One argument is that the reduced surface area from a closed lid increases temperature. Others argue that not running &amp; rendering the display (and thus GPU) generates less heat. I’m not sure who to believe.
    • herrkanin4 hours ago
      Running lid closed with external display has been officially supported since forever so I wouldn&#x27;t worry about it too much.
  • dawnerd6 hours ago
    But Amphetamine has an option to end when an app closes. I’m just so confused why everyone using ai is reinventing solutions that already exist.
    • kageroumado6 hours ago
      Claude Code or Codex (normally) don’t close the terminal window after a turn ends, they wait for the user’s reply.
    • neoecos5 hours ago
      I think the same...It happend to me that I just ask Claude to build whatever I need for my personal very specific use case without looking what else it&#x27;s outhere
    • conception6 hours ago
      Easier to ask Claude than ask google I guess.
    • flexagoon5 hours ago
      Everyone dreams about making the next cool AI tool and doesn&#x27;t bother checking if someone has already made the same thing years ago without the word &quot;AI&quot; in the description
      • kageroumado4 hours ago
        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&#x2F;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.<p>It’s not like Amphetamine can’t do the same, it’s that this app is made specifically for AI agents and nothing else.
  • geor9e3 hours ago
    Codex recently built this in - &quot;Prevent sleep while running&quot; toggle
  • moralestapia6 hours ago
    What&#x27;s old is new again, but I welcome this.<p>I used to do this 15 years ago to keep listening to music from my laptop (one of the white chiclet ones) in my backpack, can&#x27;t remember the name of the app I used then.<p>One caveat, your laptop cannot cool inside a backpack, it will overheat and shut down anyway. This happened to me several times.
    • kageroumado6 hours ago
      It has a setting for thermal cutoff that you can set to something like 60º C. Sleeping will stop heavy work (like a build) before it leads to overheating.
    • dmd6 hours ago
      that was true of intel but definitely not of arm macbooks.
      • NewJazz6 hours ago
        Then why do they have fans?
        • loeg1 hour ago
          Many ARM Macbooks do not have fans?
    • dominotw6 hours ago
      had a coworkers whose laptop keys melted into mush
  • xlii6 hours ago
    Um so it is<p><pre><code> sudo bash -c &#x27;touch KEEP_RUNNING; pmset -b sleep 0; pmset -b disablesleep 1; while [ -e KEEP_RUNNING ]; do sleep 1; done; pmset -b sleep 5; pmset -b disablesleep 0&#x27; </code></pre> and<p><pre><code> Agent, when you&#x27;re done do `rm KEEP_RUNNING`, kthxbye. </code></pre> ?<p>(personally I have Ruby scripts that check activity on &quot;tmux capture-output&quot; for that)
    • fragmede6 hours ago
      <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9224">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9224</a>
      • da_grift_shift5 hours ago
        Yeah, I&#x27;ll stick with the oneliner.<p><a href="https:&#x2F;&#x2F;ghloc.vercel.app&#x2F;kageroumado&#x2F;adrafinil?branch=main" rel="nofollow">https:&#x2F;&#x2F;ghloc.vercel.app&#x2F;kageroumado&#x2F;adrafinil?branch=main</a>
  • operatingthetan6 hours ago
    So now we&#x27;re naming apps after obscure Modafinil derivatives?
    • hamza_q_3 hours ago
      I&#x27;ll take credit for starting this trend :P<p><a href="https:&#x2F;&#x2F;github.com&#x2F;narcotic-sh&#x2F;modafinil" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;narcotic-sh&#x2F;modafinil</a>
      • operatingthetan12 minutes ago
        There were mac apps called caffeine and amphetamine years ago.
        • hamza_q_1 minute ago
          Was referring to the *afinil specifically
    • treme3 hours ago
      <a href="https:&#x2F;&#x2F;kagerou.glass&#x2F;#dispensary-shelf" rel="nofollow">https:&#x2F;&#x2F;kagerou.glass&#x2F;#dispensary-shelf</a><p>He&#x27;s a connoisseur.
    • unacorner5 hours ago
      Adrafinil&#x27;s discovery and use predates Modafinil, I believe.
  • IncreasePosts3 hours ago
    At some point, if you closed the lid and didn&#x27;t have an external monitor plugged in, macos would put the GPU in power save mode, which would tank local llm performance. Is that not the case any more? There were even small singles you could get which would trick the ps into thinking an external monitor was plugged in
    • loeg1 hour ago
      I don&#x27;t think this is for running local llms.
  • slopinthebag3 hours ago
    15k loc for this? holy cow
  • WUMBOWUMBO6 hours ago
    reminds me of ye old caffeinate
    • kageroumado5 hours ago
      Caffeinate doesn’t prevent sleep with the lid closed.
  • 2001zhaozhao3 hours ago
    We need people to rediscover remote development desperately, lol.
  • cyanydeez5 hours ago
    you can run opencode inside a docker container and expose it&#x27;s webui.
  • tangweigang1 hour ago
    [dead]
  • rnagulapalle4 hours ago
    [flagged]
  • huflungdung4 hours ago
    [dead]
  • cyclopeanutopia6 hours ago
    Ridiculous bloat.