Your agent decides what
Claude Code, Codex or Cursor states the outcome it needs — one sentence, one call. No page trees, no locators, no screenshots.
Each Playwright needs their Prima
Playwright CLI is how coding agents drive the browser today — and every click, ARIA ref and snapshot pollutes the main loop's context at frontier prices. Prima CLI is the fast subagent on top of it: a cheap model takes the wheel and hands your agent back a verdict, not a transcript.
Works with your favorite agent
Playwright CLI stays exactly where it is. Prima CLI acts as a fast subagent on top of it, so your frontier model stops driving it by hand — each model does what it is priced for.
$ prima-cli check "the theme setting survives a reload"
### Result
ok: true expectations: PASSED
used: I.click('Theme'); I.selectOption('Dark'); I.reload(); ...
### Steps
1. ok switch the theme to dark I.selectOption('Theme', 'Dark')
2. ok confirm it took effect I.seeInField('#theme', 'dark')
agent: verdict received. 1 call, ~40 tokens. moving on. Claude Code, Codex or Cursor states the outcome it needs — one sentence, one call. No page trees, no locators, no screenshots.
A budget-tier model runs the perceive-and-click loop on Playwright CLI: resolve, heal, retry. Clicks, ARIA refs and API noise never leave the subagent.
A compact envelope back: PASSED, FAILED or CONTRADICTION, the steps, the code that worked. Dumps stay inside; artifacts land on disk.
Your agent ships the feature fast, then spends twice as long proving it works. Here is that session, drawn to scale.
One feature, start to finish
15 min
Builds the feature
one continuous flow
Verifies it via Playwright CLI
snapshot, read, click, ×20
Two thirds of the session went to driving Playwright CLI in the main loop — clicks, ARIA refs and API dumps piling trashy tokens into context, billed at frontier-model rates.
And here is what that second half quietly cost you
Every click, ARIA ref and page dump stays in history as trashy tokens. Context balloons; the model degrades from there.
Frontier-model prices for ten minutes of clicking the green button in the top-right corner.
Playwright CLI is the mainstream way agents drive the browser — and it works. It is just priced wrong: clicking through a form and confirming a save does not need frontier reasoning, it needs speed, volume and a low bill. Prima CLI runs that layer on whatever budget model you point it at, while your coding agent keeps its context for architecture and code.
20 steps × (snapshot, read, ref, act) as trashy tokens in the main loop. Context fills; every later token costs more.
DevTools or Playwright MCP: a server to wire up, dozens of tool definitions — then the same round trips, same trashy tokens, no verdict.
Your frontier model clicks a real tab, waiting on the UI between steps. Slow — and the whole page still lands in its context.
A fast subagent takes one delegated call on a cheap model. Back comes PASSED, FAILED or CONTRADICTION — and room to think.
Runs its cheap model on any provider
When a coding agent drives Playwright CLI itself, every step taxes the thing you are actually paying for: reasoning.
A round trip per action in the main loop: snapshot in, read the tree, pick a ref, act, repeat — clicks, ARIA refs and API dumps piling up as trashy tokens at Opus prices.
Each Playwright CLI snapshot is kilobytes of ARIA dump that never leave history. Fifteen steps in, the context is all DOM — and every later turn costs more.
e13 and e26 live for one Playwright CLI snapshot. Apps re-render, so the agent re-snapshots for fresh refs — same tax, same page, same button.
Point your agent at prima-cli, set one model variable, and hand browser work to a fast subagent — same Playwright CLI and browser underneath, just faster and cheaper.
Because the expensive model stops reading pages. With Playwright CLI — the standard setup — every step dumps clicks, ARIA refs and snapshots into your agent's main-loop context, and the frontier model pays to parse them — trashy tokens that stay in history, compounding for the rest of the session. Prima CLI acts as a fast subagent: it takes the whole scenario in one call, runs the clicking on a cheap model you point it at, and hands back only the verdict.
Any agent that can run a terminal command. Point Claude Code, Codex or Cursor at prima-cli --help and it will find its way — the contract is taught entirely by the help text. One call carries a whole job, and the reply is sized for a machine to read, not a human.
Whatever you set PRIMA_CLI_AI_MODEL to — openai/gpt-oss-120b on OpenRouter or Groq is the sweet spot: fast, cents per session, accurate enough to click through a form. Screenshot judgement uses a separate vision model. Your coding agent stays on its own subscription, doing the work it is actually good at.
No — Playwright CLI stays the mainstream driver, and Prima CLI sits on top of it. Prima CLI attaches to the browser Playwright CLI already opened, and below it sits raw Playwright, fully intact: prima-cli pw runs a function expression with no model involved. You keep the standard tool, just faster and cheaper: when a check fails, Prima CLI reports back compactly so your agent can drop down a level and drive Playwright CLI directly.