Hacker Newsnew | past | comments | ask | show | jobs | submit | wittydeveloper's commentslogin

Nope, you can also deploy and manage your own browsers as soon as they accept custom extensions.

Does "agent-based" here mean a CLI/Coding agent or software-level agents you built? I'd say that Stagehand is subtly faster for local use cases (batching, in-extension design) while covering both CLI (via https://browse.sh) and framework-level use, whereas agent-browser is CLI-only.

The cache serves as a managed server-side layer in the Stagehand API, keyed to instruction, page content, and the options you provide. Model configuration is intentionally excluded from the cache, so switching models does not invalidate it. If the page structure changes, the call does not result in a cache hit, and we revert to full inference. Additionally, any cached selector that no longer resolves will also revert, with self-healing disabled during replay.

Regarding the local file issue: currently, caching keys are based on a Browserbase session. This means that with a purely local browser, the cache option has no effect, and there’s nothing to verify. Each call returns metadata (including status, miss reason, threshold, count, and tokens saved) so you can observe churn rather than make guesses about it.


We removed agent because so many great harnesses are available in the ecosystem. Instead of keeping it, we decided to make Stagehand v4 better integrated with popular harnesses, both at the Coding Agent level (Codex, Claude Code) and frameworks level (Eve, Deep Agents, Mastra, etc)

Exactly, as Stagehand now runs inside the browser, you'll save on the round trip. Also, enabling batch actions will further accelerate your test suite.

Tests typically drive the browser on the same machine. What round trip are we talking about here? Process-to-process over CDP?

Nope, Stagehand is open-source and works with local browsers by default.

A lot, especially for performance. That's why we built our own benchmarks that account for both the model and the harness. For example, with Claude Opus 5, the accuracy gap can be up to 3% and performance up to 200ms, depending on whether you're using Deep Agents, Eve, or Fx.

More details here: https://www.stagehand.dev/evals


It still uses CDP but communicates from an extension within the browser instead of a script running in a separate runtime or, worse, in a separate region.

Are you using CDP over web sockets or via a pipe?

We built Stagehand 2 years ago (24k stars and 4M monthly npm downloads) and recently fixed its biggest flaw: round-trip latency.

Every action performed requires a round trip between your script and the browser (short when running locally but increased when running in the cloud). We also saw multiple posts complaining about the eager token appetite of Playwright MCP.

For this reason, we rebuilt Stagehand from the ground up and shipped v4, where Stagehand controls the browser from an extension automatically loaded upon your browser startup.

Stagehand v4 comes with batch command support, dedicated token-efficient methods `act()` and `extract()`, and a brand new architecture making it 2x faster than Playwright and 80% more token efficient.

You can see for yourself by looking at our benchmarks, comparing its performance across a dozen models (frontier and open weights) and tools (Codex, Claude Code, and more): https://www.stagehand.dev/evals

Ask me anything!


I've been using Playwright a lot and also hit on the friction between playwright's web testing scope (e.g. no 1st class support for "muted" start-up of browsers, jeez) and usage for task automation all the time. This looks very interesting!

How does stagehand deal with complex http/websocket request/response and or console message filtering? https://docs.stagehand.dev/v4/reference/page#on E.g. I would like a script that tracks all communication that matches a specific filter (implemented as an anonymous function/lambda). This filter may look at patterns in the url, but sometimes needs to do a deeper inspection of also the payload (if the url does not carry enough information in itself).

I've found playwright to be prohibitively slow at this, not only because of the round-trip latency, but just the simple fact that it needs to pump the complete response to my filter function, which then proceeds to read only a couple of bytes to make the filtering decision. There are a lot of cases where I am only interested in around 1% of the total requests processed by the filter, which makes this behaviour massively wasteful.

Ideally I would like to run this filter in the browser as well. It currently simply searches the first 100 bytes (usually enough) for a given substring, but a more flexible filter would be good, perhaps even a filter func that is eval'ed in the extension? From the documentation, I don't see this use-case is currently supported. Are there any plans along these lines? :)


I'm confused. You flagged your own replies?

I'm using playwright to do diagnosis on customer sites, and I'm wondering some things:

1) Does it have full Chrome Devtools support? Like, able to diagnose where a fetch() came from, what script sets a cookie? 2) How hard would it be to set up in an AWS Lambda (I can run Playwright without needing to run a container, which saves a lot of startup time/cost)?

Always interesting to see forward work on these kinds of tools which get used so foundationally billions of times a day.


How does the “Token efficiency Hybrid accessibility-tree trimming” work?

You can see durable execution as a combination of persistent state and queues (simplified example). With regular queues, the state is spread across many places from messages, runtime and external storages where the primary value is the reliability of the message processing and simple error management. Durable brings more advanced error management and end to end reliability with persistent state.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: