Guide

Cut the tokens your browser agent spends.

A browser agent spends most of its tokens on steps, and each step re-reads the agent’s own prompt plus whatever the page returned. Cut the number of steps first: a short numbered page map, answers that show only what changed, and one call for a whole table. In our benchmark that meant 5.80M tokens against 8.80M for agent-browser, about a third fewer.

Where the tokens go

We measured a step in the Cursor-agent runs: it cost about 22k tokens with Browser Layer and about 29k with agent-browser, and roughly 90% of that was the agent harness reading its own prompt again at every step. With Claude Code a step carries about 45k tokens. The page content is the smaller part. What you control most is how many steps the agent takes.

That is why the savings below are mostly about doing fewer steps, and only secondarily about shorter answers.

Lever 1: fewer steps

Across 30 runs of the same 10 scenarios, Browser Layer took 176 steps against 391 for agent-browser with Cursor’s agent, and 127 against 196 with Claude Code. The agent finishes sooner because each answer tells it what it needs next.

  • Answer every action with what changed, not the whole page again. A repeated call that gets the same answer says so.
  • Return the next page of a list as records, so the agent can see a click worked without going looking.
  • Let an action name its control (click "Next") so the agent does not need a fresh map to find a reference.

Lever 2: read a map, not the markup

The page map lists regions and controls, not HTML. A short main region comes whole, so there is nothing more to read in it. Links and long lists stay out of the reply until the agent asks.

  • The tab line (address and title) appears only when it changed.
  • Command hints and footer link lists are dropped.
  • read --full folds regions already shown in the tab.

Lever 3: cap every answer and move bulk to files

An answer over 20,000 characters is saved whole to a file, and the reply gives the first 4,000 and how to read the rest. Bulk reads go to a file with --out, and the reply shows only the first 1,500 characters. A 120-row table comes back from get --all in one call.

steps 'tab https://shop.example/orders; get --all --out orders.txt'
find "Pending" --in orders.txt

Lever 4: cut decoration, not CSS

We tested three modes on five live sites. Blocking images, fonts and media and turning off animation kept every control the agent needed and saved 13% to 36% of bytes; Amazon’s search page loaded 2.7 times faster. Blocking all CSS broke real pages: controls vanished on Google Flights (42 lost, including the Best and Cheapest tabs) and hidden menus appeared as if they were real on GitHub and Amazon.

So Browser Layer blocks decoration and keeps stylesheets. Painting itself costs 70 to 220 ms of CPU per page load, a real share only when many tabs run at once.

What it added up to

Same agent, model, prompt and task for each tool, only the browser changed, every answer checked.

  • Claude Code on Sonnet, 10 scenarios, 3 runs: Browser Layer 5.80M tokens, 127 steps, 7.3 minutes, $2.51. agent-browser 8.80M, 196, 9.3 minutes, $3.28. Both 30 of 30.
  • Cursor’s agent on Sonnet, same scenarios: 3.7M against 12.8M tokens, 176 against 391 steps. Both 30 of 30.
  • Claude Code on Haiku, head to head with Browser Use 1.0: 4.02M against 6.93M tokens, $0.19 against $0.29 over 70 runs each.
  • Our own eight-task set: 1,255k tokens against 1,968k for agent-browser and 1,909k for playwright-cli. All three passed 8 of 8.

Where it did not help

Browser Layer tied Browser Use on Sonnet (5.80M and 5.92M tokens). On pagination our first version lost to agent-browser, 388k tokens and 17 steps against 286k and 10, because the agent could not see a click had worked. Fixing that brought it to 219k and 10 steps. Totals vary with the model, the harness and the tasks, and our sites are small fixtures, so measure your own tasks.

How to measure your own

Pick three tasks you really run, give the same prompt to each tool, count tokens and steps from the agent’s own log, and check the answer. Three runs each is enough to see a gap above 20%. The scenarios, runner and raw data are in the repository.

Questions

How many fewer tokens does it use?

In our benchmark, about a third fewer than agent-browser with Claude Code (5.80M against 8.80M over ten scenarios, three runs each) and 3.4 times fewer with Cursor’s agent. Against Browser Use it tied on Sonnet and used 1.7 times fewer on Haiku.

Is that a guarantee?

No. It is small fixture scenarios with one agent family, and totals move with the model and harness. The method and raw data are public so you can rerun it.

Does it lose accuracy to save tokens?

In those runs every answer was checked and both tools passed 30 of 30 on the shared scenarios.

What is the biggest lever for cutting browser-agent tokens?

The number of steps. A step costs about the same either way, mostly the agent re-reading its own prompt, so answers that let the agent finish in fewer calls save the most.

Keep reading