Dev.to
7/16/2026

Running Claude Code with Chrome on WSL2 via CDP: a practical workaround
Original: Claude in Chrome doesn't work on WSL2. Here's the fix: one logged-in Chrome, two drivers, cheap tokens
Short summary
Claude Code's Chrome extension doesn't work on WSL2 due to native messaging host registry mismatch between Windows and Linux. The workaround uses Chrome DevTools Protocol on port 9222 with mirrored networking, attaching two CDP clients from WSL to a Windows Chrome instance. Using accessibility tree snapshots instead of screenshots dramatically reduces token consumption for agent-driven browser automation.
- •WSL2 can't use Claude's Chrome extension due to native messaging host registry mismatch
- •Workaround: CDP on port 9222 with mirrored networking, two clients on one browser
- •Accessibility tree snapshots cost hundreds of tokens vs thousands for screenshots
Generated with AI, which can make mistakes.
Is this a good recommendation for you?


