All tools
HarnessCommunity1k

dev-browser

Updated Jul 7, 2026

A browser automation tool by sawyerhood that lets Claude Code control browsers via sandboxed JavaScript scripts. Scripts run in a QuickJS WASM sandbox — no host filesystem or network access — against persistent named pages that survive across script calls. Supports auto-connect to a running Chrome instance or launches headless Chromium. Primary interface is CLI via stdin/stdout.

View on GitHub

What it does

  • npm install -g dev-browser && dev-browser install

    Install dev-browser globally and install Playwright + Chromium for the sandboxed browser runtime.

  • dev-browser --headless

    Run a browser script via stdin in headless mode — no visible window, suitable for CI.

  • dev-browser --connect

    Attach to an existing Chrome instance with remote debugging enabled (chrome://inspect/#remote-debugging) and run a script against it.

  • browser.getPage(nameOrId)

    Script API call to get or create a persistent named page — named pages survive across script calls, preserving navigation state and cookies.

  • page.snapshotForAI()

    Script API call that returns { full, incremental? } — an AI-friendly structured page snapshot for reasoning about page content.

Files (1)

OVERVIEW.mdprimary · markdown · 2.2 KB
## What it does

dev-browser is a browser automation CLI that Claude Code agents drive via stdin/stdout. Scripts run in a QuickJS WASM sandbox — meaning they have no access to the host filesystem or network — but expose the full Playwright Page API against persistent named pages. Named pages survive across script calls, so navigation state, cookies, and localStorage persist for the duration of the process.

The tool can either launch headless Chromium or connect to your already-running Chrome instance (enable remote debugging at chrome://inspect/#remote-debugging, then use --connect).

A benchmark in the repo shows dev-browser completed a standard task in 3m 53s at $0.88 vs Playwright MCP at 4m 31s at $1.45, both at 100% success rate.

## Install

npm install -g dev-browser
dev-browser install   (installs Playwright + Chromium)

## Script API (runs in QuickJS sandbox)

browser.getPage(nameOrId) — get or create a persistent named page (or connect to a Chrome tab by targetId)

browser.newPage() — create an anonymous page, cleaned up after the script ends

browser.listPages() — list all tabs: [{id, url, title, name}]

browser.closePage(name) — close a named page

Pages are full Playwright Page objects: goto, click, fill, locator, evaluate, screenshot, and more.

page.snapshotForAI({ track?, depth?, timeout? }) — AI-friendly page snapshot returning { full, incremental? }

page.cua.* — pixel/vision tier: screenshot(), click, doubleClick, drag, scroll, keypress, type at CSS coordinates

page.domCua.* — DOM-id tier: getVisibleDom() returns pseudo-HTML with node_id=N; click, doubleClick, scroll by node id

File I/O is restricted to ~/.dev-browser/tmp/ via saveScreenshot, writeFile, and readFile helpers.

## Usage modes

dev-browser --headless <<'EOF'  (script here)  EOF  — headless, pipe script via stdin

dev-browser --connect <<'EOF'  (script here)  EOF  — connect to running Chrome

## Claude Code integration

Tell Claude to run dev-browser --help — the help output includes a full LLM usage guide. To skip permission prompts, add Bash(dev-browser *) to the allow list in .claude/settings.json.

Legacy plugin install: /plugin marketplace add sawyerhood/dev-browser, then /plugin install dev-browser@sawyerhood/dev-browser.