browser-bridge AGENTS.md

Project instructions for Browser Bridge, a Chrome extension and local service that let an agent inspect and modify web pages through the browser.

In plain words
What is it for?
Use them when developing or debugging browser inspection, page changes, message routing, or the extension’s method dispatch.
Why use it?
They show how requests travel between the agent, local service, extension, and page, making it easier to find the right code to change.

Instructions file for CodexOpenCode

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 instructions/koltyakov/browser-bridge/agents-md
Clone the repo
git clone --depth 1 https://github.com/koltyakov/browser-bridge

Made for: Codex, OpenCode.

Per session 2,959 This file is loaded in full into every session.
When invoked 2,959 The same file — it is already loaded in full.
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.02959 $0.02959
Opus 5 $0.01479 $0.01479
Sonnet 5 $0.00592 $0.00592
Haiku 4.5 $0.00296 $0.00296

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

Security

Grade A, and why

browser-bridge AGENTS.md 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 2d 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.

AGENTS.md · 198 lines

How it starts

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

Project Guide

Overview

Browser Bridge is a Chrome extension plus local Native Messaging bridge for token-efficient, scoped browser inspection and patching.

Data Flow

Agent/IDE ──stdio──▶ MCP Server ──▶ BridgeClient ── JSON-lines over TCP/socket ──▶ Daemon
bbx CLI ─────────────────────────▶ BridgeClient ── JSON-lines over TCP/socket ────┘

Extension Background ── Chrome Native Messaging ──▶ Native Host (relay) ── TCP/socket ──▶ Daemon
(Service Worker) ───── chrome.tabs.sendMessage ───▶ Content Script ───────▶ Browser DOM
                 ├──── chrome.debugger (CDP)
                 └──── chrome.scripting (MAIN world) ─────────────────────▶ Element/patch registries

Outbound: Agent calls MCP tool → BridgeClient sends { type: 'agent.request', request } as JSON-lines over TCP/socket → Daemon routes to extension socket → Native host relays to Chrome native messaging → Background service worker dispatches to content script or handles directly.

Inbound: Content script returns result → Background wraps into createSuccess/createFailure → Native host relays to daemon → Daemon matches pending request → { type: 'agent.response', response } back to agent socket.

Two transport segments:

  • Agent ↔ Daemon: TCP (127.0.0.1:9223) or Unix domain socket, newline-delimited JSON.
  • Extension ↔ Daemon: Chrome Native Messaging (4-byte LE length-prefixed binary) over stdio, relayed by the native-host subprocess.

Package Map

Package Entry Responsibility
packages/protocol/ src/index.js Shared types, error codes, method registry, defaults, budget presets. All other packages import from here.
packages/native-host/ src/daemon.js BridgeDaemon - TCP/socket server, request routing, pending request tracking with timeouts. src/native-host.js relays between Chrome native messaging and daemon socket.
packages/agent-client/ src/client.js BridgeClient - connects to daemon, sends requests, tracks responses. src/cli.js is the bbx CLI.
packages/mcp-server/ src/server.js MCP stdio server (tool schemas). src/handlers-*.js map tool calls to bridge requests.
packages/extension/ src/background.js MV3 service worker - native port, request dispatch, state management. src/content-script.js handles all DOM operations.

Read the full file on GitHub · 198 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. 2d ago First seen · 198 lines · 2,959 tokens per session scan A 1e122ff97a28

Subscribe to this mod's changes

browser-bridge AGENTS.md is an instructions file published in the GitHub repository koltyakov/browser-bridge (21 stars, last pushed 21d ago), licensed MIT. It adds 2,959 tokens to every session, about $0.0148 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.