browser-tools
This skill enables agent control of a Chrome browser via DevTools Protocol for automated web interaction, testing, and content extraction.
Community author
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- MIT (permissive)
- Pin
- 90bb51cpinned Oct 9, 2026
- Context cost
- about 1,200 tokenswhen the skill loads
- GitHub stars
- 2,593on badlogic/pi-skills
- Scripts
- 8 scripts
What it does
“Interactive browser automation via Chrome DevTools Protocol. Use when you need to interact with web pages, test frontends, or when user interaction with a visible browser is required.”
Generated summary from the skill's own text
This skill enables agent control of a Chrome browser via DevTools Protocol for automated web interaction, testing, and content extraction. The agent can navigate pages, execute JavaScript, capture screenshots, extract markdown content, manage cookies, and let users interactively select page elements using a picker tool.
When to use it
- Testing frontend code in a real browser environment
- Interacting with JavaScript-heavy pages that require full rendering
- Debugging authentication or session state issues
- Scraping dynamic content or extracting readable article text
When not to
- Static HTML pages where simple HTTP requests suffice
- Tasks not requiring visual inspection or user interaction
- When headless extraction APIs are more efficient than full browser automation
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add badlogic/pi-skills --skill browser-toolsInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install badlogic/pi-skills browser-tools@90bb51cae36515a648515b633a81c0c6efc8c74dInstalls the commit we checked (90bb51c).
Copy by hand
Download the folder at 90bb51c and put it in .claude/skills/browser-tools for Claude Code and in .agents/skills/browser-tools for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "browser-tools" by badlogic. Source, pinned to commit 90bb51cae36515a648515b633a81c0c6efc8c74d: https://github.com/badlogic/pi-skills/tree/90bb51cae36515a648515b633a81c0c6efc8c74d/browser-tools 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/browser-tools/ for Claude Code and .agents/skills/browser-tools/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/badlogic/browser-tools
SKILL.md at the pin
---
name: browser-tools
description: Interactive browser automation via Chrome DevTools Protocol. Use when you need to interact with web pages, test frontends, or when user interaction with a visible browser is required.
---
# Browser Tools
Chrome DevTools Protocol tools for agent-assisted web automation. These tools connect to Chrome running on `:9222` with remote debugging enabled.
## Setup
Run once before first use:
```bash
cd {baseDir}/browser-tools
npm install
```
## Start Chrome
```bash
{baseDir}/browser-start.js # Fresh profile
{baseDir}/browser-start.js --profile # Copy user's profile (cookies, logins)
```
Launch Chrome with remote debugging on `:9222`. Use `--profile` to preserve user's authentication state.
## Navigate
```bash
{baseDir}/browser-nav.js https://example.com
{baseDir}/browser-nav.js https://example.com --new
```
Navigate to URLs. Use `--new` flag to open in a new tab instead of reusing current tab.
## Evaluate JavaScript
```bash
{baseDir}/browser-eval.js 'document.title'
{baseDir}/browser-eval.js 'document.querySelectorAll("a").length'
```
Execute JavaScript in the active tab. Code runs in async context. Use this to extract data, inspect page state, or perform DOM operations programmatically.
## Screenshot
```bash
{baseDir}/browser-screenshot.js
```
Capture current viewport and return temporary file path. Use this to visually inspect page state or verify UI changes.
## Pick Elements
```bash
{baseDir}/browser-pick.js "Click the submit button"
```
**IMPORTANT**: Use this tool when the user wants to select specific DOM elements on the page. This launches an interactive picker that lets the user click elements to select them. The user can select multiple elements (Cmd/Ctrl+Click) and press Enter when done. The tool returns CSS selectors for the selected elements.
Common use cases:
- User says "I want to click that button" → Use this tool to let them select it
- User says "extract data from these items" → Use this tool to let them select the elements
- When you need specific selectors but the page structure is complex or ambiguous
## Cookies
```bash
{baseDir}/browser-cookies.js
```
Display all cookies for the current tab including domain, path, httpOnly, and secure flags. Use this to debug authentication issues or inspect session state.
## Extract Page Content
```bash
{baseDir}/browser-content.js https://example.com
```
Navigate to a URL and extract readable content as markdown. Uses Mozilla Readability for article extraction and Turndown for HTML-to-markdown conversion. Works on pages with JavaScript content (waits for page to load).
## When to Use
- Testing frontend code in a real browser
- Interacting with pages that require JavaScript
- When user needs to visually see or interact with a page
- Debugging authentication or session issues
- Scraping dynamic content that requires JS execution
---
## Efficiency Guide
### DOM Inspection Over Screenshots
**Don't** take screenshots to see page state. **Do** parse the DOM directly:
```javascript
// Get page structure
document.body.innerHTML.slice(0, 5000)
// Find interactive elements
Array.from(document.querySelectorAll('button, input, [role="button"]')).map(e => ({
id: e.id,
text: e.textContent.trim(),
class: e.className
}))
```
### Complex Scripts in Single Calls
Wrap everything in an IIFE to run multi-statement code:
```javascript
(function() {
// Multiple operations
const data = document.querySelector('#target').textContent;
const buttons = document.querySelectorAll('button');
// Interactions
buttons[0].click();
// Return results
return JSON.stringify({ data, buttonCount: buttons.length });
})()
```
### Batch Interactions
**Don't** make separate calls for each click. **Do** batch them:
```javascript
(function() {
const actions = ["btn1", "btn2", "btn3"];
actions.forEach(id => document.getElementById(id).click());
return "Done";
})()
```
### Typing/Input Sequences
```javascript
(function() {
const text = "HELLO";
for (const char of text) {
document.getElementById("key-" + char).click();
}
document.getElementById("submit").click();
return "Submitted: " + text;
})()
```
### Reading App/Game State
Extract structured state in one call:
```javascript
(function() {
const state = {
score: document.querySelector('.score')?.textContent,
status: document.querySelector('.status')?.className,
items: Array.from(document.querySelectorAll('.item')).map(el => ({
text: el.textContent,
active: el.classList.contains('active')
}))
};
return JSON.stringify(state, null, 2);
})()
```
### Waiting for Updates
If DOM updates after actions, add a small delay with bash:
```bash
sleep 0.5 && {baseDir}/browser-eval.js '...'
```
### Investigate Before Interacting
Always start by understanding the page structure:
```javascript
(function() {
return {
title: document.title,
forms: document.forms.length,
buttons: document.querySelectorAll('button').length,
inputs: document.querySelectorAll('input').length,
mainContent: document.body.innerHTML.slice(0, 3000)
};
})()
```
Then target specific elements based on what you find.
From badlogic/pi-skills at 90bb51c, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at 90bb51cFiles
- SKILL.md5.2 KB · abb6f33fc505
- .gitignore134 B · 43bbc08d8480
- browser-content.js3.2 KB · 97b1d6a7ed27
- browser-cookies.js861 B · c1828d427ae5
- browser-eval.js1.4 KB · 3c1ddd6ab172
- browser-hn-scraper.js3.1 KB · 27b4aefebeba
- browser-nav.js1.3 KB · 7d6bd34f94b0
- browser-pick.js5.0 KB · 9a05689c1c45
- browser-screenshot.js838 B · c070ebbb8f86
- browser-start.js2.3 KB · 8529f9a762b4
- package-lock.json85 KB · 24e6b9120bc3
- package.json487 B · 70e10b3ed27a
12 files, 109 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 90bb51cRelated in Frontend and design
next-bundle-optimizer
Audits Next.js applications to identify and reduce browser bundle size and initial-load work by analyzing routes, dependencies and client outputs.
by VercelOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago
next-cache-components-optimizer
Optimize Next.js routes to display meaningful UI instantly on initial load or client navigation by encoding the optimization goal as a failing…
by VercelOfficial publisher
Claude Code, Codex, Cursor +4 · about 5.6K tokens · pinned 6 days ago
next-partial-prefetching-adoption
Enables Partial Prefetching in Next.js 16.3+ apps and guides adoption through auditing Link prefetch behavior, preserving UI in tests or manually, and…
by VercelOfficial publisher
Claude Code, Codex, Cursor +4 · about 6.7K tokens · pinned 6 days ago
remotion-interactivity
This skill teaches how to structure Remotion code so the Studio IDE recognizes and makes it interactive.
by RemotionOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.4K tokens · pinned 6 days ago
remotion-interactivity
This skill teaches how to structure Remotion video components to unlock Studio interactivity features like click selection, drag-and-drop, resizing, rotation…
by RemotionOfficial publisher
Claude Code, Codex, Cursor +3 · about 4.8K tokens · pinned 6 days ago
remotion-maps
This skill enables creating map-based animations with Remotion using four different mapping libraries: Mapbox, MapLibre, MapTiler, or CesiumJS.
by RemotionOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 240 tokens · pinned 6 days ago