# Repository Briefing: SawyerHood/dev-browser
> Source: https://repoforai.com/repo/SawyerHood/dev-browser (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/SawyerHood/dev-browser
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A+ (88/100 · Maintenance 31/35 · Adoption 17/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v1.0.0 (2026-11-03) — https://github.com/SawyerHood/dev-browser/releases
- **Review Snapshot**: 2026-11-30
- **Deployment / Stack Signals**: CLI, Self-Hosted
- **Momentum**: 6,764 ★ total (+0 24h / +3 7d) · 446 forks
- **Topics**: `claude-code`, `playwright`, `skills`
- **When to Use**: Best for: Trusted coding agents that need to inspect, interact with, and verify a web app over multiple calls using persistent tabs and Puppeteer. Skip if: You need to execute mutually untrusted scripts, require native Windows or musl Linux support, or already have a harness that must own per-test browser isolation and teardown.

## Overview
```text
### Architecture & Core Mechanics
dev-browser is a TypeScript browser automation tool with two entry points: the `dev-browser` CLI and the MCP server launched by `dev-browser mcp`. Both send work to the same warm daemon. The release binary bundles Bun and Puppeteer, while Chrome runs separately. `browser.getPage(name)` retrieves or creates a named tab and returns a Puppeteer `Page` with agent-oriented helpers.

Execution state and browser state have different lifetimes. Each command gets a fresh `node:vm` context with top-level `await`, but named tabs can outlive it. At completion or timeout, the daemon closes that command’s page, locator, browser-context, and registry operations rather than tearing down the tab. MCP exposes script execution, page and browser listing, stop, and help. Bundled Codex and Claude skills are a separate discovery path for agents that can invoke the CLI.

### Key Capabilities & Differentiators
The core workflow is inspect, act, and verify without reopening the browser. `page.snapshot({ interactive: true })` emits a compact accessibility tree with element refs; Puppeteer selector methods accept forms such as `ref/e12`. Scripts retain the full Puppeteer Page API and gain helpers for JPEG screenshots, load settling, and form filling. `saveFile` and `readFile` are restricted to `~/.dev-browser/v1/tmp`.

The tool can launch Chrome with an isolated profile or attach to an existing Chrome session. In headless Linux benchmarks, medians over nine runs were about 13 ms for an empty script, 14 ms for `getPage("x")` plus `page.title()`, 18 ms for a snapshot of a search-results-like page, and 36 ms for a screenshot with a warm daemon. Cold daemon and Chrome launch took about 280 ms. These measurements characterize local operations, not end-to-end page navigation or agent task latency.

### Trade-offs & Limitations
Compared with embedding Puppeteer or Playwright directly, dev-browser supplies the session reuse and text-based element targeting an agent would otherwise have to build. Direct integration is preferable when a test harness needs explicit ownership of browser contexts, test isolation, and teardown. The daemon serializes browser and page creation and uses a bring-to-front lock for input across tabs, but scripts targeting the same named tab can still interleave. Give concurrent jobs separate tabs or coordinate access in the caller.

A fresh `node:vm` context is not a security sandbox. Keep automatic CLI approval scoped to trusted scripts and prefer a dedicated profile over attaching to a browser with unrelated credentials. Attachment does not transfer ownership: idle cleanup never closes an attached browser. Launched browsers close after 30 idle minutes by default, but their on-disk profiles, cookies, and login state persist. Process cleanup is therefore not session-data cleanup.

### Hardware & Deployment Guide
Install with `npm install -g dev-browser`; run `dev-browser install` if Chrome cannot be found. The release binary does not require Node after installation and supports macOS and glibc Linux, but not Windows or musl Linux. On Ubuntu, Snap Chromium cannot read the default `~/.dev-browser/v1` directory; install Chrome through dev-browser or point `DEV_BROWSER_CHROME` at another binary.

The CLI and MCP are self-hosted; `claude mcp add dev-browser -- dev-browser mcp --headless` registers the headless MCP entry point. The CLI may download its binary on first use if it was not installed earlier; private mirrors and manually provisioned binaries are supported. On Chrome 136 and later, use a dedicated profile for remote debugging because the default profile ignores the debugging flags. Release v1.0.0 followed rc.3 and rc.4 and replaced the 0.2 Playwright/QuickJS stack with Puppeteer/Bun. It uses a separate state directory, supports migration of durable doobie state, and requires changes to legacy snapshot and ref calls. The old `page.cua` and `page.domCua` helpers are not included.
```

## Key Capabilities
```text
- Session reuse: named Puppeteer pages keep browser state across CLI scripts and MCP calls.
- Element targeting: accessibility snapshots expose refs such as `e12`, usable in selectors as `ref/e12`.
- Execution lifecycle: top-level `await` in a fresh `node:vm` context per command, with command-scoped browser operations closed at completion or timeout.
- Browser attachment: `--connect` accepts auto-discovery, a port, HTTP, WebSocket, or a raw CDP Unix socket.
- Idle policy: launched browsers close after 30 idle minutes by default; attached browsers do not.
- MCP surface: run scripts, list pages or browsers, stop sessions, and retrieve help through the same daemon as the CLI.
```

## Quick Start / Clone
```bash
npm install -g dev-browser
dev-browser install    # only needed if dev-browser cannot find Chrome
```
