Skip to content
For AI agents and builds

Keep your computer awake while an AI agent or long build runs

If your agent or build runs in a terminal, the simplest fix is the operating system's own: caffeinate -i on a Mac, or PowerToys Awake on Windows. AwakeTab helps when you also want to watch progress. In Chrome or Edge, a visible AwakeTab tab keeps the display on, and while the display is on, neither Windows nor macOS idle-sleeps.

Sources checked Saturday, 26 September 20264 min readBy Soubhik Biswas
Try it hereTry itStart a session, switch tabs, then come back and watch the pill. No end time: it keeps the screen on until you stop it.Start this session

Set up a visible monitor for a long run

  1. Start the agent or build.Run Claude Code, Codex or your build as usual, with the laptop plugged in.
  2. Open AwakeTab in its own small window.Choose ∞, or "Until…" with a time such as 7:00 AM tomorrow. Pick Minimal mode, a dim screen with the elapsed time.
  3. Place it beside your terminal.It can sit unfocused; it only has to stay uncovered.

What to expect during the run

A web page can only ask for the screen to stay on, through the Screen Wake Lock API. What that does for the rest of the machine depends on the system:

  • Windows: Chrome and Edge ask Windows to keep the display on, and while it is on, Windows doesn't idle-sleep. Keep the screen on in Windows 11 has the settings.
  • macOS: Chrome holds a "no display sleep" power assertion, so the Mac does not idle-sleep. The Mac page has the details.
  • Linux: the browser asks your desktop over D-Bus, and some desktops honour it better than others.

This lasts only while the tab is visible.

The pill at the top of the tool tells you what the browser is doing:

Screen awake
The display stays on, so the computer does not idle-sleep.
Paused — tab hidden
The window is minimised or covered, so the normal sleep timer runs again. Uncover it and AwakeTab asks again.
Blocked — here's the fix
The browser said no. Chrome and Edge have no battery check, but Firefox refuses at 5% battery or less while not charging. The card names the fix.

Pick the tool for the job

Your situationBest fitWhy
Claude Code, Codex or a build in a Mac terminalcaffeinate -i in front of the commandHolds off idle sleep until the command exits, then lets go
The same job on WindowsPowerToys AwakeKeeps the PC awake; the display turns off unless you switch on "Keep screen on"
You want to watch the runA visible AwakeTab tabThe screen stays lit for a glance at progress
Overnight, tab hidden, Chrome or EdgeAwakeTab for Chrome, System levelKeeps the computer awake with the tab hidden; the screen may dim or lock

On a Mac, that looks like caffeinate -i codex or caffeinate -i npm run build. Microsoft documents PowerToys Awake on Microsoft Learn (checked 26 September 2026); our PowerToys Awake comparison sets the two side by side.

Check that it's working

On a Mac, run pmset -g assertions in Terminal and look for a PreventUserIdleDisplaySleep or NoDisplaySleep line from your browser. On Windows, run powercfg /requests in Terminal as administrator; the browser should be listed under DISPLAY.

The lid, and other walls a tab can't climb

Closing a laptop lid sleeps it, whatever any tab or command asks. The one exception is a Mac running closed with its charger and an external monitor connected (clamshell mode); our guide to Mac sleep with the lid closed explains the trade-offs. For a remote machine you reach over SSH, set sleep on that machine, not in your local browser.

Before a long run

0 of 4 checked

Questions

Run caffeinate -i claude instead of claude. The Mac will not idle-sleep until you quit Claude Code; the display can still turn off. Use caffeinate -di claude if you also want the screen to stay lit so you can glance at it. The same pattern works for codex or any build command.

Soubhik Biswas · Builds AwakeTab. Sources checked Saturday, 26 September 2026. About AwakeTab