Skip to main content
skill CX Codex

agent-browser · nanocoai — Claude Code skill: browser automation for AI agents

A skill for Claude Code, Codex, Cursor, Copilot, Gemini CLI and OpenCode. It hands your agent a real browser: open pages, read articles, fill forms, grab screenshots, pull data, test web UIs.

MIT ★ 31,137 updated 2026-10-29

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add nanocoai/nanoclaw --skill agent-browser -a claude-code
Open on GitHub

What agent-browser does

agent-browser runs in Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. It is a CLI wrapper over a browser that the agent calls through Bash — agent-browser open, snapshot, click, fill and the rest.

The core idea is accessibility-tree snapshots. agent-browser snapshot -i returns interactive elements with refs like @e1 and @e2, and you click, type or upload through those refs. Semantic locators work too: agent-browser find role button click --name "Submit".

Built-in wait subcommands cover element, text, URL pattern and network idle conditions. Custom eval polling needs both a timeout and a max-attempts counter — an unbounded loop will hang the agent turn if the selector never appears. Screenshots and PDFs go to the path you give; session state persists via state save and state load.

What it helps with

  • open a page and read its content
  • fill a form on a website
  • save a screenshot or export a page as PDF
  • extract data from HTML using snapshot refs
  • keep login state between sessions

Example prompts for the agent

  • Open https://example.com/form, take a snapshot, fill the Email and Password fields and click Submit
  • Find the button labeled "Sign In" through a semantic locator and click it
  • Save the session state to auth.json after login and open the dashboard

How to install agent-browser

1Skills CLI (Vercel)

npx skills add nanocoai/nanoclaw --skill agent-browser -a claude-code

2Manually: put the files in place

~/.claude/skills/agent-browser/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/agent-browser/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about agent-browser

How do I install agent-browser in Claude Code?

Run npx skills add nanocoai/nanoclaw --skill agent-browser -a claude-code. The skill file lands at ~/.claude/skills/agent-browser/SKILL.md.

What does agent-browser do?

It gives your agent browser access from the command line: navigation, page snapshots, clicks, form filling, waits, screenshots, PDF export and cookie handling.

What is the difference between agent-browser fill and agent-browser type?

fill clears the field before typing, while type enters text without clearing. Pick based on whether the current value should stay.

Source text

SKILL.md · MIT
---
name: agent-browser
description: Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use whenever a browser would be useful, not just when the user explicitly asks.
allowed-tools: Bash(agent-browser:*)
---

# Browser Automation with agent-browser

## Quick start

```bash
agent-browser open <url>        # Navigate to page
agent-browser snapshot -i       # Get interactive elements with refs
agent-browser click @e1         # Click element by ref
agent-browser fill @e2 "text"   # Fill input by ref
agent-browser close             # Close browser
```

## Core workflow

1. Navigate: `agent-browser open <url>`
2. Snapshot: `agent-browser snapshot -i` (returns elements with refs like `@e1`, `@e2`)
3. Interact using refs from the snapshot
4. Re-snapshot after navigation or significant DOM changes

## Commands

### Navigation

```bash
agent-browser open <url>      # Navigate to URL
agent-browser back            # Go back
agent-browser forward         # Go forward
agent-browser reload          # Reload page
agent-browser close           # Close browser
```

### Snapshot (page analysis)

```bash
agent-browser snapshot            # Full accessibility tree
agent-browser snapshot -i         # Interactive elements only (recommended)
agent-browser snapshot -c         # Compact output
agent-browser snapshot -d 3       # Limit depth to 3
agent-browser snapshot -s "#main" # Scope to CSS selector
```

### Interactions (use @refs from snapshot)

```bash
agent-browser click @e1           # Click
agent-browser dblclick @e1        # Double-click
agent-browser fill @e2 "text"     # Clear and type
agent-browser type @e2 "text"     # Type without clearing
agent-browser press Enter         # Press key
agent-browser hover @e1           # Hover
agent-browser check @e1           # Check checkbox
agent-browser uncheck @e1         # Uncheck checkbox
agent-browser select @e1 "value"  # Select dropdown option
agent-browser scroll down 500     # Scroll page
agent-browser upload @e1 file.pdf # Upload files
```

### Get information

```bash
agent-browser get text @e1        # Get element text
agent-browser get html @e1        # Get innerHTML
agent-browser get value @e1       # Get input value
agent-browser get attr @e1 href   # Get attribute
agent-browser get title           # Get page title
agent-browser get url             # Get current URL
agent-browser get count ".item"   # Count matching elements
```

### Screenshots & PDF

```bash
agent-browser screenshot          # Save to temp directory
agent-browser screenshot path.png # Save to specific path
agent-browser screenshot --full   # Full page
agent-browser pdf output.pdf      # Save as PDF
```

### Wait

```bash
agent-browser wait @e1                     # Wait for element
agent-browser wait 2000                    # Wait milliseconds
agent-browser wait --text "Success"        # Wait for text
agent-browser wait --url "**/dashboard"    # Wait for URL pattern
agent-browser wait --load networkidle      # Wait for network idle
```

