Can AI agents use the screen with the MacBook lid closed?

By Matyas Rathonyi. Updated October 5, 2026. Guides

Yes. The usual fixes are an external monitor or an HDMI dummy plug on power, or a virtual display plus pmset. Clamshell for Mac does it with nothing plugged in: during an armed lid-closed session, agents can use the screen while the built-in display stays black, so computer use and the iOS Simulator keep working.

No plugNo dummy dongle or virtual display
Black panelThe built-in display stays dark
No sudoNo admin rights or pmset
$9.99 onceAfter a 7-day free trial

Clamshell for Mac keeps the Mac awake with the lid closed while armed, and agents can keep using the screen. Free for 7 days.

Download free trial

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99

The MacBook lid closes and the screen goes black, but a simulated phone on that screen keeps updating for the agent. Simulator
Black to you, usable for the agent.With Clamshell armed, the built-in display stays dark while computer use and the iOS Simulator keep working with the lid shut.

Keeping a MacBook awake with the lid closed is a solved problem. Keeping a screen available is not, and it is the part that breaks agent work that sees and clicks: computer use, the iOS Simulator, headed browser automation and UI tests. In early October 2026 a widely shared post on X asked exactly this, and many replies pointed at pmset, dummy plugs or virtual displays. Here is what each option actually does.

Why agents lose the screen when the lid closes

Two separate things have to hold. First, the Mac must stay awake: closing the lid normally sleeps it, and a sleeping Mac runs nothing. Second, there must be a screen for apps to draw to and for the agent to capture. A lid-closed Mac kept awake some other way can still leave screen-dependent work in trouble; a Hacker News post from early 2026 described lid-closed screenshot pipelines becoming unreliable or failing.

Top: a Mac kept awake by pmset alone with the lid shut, where screen capture for the agent can fail. Bottom: with Clamshell armed, the agent keeps receiving screen content. pmset only captures can fail ? Clamshell armed screen available
Awake is not the same as visible. Agents that work from screenshots need a display to capture. Since Clamshell 1.4.19, agents can use the screen during an armed lid-closed session while the built-in display stays black.

Not every agent task needs a screen. Headless browser runs do not draw to a display; Playwright's docs note it launches browsers headless by default. If your tests are headless, any method that keeps the Mac awake is enough, including pmset. The screen question is for headed browsers, computer use, the simulator and anything else an agent has to look at.

Your options, compared

OptionScreen for agentsOn batteryWhat you need
External monitor Yes No Display, power, keyboard and mouse, per Apple
HDMI dummy plug Yes No A $5 to $10 plug and AC power
Virtual display plus pmset Depends on setup Yes A virtual display app, admin password, manual undo
Lid open Yes Yes Nothing, plus an idle-sleep fix for long runs

HDMI dummy plug on a MacBook: what it does and what it needs

A dummy plug pretends to be a monitor. On May 12, 2026, Macworld called dummy display plugs the hot new MacBook dongle for AI developers, priced at $5 to $10, with the appeal that you just pull it out to stop. Because macOS sees a display, the Mac enters Apple's closed-display mode, and the agent gets a full screen to work on.

The catch is power. Apple documents closed-display mode as needing the Mac "connected to power and using an external keyboard and mouse", and a Hacker News commenter made the same point about dummy plugs: clamshell mode holds only on AC. For a desk setup that is fine and cheap. It is the wrong tool for a train, a sofa or a bag.

A closed MacBook with a dummy plug in one port and a power cable in the other: closed-display mode needs power. Dummy plug needs power A closed MacBook with nothing plugged in, kept awake by Clamshell and still working, on battery or power. Clamshell armed battery or power
Hardware trick vs lid control. A dummy plug borrows Apple's external-display path, which wants power. Clamshell controls lid sleep directly and works on battery, with an optional low-battery cutoff.

Virtual display plus pmset

The software version of the dummy plug is a virtual display app paired with sudo pmset -a disablesleep 1. BetterDisplay's README, as of October 2026, describes virtual screens "for headless Macs and remote access", with advanced virtual-screen features in its $21.99 Pro tier. It does not claim to stop lid sleep, which is why people pair it with pmset.

