[BUG] Claude Code fails to start in WSL2 when used alongside Windows PowerShell with Claude in Chrome enabled
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After configuring Claude in Chrome in a PowerShell environment on Windows, attempting to run Claude Code in WSL2 results in the error "Claude in Chrome Native Host not supported on this platform" and Claude Code fails to start.
What Should Happen?
PowerShell and WSL2 environments should be independent, so Claude in Chrome connection settings should be configured separately for each environment. The behavior of Claude Code in WSL2 should not be affected by settings or configurations made in PowerShell.
Error Messages/Logs
$ claude
file:///home/natsuume/.asdf/installs/nodejs/24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2730
`;import{chmod as eQ7,mkdir as x19,readFile as v19,writeFile as k19,readdir as AB7,access as T19}from"fs/promises";import{homedir as f19}from"os";import{join as v$}from"path";import{fileURLToPath as QB7}from"url";function lV1(A){if(m9()&&A!==!0)return!1;if(A===!0)return!0;if(A===!1)return!1;if(V0(process.env.CLAUDE_CODE_ENABLE_CFC))return!0;if(KK(process.env.CLAUDE_CODE_ENABLE_CFC))return!1;let Q=v1();if(Q.claudeInChromeDefaultEnabled!==void 0)return Q.claudeInChromeDefaultEnabled;return!1}function dq0(){let A=t7(),Q=kDA.map((B)=>`mcp__claude-in-chrome__${B.name}`);if(A){let B=`"${process.execPath}" --chrome-native-host`;return y19(B).then((G)=>S19(G)),{mcpConfig:{[Ek]:{type:"stdio",command:process.execPath,args:["--claude-in-chrome-mcp"],scope:"dynamic"}},allowedTools:Q,systemPrompt:mq0}}else{let B=QB7(import.meta.url),G=v$(B,".."),Z=v$(G,"cli.js");return y19(`"${process.execPath}" "${Z}" --chrome-native-host`).then((J)=>S19(J)),{mcpConfig:{[Ek]:{type:"stdio",command:"node",args:[`${Z}`,"--claude-in-chrome-mcp"],scope:"dynamic"}},allowedTools:Q,systemPrompt:mq0}}}function ZB7(){let A=xQ(),Q=f19();switch(A){case"macos":return v$(Q,"Library","Application Support","Google","Chrome","NativeMessagingHosts");case"linux":return v$(Q,".config","google-chrome","NativeMessagingHosts");case"windows":{let B=process.env.APPDATA||v$(Q,"AppData","Local");return v$(B,"Claude Code","ChromeNativeHost")}case"wsl":default:return null}}async function S19(A){let Q=ZB7();if(!Q)throw Error("Claude in Chrome Native Host not supported on this platform");let B=v$(Q,GB7),G={name:pV1,description:"Claude Code Browser Extension Native Host",path:A,type:"stdio",allowed_origins:["chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/",...[]]},Z=JSON.stringify(G,null,2);if(await v19(B,"utf-8").catch(()=>null)===Z)return;if(await x19(Q,{recursive:!0}),await k19(B,Z),xQ()==="windows")YB7(B);k(`[Claude in Chrome] Installed Chrome native host manifest at: ${B}`),j4A().then((J)=>{if(J)k("[Claude in Chrome] First-time install detected, opening reconnect page in Chrome"),gsB(BB7);else k("[Claude in Chrome] First-time install detected, but extension not installed, skipping reconnect")})}function YB7(A){T6("reg",["add",`${P19}`,"/ve","/t","REG_SZ","/d",A,"/f"]).then((Q)=>{if(Q.code===0)k(`[Claude in Chrome] Registered Chrome native host in Windows registry: ${P19}\\${pV1}`);else k(`[Claude in Chrome] Failed to register Chrome native host in Windows registry: ${Q.stderr}`)})}async function y19(A){let Q=xQ(),B=v$(gQ(),"chrome"),G=Q==="windows"?v$(B,"chrome-native-host.bat"):v$(B,"chrome-native-host"),Z=Q==="windows"?`@echo off
Error: Claude in Chrome Native Host not supported on this platform
at S19 (file:///home/natsuume/.asdf/installs/nodejs/24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2730:1487)
at file:///home/natsuume/.asdf/installs/nodejs/24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2730:937
Node.js v24.2.0
Steps to Reproduce
- Enable Claude in Chrome settings in PowerShell on Windows (run
claude --chromeif already set up) - Run
claudecommand in WSL2 environment - Error occurs: "Claude in Chrome Native Host not supported on this platform"
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.72
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Workaround:
Running claude --no-chrome in the WSL2 environment allows Claude Code to start normally.
Side effect of the workaround:
After using this workaround, launching Claude Code in PowerShell also requires explicitly specifying the --chrome flag to use the Claude in Chrome functionality. This makes the default behavior inconsistent across environments.
Environment details:
- Windows PowerShell on Windows
- WSL2 (Linux) with bash shell
- WSL2 is configured to use the Windows-installed Chrome browser
Observation:
After enabling Claude in Chrome in the Windows PowerShell environment, running claude in WSL2 consistently fails with the error:
"Claude in Chrome Native Host not supported on this platform".
Hypothesis:
After Claude in Chrome is enabled on Windows, Claude Code in WSL2 appears to detect Chrome integration as enabled.
This may be caused by either shared CLI configuration/state between Windows and WSL2, or by Claude Code detecting Chrome or extension-side state from the Windows environment.
The exact mechanism has not been confirmed.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