keepscreenunlocked.

AI agents

Keep your laptop awake during a long AI agent run.

Claude Code, Cursor, GitHub Copilot's agent mode, a local Ollama model chewing through a big job — the thing that actually interrupts any of them is the same, and it's not what most people assume.

Inactive

Pick a duration and hit start.

Duration

Stealth screen
— covers the page with black (or your own wallpaper) so it looks like nothing is open.
Fullscreen
— the same cover, edge to edge. Press Esc to leave.
Ambient sound

Starts only when you press Play. It fades out on its own, when you stop the tool, and when you enter stealth screen (unless you tick the box above).

Feedback

Local agent vs. cloud agent — it matters which one you're running

Tools that run locally — Claude Code, Cursor, GitHub Copilot's agent mode, a local Ollama or LM Studio model — execute directly on your machine's CPU/GPU. The only thing that pauses them is your system actually sleeping (suspending). A locked or dimmed screen doesn't touch them; they keep running in the background exactly the same either way.

Tools that run in the cloud — ChatGPT in a browser tab, Claude.ai, most API-based assistants — do the actual computation on the provider's servers. Your laptop sleeping doesn't pause that computation at all; it just disconnects your view of it. See ourChatGPT-specific pagefor that distinction in more detail.

What actually stops a local agent, and the fix for each layer

There are two separate things that can get in the way of a long local run, and they need two separate fixes:

  • Screen locking/dimming — annoying (you have to keep unlocking to check on it), but doesn't actually pause the agent. This tool fixes it: no install, works even on a locked-down work laptop.
  • Full system sleep — this genuinely pauses everything, agent included, until the machine wakes back up. No browser-based tool can prevent this — the Wake Lock API's spec explicitly dropped the "system" lock type that would have allowed it. Fix this in your OS's own power settings instead: on Windows, Settings → System → Power & sleep → Sleep → Never (while plugged in); on Mac, System Settings → Battery → Options → "Prevent automatic sleeping on power adapter," or run caffeinate -s in a spare terminal tab for the duration of the run.

If you'd rather not use a terminal command, the freeKeep Screen Unlocked Chrome extensionhas a "Computer awake" mode that asks the system not to sleep, which a web page can't do. A closed laptop lid still puts most machines to sleep either way.

For a genuinely unattended long run — walk away, come back in a few hours — both matter: the OS sleep setting is what actually guarantees the agent keeps working, and this tool is what means you come back to a usable screen instead of a locked one.

Pick your tool

Each page answers the same question for one tool: what happens to a run when the screen locks, and when the whole machine sleeps.

  • Claude CodeRuns locally; only real system sleep pauses it.
  • CursorLocal editor and agent; a Mac caffeinate guide is linked too.
  • GitHub CopilotAgent mode in your editor versus work done on GitHub's servers.
  • ChatGPTComputation happens in the cloud; sleeping disconnects your view.
  • GeminiWhat a sleeping laptop does to it, and what is documented.
  • PerplexityClosing the tab or laptop mid-answer.
  • ClaudeChat app in the cloud; Claude Code CLI runs locally.
  • CodexCloud tasks keep going; the CLI and local IDE mode pause.
  • GrokCloud chat; closing the lid ends your live view.
  • DeepSeekHosted chat versus a model you run locally.
  • WindsurfLocal editor agent; system sleep pauses it.
  • ClineVS Code extension with a model over the network.
  • All tools comparedOne table: which keep running and which pause.

Running a long agent job on a Mac? Keep a Mac awake while Cursor or Claude Code runs.

Setups by operating system

SystemHow to keep a long task running
macOSRun the task through caffeinate -i your-command so the Mac stays awake until it finishes, and keep it on power.
LinuxWrap it with systemd-inhibit --what=idle:sleep your-command, which blocks idle sleep while the command runs.
WindowsRaise the "sleep" timeout while plugged in, or use PowerToys Awake. powercfg /requests shows what is holding the PC awake.

In every case a closed laptop lid can still sleep the machine unless the lid action is changed or an external display is attached.

An overnight checklist

  • Plug the laptop in and use a surface that lets it breathe.
  • Set the lid action and the sleep timer for the plugged-in case.
  • Check that Wi-Fi power saving will not drop the connection and that a VPN session will not time out.
  • Run the work inside tmux or screen so it survives a closed terminal window. These keep a process running when the terminal goes away, but they do not stop the machine sleeping.
  • Make the task resumable: write progress to disk so a pause costs minutes, not hours.

When to move the job off your laptop

If a task regularly runs for hours, the sturdier answer is to run it somewhere that is meant to stay on: a small cloud server, a spare desktop, or the vendor's own cloud runner if the tool has one. A laptop is built to sleep, and fighting that is the fragile route.

The related pages cover individual tools: Claude Code, Cursor and GitHub Copilot.