When should you use it?
- You want an agent to verify a UI, not just write code
- You prefer commands and tools over screen control
- You can grant permissions per session
Not for: Granting broad screen access without per-app approval; Headless or non-interactive sessions, where it does not run
What do you need, and what do you get?
You need
- A supported interactive session on a Mac
- OS permissions for watching and controlling the screen
- A UI task that truly needs the screen
You get
- A UI exercised the way a person would
- Commands and tools tried before screen control
- Per-app approval prompts you can allow or deny
How does it work, step by step?
- Keep it a last resortLet the agent run a command or use an MCP tool first; screen control only when needed.
- Enable it per projectTurn the feature on for the specific codebase, since it is off by default.
- Grant the OS permissionsApprove accessibility and screen recording, then restart the session if prompted.
- Approve each appAllow access per app per session rather than opening everything at once.
- Watch broad-reach warningsNote the extra warnings for terminals and IDEs, which are like shell access.
The prompt
Our own prompt, inspired by Mohamed EL BATHA and written to work in Claude Code. Values in lime are placeholders.
For this task, prefer a shell command first, then an MCP tool if one fits, and only control the screen if the task genuinely requires it, such as verifying a rendered UI. Before touching any app, tell me which one and why. Exercise the interface the way a user would, report what you saw, and stop if an action needs broader access than I approved.
Inspired by Mohamed EL BATHA: Claude Code Computer Use: Test UIs Without Leaving the CLI. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Terminals and IDEs get flagged as shell-equivalent; approve them deliberately.
- It needs an interactive session and does not work headless, so plan around that.
Our take
The design choice Mohamed EL BATHA highlights is worth copying in any agent setup: an escalation ladder that runs from a shell command, to a dedicated tool, to the screen only when nothing else will do. Screen control is slow, fragile and broad, since an agent that can click anywhere can also click the wrong thing, so making it the last resort keeps most work fast and predictable. The per-project setting and per-app approval each session add containment. Use screen control for what it is genuinely good at, such as checking that a UI renders correctly, that a button actually works or that a flow behaves the same as the tests claim. Close unrelated apps and private windows before a session, because a screenshot can capture anything visible, including messages or financial pages. Resist approving every app permanently for convenience. If the tool warns that an action has broad reach, such as controlling a terminal or a browser with logged-in sessions, read it rather than clicking through, and switch the feature off in projects that no longer need it.
Where the time goes back: UI checks that normally pull you out of the terminal get done in place, with the agent only touching the screen when nothing else will do.
FAQ
When does it use the screen?
Is access broad by default?
Source and credit
Inspired by Mohamed EL BATHA. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- Claude Code Computer Use: Test UIs Without Leaving the CLI
- Creator
- Mohamed EL BATHA
- Published on
- claudcod.com
- Original date
- Jun 6, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Claude Code
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.