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

By Matyas Rathonyi. Updated October 21, 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: with its Agent Screen module on, 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 helper
$9.99 onceAfter a 7-day free trial

An animated MacBook with a coding agent deploying a website from its terminal. The Option key is held and the lid closes: the display goes black, but the Mac stays awake, so a dimmed copy of the terminal keeps working above the closed laptop while its front edge fills with light. When the deploy is done, a pointer shows how to lift the lid. Opening it wakes the Mac to its lock screen, which unlocks to the finished run: deployed, with the live address. The lid can then be opened and closed freely.

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

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell.

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 and its Agent Screen module on, 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 Extra hardware. Display, power, keyboard and mouse, per Apple
HDMI dummy plug Yes No Extra hardware. A $3.50 to about $10 plug and AC power
Virtual display plus pmset Depends on setup Yes Admin password, a virtual display app, 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, with the appeal that you just pull it out to stop. Plugs cost $3.50 to about $10: Adafruit lists one at $3.50, and Macworld says some people think the convenience is worth $5 to $10. 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 an app. A dummy plug borrows Apple's external-display path, which wants power. Clamshell needs no extra hardware and works on battery, with a low-battery cutoff at 20% that is on by default.

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 Clamshell 2.0 this is the Agent Screen module, off by default: with it on, the display stays on and black while an agent is using the screen; with it off, the display sleeps 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. Displays and dummy plugs can stay connected. Clamshell arms with or without them.
  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 with a lid angle sensor (the 14-inch and 16-inch MacBook Pro from 2021 on, and some newer MacBook Air models). Right-click and Shortcuts 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.

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell. Also on Setapp.

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 Agent Screen module turned on (it is off by 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 Agent Screen module turned 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, but they do not conflict. Clamshell arms with a dummy plug attached, as with any display, so the plug adds nothing. Use the plug on its own with power connected, or arm Clamshell with or without it.

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. Rechecked October 15, 2026: Adafruit's HDMI Dummy Plug and Macworld's May 12, 2026 story.