OpenCode contributor Dax Raad has completed a ground-up rewrite of the project's browser automation tool in Rust, achieving dramatic reductions in both binary size and runtime memory consumption. The effort, completed with the help of AI coding models for just $60, demonstrates how language choice and focused implementation can dramatically reshape resource usage in developer tools.

A 4.3 MB binary

The performance gains Raad shared on X last Saturday are substantial. The resulting Rust binary weighs in at just 4.3 MB, a dramatic reduction from the prior Node-based version's 53 to 64 MB footprint. Each OpenCode Browse connector now consumes approximately 5.6 MB of memory after a few operations, down from roughly 190 MB—representing a 97% decrease.

The new Rust binary is just 4.3 MB, compared with 53 to 64 MB for the previous Node version.

Dax Raad

The relay component that bridges AI agents to the browser exhibits similarly impressive efficiency gains. Raad's benchmarks show the Rust relay at 6 MB when idle, rising to 6.6 MB under load, versus 353 MB for the Node relay after six days of continuous operation.

Replacing Playwright and Patchright

OpenCode Browse functions by connecting AI coding agents to a developer's browser via a Chromium extension paired with an MCP server. The earlier Node implementation relied on Playwright for automation tasks and Patchright for evasion, but Raad extracted only the specific functionality Browse required and implemented it directly in Rust to eliminate unnecessary overhead.

The new Rust relay establishes communication with the Chromium extension through WebSockets and leverages the Chrome DevTools Protocol to manage browser operations, agent sessions, session recordings, and network traffic analysis. The implementation also incorporates QuickJS to run JavaScript supplied by agents, eliminating the dependency on a separate Node runtime.

Inside the pull request

The merged pull request documentation shows that Raad replaced the Node CLI and relay infrastructure while preserving the existing Chromium extension and continuing to use the Chrome DevTools Protocol for browser control.

Testing involved two phases using approximately 10 regression agents running against a live Chrome instance. The Rust version achieved an 85% score on Stealth Bench v2, compared with 90.5% for Browser Use Cloud, though the pull request does not provide a baseline score for the original Node implementation.

Some capabilities did not survive the transition. Raad removed time zone and locale emulation features, as well as the download tool—which Chrome blocks at the extension level. The Rust implementation also carries forward an existing limitation from the Node version: a busy-looping eval operation cannot be halted through the extension interface.

Browse retains its security model, including relay authentication, extension pairing verification, and origin-based access controls. Agents remain restricted to tabs they create themselves or that users explicitly grant them access to.

The real $60 cost

Raad stated the rewrite "only cost $60" and later clarified on X that Claude Opus served as his primary coding assistant, with DeepSeek handling secondary tasks. The two models helped him reconstruct the Playwright and Patchright capabilities Browse needed, though the $60 figure excludes the manual effort Raad invested in code review, testing, and bug fixes.

the $60 figure doesn't include the time he spent checking, testing, and fixing the code

While the memory improvements are undeniable, Raad has assumed ongoing maintenance responsibility for code that Playwright and Patchright previously handled. His team must now manage browser compatibility changes, authentication updates, and security patches that previously arrived through those maintained libraries. This dynamic illustrates a broader challenge with AI-assisted rewrites: code becomes inexpensive to generate but often demands substantially greater effort to sustain over time.