cdp

cdp is a skill for Claude Code, Codex from browser-use/desktop. It costs 60 tokens per session (3,189 once invoked), scanned A, original, MIT.

A guide for controlling an assigned Chromium browser through the Chrome DevTools Protocol, a programming interface for inspecting and driving browser pages.

In plain words
What is it for?
Use it to connect to Browser Use Desktop’s assigned browser, inspect pages, run browser scripts, and access browser debugging features.
Why use it?
It keeps a persistent browser connection so repeated JavaScript commands can work with the same tab and session.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/browser-use/desktop/browser-harness-js
Any agent
npx skills add browser-use/desktop --skill browser-harness-js
Clone the repo
git clone --depth 1 https://github.com/browser-use/desktop

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cdp

README.md
[![agentmods](https://agentmods.dev/badge/skills/browser-use/desktop/browser-harness-js.svg)](https://agentmods.dev/skills/browser-use/desktop/browser-harness-js)
Your own site
<a href="https://agentmods.dev/skills/browser-use/desktop/browser-harness-js"><img src="https://agentmods.dev/badge/skills/browser-use/desktop/browser-harness-js.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,189 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00060 $0.03189
Opus 5 $0.00030 $0.01595
Sonnet 5 $0.00012 $0.00638
Haiku 4.5 $0.00006 $0.00319

Measured 4d ago against content hash 64570f439df6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cdp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (sdk/browser-harness-js.cmd, sdk/generated.ts, sdk/repl.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

app/src/main/hl/stock/browser-harness-js/SKILL.md · 249 lines

How it starts

The opening of the file, as written. The whole thing — 249 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CDP — browser-harness-js skill

Custom codegen'd CDP SDK (every method from browser_protocol.json + js_protocol.json gets a typed wrapper) plus a tiny HTTP server that holds one persistent CDP Session. The browser-harness-js CLI auto-starts the server on first use and forwards JS snippets to it.

Browser Use Desktop bundles the runtime under ./browser-harness-js/sdk/ and puts that directory on PATH for you. Do not run npx skills add or create global symlinks from inside the desktop harness.

First use in Browser Use Desktop

Connect to the app-assigned target before page-level calls:

browser-harness-js 'await connectToAssignedTarget()'

connectToAssignedTarget() reads BU_TARGET_ID and BU_CDP_PORT, attaches the assigned target when possible, and enables the common Page/DOM/Runtime/Network domains. The CLI auto-installs bun on first run if it is missing. Set BROWSER_HARNESS_SKIP_BUN_INSTALL=1 to opt out.

How to use

Just run browser-harness-js '<JS>'. The first call spawns the server in the background; subsequent calls hit the same process and so reuse the same session, the same WebSocket to Chrome, and any globals you set.

browser-harness-js 'await connectToAssignedTarget()'
browser-harness-js 'await session.Page.navigate({url:"https://example.com"})'
browser-harness-js '(await session.Runtime.evaluate({expression:"document.title",returnByValue:true})).result.value'

Output is the raw result content — no {ok,result} envelope.

Result type stdout
string bare text, no JSON quotes (e.g. Example Domain)
number / boolean 42, true
object / array (non-empty) compact JSON (e.g. {"frameId":"..."}, [1,2,3])
undefined / null / "" / {} / [] empty (no output)

Errors go to stderr, exit code 1. The CDP error message and JS stack are printed verbatim, e.g.:

Error: CDP -32602: invalid params
    at _call (.../session.ts:117:33)
    ...

Detect failure with if browser-harness-js '...'; then ...; else handle_error; fi or by checking $?.

Read the full file on GitHub · 249 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 249 lines · 60 tokens per session scan A 64570f439df6

Subscribe to this mod's changes

cdp is a skill published in the GitHub repository browser-use/desktop (671 stars, last pushed 1mo ago), licensed MIT. It adds 60 tokens to every session and 3,189 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

browser-harness

Control a real browser via CDP: clicking, typing, navigation, logged-in sessions, JS-rendered or bot-protected pages. Not for plain HTTP fetches of public content - use curl for those.

browser-use/browser-harness · 46 tokens

x402

Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — "just use it" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing…

browser-use/browser-use · 175 tokens

browser-use

Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work.

browser-use/browser-use · 26 tokens

remote-browser

Controls an isolated Browser Use Cloud browser from a sandboxed machine with the current Browser Use CLI.

browser-use/browser-use · 22 tokens

opencli-browser

Use when an agent needs to drive a real Chrome window via opencli — inspect a page, fill forms, click through logged-in flows, or extract data ad-hoc. Covers the selector-first target contract, compound form fields, stale-ref handling, network capture, and the agent-native envelopes the CLI returns. Not for writing…

jackwener/OpenCLI · 80 tokens

opencli-adapter-author

Use when writing an OpenCLI adapter for a new site or adding a new command to an existing site. Guides end-to-end from first recon through field decoding, adapter coding, and verify. Replaces opencli-oneshot / opencli-explorer. For ad-hoc browser driving (no adapter), see opencli-browser instead; for a top-level…

jackwener/OpenCLI · 88 tokens