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)

    Robin Cartier perspective

    This page is part of Robin Cartier's working AI knowledge graph: a practical research layer for production AI, recommendation systems, experimentation, GEO, and agentic web readiness.

    The useful next step is to connect this concept back to applied product leadership and operating models.

    Recommended next

    Keep reading from this thread

    From 491 indexed pages and articles.

    1. Wiki concept Browser Automation with Claude Code The pattern of connecting a browser automation CLI (Playwright) to Claude Code so it can control a real browser — navigating Related by playwright
    2. Wiki concept Self-Checking Todo Loops A Claude Code execution pattern where the agent maintains an explicit todo list, runs verification steps after each meaningful change, reads the result Related by playwright
    3. Insight AI Measurement and Experimentation How to measure AI product impact with evals, adoption metrics, online experiments, guardrails, and cost tracking Readers have engaged with this next