How to Install and Set Up Claude Code agent-browser: A Beginner's Guide
If you want Claude Code to open websites, click buttons, fill out forms, and test web applications, agent-browser is a useful tool to add to your development workflow.
agent-browser is a browser automation CLI developed by Vercel Labs. It allows AI coding agents such as Claude Code to interact with real web pages through simple terminal commands.
Getting started involves two main steps: installing the agent-browser CLI and Chrome, then adding the agent-browser Skill to Claude Code.
📌 Quick Overview
Tool: agent-browser by Vercel Labs
CLI installation:
npm install -g agent-browserBrowser installation:
agent-browser installClaude Code Skill:
npx skills add vercel-labs/agent-browserMain features: Browser navigation, clicking, form filling, screenshots, data extraction, and web testing.
🔍 What Is agent-browser?
agent-browser is a command-line browser automation tool designed for AI agents.
Instead of simply generating code, Claude Code can use agent-browser to interact with a website, inspect page elements, and perform actions such as clicking buttons or entering text.
Common use cases include:
Opening websites and inspecting page content
Filling out forms and interacting with login pages
Clicking buttons and navigating between pages
Capturing browser screenshots
Testing web application functionality
It is particularly useful when you want Claude Code to test a website after making code changes.
⚙️ How to Install agent-browser
Before installation, make sure Node.js and npm are available on your system.
Open PowerShell or your terminal and run:
node -v
npm -v
If both commands display version information, continue with the installation.
1. Install the agent-browser CLI
Run the following command:
npm install -g agent-browser
This installs agent-browser globally, allowing you to use the command across different projects.
2. Install Chrome
Next, install the browser required for automation.
agent-browser install
This downloads Chrome for Testing, providing a browser environment for automated interactions.
3. Install the Claude Code Skill
Now add the agent-browser Skill so Claude Code knows how to use the tool.
npx skills add vercel-labs/agent-browser
This adds the Skill to the Claude Code environment, typically under .claude/skills/agent-browser/.
The installed Skill is intentionally lightweight. Rather than storing an outdated copy of all instructions, it directs Claude Code to retrieve the relevant instructions from the installed agent-browser CLI.
🚀 Test Your Installation
Once installation is complete, check whether the CLI is working:
agent-browser --help
Next, open a test website:
agent-browser open https://example.com
To inspect interactive elements on the page, run:
agent-browser snapshot -i
The command displays interactive elements with reference IDs, such as @e1 and @e2.
You can use these references to interact with the page.
For example, click an element:
agent-browser click @e1
Enter text into a form field:
agent-browser fill @e2 "Hello World"
After the page changes, run snapshot -i again to inspect the updated page.
💡 Using agent-browser with Claude Code
Once the installation is complete, start Claude Code and describe the browser task you want it to perform.
For example:
"Use agent-browser to open my development website, inspect the main navigation menu, and test whether each page loads correctly."
Claude Code can use the installed Skill to understand the workflow, navigate the browser, inspect page elements, and perform the requested tests.
For more consistent behavior across projects, you can also add browser automation instructions to your project's CLAUDE.md file.
⚠️ Important Things to Remember
Installing the CLI and installing the Claude Code Skill are separate steps. Installing the Skill alone does not automatically install the browser executable.
Also, be careful when automating websites that contain personal information or authenticated sessions. Review actions before allowing automation to submit payments, publish content, or delete data.
If you regularly develop and maintain websites, start by running agent-browser --help in your terminal. Then ask Claude Code to open a test page and inspect its navigation menu. This is a practical way to become familiar with browser automation.