Give Claude Code full browser control. Navigate pages, click buttons, fill forms, take screenshots, and read page content — all through a real Chromium browser.
- Launches a real Chromium browser controlled via Chrome DevTools Protocol (CDP)
- Claude can navigate, click, type, screenshot, and read any web page
- Persistent login profile — log in once, stay logged in across sessions
- Optional anti-detection mode (Patchright) for sites with bot protection
- Accessibility tree snapshots for token-efficient page understanding
- Python 3.8+
- macOS, Linux, or Windows
mkdir -p ~/.browser-tool
cp browser_tool.py ~/.browser-tool/browser_tool.pypython3 ~/.browser-tool/browser_tool.py installThis installs Playwright and downloads Chromium automatically.
Optional — anti-detection mode (for Cloudflare/DataDome protected sites):
python3 ~/.browser-tool/browser_tool.py install --with-patchrightCopy the skill file to your Claude Code commands directory:
mkdir -p ~/.claude/commands
cp browser.md ~/.claude/commands/browser.mdOpen Claude Code and type /browser to activate browser control. Or just ask Claude to "open a browser and go to example.com" — it will know what to do.
You (Claude Code) ──> browser_tool.py ──> CDP ──> Chromium
↑
Stays open as a
detached process
launchstarts Chromium with--remote-debugging-port=9222as a detached process- Every other command (navigate, click, screenshot...) connects via CDP, does its work, disconnects
- The browser stays open independently — no process blocking
- Login sessions persist in
~/.browser-tool/profile/
| Command | What it does |
|---|---|
launch |
Start Chromium (or --patchright for anti-detection) |
navigate <url> |
Go to a URL |
click <selector> |
Click an element |
type <selector> <text> |
Type into a field (--clear to replace) |
snapshot |
Get accessibility tree (best for AI reasoning) |
screenshot |
Save viewport screenshot |
html |
Get page HTML |
evaluate <js> |
Run JavaScript |
wait --selector <sel> |
Wait for element to appear |
pages |
List open tabs |
status |
Check if browser is running |
close |
Kill the browser |
- Use
snapshotoverscreenshotwhen Claude needs to understand page structure — it's faster and more token-efficient - Use
--patchrightwhen a site has Cloudflare, DataDome, or similar bot detection - Logins persist — once you log into a site, you stay logged in across Claude Code sessions
- Screenshots are saved to
/tmp/browser_screenshots/and auto-opened in Preview (macOS)