claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Claude in Chrome Native Host not supported on this platform (WSL2)

Open Zate opened this issue 4 months ago • 3 comments

I was excited to try out the Chrome integration Beta, but it appears that using chrome under WSL2 isnt supported. Playwright works just fine, the addon is installed, but I get the following errors.

**Bug Description**
claude --allow-dangerously-skip-permissions --chrome
2672 | Never reuse tab IDs from a previous/other session. Follow these guidelines:
2673 | 1. Only reuse an existing tab if the user explicitly asks to work with it
2674 | 2. Otherwise, create a new tab with mcp__claude-in-chrome__tabs_create_mcp
2675 | 3. If a tool returns an error indicating the tab doesn't exist or is invalid, call tabs_context_mcp to get fresh tab IDs
2676 | 4. When a tab is closed by the user or a navigation error occurs, call tabs_context_mcp to see what tabs are available
2677 | `;function mw$(H){if(cB()&&H!==!0)return!1;if(H===!0)return!0;if(H===!1)return!1;if(fA(process.env.CLAUDE_CODE_ENABLE_CFC))return!0;if(eW(process.env.CLAUDE_CODE_ENABLE_CFC))return!1;let $=R$();if($.claudeInChromeDefaultEnabled!==void 0)return $.claudeInChromeDefaultEnabled;return!1}function nSA(){let H=EM(),$=GPH.map((A)=>`mcp__claude-in-chrome__${A.name}`);if(H){let A=`"${process.execPath}" --chrome-native-host`;return hbD(A).then((L)=>bbD(L)),{mcpConfig:{[Eb]:{type:"stdio",command:process.execPath,args:["--claude-in-chrome-mcp"],scope:"dynamic"}},allowedTools:$,systemPrompt:lSA}}else{let A=kbD.fileURLToPath("file:///home/runner/work/claude-cli-internal/claude-cli-internal/src/utils/claudeInChrome/setup.ts"),L=NP.join(A,".."),I=NP.join(L,"cli.js");return hbD(`"${process.execPath}" "${I}" --chrome-native-host`).then((B)=>bbD(B)),{mcpConfig:{[Eb]:{type:"stdio",command:"node",args:[`${I}`,"--claude-in-chrome-mcp"],scope:"dynamic"}},allowedTools:$,systemPrompt:lSA}}}function fK1(){let H=jL(),$=iSA.homedir();swi | ... truncated

error: Claude in Chrome Native Host not supported on this platform
      at bbD (/$bunfs/root/claude:2677:1418)
      at bbD (/$bunfs/root/claude:2677:2137)
      at <anonymous> (/$bunfs/root/claude:2677:446)

Bun v1.3.4 (Linux x64 baseline)

**Environment Info**
- Platform: linux ( Linux <hotname_removed> 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
- Terminal: windows-terminal
- Version: 2.0.72
- Feedback ID: 4a7b4af1-dcaa-4c63-a6f1-0acc2c170b23

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"

Zate avatar Dec 18 '25 10:12 Zate

WSL (Windows Subsystem for Linux) is also not supported.

https://code.claude.com/docs/en/chrome

sickmz avatar Dec 19 '25 07:12 sickmz

WSL Chrome Native Host Crash Workaround

Issue: Claude Code crashes on startup in WSL with "Claude in Chrome Native Host not supported on this platform"

Affected versions: 2.0.55+ (Chrome integration feature)

GitHub Issue: #14445

Symptoms

Error: Claude in Chrome Native Host not supported on this platform
    at oe2 (file:///.../cli.js:2694:1487)

Claude Code fails to start entirely. The error is unhandled and crashes the process.

Root Cause

  1. Claude Code 2.0.55+ includes "Claude in Chrome" browser integration
  2. On startup, hw0() triggers Chrome native host installation via re2().then(oe2())
  3. m07() returns null for WSL (explicitly unsupported platform)
  4. oe2() throws an uncaught error when path is null
  5. The CLAUDE_CODE_ENABLE_CFC setting in settings.json is loaded after the Chrome setup code runs

Workaround

Set the environment variable at the shell level so it's available before Claude Code's settings.json is processed:

# Add to ~/.bashrc (or ~/.zshrc for zsh)
export CLAUDE_CODE_ENABLE_CFC=false

Then restart your terminal or run:

source ~/.bashrc

Why This Works

  • Shell environment variables are available immediately when Node.js starts
  • settings.json env section is processed later in the startup sequence
  • The Chrome feature check (XV1()) reads process.env.CLAUDE_CODE_ENABLE_CFC early enough to skip the install

What Doesn't Work

Approach Result
settings.json env: "CLAUDE_CODE_ENABLE_CFC": "false" Too late, Chrome code runs first
settings.json env: "CLAUDE_CODE_ENABLE_CFC": "0" Same issue
Blocking ~/.claude/chrome/ directory creation Uncaught EEXIST/EACCES errors
Downgrade + clean + upgrade VSCode extension recreates chrome/ dir

Verified Configuration

Platform: WSL2 (Ubuntu on Windows)
Node: v24.11.1
Claude Code: 2.0.75
VSCode Extension: 2.0.75

Notes

  • The VSCode extension (2.0.75) handles the WSL error gracefully internally
  • Only the CLI crashes; VSCode continues working
  • This workaround survives Claude Code upgrades
  • The ~/.claude/chrome/ directory may still be created by VSCode extension; this is harmless

Timeline

  • 2025-12-21: Workaround discovered via root cause tracing
  • Bug remains open in Claude Code; proper fix should add error handling or platform check before hw0() call

Neikan-BSN avatar Dec 21 '25 11:12 Neikan-BSN

Repro confirmed on my side.

Environment:

  • Windows 11 + WSL2 (Ubuntu)
  • Claude Code CLI 2.0.75 (npm-global)
  • Chrome on Windows

Steps:

  1. Run claude in WSL (or claude --chrome / enable Chrome integration by default)
  2. CLI errors immediately: Error: Claude in Chrome Native Host not supported on this platform

Expected: Graceful behavior on WSL (auto-disable Chrome integration with a clear message) OR a supported WSL->Windows bridge.

Current workaround: claude --no-chrome (but it disables the feature entirely).

pavelbe avatar Dec 22 '25 13:12 pavelbe