playwright CLAUDE.md

Project instructions for contributing to Playwright, a framework for testing and automating Chromium, Firefox, and WebKit browsers. They describe its monorepo structure, where many related packages are kept in one repository, and its main directories.

In plain words
What is it for?
Use them when developing Playwright APIs, browser packages, test tools, reports, documentation, or other parts of the repository.
Why use it?
They reduce the time needed to find the right package, source folder, test suite, or documentation when changing Playwright.

Instructions file

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/microsoft/playwright/claude-md
Clone the repo
git clone --depth 1 https://github.com/microsoft/playwright
Per session 1,902 This file is loaded in full into every session.
When invoked 1,902 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.01902 $0.01902
Opus 5 $0.00951 $0.00951
Sonnet 5 $0.00380 $0.00380
Haiku 4.5 $0.00190 $0.00190

Measured yesterday against content hash 99809538a469, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

playwright CLAUDE.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 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.

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.

CLAUDE.md · 165 lines

How it starts

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

Monorepo Packages

Package npm name Purpose
playwright-core playwright-core Browser automation engine: client, server, dispatchers, protocol
playwright playwright Test runner + browser automation (public package)
playwright-test @playwright/test Test runner entry point
playwright-client @playwright/client Standalone client package
protocol (internal) RPC protocol definitions (protocol.yml → generated channels.d.ts)

Browser Packages

playwright-chromium, playwright-firefox, playwright-webkit — per-browser distributions. playwright-browser-chromium, playwright-browser-firefox, playwright-browser-webkit — binary packages.

Tooling Packages

Package Purpose
html-reporter HTML test report viewer
trace-viewer Trace viewer UI
recorder Test recorder
web Shared web UI components
injected Scripts injected into browser pages

Key Directories

Directory Purpose
tests/ All test suites (page, library, playwright-test, mcp, etc.)
docs/src/ API documentation — source of truth for public TypeScript types
docs/src/api/ Per-class API reference (class-page.md, class-locator.md, etc.)
utils/ Build scripts, code generation, linting, doc tools
browser_patches/ Browser engine patches

Build

npm run build       # Full build
npm run watch       # Watch mode (recommended during development)

Assume watch is running and code is up to date. Generated files (types, channels, validators) are produced by watch automatically.

Lint and type check

npm run flint

Runs all lint checks in parallel: eslint, tsc, doclint, check-deps, generate_channels, generate_types, lint-tests, test-types, lint-packages, code-snippet linting.

Always run flint before committing. Do not use tsc --noEmit or individual lint commands separately.

Read the full file on GitHub · 165 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 First seen · 165 lines · 1,902 tokens per session scan A 99809538a469

Subscribe to this mod's changes

playwright CLAUDE.md is an instructions file published in the GitHub repository microsoft/playwright (95,378 stars, last pushed 3d ago), licensed Apache-2.0. It adds 1,902 tokens to every session, about $0.0095 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 instructions, from other repositories