Run Claude Code inside a Docker container while controlling Chrome on your host machine.
Claude Code has a "Claude in Chrome" feature that lets it control your browser — navigate pages, fill forms, take screenshots, etc. Normally this only works when Claude Code runs directly on your machine. This project bridges that gap so Claude Code running in a container can talk to Chrome on your host.
A socat bridge in the container and a Node.js script on the host forward messages between them:
Container Host
Claude Code Chrome
| |
v ^
socat (entrypoint) --TCP:9229--> bridge-host.js
(Unix socket) (Unix socket)
- Docker (Docker Desktop, OrbStack, or similar)
- Node.js on the host (for bridge-host.js)
- Chrome with the Claude browser extension installed
- Claude account credentials
-
Create
.env.localwith your credentials:CLAUDE_CREDENTIALS={"claudeAiOauth":{"accessToken":"...","refreshToken":"...","expiresAt":...}}You can find these in
~/.claude/.credentials.jsonon your host. -
Build and start the container:
make up
-
Start the host bridge (separate terminal):
node bridge-host.js
-
Inside the container, start Claude (the bridge starts automatically via entrypoint):
claude --chrome
-
Ask Claude to do something in Chrome, e.g.
open google.com.
| Command | Description |
|---|---|
make up |
Build image and start interactive shell |
make shell |
Open additional terminal in the container |
This project is a proof-of-concept solution for anthropics/claude-code#15450 — a feature request for remote development support for the Chrome extension. The same approach can be adapted for Eclipse Che, GitHub Codespaces, Gitpod, or any environment that supports host.docker.internal or TCP port forwarding.
- "Extension not detected" — Make sure
bridge-host.jsis running on the host and Chrome has the Claude extension active. - Bridge container can't connect — Verify
bridge-host.jsis listening on port 9229. - Username mismatch — The
USERenv var in the container must match the socket directory name. It defaults toclaude.