add-webmcp
Analyze an existing web application, identify safe user-visible capabilities across routes, forms, server actions, handlers, and schemas, then implement…
Capture a full DevTools-protocol trace of any browser automation — CDP firehose, screenshots, and DOM dumps — then bisect the stream into per-page searchable buckets. Use when the user wants to debug a failed run, audit network/console/DOM activity, attach a trace to an
$ npx -y skills add browserbase/skills --skill browser-trace --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/browser-traceContext preview
The summary Claude sees to decide when to auto-load this skill.
Capture a full DevTools-protocol trace of any browser automation — CDP firehose, screenshots, and DOM dumps — then bisect the stream into per-page searchable buckets. Use when the user wants to debug a failed run, audit network/console/DOM activity, attach a trace to an
name: browser-trace description: Capture a full DevTools-protocol trace of any browser automation — CDP firehose, screenshots, and DOM dumps — then bisect the stream into per-page searchable buckets. Use when the user wants to debug a failed run, audit network/console/DOM activity, attach a trace to an in-progress session, or feed structured per-page summaries back into an agent loop so its next iteration learns from the last one. compatibility: "Requires Node 18+, the browse CLI (`npm install -g browse`) with `browse cdp`, and optionally `jq` for ad-hoc querying of the bisected JSONL files. For remote Browserbase sessions, also requires `BROWSERBASE_API_KEY`. The skill scripts themselves use only the Node standard library — no `npm install` step." license: MIT allowed-tools: Bash, Read, Grep
Attach a **second, read-only CDP client** to a browser session that is already being driven by your main automation. The trace records the full DevTools firehose to NDJSON, polls for screenshots and DOM dumps in parallel, and slices everything into a directory tree that bash tools can search.
This skill does **not** drive pages — it only listens. Pair it with the `browser` skill, `browse`, Stagehand, Playwright, or anything else that speaks CDP.
If the user just wants to **drive** the browser, use the `browser` skill instead.
node --version # require Node 18+ which browse || npm install -g browse which jq || true # optional — used only for ad-hoc querying
Verify `browse cdp` exists:
browse --help | grep -q "^\s*cdp " || echo "browse cdp not available — update browse"
Every Chrome DevTools target accepts **multiple concurrent CDP clients**. Your main automation is one client; this skill adds a second one that only enables observation domains (Network, Console, Runtime, Log, Page) and never sends action commands.
The tracer has three pieces:
1. **Firehose**: `browse cdp <target>` streams every CDP event as one JSON object per line to `cdp/raw.ndjson`. 2. **Sampler**: a polling loop calls `browse screenshot --cdp <target> --path <file>` and `browse get html body --cdp <target>` on an interval (default 2s). The helper passes `--cdp` when it samples so it can attach to the traced target from its own process; once a browse daemon session is attached to a CDP target, follow-up commands in that session do not need to repeat `--cdp`. 3. **Bisector**: after the run, `bisect-cdp.mjs` walks `raw.ndjson` once, slices it into per-bucket JSONL files keyed by CDP method, and additionally bisects per page using top-level `Page.frameNavigated` events as boundaries.
# 1. Launch Chrome with a debugger port (any user-data-dir keeps it isolated). "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \ --remote-debugging-port=9222 \ --user-data-dir=/tmp/chrome-o11y \ about:blank & # 2. Start the tracer. node scripts/start-capture.mjs 9222 my-run # 3. Run your main automation against port 9222. browse open https://example.com --cdp 9222 # ...whatever the run does... # 4. Stop and bisect. node scripts/stop-capture.mjs my-run node scripts/bisect-cdp.mjs my-run
Two helpers wrap the platform-side bookkeeping: `bb-capture.mjs` creates or attaches to a session and starts the tracer; `bb-finalize.mjs` pulls platform artifacts (final session metadata, server logs, downloads) into the run dir at the end.
> Browserbase ends a session as soon as its last CDP client disconnects. **Create with `--keep-alive`, then attach automation to the session's `connectUrl` before or together with the tracer.** `bb-capture.mjs --new` handles the keep-alive session and tracer setup; your automation still needs to attach.
export BROWSERBASE_API_KEY=... # 1. Create a keep-alive session AND start the tracer in one step. # Prints the session id, connectUrl prefix, and a live debugger URL you # can open in a browser to watch the run interactively. node scripts/bb-capture.mjs --new my-run # 2. Drive automation. bb-capture stamped the session id into the manifest. SID=$(jq -r .browserbase.session_id .o11y/my-run/manifest.json) CONNECT_URL="$(browse cloud sessions get "$SID" | jq -r .connectUrl)" BROWSE_NAME=my-run-browser browse open https://example.com --cdp "$CONNECT_URL" --session "$BROWSE_NAME" browse open https://news.ycombinator.com --session "$BROWSE_NAME" # 3. Stop the tracer, bisect, then pull platform artifacts and release. node scripts/stop-capture.mjs my-run node scripts/bisect-cdp.mjs my-run node scripts/bb-finalize.mjs my-run --release
Attaching to a session that's *already running* (e.g. one your production worker created) — `bb-capture.mjs` accepts a session id instead of `--new`:
# Pick a running session (filter client-side; browse cloud sessions list has no --status flag) browse cloud sessions list | jq -r '.[] | select(.status == "RUNNING") | .id' node scripts/bb-capture.mjs <session-id> mid-flight-debug # ...tracer runs alongside the existing automation client; no disruption... node scripts/stop-capture.mjs mid-flight-debug node scripts/bisect-cdp.mjs mid-flight-debug node scripts/bb-finalize.mjs mid-flight-debug # without --release: leave the session running
`bb-capture.mjs` adds a `browserbase` block to `manifest.json` (session id, project, region, started_at, expires_at, debugger URL). `bb-finalize.mjs`
A set of skills for enabling Claude Code to work with Browserbase through browser automation and the official browse CLI.
Repo: browserbase/skills
Analyze an existing web application, identify safe user-visible capabilities across routes, forms, server actions, handlers, and schemas, then implement…
Audit the developer experience of a product, SDK, docs site, or SKILL.md by dropping multiple Claude subagents at it with only a tiny task prompt and real…
Self-improving browser automation via the auto-research loop. Iteratively runs a browsing task, reads the trace, and improves the navigation skill…
Turn a website's observable HTTP traffic into a best-effort OpenAPI 3.1 spec by analyzing a `browser-trace` capture. Use when the user wants to…
Migrate browser-use (Python) browser-automation scripts to Stagehand v3 (TypeScript) on Browserbase. Use when the user wants to convert, port, rewrite, or…
Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from…