/cc-arsenal:agent-browserfrom cc-arsenal
Headless browser automation CLI optimized for AI agents. Uses accessibility-tree snapshots with @e1-style refs for ~93% less context than raw DOM tools. Click, fill forms, log in, extract data, take screenshots, scrape sites, or test web apps.
Ships in cc-arsenal. 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.
Read when SKILL.md points to them.
agent-browser is an open-source browser automation CLI from Vercel Labs, built for LLM interaction with a snapshot + refs system: instead of a full DOM, snapshot returns an accessibility tree of just the interactive elements (buttons, inputs, links) with semantic labels, each tagged with a stable @e1-style ref. Full DOM dumps run 5000+ nodes / 200KB of context; an accessibility-tree snapshot is 50-100 elements / ~10KB, roughly a 93% reduction. Refs also survive re-renders, so they don't need re-deriving after every DOM tweak the way CSS selectors do.
See When to Use vs Playwright for when this CLI beats DOM-based tools.
# macOS (preferred — managed by Homebrew)
brew install agent-browser
# Linux / fallback
npm install -g agent-browser
# Install browser binaries after either method
agent-browser install
# Linux: also install system dependencies
agent-browser install --with-deps
# Verify health
agent-browser doctor
# 1. Navigate to a page
agent-browser open https://example.com
# 2. Get snapshot with refs
agent-browser snapshot -i
# Output shows:
# textbox "Email" [ref=e1]
# textbox "Password" [ref=e2]
# button "Submit" [ref=e3]
# 3. Interact using refs
agent-browser fill @e1 "[email protected]"
agent-browser fill @e2 "password123"
agent-browser click @e3
# 4. Wait and verify
agent-browser wait --load networkidle
agent-browser snapshot -i
Refs are invalidated whenever the page changes (navigation, dropdown opening,
DOM re-render). Re-run snapshot -i after any action that could change the
page before reusing a ref: an ref from before the action may now point at a
different element or nothing at all.
Always pass --session: one named session per project prevents stale
daemons from accumulating across parallel agent sessions.
# Use project name as session (run this pattern everywhere)
agent-browser --session "$(basename "$PWD")" open https://app.com
# Authenticated flows: add persistent profile (gitignored)
agent-browser --session "$(basename "$PWD")" --profile .claude/browser-profile open https://app.com/login
# Stateless scraping/extraction: use Lightpanda instead (10x less memory)
agent-browser --session "$(basename "$PWD")" --engine lightpanda open https://public-site.com
# List all active sessions
agent-browser session list
# Diagnose + clean stale sockets (run when things feel wrong)
agent-browser doctor --fix
# Close this project's session only (never use --all with parallel projects)
agent-browser close --session "$(basename "$PWD")"
| Task | Engine | Why |
|---|---|---|
| Testing your own app, screenshots, React/SPA | chrome (default) | Full rendering, CDP, JS |
| Authenticated flows needing saved login | chrome + --profile | Persistent storage state |
| Bulk scraping / data extraction from public pages | lightpanda | 10x less memory, 10x faster |
Paginated crawls, get text at scale | lightpanda | Ephemeral, no cache buildup |
| Extensions, headed mode, file access | chrome (required) | Lightpanda can't do these |
Rule: if it only reads public pages and needs no login or screenshot → Lightpanda. Otherwise Chrome.
agent-browser --session "$(basename "$PWD")" open <url> # navigate
agent-browser snapshot -i # get @refs
agent-browser click @e1 # click
agent-browser fill @e2 "text" # fill a field
agent-browser wait --load networkidle # wait for load
agent-browser get text @e3 # read element
agent-browser read <url> --outline # page as text, no browser
agent-browser is visible @e1 # verify state
agent-browser screenshot page.png # capture
agent-browser close --session "$(basename "$PWD")" # cleanup
Full command surface (navigation, all interactions, find semantic
locators, waits, screenshots/video, tabs, network, cookies, auth, MCP server,
global flags) lives in references/commands.md.
readTo get a page's content as agent-readable text, use read before reaching for a
browser session. It launches nothing when given a URL.
agent-browser read https://docs.example.com/guide # markdown if the site serves it, else extracted text
agent-browser read https://docs.example.com/guide --outline # heading outline only, cheapest way to scan a page
agent-browser read https://docs.example.com --llms index # nearest llms.txt links
agent-browser read https://docs.example.com --llms full --filter auth # llms-full.txt, only matching sections
agent-browser read # no URL: the rendered DOM of the active tab
An explicit URL is fetched with Accept: text/markdown, then retried with .md
appended, then the ancestor paths are searched for a matching llms.txt, and
last it falls back to text extracted from the HTML. Useful flags: --filter <text>
(keep matching sections), --require-md (fail unless the response is real
markdown), --raw (body unextracted), --max-output <chars>, --json. With no
URL, read needs an open page (open <url> and wait --load networkidle
first), which makes it the way to extract a JS-rendered page after it settles.
--llms and --require-md need an HTTP resource, so without a URL they use the
active tab's URL.
Browser automation's core failure mode is confidently reporting page state nobody actually read. Before writing any claim into your final report:
get text / get value (or a snapshot that
covers it) and quote the exact string returned. Never restate a value from
the test plan or a product label as if it were observed on the page.snapshot -i hides non-interactive content. Totals, prices, and
confirmation banners often live in a <span>/<div>, not a button or
input: -i won't surface them. Use plain snapshot or
get text <selector> to reach them.get url or a snapshot heading) immediately before calling screenshot,
and name the file after what you just confirmed, not what you set out to
capture.agent-browser --session myapp open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "[email protected]"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser get url # confirm redirected off /login
agent-browser close --session myapp
agent-browser --session catalog --engine lightpanda open https://shop.example.com/catalog
agent-browser get count ".product-card"
agent-browser snapshot -i -s ".product-card"
agent-browser close --session catalog
agent-browser --session checkout open http://localhost:3000/cart
agent-browser snapshot -i
agent-browser click @e4 # Add to cart
agent-browser get text .cart-total # read the total — e.g. "$9.99" — don't assume it changed
agent-browser click @e9 # Checkout
agent-browser wait --url "**/confirmation"
agent-browser get text @e2 # read the confirmation heading
agent-browser close --session checkout
Report only the strings those two get text calls actually returned, not
a number copied from the test plan.
python3 -m http.server 3111 --directory ./dist & # note the PID
echo "started static server on :3111, pid $!"
agent-browser --session localtest open http://localhost:3111
agent-browser snapshot -i
agent-browser get url # confirm you're on the expected page first
agent-browser screenshot cart-page.png # name matches what get url just confirmed
agent-browser close --session localtest
kill %1 # stop the server you started, before declaring done
echo "stopped server on :3111"
| Need | Use | Why |
|---|---|---|
| AI agent driving a browser, CLI-first, minimal tokens | agent-browser | ~93% less context via accessibility-tree snapshots, zero config, @e1 refs survive DOM changes |
| Multiple isolated sessions in parallel | agent-browser | Built-in --session isolation |
| Full JS API, service workers, device emulation, CDP internals | Playwright (direct) | agent-browser doesn't expose the full programmatic API |
| Reusing an existing Playwright test suite | Playwright (direct) | Don't rewrite working tests to switch tools |
| Interacting with the user's already-open, logged-in Chrome tab | claude-in-chrome | agent-browser drives its own separate browser instance, not the user's live session |
Detailed reference material lives in bundled files, loaded on-demand, and is
regenerated from the CLI's own agent-browser skills get core --full so it
stays in sync with the installed version. Load each only when the task
needs it:
| File | Load for |
|---|---|
| references/commands.md | a command signature, flag, or alias not covered by the cheat sheet above (navigation, interaction, find, wait, screenshot/video, settings, tabs, frames, network/console, MCP server, global flags) |
| references/advanced.md | session-state persistence, authentication (login flows, OAuth, 2FA, cookie import), trust-boundary safety rules, proxy configuration, or Chrome DevTools profiling |
| references/workflows.md | the snapshot + ref model in depth, or video-recording patterns |
If these ever drift from the installed CLI, regenerate with
agent-browser skills get core --full and re-split (see git history of this
file for the split points).
npx opensrc vercel-labs/agent-browser (needs Node.js: fnm install --lts or brew install node; fetches the actual source for reference: there is no vendored copy in this skill)AGENT_BROWSER_IDLE_TIMEOUT_MS # Auto-close daemon after N ms idle (set 300000 in dotfiles)
AGENT_BROWSER_SESSION # Default session name (set per-project in your agent config file)
AGENT_BROWSER_ENGINE # Default engine: chrome | lightpanda
AGENT_BROWSER_EXECUTABLE_PATH # Custom browser binary path
AGENT_BROWSER_EXTENSIONS # Comma-separated extension paths
AGENT_BROWSER_PROVIDER # Cloud provider (browseruse, browserbase, browserless)
AGENT_BROWSER_ENCRYPTION_KEY # AES-256-GCM key for session state files (64-char hex)
AGENT_BROWSER_STREAM_PORT # WebSocket port for streaming
AGENT_BROWSER_HOME # Installation directory
--session <project-name>: prevents stale-socket accumulation across parallel sessions (can cause daemon OOM)agent-browser close --all or kill the browser process globally: breaks other projects' parallel sessions.claude/browser-profile/) must be in .gitignore: they contain plaintext cookies and login tokens--profile for stateless work: persistent profiles accumulate browser cache; idle-timeout only reclaims RAM, not disk cacheagent-browser doctor --fix when sessions feel stuck: cleans stale sockets without killing active sessionsagent-browser close only tears down the browser session, not an app server; kill it explicitly and say so (see Verify Before You Claim)agent-browser skills get core --fullWhat SKILL.md sets; muted values are Claude Code's defaults
agent-browser close --session "$(basename "$(pwd)" 2>/dev/null)" 2>/dev/null || agent-browser close 2>/dev/null || true10s52 skills in this plugin
/anything-to-skillTurns a docs site, local folder, PDF or book, YouTube video, playlist or channel, or a topic into a source-grounded, token-efficient agent skill (hub SKILL.md, sectioned references, INDEX, evals), and can compact it into a lean expert skill. Use for "make a skill from these docs", "turn this channel into a skill". Not for a skill from your own description (use create-skill), improving one (use improve-skill) or finding third-party skills (use find-skills)./ci-generateGenerate a production-ready CI/CD pipeline config (GitHub Actions, GitLab CI, CircleCI, or Jenkins) by discovering the project's actual stack, test/build commands, and dependencies. Use when setting up CI for a new project, adding a missing workflow file, or asked to create/generate a pipeline, workflow, or `.gitlab-ci.yml`/`Jenkinsfile`. Not for writing a Dockerfile itself (see docker-init), this only wires CI stages around one. Not for running existing CI checks locally (use ci-local), this skill only authors the pipeline file itself./ci-localRun the checks a GitHub Actions workflow would run, locally, when Actions is unavailable or out of quota. Parses .github/workflows/*.yml, extracts the jobs/steps that gate merges (lint, typecheck, test, build), translates them to local commands respecting the workflow's pinned node/python versions and env, executes them sequentially, and reports a parity table of what passed locally vs. what can't be replicated (service containers, secrets, matrix dimensions) and why. Activates on "CI quota", "Actions is down/unavailable", "run CI locally", "verify like CI would", "run the pipeline on my machine", or a pre-push request to check a branch the way CI checks it. Not for generating a new workflow file (use ci-generate), not for debugging why a specific CI run failed on GitHub (use fix-bug or review-code), and not for the release/hotfix gating process itself (use gitflow), this skill only produces the local stand-in when the real thing isn't reachable./clotho-researchFind what a change will actually touch before planning it — the existing code that must change, the prior art worth copying, and the risks that will bite. Trigger on "what would this change touch", "research this before we plan it", or an automated pre-planning step. Reports files, sources, and risks; it never proposes an implementation and never edits anything. Not for auditing dependencies (use review-deps), not for writing the plan itself (use project-planner), and not for reviewing code that already exists (use review-code)./codex-imagegenGenerates images and polished raster art (logos, mascots, hero images, icons, characters, sprite sheets, illustrations, product mockups) by driving Codex CLI's $imagegen skill. This is the default image generator, use it for any request to generate or create an image or visual asset, including "generate an image", "create a hero image", "make a mascot", "design a logo", "draw an icon", "generate a sprite sheet", or "make an illustration". Requires the `codex` CLI installed and authenticated (ChatGPT auth). Not for architecture, flow, or sequence diagrams (use docs-diagram)./create-ruleCreate a new memory/instruction rule for whatever AI coding tool a project actually uses, a CLAUDE.md entry or .claude/rules/*.md file for Claude Code, an AGENTS.md entry for Codex/Cursor/Copilot/Gemini-CLI-style tools, or a .cursor/rules/*.mdc file for Cursor. Use when the user runs /create-rule or asks to add a project rule, user/personal rule, coding standard, style guide entry, or workflow instruction to memory, AGENTS.md, or CLAUDE.md. Not for creating skills or slash commands (use create-skill). Not for discovering or installing existing third-party skills (use find-skills).npx claudepluginhub mgiovani/ai-arsenal --plugin cc-arsenal