browser-cdp

browser-cdp is a skill for Claude Code, Codex from zenstory-ai/oh-story-dsh. It costs 94 tokens per session (2,372 once invoked), scanned A, a copy of browser-cdp, MIT.

A browser-control guide for using Chrome through Chrome DevTools Protocol, a built-in interface for automation. It explains how to reuse existing login sessions, open pages, run JavaScript, take snapshots, and extract authentication tokens.

In plain words
What is it for?
Use it for browser automation, page inspection, authenticated web tasks, screenshots, and extracting information from loaded pages.
Why use it?
It helps automate tasks in an already logged-in Chrome session without requiring users to sign in again. It also includes checks and consent steps before starting Chrome in a way that may close existing browser processes.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: mentions Claude Code; built for openclaw; mentions OpenCode.

Good fit Use it for browser automation, page inspection, authenticated web tasks, screenshots, and extracting information from loaded pages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zenstory-ai/oh-story-dsh/browser-cdp
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.

Any agent
npx skills add zenstory-ai/oh-story-dsh --skill browser-cdp
Clone the repo
git clone --depth 1 https://github.com/zenstory-ai/oh-story-dsh

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 browser-cdp

README.md
[![agentmods](https://agentmods.dev/badge/skills/zenstory-ai/oh-story-dsh/browser-cdp/github.svg)](https://agentmods.dev/skills/zenstory-ai/oh-story-dsh/browser-cdp)
Your own site
<a href="https://agentmods.dev/skills/zenstory-ai/oh-story-dsh/browser-cdp"><img src="https://agentmods.dev/badge/skills/zenstory-ai/oh-story-dsh/browser-cdp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for browser-cdp

Your own site · 80×15
<a href="https://agentmods.dev/skills/zenstory-ai/oh-story-dsh/browser-cdp"><img src="https://agentmods.dev/badge/skills/zenstory-ai/oh-story-dsh/browser-cdp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,372 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.1 $0.00094 $0.02372
Opus 5.5 $0.00038 $0.00949
Sonnet 5.5 $0.00019 $0.00474
Haiku 4.5 $0.00009 $0.00237

Measured 8d ago against content hash 04ed954c8202, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

browser-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 8d ago.

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.

Origin

This is a copy

100% identical to browser-cdp — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

packages/knowledge/oh-story/skills/browser-cdp/SKILL.md · 188 lines

How it starts

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

Browser CDP 操作工具

通过 CDP(Chrome DevTools Protocol)连接 Chrome,复用登录态并执行浏览器操作。

前置条件

  • macOS / Linux / Windows(实验性),已安装并使用过 Google Chrome,来源 profile 已存在
  • Node.js 20+
  • agent-browser 已安装:npm install -g agent-browser

启动或重建时,若需结束 Chrome 进程,先按下方流程征得同意;未保存的标签页或草稿可能丢失。


启动流程(每次都按这个顺序)

下文 {SKILL_DIR} 指本 skill(browser-cdp)的目录。

第一步:探测当前状态(无副作用)

node {SKILL_DIR}/scripts/setup-cdp-chrome.js 9222 --detect-only

输出形如:

CDP_STATUS=ready                        # 已就绪,可直接复用
CDP_URL=http://127.0.0.1:9222/json/version
BROWSER=Chrome/148.0.7778.168

或:

CDP_STATUS=needs-setup
CHROME_RUNNING=yes                      # 用户有 Chrome 在跑,启动会杀掉
CHROME_PID_COUNT=3

第二步:根据探测结果分支

  • CDP_STATUS=needs-setup 且 CHROME_INSTALLED=no → 本机没找到 Chrome,告诉用户先安装并用它登录一次需要的网站,不要运行 setup。
  • CDP_STATUS=ready 且本次只需连接 → 直接使用 agent-browser --cdp 9222 ...,不要运行 setup。
  • 明确请求 --reset / --profile → 即使 ready 也走重建,按下方「需要结束 Chrome 时」处理。
  • CDP_STATUS=needs-setup 且 CHROME_RUNNING=no → 安全启动:
    node {SKILL_DIR}/scripts/setup-cdp-chrome.js 9222 --yes
    
  • CDP_STATUS=needs-setup 且 CHROME_RUNNING=yes → 按下方「需要结束 Chrome 时」处理。

需要结束 Chrome 时(同意流程):凡是会结束正在运行的 Chrome 的命令(Chrome 在运行时启动、--reset、显式 --profile),都按这三步走:

  1. 带上原定选项加 --dry-run 跑一次,看会结束几个 Chrome 进程;
  2. 告诉用户会结束 N 个 Chrome 进程、未保存的标签页或草稿可能丢失,问是否继续;
  3. 用户同意后,去掉 --dry-run、加 --yes 重跑;用户拒绝就放弃这次自动化。

非 TTY 调用中,Chrome 在运行且未传 --yes 时,脚本以退出码 3 报 NEEDS_CONSENT: ... 并中止。取得同意后再重跑,不自动补 --yes。

换端口:9222 被别的程序占用时可以换一个端口(如 9333),之后所有 agent-browser --cdp 命令用同一个端口,扫榜脚本加 --port 9333,查资料助手传 cdp_port: 9333。


启动脚本选项

选项 说明
--detect-only 只探测,不修改任何状态
--yes 已征得同意,跳过交互提示
--reset 启动前清空 ~/chrome-debug-profile(登录失效时用)
--profile <name> 指定来源 profile(默认 Default,如 "Profile 1");显式传入即重建
--dry-run 打印将执行的步骤,不执行

退出码:0 成功 / 1 通用错误 / 2 用户拒绝(TTY)/ 3 需同意但缺 --yes。


常用操作

打开页面并等待加载

agent-browser --cdp 9222 open "<URL>"
agent-browser --cdp 9222 wait 3000

Read the full file on GitHub · 188 lines

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. 8d ago Changed · +11 lines 04ed954c8202
  2. 12d ago Changed · +1 lines e189f957d068
  3. 1mo ago First seen · 176 lines · 94 tokens per session scan A aa594fbec8ba

Subscribe to this mod's changes

browser-cdp is a skill published in the GitHub repository zenstory-ai/oh-story-dsh (629 stars, last pushed today), licensed MIT. It adds 94 tokens to every session and 2,372 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to browser-cdp, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

browser-cdp

Use this skill when you need to control a Chrome browser via CDP (Chrome DevTools Protocol) to reuse existing login sessions. Covers: launching Chrome in debug mode, opening URLs, waiting for page load, evaluating JavaScript, taking snapshots, and extracting auth tokens. Trigger phrases: browser automation, CDP…

zenstory-ai/oh-story-claudecode · 94 tokens

browser-cdp

Use this skill when you need to control a Chrome browser via CDP (Chrome DevTools Protocol) to reuse existing login sessions. Covers: launching Chrome in debug mode, opening URLs, waiting for page load, evaluating JavaScript, taking snapshots, and extracting auth tokens. Trigger phrases: browser automation, CDP…

uu201/character-arc · 94 tokens

agent-first-screenshots

Agent-first screenshots — an agent drives the real app via CDP and produces clean, defect-free product screenshots (newsletters, landing pages, social, decks, PR). Dual-channel verification (DOM + pixels + vision) in a capture loop. Use for any "take/redo screenshots of the app" task.

Devin-AXIS/iPolloWork · 69 tokens

record-operations

Record a desktop demonstration or import a Chrome Recorder flow, automatically name and save it, then export a portable Skill draft without requiring setup forms.

Devin-AXIS/iPolloWork · 32 tokens

daytona-chrome-cdp

Launch and control standalone Chrome in a Daytona sandbox via CDP. Use for web sign-in, OAuth, Den Web setup, browser-only flows, or when the app should not be driven through Electron CDP.

Devin-AXIS/iPolloWork · 49 tokens

xhs-ops-dispatcher

Dispatch due Xiaohongshu browser jobs to locked account workers.

Devin-AXIS/iPolloWork · 21 tokens