Why Playwright is the wrong tool for AI agents
Playwright was built for humans writing tests. Then everyone started bolting AI on top and pretending it fit. It doesn't.
When an AI agent uses Playwright (or the Playwright MCP), every step usually means: take a full-page screenshot, send it to the model, model decides what to do, repeat. Multiply that by 20 steps in a real workflow and you're burning tens of thousands of tokens just on pixels the model didn't need.
It's slow. It's expensive. And the model still misses stuff because it's reading a picture instead of structured data.
What agent-browser does differently
Vercel's agent-browser is a native Rust CLI built specifically for AI agents. Two things make it different.
First, it gives the AI an accessibility tree with refs instead of a screenshot. So the model sees something like @e1: button "Sign in"instead of a 2MB PNG. The model picks the ref, agent-browser does the click. That's where the 93% token reduction comes from.
Second, it's a Rust binary. No Node.js daemon. No Playwright runtime. It connects to a real Chrome instance and runs commands fast.
31,000+ stars on GitHub. Maintained by Vercel Labs. This isn't a weekend project.
How the workflow actually looks
The pattern your AI agent will use is dead simple:
snapshot returns a compact accessibility tree with refs like @e1, @e2, @e3. The model picks one, agent-browser does the action. Screenshots only when you actually need pixels.
Compared to MCP Playwright dumping huge HTML or screenshots into your context every step, this feels like cheating.
It also supports semantic locators if you want them: agent-browser find role button click --name "Submit". Same idea — the AI describes what it wants in plain language, the binary handles the DOM lookup.
Install it in 10 seconds
Easiest path — just tell Claude Code to do it:
Tell Claude: "install agent-browser globally and run agent-browser install to download Chrome"
Prefer to do it manually? One line in your terminal:
That second command (agent-browser install) downloads Chrome from Chrome for Testing — Google's official automation channel. First-time setup only. After that you're ready.
Mac users can also use Homebrew: brew install agent-browser && agent-browser install.
What to use it on
- Any AI agent that browses the web. Lead scraping, content research, testing, form-filling. All of it gets cheaper and faster.
- Replacing Playwright MCP. If you're using
mcp__playwright__*in Claude Code right now, switch. The token savings alone pay for the migration in one day of usage. - Multi-step browser workflows. Use
agent-browser batchto chain commands in one process. Kills startup overhead when you're running 20 steps in a row. - Logged-in scraping. Session persistence, cookies import, and connecting to existing Chrome via CDP. Real production stuff.
When to skip it: one-off "open this URL and screenshot it" jobs where token cost doesn't matter. For everything else, this is the new default.