Claude Code with Chrome: --chrome, setup and headless servers
Connect Claude Code to Chrome with the Claude in Chrome extension: --chrome and /chrome, plans, permissions, errors, and Playwright or DevTools MCP on a server.
Claude Code drives Chrome through Anthropic’s Claude in Chrome extension (version 1.0.36 or later). Install it, sign in to it with the same Claude account and organization as Claude Code, then start claude --chrome, or run /chrome in a session to check the connection and turn it on for every session. It needs a Pro, Max, Ultra, Team or Enterprise plan and a /login sign-in: with an API key or a claude setup-token token it stays off, and it isn’t available on Bedrock, Google Cloud or Foundry, or in WSL. Claude works in a visible Chrome window with your logins, asks before acting on each new site, and stops for you at a login page or CAPTCHA. On a server with no desktop, the alternative is a browser MCP server that runs Chrome headless on the server itself: claude mcp add playwright npx @playwright/mcp@latest or claude mcp add chrome-devtools --scope user npx chrome-devtools-mcp@latest.
Turning it on
With the extension installed and signed in, and Chrome running, start Claude Code with the flag:
claude --chromeCopiedThe first time, Claude Code shows a one-time dialog about site permissions and writes a native messaging host file that Chrome reads only when it starts, so if the extension isn’t found on the first try, Anthropic’s Chrome page says to restart Chrome. On Linux the file is ~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json.
/chromeinside a session shows the connection status, manages permissions, reconnects the extension, picks which browser to use when more than one is connected, and has the option to turn Chrome on by default. That setting isclaudeInChromeDefaultEnabledin~/.claude.json, and the VS Code extension shares it, where it is the Enabled by default switch (or type@browserto connect one session).- On by default costs context: the browser tools and their instructions load into every session. Anthropic suggests turning it off and using
--chromewhen you need it if context use climbs;claude --no-chromeskips it for one session and leaves the setting on. - Without the flag, an interactive session that needs a browser and finds no extension shows “Claude wants to use your browser”, at most once per session, with Install extension, Not now and Don’t ask again. If the extension is already installed, a start-up dialog, “Claude in Chrome extension detected”, asks instead, and your answer sets the default.
CLAUDE_CODE_ENABLE_CFC=1in the environment does the same as the flag, which overrides it. A repository can’t turn it on: set in a project’s.claude/settings.jsonit is ignored with a warning that startsClaude Code ignored CLAUDE_CODE_ENABLE_CFC in this project's settings, so a checked-out repo can’t connect Claude to your browser.
What it needs
| Requirement | As of November 2026 |
|---|---|
Plan | Pro, Max, Ultra, Team or Enterprise, used directly with Anthropic. Not through Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry. |
Sign-in | /login with your Claude account. An API key or a claude setup-token token keeps Chrome off even with --chrome, because the extension can’t authenticate with them. |
Extension | Claude in Chrome 1.0.36 or later, signed in to the same account and organization as Claude Code (/status shows Claude Code’s organization). |
Browser | Chrome or Edge per the Claude Code docs, which add that Brave, Arc, Vivaldi and Opera are detected too. Anthropic’s help center article says the extension “is not supported on other Chromium-based web browsers”; the two pages disagree. |
System | The docs give the setup file’s location on macOS, Linux and Windows. Not supported in WSL. |
Organization | Off by default on Enterprise with HIPAA (an Owner turns it on under Organization settings, Claude in Chrome); unavailable in Claude Code with zero data retention, where /chrome reports Claude in Chrome is disabled by your organization's policy. |
The extension’s own side panel became a Claude Cowork session in August 2026. That changes the panel, not the Claude Code connection described here.
What Claude can do in the browser, and when it asks
Claude opens its own tabs, collected into a tab group for the session, and they share your browser’s logins, so it can work in Gmail, Google Docs, an admin console or anything else you’re signed in to. It navigates, clicks, types and fills forms, reads console errors and the DOM, takes screenshots and saves them to disk, records GIFs, and attaches local files to upload fields. Run /mcp, select claude-in-chrome, then View tools for the full list. A typical first request, from the docs:
Go to code.claude.com/docs, click on the search box, type "hooks", and tell me what results appearCopied- Permission is per site. The prompt starts
Claude in Chrome wants toand offers to allow all actions on that site for the session. In auto mode, when the classifier approves a browser call, the extension can skip its own per-site check for that call, unless your permission rules deny any site to Claude in Chrome. In plan mode Claude asks before it opens a tab or records a GIF. - Logins and CAPTCHAs are yours. Claude pauses at either and asks you to deal with it in the window.
- Uploads take up to 10 MB of files in total per upload. Claude refuses a file you have denied it permission to read, a file with several hard links (common in
node_modules; copy it first), and, from v2.1.293, files named like credentials:.env,.pem,.key, anything under.ssh. - GIFs record everything on screen, account details on logged-in pages included; Anthropic says to review one before sharing it.
- Tabs close with the session only sometimes.
/clearcloses the group; exiting or/resumecloses it only if it holds nothing but empty new tabs.
On a server with no desktop
Anthropic’s Chrome page doesn’t say where the extension must run relative to Claude Code. The setup it describes is that Claude Code “installs a native messaging host configuration file” in the browser’s own configuration folder (the Linux path is above), and “Chrome reads this file on startup.” GitHub requests to support Claude Code on a server with Chrome on your own computer (#15450, #21299) were closed by a bot with no answer from Anthropic. For an agent that browses on a server, run the browser on the server, which is what the MCP servers below do.
The MCP alternatives: Playwright and Chrome DevTools
Both are ordinary local MCP servers, added with claude mcp add, that start their own Chrome on the machine where Claude Code runs. They work with an API key, on any provider, and with no extension or Claude account in the loop; the browser has none of your logins unless you sign in inside it.
| Claude in Chrome | Playwright MCP | Chrome DevTools MCP | |
|---|---|---|---|
Maker | Anthropic | Microsoft (v0.0.86, 18 Nov 2026) | Chrome DevTools team (v1.13.0, 11 Nov 2026) |
Browser | Your own Chrome, with your logins | Its own, persistent profile by default; Chrome, Edge, Firefox or WebKit | Its own Chrome profile, or a running Chrome you point it at |
Reads pages by | Page content, screenshots, console, DOM | Accessibility snapshots, “bypassing the need for screenshots” | DevTools: console, network requests, screenshots, performance insights |
Headless server | No browser of its own | --headless (headed by default) | --headless (off by default) |
Needs | Claude plan, /login, the extension | Node.js 20+ | Node.js LTS, current stable Chrome |
On a server with no display, both default to a visible window, so pass --headless. Everything after -- goes to the server untouched:
# Playwright MCP, headless, profile kept in memory
claude mcp add playwright -- npx @playwright/mcp@latest --headless --isolated
# Chrome DevTools MCP, headless, throwaway profile, no usage statistics
claude mcp add chrome-devtools --scope user -- npx chrome-devtools-mcp@latest --headless --isolated --no-usage-statisticsCopied- Profiles. Without
--isolated, Playwright keeps its profile in~/.cache/ms-playwright/mcp-{channel}-{workspace-hash}and Chrome DevTools MCP in$HOME/.cache/chrome-devtools-mcp/chrome-profile. A persistent profile keeps whatever logins you make there, which is useful on a machine only you use and a liability anywhere else. - Usage statistics. Chrome DevTools MCP collects them by default; its README says to pass
--no-usage-statistics, or setCHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS. - Chrome refuses to start as root, which the DevTools server’s troubleshooting notes is common in containers and CI images. Run Claude Code as an ordinary user; if Chrome still fails in a container, the cause is usually the sandbox Docker and Ubuntu block, and Playwright’s
--no-sandboxis the last resort there. - Memory. A headless Chrome on a small server grows with every tab and can bring the machine down; an agent’s browser and the OOM killer covers the numbers and the fixes.
- Playwright’s own advice is that coding agents increasingly use its separate Playwright CLI with skills, which it calls “more token-efficient” than the MCP server; the MCP server suits long loops that need the browser’s state kept.
Pointing an MCP server at a Chrome you already have open
Both servers can drive a running Chrome instead of starting one. Playwright’s --extension connects to existing tabs in Chrome or Edge through its own “Playwright Extension”. Chrome DevTools MCP has two routes, per its advanced usage guide:
--autoConnectattaches to a Chrome 144 or later running on the same machine, after you allow it atchrome://inspect/#remote-debugging; Chrome asks your permission in a dialog, and the server uses the default profile.--browser-url=http://127.0.0.1:9222attaches to a Chrome started with a debugging port. Chrome requires a non-default profile directory for it, so this Chrome has none of your usual logins:
/usr/bin/google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-profile-stableCopiedWith Claude Code on a server and that Chrome on your computer, neither project shows a recipe, but the documented parts combine: the DevTools server’s troubleshooting guide tunnels port 9222 with ssh -N -L from a VM to its host, and the reverse, ssh -R, puts your computer’s port on the server, bound to the server’s loopback by default:
# on your computer, with Chrome running as above
ssh -N -R 9222:127.0.0.1:9222 you@your-server
# on the server
claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest --browser-url=http://127.0.0.1:9222CopiedThe project’s warning applies twice over: with the port open, “any application on your machine can connect to this port and control the browser,” and through the tunnel, so can anything on the server. Keep sensitive sites out of that profile while the port is open.
Errors, and what fixes them
| Message | Meaning and fix |
|---|---|
Browser extension is not connected | The extension isn’t running, or is signed in to a different account or organization (check /status), or an organization IP allowlist blocks bridge.claudeusercontent.com. Fix the sign-in, restart Chrome and Claude Code, run /chrome. Switching the extension’s organization means logging out of it, which loses its saved shortcuts and scheduled tasks. |
No browsers are connected | No Chrome is open with the extension signed in to this account and organization, or Claude Code can’t reach the bridge. |
“Not detected” in /chrome | The extension isn’t installed or is disabled; install or enable it in chrome://extensions. |
Receiving end does not exist | The extension’s service worker went idle in a long session. /chrome, Reconnect extension; before v2.1.290 that only opened a page, so update. |
No tab available | Claude acted before a tab was ready; ask it to open a new tab. |
Commands stop responding | A JavaScript alert or confirm dialog is blocking the page; dismiss it and tell Claude to continue. |
Chrome stays off with --chrome | Claude Code is signed in with an API key or a setup-token token; sign in with /login. |