Run Claude Code inside a Docker container while controlling Chrome on your host machine.
Python port of claude-code-remote-chrome.
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 Python bridge in the container and a Python script on the host forward messages between them:
Container Host
Claude Code Chrome
| |
v ^
bridge_container.py --TCP:9229--> bridge_host.py
(Unix socket) (Unix socket)
- Docker (Docker Desktop, OrbStack, or similar)
- Python 3.8+ on the host (for bridge_host.py)
- Chrome with the Claude browser extension installed
- Claude account credentials
-
Create
.env.localwith your OAuth token:CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...Get your token by running
claude setup-tokenon your host, or copy theaccessTokenvalue from~/.claude/.credentials.json. -
Build and start the container:
make up
-
Start the host bridge (separate terminal):
python3 bridge_host.py
-
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 |
| File | Location | Purpose |
|---|---|---|
bridge_host.py |
Host | TCP server, connects to real NMH socket |
bridge_container.py |
Container | Unix socket listener, forwards to TCP host bridge |
chrome_native_host.py |
Container | Placeholder NMH (Claude Code expects it; MCP doesn't use it) |
entrypoint.sh |
Container | Credentials, chrome-native-host, starts bridge_container.py |
Dockerfile |
Build | node:20-slim + python3, Claude CLI, user matching host UID |
docker-compose.yml |
Build | Sets env vars |
Makefile |
Host | up, shell commands |
- "Extension not detected" — Make sure
bridge_host.pyis running on the host and Chrome has the Claude extension active. - Bridge container can't connect — Verify
bridge_host.pyis listening on port 9229. - Username mismatch — The
USERenv var in the container must match the socket directory name. It defaults toclaude.