Playwright CLI

Microsoft’s browser automation CLI that Claude Code uses to control a real browser — navigating pages, clicking elements, filling forms, taking screenshots, and running headless or headed sessions — without loading an MCP server into context.

Key facts

  • Type: Browser automation tool
  • Maker: Microsoft (open-source)
  • Status: Active
  • Language: JavaScript/TypeScript test scripts
  • Token advantage: Zero tool-definition tokens loaded at session start (vs Chrome DevTools MCP, which loads its full catalogue)

What it does

Playwright CLI is installed as a project dependency. Claude Code writes and iterates JavaScript scripts that control a browser instance. Each automation task gets its own script file (e.g., qa-test.js, school-likes.js) that improves across runs as Claude learns which selectors work for a given UI.

Key patterns demonstrated by Nate Herk [011]:

  • QA testing loop — Claude builds a multi-page web app, writes a Playwright test script, reads bug output, patches code, re-runs — iterating until all tests pass without human input.
  • Scraping with fallback — Claude attempted Google scraping, got blocked, autonomously switched to DuckDuckGo mid-run.
  • Authenticated community bot — logs in once via Chrome user-data profile, then all subsequent runs inherit the active session. Posts daily news roundups, likes content, replies to comments, votes on polls — fully autonomously via Claude Code scheduled tasks.
  • Related

    Source references

    • [011] Nate Herk — Claude Code power features cluster (2026-04-20 to 2026-04-27)