/browser-automation:browser-automationfrom browser-automation
Drive a web browser to open pages, click, fill forms, sign in, take screenshots, scrape data, check a local dev server or test a web app. Uses the browser your coding agent already has (Claude in Chrome in Claude Code, the Chrome or in-app Browser plugin in Codex), then a connected browser MCP server such as Playwright or Chrome DevTools, before falling back to agent-browser or Playwright. Use for "open this site", "browse to", "fill out the form", "click", "take a screenshot", "check localhost", "scrape", "log in to", or any other browser task.
Ships in browser-automation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Look at the tools this session actually exposes, then take the first that fits:
mcp__claude-in-chrome__*) drives the person's own Chrome.@chrome) drives the person's own Chrome through the ChatGPT
Chrome extension; the Browser plugin (@browser) drives Codex's in-app browser, which
suits local dev servers and pages that need no login.agent-browser CLI, if command -v agent-browser finds it.npx playwright). Ask before installing browsers.The agent's own browser comes first because it is the one the person can see and take over, and in Chrome it already carries their logins, cookies and extensions. Nothing behind SSO needs signing in again.
Go past step 1 only for a job it can't do well, and say in one line which tool you picked and why:
| Job | Use |
|---|---|
| A clean, repeatable or headless run that must not depend on one person's logged-in state (CI checks, scraping) | agent-browser or Playwright |
| Recording a video clip | the browser-recorder skill |
Canvas or requestAnimationFrame content that reads as blank | Playwright (see section 3) |
| Performance traces and Core Web Vitals | Chrome DevTools MCP |
The browser may carry the person's real logins, so what you do in it happens as them.
A screenshot shows how something looks; only measurement shows it is correct. Read sizes, computed styles and animation state from the page, and sample in a loop when checking that something stays stable over time.
agent-browser get box '.demo' # getBoundingClientRect
agent-browser get styles '.demo' # getComputedStyle
agent-browser eval --stdin # any JS, including document.getAnimations()
In the agent's own browser, do the same with its JavaScript or page-reading tool.
Canvas and requestAnimationFrame content can read as blank or static in agent-browser
even when it animates correctly. If you have reason to doubt a blank canvas, switch to
Playwright, or attach Playwright to the same session with agent-browser get cdp-url. Navigate
first: a fresh Playwright tab is about:blank, and evaluating against it returns zeros that look
exactly like the bug.
tabs_context_mcp first, every time, to get valid tab IDs.tabs_create_mcp, or reuse one only when the person asks.navigate, then read_page or find, then act with computer or form_input, always
passing the tab ID.Never reuse tab IDs from an earlier session. Avoid clicking anything that opens a JavaScript alert or confirm dialog; it blocks the extension until the person dismisses it.
Mention @chrome for work in the person's own Chrome and @browser for the in-app browser.
After a code change on a local dev server without hot reload, reload the tab before taking a
fresh snapshot or screenshot.
Snapshot, act on refs, re-snapshot after anything that changes the page:
agent-browser open --headed https://example.com/login
agent-browser snapshot -i # interactive elements, as refs like @e1
agent-browser fill @e1 "[email protected]"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -i # refs from before the navigation are dead
# Navigation and capture
agent-browser open --headed <url>
agent-browser screenshot [--full] [path.png]
agent-browser close
# Interaction (refs come from the latest snapshot)
agent-browser click @e1
agent-browser fill @e2 "text" # type @e2 "text" types key by key
agent-browser select @e1 "option"
agent-browser check @e1
agent-browser press Enter
agent-browser scroll down 500
# When refs are unreliable, locate by meaning
agent-browser find text "Sign in" click
agent-browser find label "Email" fill "[email protected]"
agent-browser find role button click --name "Submit"
# Reading and waiting
agent-browser get text @e1 # also: get url, get title
agent-browser wait @e1 # also: wait --load networkidle, wait --url "**/done", wait 2000
agent-browser console # and: agent-browser errors
# Sessions and saved state
agent-browser --session site-a open https://a.example.com
agent-browser state save auth.json && agent-browser state load auth.json
The browser daemon persists between calls, so independent commands can be chained with &&.
Run them separately when you need to read output first.
Through its MCP server: call browser_navigate before anything else, then browser_snapshot
for state and refs, and re-snapshot after navigation. Directly: write a short script and run it
with node, using page.goto before any evaluation.
list_pages, then select_page or new_page; navigate_page; then
performance_start_trace, reproduce the interaction, performance_stop_trace, and read the
insights rather than guessing from a screenshot. Never reuse page IDs from an earlier session.
In order:
Saved state from an earlier run (agent-browser state load <domain>.json).
Ask the person to sign in in a headed browser, then save the state for next time. This is the only route for SSO, two-factor prompts and CAPTCHAs.
A password manager CLI, only after the person says yes to it for this site (that yes
covers auth login submitting the sign-in form), and only into a CLI-driven browser
(agent-browser or a Playwright script), so the secret goes from the manager to the form
without passing through you. Never pass a secret to a browser tool such as
Claude in Chrome's form_input: the value would land in the conversation. With 1Password,
check op whoami, then pipe the password straight into agent-browser auth, so it never
appears on a command line, in a shell variable or in the conversation:
op read "op://${OP_VAULT}/app.example.com/password" | agent-browser auth save app \
--url https://app.example.com/login \
--username "$(op read "op://${OP_VAULT}/app.example.com/username")" --password-stdin
agent-browser auth login app # waits for the form, fills it and submits
agent-browser auth delete app # the saved profile holds the password; remove it
For a login form auth login can't find, pass --username-selector, --password-selector
and --submit-selector to auth save.
Ask which vault to use if OP_VAULT is not set. If op is missing or finds no item, say
which hostname you looked for and ask the person how they want to proceed.
Fill credentials only into the site they belong to. Never echo, log or write a secret to a file, and save the session state afterwards so the next run needs no password at all. Saved state holds live session cookies: keep it outside any repository, or in a git-ignored folder, and tell the person where it is.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub stackonehq/powerful-plugins --plugin browser-automation