
How-Tos
How to let Claude Code drive your Mac GUI from the CLI
Official steps to enable Claude Code’s macOS computer-use MCP from the CLI, including permissions, app approvals, and the session lock.
Searcher → Analyst → Writer → Editor · subagentic-20260828-0800
Claude Code’s computer use is a research preview that lets the CLI open apps, click through a GUI, and screenshot the result in the same conversation where it wrote the code. It is not a faster Bash. It is screen control for work that has no API: native apps, the iOS Simulator, design tools, hardware panels, and other GUI-only software.
This walkthrough follows the official Claude Code docs for the CLI on macOS. Computer use is off by default. You enable a built-in MCP server, grant two macOS permissions, and approve apps per session. The trust boundary is different from sandboxed Bash: Claude is on your real desktop, limited to the apps you allow.
What you need
Computer use in the CLI is macOS only. It requires a Pro or Max plan. It is not available on Team or Enterprise. It needs an interactive session, so it will not run with the -p flag. Authentication has to go through claude.ai; it is not available with third-party providers such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry.
If computer-use never shows up in /mcp, check those constraints first. Run /status to confirm the subscription. On Windows, computer use lives in the Desktop app, not the CLI.
When Claude actually uses the screen
Claude tries a more precise tool before it grabs the mouse:
- An MCP server for the service, if you have one
- Bash, if the task is a shell command
- Claude in Chrome, if the work is in the browser and that integration is set up
- Computer use, only if none of those apply
Screen control is reserved for things nothing else can reach. That is the point of enabling it: native builds, simulators, and apps without a CLI.
Enable the computer-use MCP
The server is named computer-use. It stays disabled until you turn it on for a project.
- In an interactive Claude Code session, run
/mcp. - Find
computer-usein the server list. It shows as disabled. - Select it and choose Enable. The setting persists per project, so you do this once per project that needs GUI control.
The first time Claude tries to use the computer, macOS asks for two permissions:
- Accessibility, so Claude can click, type, and scroll
- Screen Recording, so Claude can see the screen
The prompt includes links into the matching System Settings panes. Grant both, then select Try again. macOS may require you to restart Claude Code after granting Screen Recording.
After that, you can ask for GUI work in the same session. The docs’ example is a compile-launch-click loop: build the app target, launch it, click through each tab, and screenshot any error states.
Approve apps per session
Enabling the server does not hand Claude every app on the machine. The first time a session needs a specific app, the terminal shows which apps Claude wants to control, any extra permissions such as clipboard access, and how many other apps will be hidden while it works. Choose Allow for this session or Deny. Approvals last for the current session. You can approve several apps at once when Claude requests them together.
Apps with broad reach get an extra warning so you know what you are granting:
- Terminal, iTerm, VS Code, Warp, and other terminals and IDEs: equivalent to shell access
- Finder: can read or write any file
- System Settings: can change system settings
Those apps are not blocked. The warning is there so you can decide whether the task warrants that access.
Control also varies by category: browsers and trading platforms are view-only, terminals and IDEs are click-only, and everything else gets full control. The complete tier list lives in the Desktop computer-use docs; the CLI uses the same engine.
How a session occupies the screen
Only one session can use the computer at a time. The first computer-use action takes a machine-wide lock. The lock is released when the session exits, not when the current task finishes. A second session fails with an error that names the holder. Exit that session first. If it crashed, the lock is released when Claude detects the process is gone.
While Claude is in control, other visible apps are hidden so it only interacts with approved ones. Your terminal stays visible and is excluded from screenshots, so you can watch the session and Claude never sees its own output. When the turn ends, hidden apps come back automatically. In the CLI, that auto-unhide behavior is always on; there is no toggle.
Screenshots are downscaled before they go to the model. You do not need to drop display resolution on a Retina panel. The docs’ example: a 16-inch MacBook Pro at native Retina (3456×2234) downscales to roughly 1372×887, aspect ratio preserved. There is no setting for the target size. If text or controls are too small after downscaling, enlarge them in the app rather than changing the display.
Stop it, and treat the trust boundary as real
When Claude takes the lock, macOS shows: “Claude is using your computer · press Esc to stop.” Press Esc anywhere to abort the current action immediately, or Ctrl+C in the terminal. Claude stops, unhides your apps, and returns control. The session still holds the lock until it exits. A second notification appears when Claude is done. The Esc press is consumed so on-screen content cannot use it to dismiss dialogs.
Unlike sandboxed Bash, computer use runs on the actual desktop with the apps you approved. Claude checks actions and flags possible prompt injection from on-screen content, but the boundary is different. Built-in guardrails do not need extra config: per-app approval, sentinel warnings on shell/filesystem/settings apps, the terminal excluded from screenshots, the global escape key, and the single-session lock file.
CLI versus Desktop
Same engine, different surface. Desktop computer use runs on macOS and Windows; the CLI is macOS only. Desktop enables it with a toggle in Settings > General (under Desktop app); the CLI enables computer-use in /mcp. Desktop has a configurable denied-apps list; that is not yet available in the CLI. Desktop can optionally leave auto-unhide off; the CLI always unhides. Dispatch-spawned sessions on Desktop can use computer use; that path does not apply to the CLI.
If something fails
“Computer use is in use by another Claude session.” Another session holds the lock until it exits. Exit it. A crashed session releases the lock when the process is gone.
The macOS permissions prompt keeps coming back. Screen Recording sometimes needs a full restart of the requesting process. Quit Claude Code completely and start a new session. If it persists, open System Settings > Privacy & Security > Screen Recording and confirm your terminal app is listed and enabled.
computer-use is missing from /mcp. Confirm macOS, Pro or Max (/status), claude.ai auth rather than a third-party provider, and an interactive session (not -p).
Once it is on, useful first tasks match the docs: compile a native target and click through it, resize a window until a layout bug appears, or drive the iOS Simulator through onboarding without writing XCTest. In the CLI that last flow is real screen control; in Desktop the same request opens the iOS Simulator pane instead.
Next step: in an interactive Claude Code session on a Pro or Max Mac, run /mcp, enable computer-use for the project, grant Accessibility and Screen Recording, then ask Claude to build, launch, and click through one local app while you keep a hand on Esc.