
Vercel Open-Sourced “Computer Use”: agent-desktop from Installation to Staying Out of Trouble — the First Step-by-Step Guide in the Chinese-Speaking Community
Holy shit, guys, we really need to talk about this.
On the morning of October 31, Vercel’s Chris Tate (@ctatedev) dropped a post:
In one sentence: agent-browser lets an agent operate the browser; agent-desktop lets an agent operate your entire computer.
A little more than a day after launch, the original post had 7,400+ likes and 8,300+ bookmarks. Bookmarks outnumbered likes — which means everyone wanted to “come back and look into this later”.
But I looked around the Chinese-speaking corner of the internet: there were plenty of recaps, yet still nothing that clearly walked through the whole chain, from install, permissions, and hooking it up to Claude Code / Codex, to how to keep it from wrecking your computer.
So in this post I’m sticking to the practical bits. Just copy them.
I. What is this thing, exactly?
Four sentences from the official original post:
Computer Use for any coding agent
Full support for macOS, Windows, and Linux
It runs in the background, and you can keep doing what you were doing
Multiple agents can use your computer at the same time, each with its own cursor
Essentially it is a command-line tool (CLI) written in Rust + a C library, open-sourced under Apache-2.0, free for personal and commercial use.
Here is the key point: it is not an agent itself. The official wording is: "It is a tool, not an agent." The loop of “take a look → take an action → take another look to confirm” runs inside your Claude Code / Codex. agent-desktop is only responsible for being its eyes and hands.
II. Why is this stronger than “screenshot + guess the coordinates”?
A lot of people are still using a screenshot approach: take a screenshot and toss it to the model → the model says “the button is probably at (812, 433)” → the mouse clicks there.
But folks have all stepped on the problems with this approach:
Move the window a little, and all the coordinates are useless
Change the resolution or scaling, and the click misses
Every step needs a screenshot, and tokens burn like crazy
Did the click land? You can only take another screenshot to “look”
agent-desktop takes a different approach: it reads the operating system’s accessibility tree directly.
That is the “UI structure tree” the system already provides for screen readers — which thing is a button, what it is called, and whether it can be clicked, the system already knows.
The flow is like this:
snapshot takes a “structural snapshot” and returns JSON. Every operable element has a ref, which looks like this: @s8f3k2p9:e8
The agent issues a command against the ref: click @s8f3k2p9:e8
Take another snapshot to confirm it really did click
The whole process needs no screenshots and no pixel matching. (A screenshot feature exists, but it is a separate command, not a requirement.)
There are also a few design choices I think are real pluses:
Headless by default: ref-based operations go through the accessibility API, and do not move your mouse or steal focus. That is the principle behind “it runs in the background, and you keep working as usual”.
To use a real mouse and real keyboard, you must explicitly add --headed. Without that flag, it would rather fail than secretly move your mouse.
A ref belongs only to that one snapshot. If the UI changes, an old ref will raise STALE_REF, forcing the agent to look again instead of clicking blindly.
Every error comes with whether it can be retried safely: retry only when retry is safe, to prevent the same “Submit” button from being clicked twice.
III. Installation (all three platforms)
Universal: one command
The npm package already includes native x64 and ARM64 binaries for macOS / Windows / Linux. Bun, Yarn, and pnpm can also install it.
⚠️ A small pitfall: new versions of npm block install scripts (postinstall) by default. It still works if they are blocked, but every call goes through the Node launcher and is a bit slower (official numbers: about 146ms vs 21ms). If you want it fast, the official method is:
Another pitfall: if you run npm install agent-desktop without -g, the command is not on your PATH, and you have to run it with npx agent-desktop.
After installing, first run this health check:
It will tell you the platform, permission status, and supported_surfaces. If supported_surfaces is empty, that means the permissions / accessibility bus are not working, not that your desktop has nothing on it.
I did a real install on my own Ubuntu 24.04 (GNOME, X11): after a single npm command, permissions were already granted, and supported_surfaces was not empty, which meant it was ready to use.
Official Homebrew / Scoop packages are still being submitted; do not use brew to install it for now.
macOS
Requirements: macOS 13+, Intel and Apple Silicon both work
Required: Accessibility permission, granted to “the app that launches agent-desktop” — Terminal, iTerm2, Warp, VS Code, Codex, and the like. If System Settings also lists the agent-desktop binary separately, check that too
Optional: Screen Recording, only needed for screenshot and when recording screenshot evidence
Optional: Automation (System Events), only needed for things like opening Notification Center
The official project gives a rather thoughtful guided command:
After you have granted permission, run agent-desktop permissions once more. Once you see granted, you are good; you do not need to restart the terminal.
Verify it:
(On macOS 27 and later, this “Accessibility” list was renamed Device Control and Data Access, so you don’t miss it under the new name.)
Windows
Requirements: Windows 10 1809+ / Windows Server 2019+, x64 or ARM64
Permissions: apps at the same privilege level as your terminal; no authorization is needed
Apps running as administrator: they can be read, but only an equally elevated agent can send them input
It must run inside the interactive desktop you are logged into. UAC prompts, the login screen, the lock screen, and Session 0 services are all unsupported
⚠️ Two pitfalls:
The binary is unsigned. Browser downloads may get a SmartScreen warning or be quarantined by antivirus; on a fresh Windows 11 install, Smart App Control will block it outright. Installing via npm does not trigger SmartScreen; npm is recommended.
In PowerShell, a ref must be quoted: '@s8f3k2p9:e8', otherwise @ will be treated as the splatting operator.
Linux
Primary target: Ubuntu 24.04+ + GNOME 46, glibc 2.35 minimum
Ubuntu 22.04 will not work (the official docs say its ATK bridge will crash)
You must install at-spi2-core, and run it inside the graphical session you are logged into. If you SSH in, use a TTY, or a container with no session bus, you will not see any apps at all
X11 keypresses need XTEST; Wayland keypresses need GNOME Mutter RemoteDesktop; the Wayland clipboard needs wl-clipboard
Pointer-style mouse operations are rejected on Wayland, and window control is unsupported; semantic operations (clicking buttons, filling forms) work on both X11 and Wayland
Chromium and Qt apps need extra launch flags / environment variables before they appear on the accessibility bus. See agent-desktop skills get agent-desktop-linux references/troubleshooting.md for details.
A note from real use: Ubuntu 24.04 + GNOME is the official primary environment, and on this machine I could use it after install with no extra setup. But on a Debian cloud server that did not have at-spi2-core installed, list-apps immediately reported PLATFORM_NOT_SUPPORTED (the accessibility bus org.a11y.Bus was unavailable). On Linux, first run dpkg -l at-spi2-core and take a look; it can save you half an hour.
IV. Hooking it up to Claude Code / Codex
Let me be clear first: there is no MCP configuration in the official docs. The way you hook it up is “CLI + skill” — the agent already knows how to run shell commands, so you just teach it to use this CLI.
The official project gives two methods:
Method 1: install the skill (recommended)
This is the official skill on skills.sh. [To be confirmed: which directory npx skills add actually installs the skill into for Claude Code / Codex, and whether you need to interactively choose a target agent, is not spelled out in the official README; follow the command’s actual prompts]
Method 2: paste a paragraph into AGENTS.md
Official original wording, copy it directly:
[To be confirmed: the official docs say AGENTS.md. Claude Code reads CLAUDE.md by default. Whether putting it in CLAUDE.md is equivalent is not stated officially; I suggest putting it in both, or testing it yourself]
This design is clever: the docs live inside the binary and are bound to the version.
Have the agent read these two before the first use, and it will not try outdated usage at random.
V. The first hands-on task: click once in Finder, and verify
First run through it yourself by hand, and understand the loop (the commands come from the official Quick start, for macOS):
Note: @s8f3k2p9:e8 is an example; you must use the ref returned by your own snapshot. A bare @e8 will be rejected outright (INVALID_ARGS).
If Finder has no window open, you will get WINDOW_NOT_FOUND; open a window first.
Then give this prompt to Claude Code / Codex; just copy it:
Why should the first task be “read only”? Because you need to confirm that it can see accurately before you give it permission to act. That is the first step in avoiding disasters.
For a complex app (Slack, for example), do not start with a full snapshot, or tokens will explode. The official suggestion is to sketch the skeleton first, then drill into a local region:
If there are many windows and you get AMBIGUOUS_TARGET, take the window id from error.details and specify it with --window-id.
A real test: I had it press a calculator myself on Ubuntu
I could not take the Mac Finder example on the machine in front of me, so I used GNOME Calculator on my Ubuntu machine to do the same “look → click → look again” loop, with screenshots the whole way, so you can follow along.
Before the operations, the calculator was empty:

