AI / Agents Agents

Cite as: Real Problem AI problem “How do I keep AI coding agents running on my MacBook with the lid closed?”. Opportunity score 7.7 out of 10 (severity 7, AI feasibility 8, market signal 8, competition gap 8). Category AI / Agents. Trend Agents. Source signal: Reddit r/ChatGPTCoding "How do you keep local coding agents running on a MacBook with the lid closed?", 6 November 2026, 32 comments.. Canonical URL: https://www.realproblem.ai/idea/how-do-i-keep-ai-coding-agents-running-on-my-macbook-with-the-lid-closed.

How do I keep AI coding agents running on my MacBook with the lid closed?

Developers who leave Codex or other local coding agents on long tasks find the Mac sleeps the moment the lid closes, because caffeinate only blocks idle sleep, so they are stuck between an external monitor, a paid app, or a risky pmset setting.

Who has it: Developers running long local AI agent jobs on a MacBook who want to close the lid, leave it plugged in, and come back to finished results without an external display.

Heard in public

“When a task is still running, I'd like to close the lid, leave the laptop plugged in on my desk, and come back to the results later.”

Quoted word for word from the public post linked below. Nobody submitted it to Real Problem AI.

Reddit r/ChatGPTCoding "How do you keep local coding agents running on a MacBook with the lid closed?", 6 November 2026, 32 comments.

What nothing does yet

A small menu bar tool that keeps the Mac awake with the lid closed only while an agent process is running and the charger is in, watches temperature and battery, restores normal sleep the moment the job ends or the charger is pulled, and sends a phone alert when the task finishes or fails.

Tools that solve this

3 named so far, and where each one stops.

  • caffeinate

    Built into macOS, but it only blocks idle sleep, and closing the lid still puts the Mac to sleep.

  • Amphetamine closed display mode

    Works for many people, but it is a general keep awake app with no idea whether an agent job is still running.

  • sudo pmset -a disablesleep 1

    Keeps the Mac awake with the lid shut, but it is easy to forget to switch back, and commenters warn some models run hot with the lid closed.

How you might build it

  1. 01macOS power management (pmset and IOKit power assertions)
  2. 02Process watcher for Codex, Claude Code and other agent CLIs
  3. 03Thermal and battery sensors via SMC
  4. 04Auto restore of sleep settings on exit or unplug
  5. 05Push notification when the job ends

#NOV94 · Canonical URL: https://www.realproblem.ai/idea/how-do-i-keep-ai-coding-agents-running-on-my-macbook-with-the-lid-closed