It works on battery and costs little, but it is two tools and an admin command that stays on until you reverse it, on battery too. If you go this way, read what pmset disablesleep does and how to undo it first.

Run computer use and the iOS Simulator lid-closed with Clamshell

Since Clamshell 1.4.19, agents can use the screen during an armed lid-closed session while the built-in display stays black. In 1.4.21 this became a setting again, Let agents use the screen while the lid is closed, and it is on by default; turning it off sleeps the display with the lid closed, which uses less battery and keeps the Mac cooler. I use it this way every day: computer use and the iOS Simulator keep working with the lid shut. Use an Apple Silicon MacBook on macOS 14 or later.

  1. Unplug displays and dummy plugs. Clamshell pauses (yellow menu bar icon) instead of arming while an external display is connected, and a dummy plug presents itself as a display, so expect a pause with one attached.
  2. Clear permission prompts while the lid is open. Grant any Screen Recording or Accessibility permission the agent asks for, open the Simulator, and run one short action so nothing waits on a dialog you cannot see.
  3. Start the agent task. Computer use, an iOS Simulator run, a headed browser session or a UI test suite.
  4. Arm, check, close. The menu bar menu arms for the next close only; holding Option while closing works on a MacBook Air M2 (2022) or later or a 14-inch or 16-inch MacBook Pro (2021) or later. Shortcuts and right-click arming stay active until you disarm.

Before a long run, do a two-minute test: close the lid, reopen, unlock, and check that the agent's last screenshots or test logs carry timestamps from while the lid was shut.

Clamshell keeps your Mac awake with the lid closed. Free for 7 days, then $9.99 once for one Mac. 14-day money-back guarantee.

Download free trial

Which option should you pick?

Always at the same desk, on power

An external monitor you already own, or a dummy plug. Cheap, supported by Apple's closed-display mode, nothing to install.

The work does not need your Mac

A cloud session avoids the problem, as long as the job does not need the simulator or Mac apps. See Claude Code cloud vs local.

The lid can stay open

Free. Pair it with an idle-sleep fix for long runs; see what Claude Code's keep-awake covers.

Lid closed, anywhere, no dongle

Clamshell. Works on battery or power, no admin rights, and the built-in display stays black while agents use the screen.

Frequently asked questions

Does a dummy HDMI plug keep a MacBook awake with the lid closed?

It can. A dummy plug makes macOS think an external display is attached, which puts the MacBook into Apple's closed-display mode. Apple documents that mode as needing power and an external keyboard and mouse, so a dummy plug is a desk setup on AC power, not a battery one.

Can Claude computer use work with the MacBook lid closed?

Yes, if the Mac stays awake and still has a screen for the agent to use. An external display or dummy plug provides one on power. With Clamshell for Mac armed and its Let agents use the screen while the lid is closed setting on, which is the default, agents can use the screen during a lid-closed session while the built-in display stays black, with no plug or virtual display.

Does the iOS Simulator run with the MacBook lid closed?

Not on its own: closing the lid without an external display puts the Mac to sleep and the simulator stops with it. It keeps running lid-closed with an external display or dummy plug on power, or during an armed Clamshell session with its default agents-screen setting on, where the iOS Simulator keeps working while the built-in display stays black.

Do headless browser tests need a screen?

No. Playwright launches browsers in headless mode by default, and headless runs do not draw to a display. They only need the Mac awake. Headed browser runs, computer use and the iOS Simulator are the jobs that need a screen.

Can I use Clamshell together with an HDMI dummy plug?

There is no reason to. A dummy plug makes macOS see an external display, and Clamshell pauses instead of arming while an external display is connected, so expect it to pause with a plug attached. Remove the plug before arming Clamshell, or use the plug on its own with power connected.

Related guides

Sources checked October 5, 2026: Macworld's May 12, 2026 article on dummy display plugs, Apple's closed-display guidance, BetterDisplay's README, Playwright's CI docs, and two Hacker News threads. Clamshell behavior is described from its changelog and from the developer's own daily use. Clamshell is an independent app, not affiliated with or endorsed by Anthropic, Apple or the makers of the tools named here.