openbrowser: Instructions file for Claude Code

CLAUDE.md

openbrowser CLAUDE.md is an instructions file for Claude Code from dylansantwani/openbrowser. It costs 12,730 tokens per session, scanned A, original, MIT.

Project guidance for OpenBrowser, a Chrome extension and zero-dependency MCP server that lets coding agents control real Chrome tabs using the user’s logged-in browser.

In plain words
What is it for?
Use it when changing the MCP server, Chrome extension, browser sessions, WebSocket hub, or routing between clients, browsers, and windows.
Why use it?
It explains the separate server and extension parts, their failure modes, and the rules needed to preserve the project’s dependency-free design.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions Claude Code; mentions OpenCode.

This is dylansantwani/openbrowser's own configuration. It tells Claude Code how to work on openbrowser itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything openbrowser configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dylansantwani/openbrowser. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dylansantwani/openbrowser/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/dylansantwani/openbrowser

Made for: Claude Code.

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 openbrowser CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dylansantwani/openbrowser/claude-md.svg)](https://agentmods.dev/instructions/dylansantwani/openbrowser/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dylansantwani/openbrowser/claude-md"><img src="https://agentmods.dev/badge/instructions/dylansantwani/openbrowser/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 12,730 This file is loaded in full into every session.
When invoked 12,730 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.12730 $0.12730
Opus 5 $0.06365 $0.06365
Sonnet 5 $0.02546 $0.02546
Haiku 4.5 $0.01273 $0.01273

Measured yesterday against content hash 260b2d1cdc02, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

openbrowser CLAUDE.md scanned grade A with 1 finding 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 yesterday.

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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

import { spawn } from 'node:child_process';
CLAUDE.md · 892 lines

How it starts

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

OpenBrowser — working guidance

Read this before changing anything in openbrowser/. It exists because most of what is non-obvious here was learned by driving the extension against real sites and watching it fail in ways that are invisible from unit tests.


What this is

A Chrome extension plus a zero-dependency MCP server, letting any MCP client (Claude Code, opencode, Cursor) drive a real Chrome browser with the user's real logins.

  MCP client ──stdio──> mcp-server ──ws://127.0.0.1:8848──> extension ──> tabs

Several MCP clients share one hub, and one hub drives several browsers. A session is bound to one browser and to one window inside it; the hub routes by that binding. See "The browser was never a singleton" below.

Two halves, two languages of failure:

  • mcp-server/ is Node. Bugs here look like "the tool never appears in my client" or "every call times out".
  • extension/ is MV3. Bugs here look like "it says it worked but nothing happened".

Hard rules

Never add a dependency. Both package.json files have empty dependencies and that is the single most important property of this project. npm install failing is the most common reason a local MCP server does not work, and it fails silently from the user's point of view. The WebSocket (src/ws.js) and the MCP protocol (src/mcp.js) are hand-written for exactly this reason. If you need a library, write the 200 lines instead.

stdout is protocol-only. In mcp-server/, anything written to stdout that is not a JSON-RPC frame corrupts the stream and the client drops the connection with no useful error. Human-readable output goes to stderr.

The service worker has no memory. MV3 kills it after ~30s idle and restarts it constantly. Anything durable lives in chrome.storage; anything else is rebuilt on demand. Every top-level statement in background/ must be safe to run many times.

Errors are written for a model to recover from. "ref e12 no longer exists — the page changed; take a fresh snapshot" beats "Error: null". Put the recovery action in the message. This is not politeness; it is the difference between an agent retrying correctly and an agent giving up.

Read the full file on GitHub · 892 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. yesterday Changed · +112 lines · +1,927 tokens per session 260b2d1cdc02
  2. 2d ago Changed · +36 lines · +556 tokens per session 38d426c8b443
  3. 6d ago First seen · 744 lines · 10,247 tokens per session scan A d00484153412

Subscribe to this mod's changes

openbrowser CLAUDE.md is an instructions file published in the GitHub repository dylansantwani/openbrowser (1 stars, last pushed 2d ago), licensed MIT. It adds 12,730 tokens to every session, about $0.0636 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens