Token-efficient browser snapshots for AI agents, with surprisingly generous savings

In agentic workflows, what we really care about is speed and efficient token use - because session limit anxiety is very real.
Browser agents work by capturing a page as an accessibility-tree snapshot, sending it to the models as text, and letting the model pick an element to work on. The snapshot is the expensive part, on dense pages it can run past 100k tokens. And a multi-step task re-takes a snapshot after every action.
So we’ve been working on ways to compress snapshots during research sessions. We’ve made improvements to the opera-browser-cli resulting in 36% smaller snapshots per byte, which compounds into 66% fewer input tokens than the existing opera-raw (and 80% fewer than the raw mcp baseline!).
On session-limited plans, fewer tokens per snapshot means more browsing inside a single session before you hit a usage wall.
For reference, we benchmarked on documentation-class pages; results on app-style UIs may differ.
By adding a compression layer on top of the excellent AXI (Agent eXperience Interface; Kun Chen, https://axi.md) design spec. We added a few clever ways to thin the snapshot, by doing structural cleanup, adding a predictable default cap and adding a URL lookup table. Here’s some examples:
- References are rewritten, because the dot tokenises into fewer tokens than the underscore;
- Role names are shortened, where the long form carries no extra meaning;
- Redundant attributes are stripped. Most are values the WAI-ARIA specification defines as implicit for the role and therefore recoverable;
- Empty nodes are dropped;
- Headings become Markdown;
- URLs are cleaned. Same-origin URLs are stripped to their path, URLs that carry no actionable destination are dropped entirely;
- Repeated boilerplate is deduplicated;
- Fragments are merged;
- Numeric attribute values are unquoted, saving the two quote characters per numeric attribute.

The full mechanics, including the benchmark tests are available in the technical paper here.
Opera Compact is included with the latest opera-browser-cli and is used by default. To install it you can run this command in the terminal:
npm install -g opera-browser-cli && opera-browser-cli setup
Learn more about opera-browser-cli:
- https://blogs.opera.com/news/2026/05/opera-browser-cli/
- https://github.com/operasoftware/opera-browser-cli