Then, in the terminal: first snapshot to get the button refs, then click 7, +, 8, and = in sequence, and finally snapshot once more to read the result:

The last line, textfield value = '15', was read back from the UI by agent-desktop itself; it is not me guessing from a picture. On the calculator side:

Note that these clicks went through the accessibility interface and were headless by default. According to the official description, they do not move the mouse or steal focus.
⚠️ A pitfall I stepped in myself, so you don’t have to: the first time, I got lazy and hardcoded button numbers from a previous snapshot (for example, e20) into a script to reuse them. Then the calculator gained a history row, the UI structure changed, the total number of elements went from 36 to 37, the same number pointed at a different button, a string of garbage expressions came out, and every click still returned ok: true.
The lesson is just two points:
A ref is only valid for the current snapshot. Snapshot again before every operation, find the ref by the button’s name, and do not memorize numbers;
ok: true only means the instruction was sent, not that the result is correct. You must snapshot again and read the result.
That is also why the official docs keep stressing “you must verify after an operation”.
VI. The multi-agent trick: one cursor per agent
This is the most explosive part of the demo video. The principle is “session + agent id”:
Key rules:
In multi-agent mode, desktop operations must carry an agent id (1–64 letters, digits, -, or _); read-only observation, the clipboard, and session management do not need one
Each different id gets its own cursor
Cursors can move at the same time, but the actual actions are queued and executed in turn (the official name is an interaction lease), so they will not scramble one another’s input
You can style each agent, for example by adding a label that shows what it is doing: agent-desktop --agent-id agent-a cursor-overlay enable --label "Organize Downloads" (for --label, --accent, and other parameters, see cursor-overlay enable --help)
Platforms: macOS and Windows are supported; on Linux, only X11 draws a cursor, and Wayland does not (the official docs are slightly inconsistent in two places: one mentions only macOS and Windows, the other includes Linux X11)
⚠️ An anti-pattern the official docs specifically list: do not let multiple agents write to the same editor at the same time. “Click in → type → submit” is not an atomic operation, and writing in parallel will definitely get crossed. Divide the work by app / window.
VII. A guide to avoiding disasters (the important part; worth saving)
A lot of people still think, “it’s just clicking a few buttons, what could go wrong”.
But think it through: what it can see is everything on your screen; what it can click is everything you can click. That includes your chat history, email, and banking apps.
I rank these by priority:
1. Minimize permissions
On macOS, only turn on Accessibility. Turn on Screen Recording only when you need screenshots, and turn it off when you are done
On Windows, do not run the agent from an administrator terminal. The official docs say that only an elevated agent can operate elevated apps — put the other way, ordinary privileges are a natural firewall
The official docs are explicit: the first time you use it, run status and permissions first. If permissions are missing, the UI tree will be empty; do not let the agent guess blindly
2. Isolation: give it a “clean room”
Most solid: run it in a macOS virtual machine / Windows virtual machine, and only install the apps the task needs
Next best: create a separate system user, and do not log into your primary Apple ID, WeChat, or browser accounts
A note for Linux: it can only see apps in “the current graphical session”, which is itself an isolation boundary; a separate user + a separate session works well
[To be confirmed: the official docs do not give a recommended VM / sandbox configuration; the above is general security advice, not official steps]
3. Do not let it touch these
Password managers (1Password, Bitwarden, Keychain)
Payment pages, online banking, exchanges
The “Send” button in email / chat
In the prompt, hard-code “only operate XX app”. The official Linux docs also specifically warn: a GTK4 password field may expose text to observation commands; only the standard password role is hidden. Do not gamble on it.
4. Human confirmation for critical actions
Spell it out in the prompt: before deleting, sending, submitting, or paying, it must stop and ask me
Keep it headless by default; use --headed only when you have explicitly agreed. The official skill’s own words: do not switch to headed just to work around a headless failure
Make the agent follow the official retry rule: retry only when disposition.retry is safe (that is, not_delivered, when you are sure it was not sent). In other cases the action may already have taken effect, and doing it again is “clicking Submit twice”; a toggle may even undo itself
5. Logs, and the ability to interrupt at any time
Starting a session comes with tracing logs built in:
Sensitive fields in the trace, such as text, value, name, title, and url, will be redacted
But the before-and-after screenshots recorded by --screenshots are not redacted; the official docs explicitly say they are sensitive data
The official docs also remind you: snapshots, the clipboard, screenshots, and command output may all contain private information; do not paste them into public logs, issues, or group chats
Want to stop? End the session, and Ctrl+C your agent directly. [To be confirmed: the official docs do not document a “one-key emergency stop” command; on macOS, the background command host exits automatically after 15 minutes of idle time]
There is also a built-in safeguard: it refuses to close critical system processes (the session-level kind); on Linux, combinations such as alt+f4, alt+tab, ctrl+alt+delete, and lock screen are rejected by press by default, and are only sent with --force. Do not let the agent add --force on its own.
6. About --dangerously-skip-permissions
This is a Claude Code parameter of its own, not one from agent-desktop. It lets Claude Code run commands without asking you.
Leaving it on is fine enough when you’re just writing code, but pairing it with agent-desktop is equivalent to handing over the mouse and keyboard of the entire computer without so much as a heads-up. My advice:
Do not turn it on on your primary machine
If you really must turn it on, only do so in a VM / a separate user
The same goes for similar “fully automatic / no confirmation” modes on the Codex side [To be confirmed: the corresponding parameter name for Codex was not verified for this article, so I am not writing a specific parameter]
VIII. Known limitations (written by the official project, not guessed by me)
It is not an agent; the loop depends on your Claude Code / Codex
Among 60 command names, these 4 currently refuse to execute: key-down, key-up, mouse-down, and mouse-up (waiting on a daemon that can automatically release keys)
Linux: pointer operations and window control do not work on Wayland; notifications only support GNOME Shell; screenshot behavior differs between X11 and Wayland (Wayland requires an authorization popup)
Windows: launch only accepts absolute paths or program names under System32, and does not recognize display names such as “Google Chrome”; type and right-click do not work in headless mode; use set-value for text input
macOS: open-system-surface is still on the roadmap
It depends on how well the app’s own accessibility support is done. On Linux, Chromium and Qt need extra flags before they can be seen
An action returning success ≠ it actually took effect. The official example: some Finder operations return success but do nothing. Always snapshot again to verify
Official Homebrew / Scoop packages are not out yet
On versions: 1.0.0 was released on October 27 (adding Linux support). When I wrote this, the latest was 1.0.2 (October 30).
Finally
To be honest, I always thought screenshot-style Computer Use was “cool in a demo, hard to use day to day”.
agent-desktop switching to reading the accessibility tree + staying in the background without stealing the mouse + errors with retry semantics is the first time I have felt “this can go into a daily workflow”.
But the more usable it is, the more careful you have to be. Start with read-only, then act in a small scope, and only then consider multi-agent parallelism. Get it working in a VM before you put it on your primary machine.
Repository: github.com/vercel-labs/agent-desktop
Folks, what’s the first desktop task you want it to do? Tell me in the comments, I’ll pick a few to test for real, and I’ll tell you whether it went off the rails or not.
If you found this useful, bookmark it, and send it to that friend who clicks through the expense system by hand every day 🫡
Code snippets from the article
The following code comes from code blocks in the original X Article, arranged in the order they appeared.
agent-desktop permissions # View only, no popup
agent-desktop permissions --guide # Open the corresponding System Settings page, with a guide panel
agent-desktop permissions --request # Show the system authorization dialog
agent-desktop snapshot --skeleton --app Slack -i --compact
agent-desktop snapshot --root @s8f3k2p9:e3 -i --compact
npm install -g agent-desktop
agent-desktop version
agent-desktop skills get desktop # The core loop, refs, verification, and retry rules
agent-desktop skills get platform # Differences on your current system
agent-desktop <command> --help # Parameters for an individual command
agent-desktop status # Will activate and check the accessibility bus
agent-desktop skills get linux # Linux-specific notes
agent-desktop snapshot -i
# 1. The main agent starts a session with a cursor, in multi-agent mode
agent-desktop session start --cursor --multi-agent --name "my-run"
# The return value includes a session_id; pass it to each sub-agent
# 2. Each sub-agent operates with its own agent id
export AGENT_DESKTOP_SESSION=<session_id>
export AGENT_DESKTOP_AGENT_ID=agent-a # The other one uses agent-b
# You can also add --session <id> --agent-id <id> to each command
# 3. Wrap up
agent-desktop session end <session_id>
npx skills add https://github.com/vercel-labs/agent-desktop --skill agent-desktop
npm install-scripts approve agent-desktop
# Or add --allow-scripts at install time
agent-desktop snapshot --app Finder -i # Get the interactive elements and refs
agent-desktop click @s8f3k2p9:e8 # Replace with the real ref returned in the previous step
agent-desktop snapshot --app Finder -i # Look once more to confirm
Use `agent-desktop` to see and operate desktop apps. Before the first use, run
`agent-desktop skills get desktop` and `agent-desktop skills get platform`, and follow them.
Use agent-desktop to help me complete a desktop task.
Rules:
1. First run agent-desktop status and agent-desktop permissions. If the permissions are incomplete, stop and tell me; do not change system settings yourself.
2. Run agent-desktop skills get desktop and agent-desktop skills get platform, and follow the rules inside them.
3. Only operate Finder; do not touch other apps.
4. Task: in Finder, open the “Downloads” folder, and tell me the names of the top 5 items in it. Read only; do not move, delete, or rename any files.
5. Every step should be “snapshot → action → snapshot again to verify”. Do not use --headed.
6. If you hit an error, retry only when error.disposition.retry is safe; otherwise stop and ask me.
agent-desktop status
agent-desktop session start --name "invoice-bot"
agent-desktop trace show --limit 50 # View the 50 most recent events
agent-desktop trace export --out run.html # Export as an HTML viewer
agent-desktop session end <session_id> # End the session; later commands will be rejected
This article was imported from an X Article. Original: https://x.com/i/status/2116834185830965712