[BUG] --chrome-native-host crashes with Bun assertion failure on Windows (all versions)
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?
The claude.exe --chrome-native-host command crashes immediately on startup with a Bun internal assertion
failure on Windows. This prevents the Claude in Chrome browser automation feature from working entirely.
The crash occurs after the socket listener path is created but before any messages are processed.
### Versions Tested
| Claude Code | Bun Version | Result |
|-------------|-------------|--------|
| 2.1.37 | Bun Canary v1.3.9-canary.51 | Crash |
| 2.1.36 | Bun Canary v1.3.9-canary.51 | Crash |
| 2.1.30 | Bun v1.3.5 | Crash |
| 2.1.0 | Bun v1.3.5 | Crash |
| 2.0.0 | N/A | --chrome-native-host not supported |
### Analysis
The crash appears to be in Bun's stdin handling (Bun.stdin(2)) when used as a Windows standalone executable.
The native messaging host protocol requires reading length-prefixed binary messages from stdin (piped from
Chrome), and this triggers the Bun assertion failure.
Key observations:
- Crash happens regardless of whether Chrome is the caller or stdin is
/dev/null - Same crash across multiple Bun versions (1.3.5 and 1.3.9-canary.51)
- The named pipe path
\\.\pipe\claude-mcp-browser-bridge-<user>is created but never becomes functional - All native messaging host configuration is correct (registry, JSON manifest, bat file, extension permissions)
### Verified Configuration
- Registry:
HKCU\Software\Google\Chrome\NativeMessagingHosts\com.anthropic.claude_code_browser_extension→
points to correct JSON
- JSON manifest: correct
allowed_origins, correctpathto bat file - Bat file: correctly calls
claude.exe --chrome-native-host - Extension: enabled, correct ID, correct permissions including "Communicate with cooperating native
applications"
- No Chrome enterprise policies blocking native messaging
What Should Happen?
claude.exe --chrome-native-host should start, create the named pipe, and bridge Chrome native messaging to the
MCP browser server without crashing. The Claude in Chrome browser automation tools should connect successfully.
Error Messages/Logs
[Claude Chrome Native Host] Initializing...
[Claude Chrome Native Host] Creating socket listener: \\.\pipe\claude-mcp-browser-bridge-<user>
============================================================
Bun Canary v1.3.9-canary.51 (d5628db2) Windows x64 (baseline)
Windows v.win11_ge
CPU: sse42 avx avx2
Args: "C:\Users\<user>\.local\bin\claude.exe" "--chrome-native-host"
Features: Bun.stdin(2) jsc standalone_executable
Builtins: "bun:main" "node:buffer" "node:child_process" "node:crypto" "node:fs" ...
Elapsed: 92ms | User: 0ms | Sys: 15ms
RSS: 0.32GB | Peak: 0.32GB | Commit: 0.47GB | Faults: 78279 | Machine: 68.53GB
panic(main thread): Internal assertion failure
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Bun crash report: https://bun.report/1.3.9/e_2d5628dbEkgggC+s1oU+vvkOu8t/uBysi5uB__qt24tCA0eNrzzCtJLcpLzFFILC5OLS
rJzM9TSEvMzCktSgUAiSkKPg
Steps to Reproduce
Steps to Reproduce
- Install Claude Code on Windows (any version with Chrome support: 2.1.0+)
- Install the "Claude in Chrome" extension from Chrome Web Store (v1.0.47)
- Run directly:
"C:\Users\<user>\.local\bin\claude.exe" --chrome-native-host - Observe immediate crash with Bun assertion failure
Alternative reproduction:
- Start Claude Code with
claude --chrome - Attempt any
mcp__claude-in-chrome__*tool call - Get "Browser extension is not connected" error
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.37 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
- Windows 11 build 22631.6199
- Chrome extension service worker shows no errors (the native host crashes before Chrome can communicate with it)
- The "browser is managed by your organization" flag is present but only due to a single
LocalNetworkAccessAllowedForUrls policy — no native messaging restrictions
- Tested with both stdin from Chrome and from /dev/null — same crash
- Bun crash report URL: https://bun.report/1.3.9/e_2d5628dbEkgggC+s1oU+vvkOu8t/uBysi5uB__qt24tCA0eNrzzCtJLcpLzFFI
LC5OLSrJzM9TSEvMzCktSgUAiSkKPg
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