Guide · Agent skill
How to use the agent-browser skill for browser automation
Updated · written with AI from the project's own documentation and checked against our catalogue data
The agent-browser skill teaches an AI agent to drive a real web browser from the command line. It is useful for people who want an agent to open pages, fill in forms, click buttons, take screenshots or pull data from a site that has no API. This guide explains what the skill does, how to install it, how to trigger it with plain requests and what to watch for on safety.
Quick start
- 1Install the CLI and a browser runtime. Set up the agent-browser CLI and a browser runtime for it, following the CLI's own documentation. Confirm it runs with npx agent-browser or agent-browser on your PATH.
- 2Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into your project's .claude/skills/ folder.
- 3Or upload the ZIP in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the ZIP.
- 4Describe the browser task. Ask in plain language, naming the site, the fields or buttons involved and the result you want, for example fill out a form or take a screenshot.
- 5Let the agent navigate and snapshot. The agent opens the page and runs snapshot -i to get element references such as @e1 before it interacts with anything.
- 6Check the result. Review the agent's snapshot or screenshot output and confirm the outcome yourself, especially after any form submission.
What the agent-browser skill lets the agent do
An agent skill is a folder of instructions and tools that an AI agent can load when a task calls for them. This one is built around the agent-browser command-line tool. Once it is in place, the agent can navigate to a URL, read the interactive elements on the page, fill fields, select options, check boxes, click, wait for pages to load, scroll, and capture screenshots or PDFs.
The skill also keeps a background browser running between commands, so the agent can work through a multi-step flow without starting over each time. It can save cookies and localStorage so later runs stay signed in. Because the skill is a documented workflow, the agent follows the listed commands rather than guessing at browser syntax.
- Open pages and read interactive elements with references such as @e1 and @e2
- Fill forms, select dropdown options, check boxes and click buttons
- Wait for network idle, a URL pattern or a specific element
- Take screenshots, full-page captures or PDFs
- Extract text or JSON from elements on a page
- Save and reuse login state
Install the agent-browser skill
Download the ZIP for the skill from this page. You can install it in one of two ways. For a personal setup, unzip it into ~/.claude/skills/. For a single project, unzip it into the project's .claude/skills/ folder. If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the ZIP there.
The skill calls a command-line tool, so you also need the agent-browser CLI and a browser runtime for it. The skill can invoke the CLI as npx agent-browser or as agent-browser if it is on your PATH. The source for this skill does not include a separate install command for the CLI, so follow the CLI's own documentation for that part.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into your project's .claude/skills/
- Claude apps: Settings, then Capabilities, then Skills, then upload the ZIP
- Confirm that agent-browser runs from npx or from your PATH
Trigger the skill with natural requests
You do not need special syntax. Describe the browser task in plain language and the agent will load the skill when the request matches its description. The skill's trigger list includes requests such as open a website, fill out a form, click a button, take a screenshot, scrape data from a page, test this web app, login to a site and automate browser actions.
Be specific about the site and the outcome. A request that names the page, the fields and the result you want gives the agent what it needs to plan the steps.
- Open https://example.com/signup and fill in the form with my test details, then tell me what the confirmation page says
- Take a screenshot of the pricing page on this site
- Scrape the product names and prices from this listing page into a text file
- Test the checkout flow in my local web app and report any step that fails
Follow the core workflow: navigate, snapshot, interact
Every browser task in this skill follows the same pattern. The agent opens the page, takes a snapshot to get element references, interacts using those references, and then takes a fresh snapshot after anything changes the page. References look like @e1 and @e2, and they are only reliable until the page changes, which is why the workflow re-snapshots after navigation.
- Navigate with agent-browser open <url>
- Snapshot with agent-browser snapshot -i to list elements with refs
- Interact with click, fill, select or check using the refs
- Re-snapshot after navigation or DOM changes
agent-browser open https://example.com/form
agent-browser snapshot -i
agent-browser fill @e1 "user@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait --load networkidle
agent-browser snapshot -iSave login sessions and handle credentials safely
For sites that need a login, the skill can save state so later runs stay signed in. With the --session-name option, cookies and localStorage are saved automatically when the browser closes and loaded the next time you use that session name. Saved sessions are stored under ~/.agent-browser/sessions/. You can also save state to a file with agent-browser state save and load it with agent-browser state load.
To protect that state at rest, set the AGENT_BROWSER_ENCRYPTION_KEY environment variable before you start a session. Credentials for login flows are supplied through environment variables, so they do not need to appear in the command text. Use a test or low-stakes account while you learn the skill.
- Use --session-name to auto-save and restore state
- Saved sessions live in ~/.agent-browser/sessions/
- Use state list, state show, state clear and state clean to manage them
- Set AGENT_BROWSER_ENCRYPTION_KEY to encrypt saved state
- Pass usernames and passwords through environment variables such as $USERNAME and $PASSWORD
agent-browser --session-name myapp open https://app.example.com/login
agent-browser close
agent-browser --session-name myapp open https://app.example.com/dashboardGet data out of pages and fix common problems
For data extraction, the agent can read a single element with get text, dump the page text, or add --json to snapshot and get commands for parsing. Some get subcommands do not accept @refs. According to the skill's local notes, get html, get box, get styles, get value, get attr and get count need a CSS selector instead of a ref, and a ref there can fail silently.
If a command behaves unexpectedly, check the help for the CLI version you have installed, since the local notes say command details may differ between releases. Re-snapshot if the page has changed, and verify the result yourself rather than trusting the agent's summary.
- Use get text with @refs or CSS selectors
- Use get html, get box, get value or get attr with CSS selectors, not @refs
- Add --json to snapshot or get for structured output
- Use --headed to watch the browser while debugging
- Use screenshot --annotate to see numbered element labels
agent-browser get text body > page.txt
agent-browser snapshot -i --jsonWhat people use it for
- Testing a web app's signup, login or checkout flow end to end and reporting which step failed
- Pulling product names, prices or listings from a website that has no API
- Filling the same online form every week with new values
- Capturing screenshots or PDFs of pages for documentation or records
- Comparing two pages with the diff command to see what changed
Frequently asked questions
How do I install the agent-browser skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into your project's .claude/skills/ folder for one project. In the Claude apps you can instead upload the ZIP under Settings, Capabilities, then Skills. You also need the agent-browser CLI and a browser runtime for it.
What does the agent-browser skill require?
It requires the agent-browser CLI, which can be run as npx agent-browser or as agent-browser on your PATH, plus a browser runtime installed for that CLI. Setting AGENT_BROWSER_ENCRYPTION_KEY and supplying site credentials through environment variables are optional. The skill runs scripts and uses the network.
Is the agent-browser skill free to use?
The skill is licensed under Apache-2.0, and the full license text is included in the LICENSE.txt file in the download. This page does not state any price, so check the license and the CLI's documentation for terms that apply to your use.
Is it safe to let an AI agent log into my accounts?
Not for sensitive accounts such as banking or email. The agent acts with real logins and saved session state, which can be risky if it misclicks or if page content manipulates it. Use test accounts, keep sessions encrypted with AGENT_BROWSER_ENCRYPTION_KEY, and review what the agent did.
Why does get text fail when I use an @ref?
Not every get subcommand accepts @refs. The skill's local notes say get html, get box, get styles, get value, get attr and get count need a CSS selector, and a ref there can fail silently. Use get text with a ref, or switch to a CSS selector for the other commands.
Can the agent scrape any website?
No. Do not use it to scrape sites whose terms of service forbid automated access. The skill is also not useful for tasks that need no web interaction.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers testing web app flows, analysts pulling data from sites without an API, and anyone repeating the same web task. Skip it for banking, email or other sensitive accounts, for scraping that breaks a site's terms, and for tasks that never touch a browser.
Download the skill