Part of the AI Coding Harness Guide — environment design for coding agents in production.

I Love Claude in Chrome. So I Built It for Every Agent.#

Published by

Claude in Chrome is one of my favorite things in Claude Code. Top three, maybe top four. You type /chrome, and the agent works in your real browser, signed in where you are signed in. It checks the page it just changed. It reads the dashboard you could not be bothered to open. Once you get used to it, an agent without a browser feels half blind.

Then two things kept bothering me.

I don't live in one harness#

Some days I run Codex. Some days OpenCode, or something else I am trying out. Every time I switch, the browser story gets worse. Nothing else I use comes close to how well Claude Code works with Chrome, and I kept missing it.

Even Claude Code wastes a lot#

I watch my agents work, and the browser part often looked slow and expensive. Screenshot, look, click, screenshot again. So I went through my own sessions and counted. Browser agents took 1,849 screenshots. They read the page as text 7 times.

That matters more now than a year ago. Subscriptions get squeezed, limits get tighter, and sometimes you pay by the token through the API. Every extra screenshot is time and money.

I have built Chrome extensions and web apps for years, so I got curious. Can an agent drive Chrome faster, in fewer calls, with fewer tokens, and from any harness?

What I built#

better-browser-mcp (bbm) is an MCP server plus a small Chrome extension. Any agent that speaks MCP gets your own Chrome: Codex, Claude Code, OpenCode, whatever you run.

The trick is boring on purpose. The agent gets the page as text with short refs, and it can do several steps in one call and get back only what changed. Here is a real login from one of my test pages:

> navigate /login-form/
  textbox "Username" [e1]
  textbox "Password" [e2]
  button "Sign in" [e4] disabled

> act  type e1 "bench_user" · type e2 "S3cure!pass#42" · click e4
  1. type e1 "bench_user" ✓
  2. type e2 "S3cure!pass#42" ✓
  3. click e4 ✓
  # Welcome back

Two calls. No screenshots.

It also tries to be a polite guest in your browser. The agent works in its own tab group, never grabs your active tab, and never steals focus while you type. Everything stays on your machine.

Did it work?#

I built 16 nasty test pages: iframes, shadow DOM, native dialogs, popups, file uploads, and one page that tries to trick the agent with hidden instructions. Claude Sonnet ran each page twice with each tool, and a test server checked the result, so nobody could just claim success.

PassedTokens per taskTime per task
bbm32/3230.5k11 s
Claude in Chrome28/32109.9k39 s

That is 72% fewer tokens and 3.5× faster than the tool I love. Playwright MCP and chrome-devtools-mcp also passed every run, but they used about three times the tokens. On real sites in my own Chrome (Hacker News, an Amazon search, adding to a cart), bbm used between a half and a quarter of the tokens, and on the Amazon tasks a third of the calls or fewer. The samples are small, and the full method and raw runs are in the repo.

It was not a straight line. On one task, drafting a 10-post thread in a social composer, bbm first used three times more tokens than Claude in Chrome. Every snapshot was carrying the whole page behind the dialog. Now snapshots cover only the open dialog. Every failure like that is written down as a lesson with a test, so it stays fixed.

The worst case#

The worst thing that can happen is that the Claude Code team or the Codex team reads this and makes their own browser integration better. I would be very happy with that.

Until then, it is open source and MIT-licensed. The setup takes about five minutes:

git clone https://github.com/alexsorokoletov/better-browser-mcp
cd better-browser-mcp/prototype && npm install
codex mcp add bbm -- node "$PWD/src/server.ts"
# Claude Code: claude mcp add -s user bbm -- node "$PWD/src/server.ts"

Then load the extension (guide) and ask your agent to open a page. The extension is waiting for Chrome Web Store review, so for now you load it unpacked.

If it breaks on a site you care about, open an issue. That is how the lessons list grows.