Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Supports remote Browserbase sessions with automatic CAPTCHA solving, anti-bot stealth mode, and residential proxies — ideal for scraping protected websites, bypassing bot detection, and interacting with JavaScript-heavy pages.
41:T1fa6,
Automate browser interactions using the browse CLI with Claude.
Before running any browser commands, verify the CLI is available:
which browse || npm install -g @browserbasehq/browse-cli
The CLI supports explicit per-session environment overrides. If you do nothing, the next session defaults to Browserbase when BROWSERBASE_API_KEY is set and to local otherwise.
browse env local starts a clean isolated local browserbrowse env local --auto-connect reuses an already-running debuggable Chrome and falls back to isolated if nothing is availablebrowse env local <port|url> attaches to a specific CDP targetbrowse env remote switches the current session to BrowserbaseBROWSERBASE_API_KEY is setbrowse env localbrowse env local --auto-connectAll commands work identically in both modes. The daemon auto-starts on first command.
browse open <url> # Go to URL (aliases: goto)
browse open <url> --context-id <id> # Load Browserbase context (remote only)
browse open <url> --context-id <id> --persist # Load context + save changes back
browse reload # Reload current page
browse back # Go back in history
browse forward # Go forward in history
browse snapshot # Get accessibility tree with element refs (fast, structured)
browse screenshot [path] # Take visual screenshot (slow, uses vision tokens)
browse get url # Get current URL
browse get title # Get page title
browse get text <selector> # Get text content (use "body" for all text)
browse get html <selector> # Get HTML content of element
browse get value <selector> # Get form field value
Use browse snapshot as your default for understanding page state — it returns the accessibility tree with element refs you can use to interact. Only use browse screenshot when you need visual context (layout, images, debugging).
browse click <ref> # Click element by ref from snapshot (e.g., @0-5)
browse type <text> # Type text into focused element
browse fill <selector> <value> # Fill input and press Enter
browse select <selector> <values...> # Select dropdown option(s)
browse press <key> # Press key (Enter, Tab, Escape, Cmd+A, etc.)
browse drag <fromX> <fromY> <toX> <toY> # Drag from one point to another
browse scroll <x> <y> <deltaX> <deltaY> # Scroll at coordinates
browse highlight <selector> # Highlight element on page
browse is visible <selector> # Check if element is visible
browse is checked <selector> # Check if element is checked
browse wait <type> [arg] # Wait for: load, selector, timeout
browse stop # Stop the browser daemon (also clears env override)
browse status # Check daemon status (includes env)
browse env # Show current environment (local or remote)
browse env local # Use clean isolated local browser
browse env local --auto-connect # Reuse existing Chrome, fallback to isolated
browse env local <port|url> # Attach to a specific CDP target
browse env remote # Switch to Browserbase (requires API keys)
browse pages # List all open tabs
browse tab_switch <index> # Switch to tab by index
browse tab_close [index] # Close tab
If the environment matters, set it first with browse env local, browse env local --auto-connect, or browse env remote.
browse open <url> — navigate to the pagebrowse snapshot — read the accessibility tree to understand page structure and get element refsbrowse click <ref> / browse type <text> / browse fill <selector> <value> — interact using refs from snapshotbrowse snapshot — confirm the action workedbrowse stop — close the browser when donebrowse open https://example.com
browse snapshot # see page structure + element refs
browse click @0-5 # click element with ref 0-5
browse get title
browse stop
| Feature | Local | Browserbase |
|---|---|---|
| Speed | Faster | Slightly slower |
| Setup | Chrome required | API key required |
| Reuse existing local cookies | With browse env local --auto-connect | N/A |
| Stealth mode | No | Yes (custom Chromium, anti-bot fingerprinting) |
| CAPTCHA solving | No | Yes (automatic reCAPTCHA/hCaptcha) |
| Residential proxies | No | Yes (201 countries, geo-targeting) |
| Session persistence | No | Yes (cookies/auth persist via contexts) |
| Best for | Development/simple pages | Protected sites, bot detection, production scraping |
browse env local for clean state, browse env local --auto-connect for existing local credentials, and browse env remote for protected sitesbrowse open first before interactingbrowse snapshot to check page state — it's fast and gives you element refsbrowse click @0-5browse stop when done to clean up the browser session and clear the env overridebrowse stop, then check browse status. If it still says running, kill the zombie daemon with pkill -f "browse.*daemon", then retry browse openbrowse env local --auto-connect if you already have a debuggable Chrome running, or switch to browse env remotebrowse snapshot to see available elements and their refsSwitch to remote when you detect: CAPTCHAs (reCAPTCHA, hCaptcha, Turnstile), bot detection pages ("Checking your browser..."), HTTP 403/429, empty pages on sites that should have content, or the user asks for it.
Don't switch for simple sites (docs, wikis, public APIs, localhost).
browse env local # clean isolated local browser
browse env local --auto-connect # reuse existing Chrome state
browse env remote # switch to Browserbase
Overrides are scoped per session and stay in effect until you switch again or run browse stop. After browse stop, the next start falls back to env-var-based auto detection. Use browse status to inspect the resolved local strategy while the daemon is running.
For detailed examples, see EXAMPLES.md. For API reference, see REFERENCE.md.