Claude Code · Lesson 21
Chrome Extension
Connect Claude Code to your Chrome browser and let it open pages, click buttons, read console errors, and fill in forms — all from a single terminal session. No Playwright setup, no Selenium scripts.
What the Extension Lets You Do
Once the Chrome extension is installed and Claude Code is launched with the --chrome flag, Claude gains a set of browser tools it can use on your behalf. It opens a real Chrome window, inherits your existing login sessions, and performs actions you can watch happen in real time.
Set It Up in Two Steps
Search for “Claude” in the Chrome Web Store, or click the button in the mockup below. You need version 1.0.36 or higher. After installing, confirm it is enabled in chrome://extensions.
Start Claude Code from your project directory with the --chrome flag. Claude will detect the extension and confirm the connection.
/chrome inside Claude Code and select “Enabled by default”. Be aware this loads browser tools on every session and will slightly increase context usage.Practical Example: Test Your Local Dev Server
Suppose you just added form validation to your app and want to make sure the error messages appear correctly. Instead of switching to the browser and testing manually, ask Claude to do it while your terminal stays open.
Claude interacted with the real browser, read the DOM, noticed the gap in validation, and offered to fix the source file — all without you leaving the terminal.
More Workflow Examples
The /chrome Slash Command
Inside any Claude Code session, type /chrome to open an interactive menu.
Troubleshooting
| Error message | Cause | Fix |
|---|---|---|
| Browser extension is not connected | Native messaging host can't reach the extension | Restart Chrome and Claude Code, then run /chrome |
| Extension not detected | Extension is not installed or is disabled | Install or enable the extension in chrome://extensions |
| No tab available | Claude acted before a tab was ready | Ask Claude to create a new tab and retry |
| Receiving end does not exist | Extension service worker went idle | Run /chrome → Reconnect extension |
Quick Reference
| Task | How |
|---|---|
| Start Claude Code with Chrome | claude --chrome |
| Enable Chrome by default | /chrome → Enabled by default |
| Check connection status | /chrome → Connection status |
| Reconnect after idle drop | /chrome → Reconnect extension |
| Manage site permissions | /chrome → Manage permissions |
| See available browser tools | /mcp → claude-in-chrome |
| Enable from inside session | /chrome (type it in chat) |
What's Next
The Chrome extension is set up. Next: bring Claude Code into Slack so your team can trigger Claude directly from their conversations.