browser-fetch
Delegate browser automation to a lightweight subagent (Haiku) to reduce context consumption. Also provides web clipping (HTML→Markdown) via clipper.
Best use case
browser-fetch is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Delegate browser automation to a lightweight subagent (Haiku) to reduce context consumption. Also provides web clipping (HTML→Markdown) via clipper.
Teams using browser-fetch should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/browser-fetch/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How browser-fetch Compares
| Feature / Agent | browser-fetch | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Delegate browser automation to a lightweight subagent (Haiku) to reduce context consumption. Also provides web clipping (HTML→Markdown) via clipper.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# browser-fetch
Delegate browser automation to a cost-effective subagent, preserving the main agent's context window.
## Why This Skill?
- **Problem**: `agent-browser snapshot` can consume 10,000+ tokens on complex pages
- **Solution**: Haiku subagent processes snapshots and returns only summaries (~100 tokens)
- **Result**: 90%+ context reduction while maintaining full browser capabilities
## Prerequisites
### Install agent-browser
```bash
npm install -g agent-browser
agent-browser install
```
### Install clipper
```bash
npm install -g @philschmid/clipper
```
Uses [Mozilla Readability](https://github.com/mozilla/readability) + [Turndown](https://github.com/mixmark-io/turndown) internally — same stack as Obsidian Web Clipper.
### Windows Workaround
On Windows (Git Bash), the daemon may not auto-start. Run manually:
```bash
node "$(npm root -g)/agent-browser/dist/daemon.js" &
sleep 3
```
## Basic Flow
```
Main Agent Haiku Subagent
│ │
│ Task: "Open URL, summarize" │
├──────────────────────────────────►│
│ │ 1. agent-browser open
│ │ 2. snapshot → save to file
│ │ 3. build summary
│ "Page summary + key refs" │
│◄──────────────────────────────────┤
│ │
│ Task: "Click @e5, summarize" │
├──────────────────────────────────►│
│ ...
```
## Snapshot Options
| Option | Use Case |
|--------|----------|
| `-i` | Interactive elements only (default) |
| `-i -c` | Compact output (recommended for complex pages) |
| `-i -d 2` | Limit depth (deeply nested pages) |
| `-i -s "main"` | Scope to CSS selector |
## Summary Format (Critical)
Subagent must return **structured summaries**, not raw element lists.
### Good Example
```
Product listing page (127 items displayed)
Structure:
- Filters: category (@e12), price range (@e18), search (@e24)
- Sort: date (@e30), popularity (@e31)
Sample items:
- "Product A" $29.99 (@e45)
- "Product B" $49.99 (@e52)
- "Product C" $19.99 (@e58)
Ready for instructions.
(debug: 001.txt)
```
### Bad Example
```
- @e1 Logo
- @e2 Login button
- @e3 Menu
- @e4 Search
- @e5 Footer
```
→ No context. Main agent cannot make informed decisions.
## Invocation Template
### Opening a Page
```
Task(
model: haiku,
subagent_type: general-purpose,
prompt: """
Use agent-browser to open {URL}.
Steps:
1. agent-browser open {URL}
2. agent-browser snapshot -i -c > scratchpad/browser-session/001.txt
3. Append to index.log: 001 | {time} | {URL} | {summary}
Return ONLY a structured summary:
- Page type and overview (e.g., "Login page", "Product list with 50 items")
- Key interactive elements with @refs
- Do NOT include raw snapshot data
Format:
{Page description}
Structure:
- {feature}: {description} (@ref)
Key elements:
- {element description} (@ref)
Ready for instructions.
(debug: 001.txt)
"""
)
```
### Performing Actions
```
Task(
model: haiku,
subagent_type: general-purpose,
prompt: """
Use agent-browser:
1. agent-browser fill @e1 "value"
2. agent-browser click @e3
3. agent-browser snapshot -i -c > scratchpad/browser-session/002.txt
4. Update index.log
Return structured summary only.
"""
)
```
### Complex Pages
If snapshot exceeds limits, use additional constraints:
```
agent-browser snapshot -i -c -d 2 > file.txt # Depth limit
agent-browser snapshot -i -c -s "#content" # Scope to selector
```
## Rules
### Main Agent
- Trust subagent summaries
- Do NOT read raw files (scratchpad/browser-session/*.txt) unless debugging
- Raw data is for troubleshooting only
### Subagent
- Always save snapshots to files (never return raw data)
- Append to index.log for history
- Use `--session` flag to maintain browser state
- Return concise, structured summaries
## File Structure
```
scratchpad/browser-session/
├── index.log # History (debug reference only)
├── 001.txt # Raw snapshot data
├── 002.txt
└── ...
```
### index.log Format
```
# browser-session index (debug only - do not read unless troubleshooting)
001 | 14:23:45 | https://example.com/login | Login form
002 | 14:24:12 | https://example.com/dashboard | Dashboard with 5 widgets
```
## Ending Session
```
Task(
model: haiku,
subagent_type: general-purpose,
prompt: "Run: agent-browser close"
)
```
---
## Web Clip (HTML → Markdown)
Convert web pages to clean Markdown using `clipper`. No subagent needed — runs directly.
### Basic Usage
```bash
clipper clip -u "https://example.com/article" -o scratchpad/browser-session/clip.md
```
This is the **preferred method**. Quality is equivalent to Obsidian Web Clipper (same Readability + Turndown stack).
### Output Formats
| Flag | Format |
|------|--------|
| `-f md` | Markdown (default) |
| `-f json` | JSON (title, content, url) |
### Batch Clipping
```bash
clipper crawl -u "https://docs.example.com" -g "https://docs.example.com/**/*" -o dataset.jsonl
```
### When to Use What
| Scenario | Tool |
|----------|------|
| Read an article → Markdown | `clipper clip -u` |
| Interact with a page (click, fill, navigate) | agent-browser + Haiku subagent |Related Skills
browser-testing
Use when testing web applications, debugging browser console errors, automating form interactions, or verifying UI implementations. Load for localhost testing, authenticated app testing (Gmail, Notion), or recording demo GIFs. Requires Chrome extension 1.0.36+, Claude Code 2.0.73+, paid plan.
Browser Automation Expert
浏览器自动化与网页测试专家。支持基于 MCP 工具(Puppeteer/Playwright)的实时交互,以及基于 Python 脚本的复杂自动化流实现。
agent-browser
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
browser-debugger
Systematically tests UI functionality, validates design fidelity with AI visual analysis, monitors console output, tracks network requests, and provides debugging reports using Chrome DevTools MCP. Use after implementing UI features, for design validation, when investigating console errors, for regression testing, or when user mentions testing, browser bugs, console errors, or UI verification.
native-data-fetching
Use when implementing or debugging ANY network request, API call, or data fetching. Covers fetch API, axios, React Query, SWR, error handling, caching strategies, offline support.
langsmith-fetch
Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Use when debugging agent behavior, investigating errors, analyzing tool calls, checking memory operations, or examining agent performance. Automatically fetches recent traces and analyzes execution patterns. Requires langsmith-fetch CLI installed.
economic-calendar-fetcher
Fetch upcoming economic events and data releases using FMP API. Retrieve scheduled central bank decisions, employment reports, inflation data, GDP releases, and other market-moving economic indicators for specified date ranges (default: next 7 days). Output chronological markdown reports with impact assessment.
data-fetching
Data fetching architecture guide using Service layer + Zustand Store + SWR. Use when implementing data fetching, creating services, working with store hooks, or migrating from useEffect. Triggers on data loading, API calls, service creation, or store data fetching tasks.
data-fetching-patterns
Explains data fetching strategies including fetch on render, fetch then render, render as you fetch, and server-side data fetching. Use when implementing data loading, optimizing loading performance, or choosing between client and server data fetching.
k8s-browser
Browser automation for Kubernetes dashboards and web UIs. Use when interacting with Kubernetes Dashboard, Grafana, ArgoCD UI, or other web interfaces. Requires MCP_BROWSER_ENABLED=true.
Browser
Code-first Playwright automation via TypeScript scripts. USE WHEN writing reusable automation scripts, VERIFY phase (confirming a web change actually works), headless programmatic testing, or need token-efficient browser automation in code. NOT for quick one-off CLI tasks (use AgentBrowser), NOT for authenticated sites with saved logins (use ChromeMCP+WebExplore), NOT for documenting a UI into a spec (use WebExplore).
browser-automation
Browser automation powers web testing, scraping, and AI agent interactions. The difference between a flaky script and a reliable system comes down to understanding selectors, waiting strategies, and anti-detection patterns. This skill covers Playwright (recommended) and Puppeteer, with patterns for testing, scraping, and agentic browser control. Key insight: Playwright won the framework war. Unless you need Puppeteer's stealth ecosystem or are Chrome-only, Playwright is the better choice in 202