Skip to content
TutorialUpdated 2026-06-04

Keep Claude Code running overnight

Start a long agentic run, lock your machine, and let it finish.

A long agentic coding run can take hours. Without Lidless, locking your machine (or letting it idle) suspends the system and stalls the task. Here's the setup.

Before you start

You'll need Lidless installed — see Getting started — and a task you want to keep running, such as a Claude Code session.

Steps

Turn on Keep awake

Open the menu-bar panel and enable Keep awake. The status should read Active · system won't sleep.

Keep power connected

On a laptop, plug in. With Only when plugged in enabled, unplugging pauses keep-awake and your task could stall.

Start your run, then lock the screen

Kick off the task, then lock the screen — the display sleeps while the system keeps working.

Come back to a finished job

Unlock later and your run has progressed the whole time — no paused task, no dropped SSH session.

Lock the screen from the terminal

# Sleep the display now; the system stays awake thanks to Lidless
pmset displaysleepnow

Verify it's working

On macOS, check that the keep-awake assertion is held:

pmset -g assertions

You should see PreventUserIdleSystemSleep in the list while Keep awake is on.

Battery drain

Keeping the system awake uses more power than sleeping. On battery, prefer Only when plugged in so Lidless backs off automatically.