keepscreenunlocked.

Claude Code & long AI runs

Does Claude Code stop when your laptop sleeps?

Short, honest answer: a locked screen won't stop it — a fully sleeping system will. Those are two different things, and this tool only controls one of them. Here's exactly what's going on.

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

Screen lock vs. system sleep — the actual distinction

Claude Code runs as a local process in your terminal, actually executing on your machine — editing files, running commands, reading output. That process only cares about one thing: is the CPU running?

A locked screen (Win+L, or your laptop auto-locking after a few idle minutes) doesn't pause background processes. Your CPU keeps running, your terminal keeps executing, Claude Code keeps working — with the screen off or locked. This is true with or without this tool.

Full system sleep (suspend) is different — it powers down the CPU itself, and everything running on it pauses, including Claude Code, until you wake the machine back up. This is the thing that actually interrupts a long run.

What this tool does and doesn't cover

This tool uses the browser's Screen Wake Lock API, which — despite the name overlap — only ever controls display sleep/lock, not system sleep. An earlier draft of the underlying spec included a separate "system" wake lock type that would have prevented full CPU suspend, but it wasdropped before shipping — no browser supports it. So no web-based tool, including this one, can directly keep your system from fully sleeping.

What it's genuinely useful for: keeping your display visible and your session looking active while Claude Code runs, so you're not constantly re-unlocking just to glance at progress, and so your machine doesn't look idle/away on a call or to teammates while you're watching a long run.

For the actual guarantee: set your system sleep timer

If you want certainty that a long Claude Code run won't get suspended mid-task, the fix is in your OS's power settings, not a browser tool:

  • Windows: Settings → System → Power & sleep → set "Sleep" to Never (at least while plugged in).
  • Mac: System Settings → Battery → Options → enable "Prevent automatic sleeping on power adapter when the display is off," or use caffeinate -s in a second terminal tab for just that run.

Use this tool for the display-lock annoyance, and one of those for the actual sleep guarantee — together they cover the whole problem.

Common questions

If I close my laptop lid, does Claude Code stop?
Usually yes. Closing the lid normally puts the machine to sleep, which suspends the CPU and pauses the session. It resumes when you wake the laptop, but a command that depends on the network or a timeout may fail on the way back. On a Mac with an external display and power connected, closing the lid can leave it running (clamshell mode).
What if I close the terminal window?
That usually ends the session. Closing a terminal sends its processes a hang-up signal, which is a different problem from sleep. To survive a closed window or a dropped SSH connection, run Claude Code inside tmux or screen and reattach later. That protects against disconnects, not against the machine sleeping.
How do I stop my laptop sleeping during a long run?
Use your OS: on a Mac, run caffeinate -s in a second tab; on Windows, set Sleep to Never while plugged in and choose "Do nothing" for closing the lid under Power Options. This site keeps the display on but can't hold the system awake.
Does Claude Code on the web have this problem?
No. Sessions on Claude Code on the web run in Anthropic's cloud environment, not on your laptop, so your machine sleeping doesn't interrupt them. Only the local CLI depends on your computer staying on.
Does a locked screen stop Claude Code?
No. Locking the screen leaves the CPU running, so the session carries on. The one exception is a laptop whose power plan puts the machine to sleep soon after the screen turns off, so check that setting.

Part of keeping a laptop awake during long AI agent runs. Other AI tools: Gemini · Perplexity · Cursor · GitHub Copilot.