playwriter: Instructions file for Codex

AGENTS.md

playwriter AGENTS.md is an instructions file for Codex, OpenCode from remorses/playwriter. It costs 5,786 tokens per session, scanned A, original, MIT.

A set of project instructions for developing and maintaining the Playwriter browser extension and its connected tools. The extension controls Chrome through a local WebSocket connection, a way for programs to exchange messages in real time.

In plain words
What is it for?
Use it when changing the Playwriter extension, its message protocol, local MCP server, WebSocket relay, or command-line tools.
Why use it?
It keeps changes compatible with older extension versions and explains how the extension, local server, and browser-automation client fit together.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is remorses/playwriter's own configuration. It tells Codex and OpenCode how to work on playwriter 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 playwriter configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is rm -f playwriter-*.zip && cd extension/dist-release && zip -r ../../playwriter-$(node -p "require('../manifest.json').version").zip . && cd ../...

About the project

Playwriter is a Chrome extension and command-line tool that lets coding agents control an already-running browser through Playwright, preserving its tabs, logins, cookies, and extensions. It is for browser automation from a CLI or MCP server, and the catalogue entries provide instructions and skills for agents using it.

remorses/playwriter · 4,061 stars · on GitHub · playwriter.dev

Reuse

Borrowing it

Nothing to install: this file belongs to remorses/playwriter. 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/remorses/playwriter/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/remorses/playwriter

Made for: Codex, OpenCode.

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 playwriter AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/remorses/playwriter/agents-md/github.svg)](https://agentmods.dev/instructions/remorses/playwriter/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/remorses/playwriter/agents-md"><img src="https://agentmods.dev/badge/instructions/remorses/playwriter/agents-md/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 playwriter AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/remorses/playwriter/agents-md"><img src="https://agentmods.dev/badge/instructions/remorses/playwriter/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,786 This file is loaded in full into every session.
When invoked 5,786 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.05786 $0.05786
Opus 5.5 $0.02314 $0.02314
Sonnet 5.5 $0.01157 $0.01157
Haiku 4.5 $0.00579 $0.00579

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

Security

Grade A, and why

playwriter AGENTS.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 17d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sL https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/master/pdl/domains/Target.pdl # manage “targets”: pages, iframes, workers, etc., and attach/detach sessions
AGENTS.md · 516 lines

How it starts

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

this is the playwriter codebase

the extension uses chrome.debugger to manage the user browser

read ./README.md for an overview of how this extension and mcp work read playwriter/src/skill.md to understand the MCP docs (source of truth)

keep playwriter/src/skill.md token-efficient. Keep tab-group instructions brief, use the shortest clear single-word names with no spaces, and do not document playwriter session update there.

backward compatibility

breaking changes to the WS protocol MUST never be made. publishing the extension code will never be instant, which means the extension must keep working with newer versions of the MCP and WS relay server.

Chrome Web Store review can delay an extension release by days or weeks. Users can run a new CLI, MCP or relay with an old extension during this time. CLI, MCP and relay code MUST stay compatible with older extension versions:

  • never require a new extension message, command or field without a fallback
  • detect missing extension features at runtime, then fall back or show a clear "update the extension" error
  • ship the extension side of a feature first. Make the CLI depend on it only after the store has published that version

architecture

  • user installs the extension in chrome. we assume there is only one chrome window for now, the first opened.
  • extension connects to a websocket server on port 19988. if this server is not yet open, it retries connecting in a loop
  • the MCP spawns the ws server if not already listening on 19988, in background. the mcp then connects to this same server with a playwright client
  • the server exposes /cdp/client-id which is used by playwright clients to communicate with the extension
  • the extension instead connects to /extension which is used to receive cdp commands and send responses and cdp events.
  • some events are treated specially for example because
    • we need to send attachedToTarget to let playwright know which pages are available
    • we need to send detachedFromTarget when we disable the extension in a tab
    • a few more events need custom handling
  • tabs are identified by sessionId or targetId (CDP concepts) or tabId (chrome debugger concept only)

Read the full file on GitHub · 516 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. 17d ago Changed · -452 lines · -5,791 tokens per session 2f9ab7a06dee
  2. 1mo ago Changed · +16 lines · +263 tokens per session c3b2ab5974a7
  3. 1mo ago Changed · +6 lines · +77 tokens per session d86f41d2068f
  4. 2mo ago First seen · 946 lines · 11,237 tokens per session scan A 42183193e192

Subscribe to this mod's changes

playwriter AGENTS.md is an instructions file published in the GitHub repository remorses/playwriter (4,061 stars, last pushed 3d ago), licensed MIT. It adds 5,786 tokens to every session, about $0.0231 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

playwriter AGENTS.md compared with instructions from other repositories

playwriter AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
playwriter AGENTS.mdremorses/playwriterInstructions file4.1k3d agoMITA5,786Codex, OpenCode
qmax-mcp copilot-instructions.mdQuality-Max/qmax-mcpInstructions file44d agoMITA451GitHub Copilot
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot