2026.11.22 · 4 min · claude-code · ai · agents · tooling
Let Claude Code click through your page with agent-browser.
agent-browser is a CLI from Vercel Labs that gives your coding agent a real Chrome. The agent opens your page, reads it as a short text snapshot with a ref per element, clicks by ref and reads the page's errors. How the loop works, when to use it instead of claude --chrome, and what people get wrong. As of 2026.11.
Your agent writes UI code it has never seen run. Checking every change by hand is the slow part. agent-browser moves that check to the agent: it opens your page in a real Chrome, fills the form, presses the button, and tells you what broke.
Watch the 60-second version on Instagram.
It's a Vercel Labs project, Apache-2.0, with about 52.1k stars, and it was on GitHub's weekly trending list in mid-November, up about 4.2k that week. The latest release is v0.43.0 (2026.11.12). Because it's a plain shell command, it works in Claude Code, Cursor, Codex, and any other agent that can run commands.
Install it, and the skill
npm install -g agent-browser # or: brew install agent-browser
agent-browser install # downloads Chrome
npx skills add vercel-labs/agent-browserThe skill is small on purpose. It only tells the agent to run agent-browser skills get core, which serves instructions that match the CLI version you have installed, so the instructions never drift from the binary.
The page, as text
The agent doesn't look at screenshots by default. It reads the accessibility tree: one line per element, with its role, its name and a ref. snapshot -i keeps only the interactive elements. Then the agent acts by ref: click @e3, fill @e2 "…".
The figure's page and its snapshot lines are a drawing, not a real run. The docs show the snapshot in two formats (@e1 [heading] "…" and - heading "…" [ref=e1]), so trust what your own run prints.
This is also why an unlabeled button is hard for the agent to find: it has no name to show in the snapshot. v0.43.0 now adds hints for controls with an empty or duplicate accessible name.
The loop
open the page, snapshot -i, act on a ref, then snapshot again. The "again" matters: refs break when the page navigates or an element is replaced, so a ref from the last snapshot can point at nothing.
Here is a signup check, start to finish. The commands are real; I've left out the output on purpose, because the docs don't document what errors and console print, and I'm not going to make it up.
agent-browser open localhost:5173
agent-browser snapshot -i # lists the heading, the email input, the Subscribe button
agent-browser fill @e2 "test@example.com"
agent-browser click @e3
agent-browser errors # what the page threw
agent-browser screenshot after.png # --full for the whole page, --annotate for numbered labelsIn practice you don't type these. You tell the agent: "Open localhost:5173, sign up with a test email, and tell me what breaks." It runs the loop and reports back.
Two more commands worth knowing: console reads the page's console, and diff snapshot shows what changed after an action, for example + button "Submit" [ref=e2] [disabled].
A click also fails honestly. If the target is hidden, disabled, off-screen or covered by something like a cookie banner, the click fails instead of pretending it worked, so the agent finds out.
agent-browser or claude --chrome?
Claude Code can already open your page through claude --chrome, which uses the Claude in Chrome extension.
| agent-browser | claude --chrome | |
|---|---|---|
| Browser | fresh Chrome profile | your own Chrome |
| Your logins | no | yes |
| Window | headless (--headed to show it) | visible |
| Setup | a CLI, no extension | the extension |
| Agents | any agent that runs commands | Claude Code |
When the check needs your logins, use --chrome. When it doesn't, agent-browser needs no extension, answers in plain text, and works in any agent. The headless browser closes after an hour with no commands.
On a client project I'd give the agent agent-browser for every UI change and ask it to report what broke before I review the diff, with --allowed-domains set to the local dev server.
What people get wrong
- "The AI looks at screenshots." By default it reads text, the accessibility tree. Screenshots are a debugging command you ask for.
- "It's a test framework." It doesn't save a test suite. The agent explores the page and reports what it found.
- "It's my browser." It's a fresh Chrome profile, headless by default. None of your logins are there.
- "Page content is just data." Page text reaches the model, so a page can carry a prompt injection.
--allowed-domainsand--content-boundarieslimit the risk.
The short version
- agent-browser gives your agent a real Chrome through short shell commands:
open,snapshot -i,click @e3,fill,errors. - The agent reads the page as text: one line per element, each with a ref.
- Refs go stale when the page changes, so the agent snapshots again after every action.
- It runs headless in a fresh profile; use
claude --chromewhen the check needs your logins. - Page text reaches the model, so limit the domains it can visit.
Sources: GitHub, vercel-labs/agent-browser · agent-browser docs, Introduction · Releases · CHANGELOG · Skills · Quick Start · Snapshots · Commands · Debugging · Diffing · Configuration · Security · Claude Code docs, Use Claude Code with Chrome