Dimma Screen

Guide · macOS

AI agents on a locked Mac: what breaks, and how to keep them working

Locking your Mac doesn’t stop a terminal agent, as long as the Mac stays awake. It does stop anything that looks at the screen: screenshots come back black, with no error, and web pages stop rendering. If your agent needs the screen while you’re away, keep the session unlocked and cover it.

Lock screen vs. overlay

Tested on macOS 26.6.2 and 27.0, October 2026.

What the agent doesUnlockedmacOS lock screenDimma Screen overlay
screencapture full screenWorksBlack image, exit code 0Works
screencapture -l <window>WorksFails: could not create image from windowWorks
ScreenCaptureKit captureWorksFails: no displays foundWorks
Web page animation60 frames/s060 frames/s
Web page timer (100 ms)10/s1/s10/s
Shell commands and buildsRunRunRun
Accessibility APIWorksFailsWorks
Synthetic clicks and keysDeliveredNot deliveredBlocked

Terminal agents only need the Mac awake

Use caffeinate. The Mac stays awake until the agent exits:

caffeinate -i claude

If the agent is already running, wait on its process ID instead:

caffeinate -i -w $(pgrep -n claude)

caffeinate leaves the screen as it is. Anyone walking past can use your Mac.

Step away. Your agent keeps working.

Agents that take screenshots or drive a browser window need an unlocked session. Dimma Screen keeps the session unlocked, covers every display, and keeps the Mac awake for up to 4 hours. Any key or click asks for your PIN. Under the overlay, screenshots, web pages, and the Accessibility API work as they do on an uncovered screen.

In the menu bar, choose Turn On and Keep Awake and pick a duration. Keep Show on Transparent Overlay (Settings › Overlay › Overlay Style). With the other styles, the agent sees the cover instead of your screen.

Dimma Screen · macOS 26 Tahoe or later · Apple silicon · Free for 3 days, then $9.90 once. No subscription.

Limits

  • Agents that click and type. Dimma Screen blocks synthetic input the same way it blocks a person’s, and the agent’s keystrokes count as PIN attempts. Give these agents their own Mac or virtual machine.
  • Chrome. We tested WebKit pages. We haven’t tested Chrome.
  • Your screen stays visible. Transparent Overlay only tints it.
  • Not a security lock. Where you need real security, press ⌃⌘Q.

Questions

Does Claude Code keep running when my Mac is locked?

Yes, as long as the Mac stays awake. Run caffeinate -i claude to keep it awake until Claude Code exits. Screenshots taken while the Mac is locked will be black.

Why are my agent’s screenshots black when the Mac is locked?

On the macOS lock screen, screencapture saves a black image and still reports success. Window captures fail with "could not create image from window", and ScreenCaptureKit finds no displays. The agent needs an unlocked session to see the screen.

Do web pages keep running when the Mac is locked?

The process keeps running, but drawing stops. In our test, a WebKit page dropped from 60 frames a second to 0, and a 100 ms timer slowed to once a second.

Can Claude Code run overnight on a Mac?

Yes, if the Mac doesn’t sleep. Run it under caffeinate -i and keep the lid open.

Can a computer-use agent click and type while Dimma Screen is on?

No. Dimma Screen blocks synthetic mouse and keyboard input the same way it blocks a person’s. Use it with agents that work in a terminal, take screenshots, or use the Accessibility API.