A Claude Code skill that adds Chrome profile targeting to
playwright-cli. Control your real Chrome browser with existing login state — no MCP overhead, no site restrictions, no ecosystem lock-in.
You want an AI coding agent to help with tasks in your browser (tax forms, admin dashboards, authenticated apps). But:
| Existing Solution | Why It Falls Short |
|---|---|
| Playwright MCP | Loads ~25 tool definitions per session (~114K tokens). Heavy. |
| Claude in Chrome | Blocks financial/banking sites. Requires Anthropic login. |
| Direct CDP | Chrome 136+ blocks remote debugging on default user data dir. |
playwright-cli --extension |
Works great, but no profile targeting — opens in last-active window. |
A thin wrapper (pw) that adds --pw-profile to playwright-cli, routing the browser extension connection to the correct Chrome profile.
pw open --extension --pw-profile="Work" # Opens in your Work profile
playwright-cli goto https://tax-site.com # Already logged in
playwright-cli snapshot # See the page
playwright-cli click e12 # Interact
playwright-cli close # Done
Claude Code
→ pw (profile targeting)
→ playwright-cli (browser control, Skill mode, ~27K tokens)
→ Playwright MCP Bridge extension (inside Chrome)
→ Your real Chrome tab (all cookies, login state intact)
-
Install
@playwright/cli:npm install -g @playwright/cli@latest
-
Install the Playwright MCP Bridge Chrome extension in each profile you want to control.
-
Copy the token from the extension's status page and add to your shell:
echo 'export PLAYWRIGHT_MCP_EXTENSION_TOKEN="your-token-here"' >> ~/.zshrc source ~/.zshrc
Option A: Plugin marketplace (recommended)
/plugin marketplace add yourusername/chrome-profile-bridge
/plugin install chrome-profile-bridge
Option B: Manual
# Install the skill
cp -r skill ~/.claude/skills/chrome-profile-bridge
# Install the pw wrapper
cp scripts/pw ~/.local/bin/pw
chmod +x ~/.local/bin/pwOption C: Install playwright-cli skill alongside
cd ~/.claude/skills && playwright-cli install --skills# List your Chrome profiles
pw list-profiles
# Open default profile
pw open --extension
# Open specific profile
pw open --extension --pw-profile="Profile 1"
# All playwright-cli commands work after opening
playwright-cli goto https://example.com
playwright-cli snapshot
playwright-cli click e15
playwright-cli screenshot
playwright-cli close- Extension ID: Must use the Chrome Web Store version (
mmlmfjhmonkocbjadbfplnigmagldckm). Dev/sideloaded versions have a different ID and won't work with@playwright/cli. - Token per profile: Each Chrome profile generates its own token. If you control multiple profiles, you'll need the token from the profile you're targeting (or use the same extension across profiles).
- macOS only (for now): The
pwscript uses macOS Chrome paths. PRs welcome for Linux/Windows support.
MIT