Intermediate11 min
Browser Integration and Self-Verification
Claude Code can drive a Chrome browser to navigate, click, fill forms, and take screenshots — enabling a self-verification loop where Claude implements a feature and then tests it in the running app without human intervention.
Quick Reference
- →--chrome flag enables browser control for a single session
- →settings.json enableChrome: true makes it persistent across sessions
- →/chrome command toggles browser settings; /chrome status shows current state
- →Claude can navigate URLs, click elements, fill forms, read console, take screenshots
- →Self-verification loop: implement → open localhost → verify → fix if broken
- →Playwright MCP is the structured alternative for repeatable test automation
- →PostToolUse hook can auto-trigger screenshot after every file edit
- →Works on deployed environments too, not just localhost
Enabling Browser Integration
Claude Code's browser integration uses your local Chrome installation to give Claude eyes on the running application. There are three ways to enable it, depending on whether you want it for a single session or permanently.
| Method | Scope | How |
|---|---|---|
| --chrome flag | Single session only | claude --chrome |
| settings.json | All sessions in this project | { "enableChrome": true } |
| /chrome command | Toggle inside a running session | /chrome or /chrome status |
Three equivalent ways to enable browser access
VS Code and Desktop
The VS Code extension auto-detects the Claude Code Chrome extension if it's installed. The Desktop app has a preview pane that shows the browser state inline. For CLI usage, Chrome runs headfully in the background.