Keep a Cursor agent running on your Mac

LidRun Team
6 min readJun 2026

A Cursor background agent, a long composer run, or a full project re-index all take real time, and they get suspended the moment your Mac sleeps. Here is how to keep a Cursor agent running on your Mac, even with the lid closed, while safety thresholds stay in control.

What interrupts a Cursor run

Cursor's agents and its indexing both run locally on your machine, so they pause whenever the Mac sleeps from idle or a closed lid. There is no remote worker that keeps going for you.

That bites in two common spots. A background agent grinding through a multi-step task stops mid-edit, and a large workspace re-index, the kind that takes a while on a big repo, halts partway and has to resume later.

These are exactly the runs you start so you can do something else. Walking away is the point, which is why an idle or lid-close sleep tends to land at the worst moment.

Keeping the agent alive without cooking the Mac

LidRun detects Cursor among the tools it watches and holds the Mac awake while the agent or indexer is working, so you can step away or close the lid and let it run.

Every keep-awake decision is gated by battery and thermal state. Indexing a large codebase and long composer runs can spin the CPU hard, so if temperature or charge passes your limits, LidRun lets the Mac sleep rather than overworking it.

The current thermal state shows in the menu bar throughout, so a warm run is visible rather than silent.

When it is worth turning on

Use it for the unattended stretches: a background agent on a long task, a fresh index of a large repo, an overnight cleanup pass you do not want to watch.

If you are sitting in Cursor working alongside the agent, you do not need it, the machine stays awake while you interact. Quick edits and small files index fast enough that sleep never enters the picture.

If you keep nudging the trackpad to stop the Mac dozing during a long Cursor run, that habit is the cue to try LidRun and let it hold the session safely instead.

Recommended settings

Stay plugged in for long agent or indexing runs, and leave battery auto-sleep on as a safety net for the times you forget.

Use a session timer so the run has a clear upper bound even if the agent stalls or an index gets stuck.

Keep the Mac on a hard, ventilated surface so the heat from a sustained index has somewhere to go.

Try it instead of fighting clamshell sleep

LidRun keeps your work running with the lid closed, with battery and thermal safety built in.

Download for macOS

Frequently asked

Will LidRun see the Cursor agent?

Yes. LidRun detects Cursor among many dev and AI tools and keeps the Mac awake while it is running.

Does it cover project indexing too?

Indexing runs as part of the Cursor process LidRun watches, so the Mac stays awake while a large re-index completes, within your safety thresholds.

Can I close the lid during a Cursor run?

Yes, with keep-running mode on. Battery and thermal thresholds decide when the session should end.

What if my Mac gets warm?

LidRun reads thermal state continuously and surfaces it in the menu bar, and cooling profiles respond within what the hardware allows.

Keep a Cursor Agent Running on Your Mac