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.
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 trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99
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.
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
| Option | Screen for agents | On battery | What 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 |
| Clamshell armed | Yes | Yes | The app, $9.99 once after a 7-day trial |
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.
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.
- 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.
- 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.
- Start the agent task. Computer use, an iOS Simulator run, a headed browser session or a UI test suite.
- 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.
- Nobody sees the screen. The built-in display stays black while the lid is closed. Opening the lid locks the Mac, and the display stays dark until the lock is confirmed; if Clamshell cannot confirm it, it restores the display and asks you to lock manually.
- Heat is watched. GUI work keeps more of the Mac busy. At serious or critical thermal pressure, Clamshell disarms toward normal lid sleep and blocks arming until the Mac cools. It does not replace airflow, so do not run it in a bag.
- Some Macs fall back to a sleeping display. On some Macs, an armed closed-lid session could end with macOS logging you out. If that happens, Clamshell turns the display off with the lid closed from then on and tells you, so screen-dependent agent work stops having a screen until you turn the setting back on in Settings.
- It does not drive your agent. Clamshell does not detect agents, answer prompts or end the session when a task finishes.
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 trialWhich 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
- Does Claude Code keep your Mac awake with the lid closed?
- Claude Code cloud sessions vs running locally on your Mac
- Keep Claude Code running with the lid closed
- Keep Codex running when you close your MacBook lid
- Codex Keep this Mac awake not working with the lid closed
- Run AI coding agents overnight on a MacBook
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.