### Waiting for a custom condition — ALWAYS bound it

Prefer the built-in `wait` subcommands above. Only fall back to `eval`-polling
when you must wait on a custom JS condition (e.g. a spinner disappearing or a
"Send" button re-enabling in a chat UI).

**Never write an unbounded wait loop.** A bare `until … do sleep; done` that
polls a page condition will loop *forever* if the condition never becomes true
(page failed to load, selector changed, network stalled). That does not just
fail the command — it wedges the entire agent turn: the runner keeps the model
stream open, later messages get silently swallowed, and the container can hang
for hours without the host's stuck-detection firing.

Always cap the wait with BOTH a wall-clock `timeout` and a max-attempts counter,
and always exit the loop (never leave a `sleep` loop as the last thing running):

```bash
# Bounded wait: succeeds when the condition is met, gives up after ~90s.
timeout 90 bash -c '
  for i in $(seq 1 30); do
    if agent-browser eval "document.querySelector(\".loading\") === null" 2>/dev/null | grep -q true; then
      echo READY; exit 0
    fi
    sleep 3
  done
  echo TIMEOUT; exit 1
'
# Check the exit status / output: on TIMEOUT, snapshot the page and decide —
# do NOT re-enter another unbounded wait.
```

If the wait times out, treat it as a real failure: take a `snapshot -i` or
`screenshot` to see the actual page state, report what you found, and move on.
Retrying the same unbounded wait is what causes the hang.

### Semantic locators (alternative to refs)

```bash
agent-browser find role button click --name "Submit"
agent-browser find text "Sign In" click
agent-browser find label "Email" fill "[email protected]"
agent-browser find placeholder "Search" type "query"
```

### Authentication with saved state

```bash
# Login once
agent-browser open https://app.example.com/login
agent-browser snapshot -i
agent-browser fill @e1 "username"
agent-browser fill @e2 "password"
agent-browser click @e3
agent-browser wait --url "**/dashboard"
agent-browser state save auth.json

# Later: load saved state
agent-browser state load auth.json
agent-browser open https://app.example.com/dashboard
```

### Cookies & Storage

```bash
agent-browser cookies                     # Get all cookies
agent-browser cookies set name value      # Set cookie
agent-browser cookies clear               # Clear cookies
agent-browser storage local               # Get localStorage
agent-browser storage local set k v       # Set value
```

### JavaScript

```bash
agent-browser eval "document.title"   # Run JavaScript
```

## Example: Form submission

```bash
agent-browser open https://example.com/form
agent-browser snapshot -i
# Output shows: textbox "Email" [ref=e1], textbox "Password" [ref=e2], button "Submit" [ref=e3]

agent-browser fill @e1 "[email protected]"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -i  # Check result
```

## Example: Data extraction

```bash
agent-browser open https://example.com/products
agent-browser snapshot -i
agent-browser get text @e1  # Get product title
agent-browser get attr @e2 href  # Get link URL
agent-browser screenshot products.png
```

© nanocoai · MIT · nanocoai/nanoclaw

Similar skills

All skills for Browser and scraping →

agent-browser by other authors comes first.

agent-browser vercel-labs This Claude Code skill automates browser interaction for tasks like navigating sites, filling forms, and testing web apps. It also supports exploratory QA and Electron app automation. CX Codex +1 1,600,000installs agent-browser actionbook This skill lets an agent operate a browser through commands for navigation, form entry, and page checks. Use it for browser tasks inside a coding workflow. CX Codex +1 136installs agent-browser eyadsibai This skill gives an AI agent CLI control over a browser for form entry, page scraping, screenshots, and PDF output. Use it for browser automation tasks. CX Codex +1 166installs agent-browser fcakyon This skill guides an agent through website tasks with agent-browser, from locating page controls to filling forms and capturing screenshots. Use it to gather web data or test a web app. CX Codex +1 ★ 1,216repo stars browser-navigation Factory-AI browser-navigation automates browser tasks: page navigation, form filling, screenshots, data extraction, and session recording. CX Codex +1 120installs browser-use browser-use The browser-use MCP server for Claude Code lets an agent find information on web pages, extract data, and fill forms. CX Codex +1 ★ 121,687repo stars mini-browser runablehq The mini-browser skill hands your agent a browser through the mb CLI: open pages, grab screenshots, pull text, fill forms, record screencasts. CX Codex +1 2,400installs kernel-cli kernel A skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode that teaches agents the Kernel CLI command surface for cloud browsers, proxies, profiles, and app deployment. CX Codex +1 511installs browser-setup Devin-AXIS browser-setup — a command to test browser automation in iPolloWork right away. Opens the built-in browser, checks if it's available, and displays the page title. CX Codex +1 ★ 7,523repo stars playwright-cli microsoft playwright-cli is a Claude Code skill for browser automation, web page checks, and Playwright tests. It lets the agent navigate pages and interact with their controls. CX Codex +1 221,700installs

From the same set4

Project sponsors

Companies that keep this analytics open