Drive My Browser
Let Your AI Drive Your Chrome — Logged In as You
Want your AI agent to actually use a website for you — search, click, fill
forms — but as you, with your accounts already logged in? You need
basically two things: agent-browser installed, and a little skill file that
teaches your agent the trick. That's it.
Step 1: Install agent-browser
npm i -g agent-browser && agent-browser install
This is the only real install. agent-browser is a CLI that lets an AI
control a browser.
Step 2: Add the skill
agent-browser can drive a browser, but on its own it opens a blank test
browser where you're logged into nothing. Two small gotchas get in the way:
- Modern Chrome won't let a robot remote-control your everyday profile.
- The bundled test browser can't read your saved logins (they're locked to real Chrome).
The fix is one tidy command — and instead of memorizing it, you hand it to
your agent as a skill. Save this as
~/.claude/skills/drive-my-chrome/SKILL.md:
---
name: drive-my-chrome
description: Drive the user's real, logged-in Chrome with one of their existing
Chrome profiles via agent-browser. Use when the user wants browser automation
that reuses their own login/cookies — "use my chrome profile", "my default
profile", "logged in as me", "browse as myself".
allowed-tools: Bash(agent-browser:*), AskUserQuestion
---
# drive-my-chrome
Launch the user's **real** Google Chrome with one of their existing profiles,
so logins/cookies are intact, and drive it with agent-browser.
## Steps
1. List profiles, so you know what's available:
```bash
agent-browser profiles
```
Output maps folder → account, e.g. `Profile 1 (you@work.com)`.
2. Pick the profile. If the user named one clearly, use it. Otherwise **ask**
with AskUserQuestion — "my default profile" is ambiguous (the `Default`
folder, or the account they live in?). Pass `--profile` the **folder name**
(`Default`, `Profile 1`, …), not the email.
3. Launch real Chrome, visible, in a named session:
```bash
REALCHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
AGENT_BROWSER_SESSION=mychrome agent-browser \
--executable-path "$REALCHROME" \
--profile "Profile 1" \
--headed \
open "https://www.google.com"
```
(Linux: `/usr/bin/google-chrome`. Windows:
`C:\Program Files\Google\Chrome\Application\chrome.exe`.)
4. Drive it — reuse the same session name for every command:
```bash
export AGENT_BROWSER_SESSION=mychrome
agent-browser snapshot -i # see the page; elements show as @e1, @e2…
agent-browser fill @e16 "wow" # type into the search box
agent-browser press Enter
```
5. Confirm you're logged in, then clean up when done:
```bash
agent-browser snapshot -i | grep -i "google account" # should show your account
agent-browser close --all
```
## Notes
- `--executable-path` = real Chrome (so your cookies decrypt). `--profile`
copies the profile to a temp dir so Chrome will accept remote control. Get
both right and you're logged in.
- Each launch is a throwaway copy — new logins/bookmarks don't sync back to
your real Chrome.
- Google specifically may still bounce automation to a CAPTCHA. Most other
sites stay logged in fine.
Step 3: Just ask
That's the whole setup. Now you talk to your agent in plain English:
"drive my chrome, go to google and search for wow"
The skill kicks in, asks which profile you mean if it's unsure, opens your real Chrome logged in as you, and does the thing. 🤖
That's really it — install agent-browser, drop in the skill, and ask.
Everything else is the agent's job.