Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Complete browser automation with agent-browser CLI. Supports navigation, forms, screenshots, data extraction, and parallel sessions.
.claude/skills/leoyeai-claw-browser-automation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 235% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 266% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 193% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 350% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 218% | 0% |
Complete browser automation using agent-browser CLI with local Chrome/Chromium. Supports parallel sessions, state persistence, visual debugging, and complex workflows.
bashnpm install -g agent-browser
macOS:
bashexport AGENT_BROWSER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" # Add to ~/.zshrc for persistence echo 'export AGENT_BROWSER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"' >> ~/.zshrc
Linux:
bashexport AGENT_BROWSER_EXECUTABLE_PATH="/usr/bin/google-chrome" # Or for Chromium export AGENT_BROWSER_EXECUTABLE_PATH="/usr/bin/chromium-browser"
Windows:
powershell$env:AGENT_BROWSER_EXECUTABLE_PATH="C:\Program Files\Google\Chrome\Application\chrome.exe"
bashagent-browser --version agent-browser open https://example.com agent-browser snapshot -i
Every browser automation follows this 4-step pattern:
bash# 1. Navigate to URL agent-browser open https://example.com/form # 2. Get snapshot with interactive element refs agent-browser snapshot -i # Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Submit" # 3. Interact using refs agent-browser fill @e1 "user@example.com" agent-browser fill @e2 "password123" agent-browser click @e3 # 4. Wait and verify agent-browser wait --load networkidle agent-browser snapshot -i
bash# Open URL agent-browser open <url> # Navigate to URL agent-browser open <url> --session <name> # Open in named session agent-browser open <url> --headless # Headless mode # Navigation control agent-browser back # Go back agent-browser forward # Go forward agent-browser refresh # Refresh page agent-browser close # Close browser agent-browser close --session <name> # Close specific session
bash# Basic snapshot agent-browser snapshot # Full page snapshot agent-browser snapshot -i # Interactive elements only (recommended) agent-browser snapshot -i -C # Include cursor-interactive (onclick, cursor:pointer) agent-browser snapshot -s "#selector" # Scope to CSS selector agent-browser snapshot --json # Output as JSON agent-browser snapshot --depth 3 # Limit DOM depth
bash# Click actions agent-browser click @e1 # Click element agent-browser click @e1 --double # Double click agent-browser click @e1 --right # Right click agent-browser click @e1 --modifiers Ctrl # With modifier (Ctrl, Alt, Shift, Meta) # Text input agent-browser fill @e2 "text" # Clear then type agent-browser type @e2 "text" # Type without clearing agent-browser type @e2 "text" --slowly # Type slowly (for rate-limited inputs) # Selection agent-browser select @e3 "option" # Select dropdown option agent-browser select @e3 --index 2 # Select by index agent-browser check @e4 # Check checkbox agent-browser uncheck @e4 # Uncheck checkbox agent-browser radio @e5 # Select radio button # Keyboard agent-browser press Enter # Press key agent-browser press Tab # Tab key agent-browser press Escape # Escape key agent-browser press Ctrl+A # Select all agent-browser press Ctrl+C # Copy agent-browser press Ctrl+V # Paste # Mouse actions agent-browser hover @e1 # Hover over element agent-browser scroll down 500 # Scroll down 500px agent-browser scroll up 300 # Scroll up agent-browser scroll to @e1 # Scroll to element
bash# Wait for element agent-browser wait @e1 # Wait for element visible agent-browser wait @e1 --timeout 10000 # Custom timeout (ms) # Wait for page state agent-browser wait --load networkidle # Wait for network idle agent-browser wait --load domcontentloaded # Wait for DOMContentLoaded agent-browser wait --load load # Wait for full page load # Wait for URL agent-browser wait --url "**/dashboard" # Wait for URL pattern agent-browser wait --url "**/login" --gone # Wait for URL to disappear # Wait for text agent-browser wait --text "Welcome" # Wait for text visible agent-browser wait --text "Error" --gone # Wait for text to disappear # Time wait agent-browser wait 2000 # Wait 2 seconds
bashagent-browser get text @e1 # Get element text agent-browser get text @e1 --json # JSON output agent-browser get html @e1 # Get element HTML agent-browser get attribute @e1 href # Get attribute value agent-browser get url # Get current URL agent-browser get title # Get page title agent-browser get count ".product" # Count elements matching selector
bash# Screenshots agent-browser screenshot # Screenshot to temp dir agent-browser screenshot --full # Full page screenshot agent-browser screenshot --output ./img.png # Save to specific path agent-browser screenshot --element @e1 # Screenshot specific element # PDF agent-browser pdf output.pdf # Save page as PDF agent-browser pdf output.pdf --landscape # Landscape orientation # Video (requires extension) agent-browser record start # Start recording agent-browser record stop # Stop recording
bash# List sessions agent-browser session list # Save/Load state agent-browser state save auth.json # Save session state agent-browser state load auth.json # Load saved state agent-browser state clear # Clear all saved states # Parallel sessions agent-browser --session site1 open https://site-a.com agent-browser --session site2 open https://site-b.com agent-browser --session site1 click @e1 agent-browser --session site2 click @e2
bash#!/bin/bash # submit-form.sh set -e # Navigate to form agent-browser open https://example.com/signup # Wait for form and get snapshot agent-browser wait @e1 --timeout 10000 agent-browser snapshot -i # Fill form fields agent-browser fill @e1 "John Doe" # Name agent-browser fill @e2 "john@example.com" # Email agent-browser fill @e3 "SecurePass123!" # Password agent-browser fill @e4 "SecurePass123!" # Confirm password # Accept terms agent-browser check @e5 # Submit agent-browser click @e6 # Wait for success agent-browser wait --text "Welcome" --timeout 15000 # Verify and capture agent-browser screenshot --output ./success.png echo "Form submitted successfully!"
bash#!/bin/bash # auth-flow.sh STATE_FILE="auth-state.json" # Check if we have saved state if [ -f "$STATE_FILE" ]; then echo "Loading saved authentication state..." agent-browser state load "$STATE_FILE" agent-browser open https://app.example.com/dashboard # Verify still logged in if agent-browser wait --text "Dashboard" --timeout 5000 2>/dev/null; then echo "✓ Authenticated with saved state" exit 0 else echo "Session expired, re-authenticating..." fi fi # Fresh login echo "Performing fresh login..." 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 # Wait for dashboard agent-browser wait --url "**/dashboard" --timeout 15000 # Save state for future use agent-browser state save "$STATE_FILE" echo "✓ Login successful, state saved"
bash#!/bin/bash # extract-data.sh agent-browser open https://example.com/products agent-browser wait --load networkidle agent-browser snapshot -i # Extract all product data OUTPUT_FILE="products.json" echo "[" > "$OUTPUT_FILE" # Get product count COUNT=$(agent-browser get count ".product-item") echo "Found $COUNT products" # Extract each product for i in $(seq 0 $((COUNT-1))); do REF=".product-item:nth-child($((i+1)))" NAME=$(agent-browser get text "$REF .product-name" --json) PRICE=$(agent-browser get text "$REF .product-price" --json) STOCK=$(agent-browser get text "$REF .product-stock" --json) # Add comma for all but last item if [ $i -lt $((COUNT-1)) ]; then echo " {\"name\": $NAME, \"price\": $PRICE, \"stock\": $Stock}," >> "$OUTPUT_FILE" else echo " {\"name\": $NAME, \"price\": $PRICE, \"stock\": $Stock}" >> "$OUTPUT_FILE" fi done echo "]" >> "$OUTPUT_FILE" echo "Data extracted to $OUTPUT_FILE"
bash#!/bin/bash # paginate.sh PAGE=1 MAX_PAGES=10 while [ $PAGE -le $MAX_PAGES ]; do echo "Processing page $PAGE..." # Navigate to page agent-browser open "https://example.com/items?page=$PAGE" agent-browser wait --load networkidle # Extract data from this page agent-browser snapshot -i # ... extraction logic ... # Check for next page button if agent-browser wait @next-page --timeout 3000 2>/dev/null; then agent-browser click @next-page PAGE=$((PAGE + 1)) else echo "No more pages" break fi done
bash#!/bin/bash # visual-test.sh BASELINE_DIR="./baseline" CURRENT_DIR="./current" DIFF_DIR="./diff" mkdir -p "$BASELINE_DIR" "$CURRENT_DIR" "$DIFF_DIR" # Capture current state agent-browser open https://example.com agent-browser wait --load networkidle agent-browser screenshot --full --output "$CURRENT_DIR/homepage.png" # Compare with baseline (requires imagemagick) if [ -f "$BASELINE_DIR/homepage.png" ]; then compare -metric AE "$BASELINE_DIR/homepage.png" "$CURRENT_DIR/homepage.png" "$DIFF_DIR/homepage-diff.png" 2>&1 || true echo "Visual diff saved to $DIFF_DIR/homepage-diff.png" else echo "No baseline found. Creating baseline..." cp "$CURRENT_DIR/homepage.png" "$BASELINE_DIR/homepage.png" fi
bash#!/bin/bash # api-test.sh agent-browser open https://api.example.com/docs agent-browser snapshot -i # Execute JavaScript in browser context RESPONSE=$(agent-browser eval ' fetch("/api/v1/users", { headers: { "Authorization": "Bearer TOKEN" } }).then(r => r.json()).then(d => JSON.stringify(d)) ') echo "API Response: $RESPONSE"
bash# Solution: Set Chrome path explicitly export AGENT_BROWSER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" # Or use flag agent-browser --executable-path /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome open https://example.com
bash# Solution 1: Wait for element agent-browser wait @e1 --timeout 10000 # Solution 2: Re-snapshot after page load agent-browser wait --load networkidle agent-browser snapshot -i # Solution 3: Check selector scope agent-browser snapshot -s "#form-container"
bash# Solution: Increase timeout agent-browser open https://slow-site.com --timeout 60000 # Or wait for specific event agent-browser wait --load domcontentloaded
bash# Solution: Close existing session agent-browser close --session <name> # Or use different session name agent-browser --session <new-name> open <url>
bash# Enable verbose logging agent-browser open https://example.com --verbose # Take screenshot at any point agent-browser screenshot --output ./debug-$(date +%s).png # Get current URL to verify navigation agent-browser get url # Check console logs agent-browser console # Evaluate JavaScript to inspect state agent-browser eval 'document.querySelectorAll(".product").length'
bash# ❌ BAD - May fail if element not ready agent-browser click @e1 # ✅ GOOD - Wait first agent-browser wait @e1 --timeout 10000 agent-browser click @e1
bash# ❌ BAD - Too generic agent-browser snapshot -s "div" # ✅ GOOD - Specific and stable agent-browser snapshot -s "#login-form button[type='submit']"
bash# Wait for network to settle agent-browser wait --load networkidle # Or wait for specific content agent-browser wait --text "Loading complete"
bash# Login once, reuse many times agent-browser state save auth.json # Load in subsequent runs agent-browser state load auth.json
bash# Run multiple independent sessions agent-browser --session user1 open https://app.com agent-browser --session user2 open https://app.com # Each session maintains its own state
bash# Add delays between actions agent-browser type @e1 "text" --slowly agent-browser wait 1000 # 1 second delay
bash# Execute arbitrary JavaScript agent-browser eval 'document.title' agent-browser eval 'window.innerWidth' agent-browser eval 'document.querySelectorAll(".item").length' # Complex operations agent-browser eval ' Array.from(document.querySelectorAll(".product")).map(p => ({ name: p.querySelector(".name").textContent, price: p.querySelector(".price").textContent })) '
bash# Upload file to file input agent-browser upload @file-input ./document.pdf # Or with absolute path agent-browser upload @file-input /absolute/path/to/file.txt
bash# Accept alert/confirm agent-browser dialog accept # Dismiss agent-browser dialog dismiss # Handle prompt with text agent-browser dialog accept --text "Default value"
bash# Get cookies agent-browser cookie get # Set cookie agent-browser cookie set name=value --domain example.com # Clear cookies agent-browser cookie clear
bashagent-browser open https://example.com --headless
bashagent-browser snapshot --depth 2 # Faster on complex pages
bash# Keep session alive for multiple operations agent-browser --session main open https://example.com agent-browser --session main click @e1 agent-browser --session main click @e2 agent-browser --session main close
bash# Run multiple sessions in parallel agent-browser --session s1 open https://site1.com & agent-browser --session s2 open https://site2.com & wait
bash# ❌ BAD agent-browser fill @password "MySecret123" # ✅ GOOD - Use environment variables agent-browser fill @password "$PASSWORD"
bash# After handling sensitive data agent-browser state clear agent-browser cookie clear
bash# Always use HTTPS URLs agent-browser open https://example.com # ✅ agent-browser open http://example.com # ❌
npm install -g agent-browserRun this quick test to verify everything works:
bash#!/bin/bash # test-setup.sh echo "Testing agent-browser setup..." # Test 1: Version check echo "1. Checking version..." agent-browser --version # Test 2: Open page echo "2. Opening test page..." agent-browser open https://example.com # Test 3: Get title echo "3. Getting page title..." TITLE=$(agent-browser get title) echo "Title: $TITLE" # Test 4: Screenshot echo "4. Taking screenshot..." agent-browser screenshot --output ./test-screenshot.png # Test 5: Snapshot echo "5. Getting snapshot..." agent-browser snapshot -i | head -5 echo "✓ All tests passed!"
MIT License - See LICENSE file for details.
For issues and feature requests, visit the agent-browser repository.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→pass | 3,469 | 4,010 | +16% | 1 | 1 | 0% | 712 | 5,329 | +648% | 0 | 0 | — |
case-01 | fail→pass | 12,590 | 10,788 | -14% | 1 | 1 | 0% | 1,877 | 6,285 | +235% | 0 | 0 | — |
case-02 | fail→pass | 9,626 | 9,276 | -4% | 1 | 1 | 0% | 1,661 | 6,078 | +266% | 0 | 0 | — |
case-03 | fail→pass | 11,752 | 9,760 | -17% | 1 | 1 | 0% | 2,100 | 6,156 | +193% | 0 | 0 | — |
case-05 | pass→pass | 5,175 | 5,609 | +8% | 1 | 1 | 0% | 1,045 | 5,404 | +417% | 0 | 0 | — |
case-06 | pass→pass | 5,092 | 4,860 | -5% | 1 | 1 | 0% | 953 | 5,348 | +461% | 0 | 0 | — |
case-07 | fail→pass | 5,616 | 2,769 | -51% | 1 | 1 | 0% | 1,085 | 4,886 | +350% | 0 | 0 | — |
case-08 | fail→pass | 9,794 | 2,612 | -73% | 1 | 1 | 0% | 1,543 | 4,906 | +218% | 0 | 0 | — |
case-09 | fail→pass | 7,090 | 2,950 | -58% | 1 | 1 | 0% | 1,191 | 5,006 | +320% | 0 | 0 | — |
case-10 | pass→pass | 8,640 | 2,078 | -76% | 1 | 1 | 0% | 1,547 | 4,767 | +208% | 0 | 0 | — |
case-11 | fail→pass | 2,978 | 1,643 | -45% | 1 | 1 | 0% | 501 | 4,738 | +846% | 0 | 0 | — |
case-12 | fail→pass | 10,537 | 4,101 | -61% | 1 | 1 | 0% | 1,772 | 5,179 | +192% | 0 | 0 | — |
case-13 | fail→pass | 4,734 | 2,244 | -53% | 1 | 1 | 0% | 861 | 4,875 | +466% | 0 | 0 | — |
case-14 | fail→pass | 4,001 | 1,933 | -52% | 1 | 1 | 0% | 665 | 4,765 | +617% | 0 | 0 | — |
case-15 | fail→pass | 9,195 | 3,765 | -59% | 1 | 1 | 0% | 1,564 | 4,975 | +218% | 0 | 0 | — |
case-16 | fail→pass | 5,524 | 2,530 | -54% | 1 | 1 | 0% | 932 | 4,929 | +429% | 0 | 0 | — |
case-17 | fail→pass | 5,314 | 2,756 | -48% | 1 | 1 | 0% | 987 | 4,810 | +387% | 0 | 0 | — |
case-18 | fail→pass | 7,245 | 2,340 | -68% | 1 | 1 | 0% | 1,360 | 4,863 | +258% | 0 | 0 | — |
case-19 | fail→pass | 5,403 | 2,502 | -54% | 1 | 1 | 0% | 973 | 4,917 | +405% | 0 | 0 | — |
case-20 | fail→pass | 4,714 | 2,171 | -54% | 1 | 1 | 0% | 772 | 4,822 | +525% | 0 | 0 | — |
case-21 | pass→pass | 5,399 | 2,919 | -46% | 1 | 1 | 0% | 921 | 5,005 | +443% | 0 | 0 | — |
case-22 | pass→pass | 7,079 | 2,967 | -58% | 1 | 1 | 0% | 1,116 | 4,817 | +332% | 0 | 0 | — |
case-23 | pass→pass | 3,941 | 2,786 | -29% | 1 | 1 | 0% | 693 | 4,709 | +580% | 0 | 0 | — |
case-24 | fail→pass | 5,706 | 3,220 | -44% | 1 | 1 | 0% | 905 | 4,776 | +428% | 0 | 0 | — |
case-25 | fail→pass | 5,367 | 3,234 | -40% | 1 | 1 | 0% | 814 | 4,666 | +473% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +72 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.