ckorhonen/claude-skills/agent-browser
Claude Code and agent skill by ckorhonen/claude-skills
- community
Checking that the SKILL.md file is still in the repository.
Automate headless browser interactions using agent-browser CLI. Use when scraping web pages, automating form submissions, testing web apps, or performing browser automation tasks. Works with element refs (@e1, @e2) optimized for AI agent reasoning.
Install
npx vskill@latest install ckorhonen/claude-skills/agent-browserSKILL.md
agent-browser CLI
A headless browser automation CLI designed for AI agents, with fast Rust-based execution and element refs optimized for LLM reasoning.
Overview
agent-browser provides programmatic browser control through a CLI that's purpose-built for AI agent workflows. It uses deterministic element references (@e1, @e2, etc.) from accessibility trees, making it ideal for LLM-based automation where consistent element targeting is critical.
Key Features:
- Fast Rust-based CLI with Node.js fallback
- Element refs (
@e1,@e2) for stable LLM reasoning - Session isolation for parallel browser instances
- JSON output for programmatic parsing
- Accessibility tree snapshots for element discovery
- CDP connection support for existing browser instances
When to Use
- Automating web interactions (form filling, clicking, navigation)
- Scraping web content with accessibility tree parsing
- Testing web applications programmatically
- Multi-agent scenarios requiring isolated browser sessions
- Screenshot capture and PDF generation
- Monitoring web page state changes
Prerequisites
- Node.js >= 18 or Bun runtime
- Chromium (installed via
agent-browser install)
Installation
Verify installation:
Quick Start
Core Workflow
1. Open Page and Snapshot
The snapshot returns elements like:
2. Interact Using Refs
3. Verify State
Command Reference
Navigation
| Command | Description | |
|---|---|---|
open <url> | Navigate to URL | |
back | Go back in history | |
forward | Go forward in history | |
reload | Reload current page | |
close | Close browser |
Interactions
| Command | Description | ||
|---|---|---|---|
click <ref> | Click element | ||
dblclick <ref> | Double-click element | ||
type <ref> <text> | Type text into element | ||
fill <ref> <text> | Clear and fill element | ||
press <key> | Press keyboard key (Enter, Tab, Control+a) | ||
hover <ref> | Hover over element | ||
focus <ref> | Focus element | ||
check <ref> | Check checkbox | ||
uncheck <ref> | Uncheck checkbox | ||
select <ref> <val> | Select dropdown option | ||
scroll <dir> [px] | Scroll (up/down/left/right) | ||
| `wait <ref\ | ms>` | Wait for element or milliseconds |
Information
| Command | Description | |
|---|---|---|
snapshot | Get accessibility tree with refs | |
snapshot -i | Interactive elements only | |
snapshot -c | Compact (remove empty elements) | |
snapshot -d <n> | Limit tree depth | |
get text <ref> | Get element text content | |
get html <ref> | Get element HTML | |
get value <ref> | Get input value | |
get url | Get current page URL | |
get title | Get page title | |
screenshot [path] | Take screenshot | |
screenshot --full | Full page screenshot | |
pdf <path> | Save page as PDF |
State Checks
| Command | Description | |
|---|---|---|
is visible <ref> | Check if element is visible | |
is enabled <ref> | Check if element is enabled | |
is checked <ref> | Check if checkbox is checked |
Find Elements
Session Management
Sessions provide isolated browser instances for parallel execution:
JSON Output
Use --json for machine-readable output:
Common Pitfalls
This section covers frequent failure modes and how to debug them. Each pitfall includes the symptom you'll see, the underlying cause, and the fix.
Browser not found
Symptom: Error: Browser executable not found at default path or agent-browser: command not found
Cause: Chromium isn't installed, or agent-browser CLI isn't on PATH
Fix:
Element ref becomes stale after page change
Symptom: Error: Element @e2 not found even though you just used it, or clicks fail silently
Cause: Element refs change when the DOM updates (navigation, page reload, dynamic content). Refs are only valid for the current DOM snapshot.
Fix:
Prevention: In scripts, capture fresh refs after each navigation or dynamic load.
Session conflicts and port binding
Symptom: Error: Session "default" already in use or Port 9222 already in use
Cause: Browser session is still running from a previous command or crashed script, preventing a new session from starting
Fix:
Clicks and interactions don't work on hidden elements
Symptom: agent-browser click @e5 succeeds but nothing happens, or element is invisible in screenshot
Cause: Element is outside viewport, hidden by CSS (display: none, visibility: hidden), or covered by another element. Accessibility tree may show it, but browser can't interact with it.
Fix:
Prevention: Always take screenshots before and after critical interactions to verify visual state.
Timeout waiting for navigation or element
Symptom: Error: Timeout waiting for element or script hangs indefinitely after clicking a link
Cause:
- Element doesn't exist or appears after longer than expected delay
- Navigation is stuck (network error, page not loading)
- Element selector is wrong
Fix:
Prevention: Add explicit wait commands after form submissions or link clicks that cause navigation.
Snapshot is empty or missing expected elements
Symptom: agent-browser snapshot -i --json returns [] or very few elements, but you see them visually in screenshot
Cause:
- Page content is rendered by JavaScript (React, Vue, etc.) that hasn't completed
- Elements lack accessible labels or roles
-iflag filters too aggressively
Fix:
Prevention: Add wait delays after opening pages with heavy JavaScript rendering.
Form fill doesn't work or text is partial
Symptom: Text appears to be cut off, only first few characters typed, or field stays empty
Cause:
- Field wasn't focused before typing (race condition)
- Field has input validation or character limit
- JavaScript event handlers expect specific typing speed or blur event
Fix:
Prevention: After any form fill, immediately verify the value was entered correctly with get value.
Network requests fail or external API timeouts
Symptom: Page loads but data doesn't populate, or integration tests fail when hitting real APIs
Cause:
- External API is slow or unreachable
- CORS errors (browser blocks requests to different domain)
- Missing authentication headers
- Network is isolated (testing environment)
Fix:
Prevention: For testing, use network route to mock external APIs. For production, verify connectivity before running automation.
Browser crashes or becomes unresponsive
Symptom: agent-browser command hangs or process crashes with segmentation fault; Chrome window closes unexpectedly
Cause:
- Out of memory (too many long-running sessions or screenshots)
- Invalid CDP connection
- Rare Chromium/Playwright crash
- Insufficient system resources
Fix:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/agent-browser/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ckorhonen/claude-skills/agent-browser)