Find my plan

RunAgents247 / Guide

$0to try

Keep your Mac awake so your AI agent keeps running. It is free and built in.

Your agent stops when your Mac goes to sleep. One command that is already on every Mac stops the sleep. We ran it on a MacBook Pro and checked that it worked. It has one big limit, and that is on this page too.

  • Commands run on a 2017 MacBook Pro, macOS 13.7, on Nov 11, 2026
  • This fix costs nothing and pays us nothing
  • Hostinger's Black Friday prices end December 14, 2026, per Hostinger's sale page. After that they may go up.

The command

Open the Terminal app, type this, and press Return:

caffeinate -i -s

Leave that window open. While it runs, your Mac will not go to sleep by itself, so OpenClaw, Hermes Agent, n8n or Claude Code keeps working. The screen can still turn off. That is fine.

To stop it, click the Terminal window and press Control and C.

When the free fix is not enough

Hostinger Managed OpenClaw

Price
$4.99 / mo
You pay today
$119.76 for 24 months
After that
Renews at $9.99 or $11.99 / mo
Setup
Done for you. Hostinger says it is live in about a minute. You connect Telegram or WhatsApp.
Why pay
It keeps running with your laptop closed, in your bag or out of battery.
Change your mind
30-day money back
Get this plan on Hostinger

Partner link. We may earn a commission. Your price is the same.

Rather pay month to month? Cloudways is $9.99/mo with no contract, and $1.99 for the first 2 months right now. Compare the two

Read from the host's own site on Nov 11, 2026

What we ran, and what happened

Done on November 11, 2026 on a MacBook Pro (model MacBookPro14,3) with macOS 13.7.8, plugged in.

  • 1. We started the command

    We ran caffeinate -i -s with a 12-hour limit added (-t 43200).

  • 2. We asked the Mac if it was working

    We ran pmset -g assertions, which lists everything that is holding the Mac awake. It showed two new lines from the caffeinate tool: PreventUserIdleSystemSleep and PreventSystemSleep.

  • 3. We checked the sleep setting

    pmset -g then listed caffeinate by name next to the words "sleep prevented by". So the Mac itself reports that it is being kept awake.

  • What we did not test

    We did not close the lid, and we did not run it on battery. See the limits below before you count on either one.

What the letters mean

From the command's own manual page on the Mac (type man caffeinate to read it).

  • -i keeps the Mac from idle sleep

    This is the one that matters. The manual says it prevents the system from idle sleeping.

  • -s is for when it is plugged in

    The manual says this one prevents the system from sleeping, and that it is valid only on AC power. On battery it does nothing.

  • -t sets a time limit

    Add -t and a number of seconds. -t 28800 is 8 hours. Leave it off and the command runs until you stop it.

  • -d keeps the screen on too

    You do not need it for an agent. Leave it off and let the screen sleep.

  • -w ties it to one program

    caffeinate -i -w followed by a process number keeps the Mac awake only until that program quits.

Where the free fix stops working

It is a good way to try an agent for a week. It is a poor way to depend on one.

  • Close the lid and the Mac sleeps anyway

    The command stops the Mac from falling asleep by itself. It does not stop the sleep that happens when you shut a MacBook. So the laptop has to stay open.

  • It has to stay home

    Take the laptop out and the agent goes with it. It also drops off whenever your Wi-Fi does.

  • It ends when the Terminal window closes

    Quit Terminal, restart the Mac or install an update, and you have to run the command again.

  • When you want it on with the laptop closed

    Then the agent has to live on a computer that never sleeps. Here are the three ways to do that, and what each one costs for OpenClaw.

If you outgrow the free fix: the rented options

The same numbers for every option, so you can line them up. The last one pays us nothing, and it is here anyway.

Prices read from each host's own site on Nov 11, 2026
OptionPer monthYou pay todaySetupLink
Hostinger managed agentOpenClaw or Hermes $4.99 $119.76 for 24 monthsThen renews at $9.99 or $11.99/mo Done for you See this plan
Cloudways managed agentOpenClaw or Hermes $9.99 $1.99 a month for the first 2 monthsBlack Friday offer. Then $9.99/mo, no lock-in Done for you See this plan
Hostinger serverOpenClaw, Hermes, n8n, Claude Code $6.49 or $8.79 $155.76 for 4 GB or $210.96 for 8 GB, both for 24 monthsThen renews at $11.99 or $14.99/mo 1-click install. You keep it updated. See servers
RailwayOpenClaw, n8n, your own apps $5 plus usage $0 to try. Sign up through our link and Railway adds $20 in credits.Then $5/mo, with $5 of usage included Deploys from your browser Try Railway
Do it yourselfAny Linux server From $0 Depends on the server. Oracle has a free tier. All yours. Cloudways puts it at 1 to 2 hours if everything goes right. Read the free guidesWe earn nothing here.

Questions people ask

How do I stop my Mac from sleeping while my AI agent runs?

Open Terminal and run caffeinate -i -s. Leave the window open. Your Mac will not go to sleep by itself while it runs. It is built into macOS and it is free.

Does caffeinate work with the lid closed?

No. It stops the Mac from falling asleep when it sits idle. Closing a MacBook's lid still puts it to sleep. We did not test any workaround for that.

Does it work on battery?

The manual says the -s part is valid only on AC power, and puts no such limit on -i. We ran our test plugged in, so we have not checked battery ourselves.

Will this hurt my Mac?

It is Apple's own tool and it only stops sleep. A laptop that never sleeps uses more power and stays warmer, so keep it plugged in and somewhere with air around it.

How do I turn it off?

Click the Terminal window and press Control and C. If you set a time limit with -t, it stops by itself when the time is up.

Is there a version of this for Windows?

Not on this page. We have only tested the Mac command, so we do not cover Windows here.

How does RunAgents247 make money?

Some hosts pay us a commission when you sign up through our links. It does not change your price. Some options on this site pay us nothing. They are here because sometimes they are the right answer. How we check prices.

Want it on with the laptop closed?

Pick what you run and see one plan with its full price in two taps.

Find my plan