Chrome extension native host crashes on Windows (Bun v1.3.5 panic)

Resolved 💬 5 comments Opened Jan 28, 2026 by fabiosuizu-betterbrain Closed Mar 9, 2026

Bug Description

The Chrome extension's native messaging host (claude.exe --chrome-native-host) consistently crashes with a Bun v1.3.5 internal assertion failure on Windows when it tries to process stdin messages. This makes the --chrome / Claude-in-Chrome feature completely non-functional on Windows.

Environment

  • Claude Code version: 2.1.21
  • Chrome extension version: 1.0.40
  • OS: Windows 11 (10.0.26200.7628)
  • Bun version (bundled): 1.3.5

Steps to Reproduce

  1. Install Claude Code v2.1.21 on Windows
  2. Install Chrome extension v1.0.40
  3. Start Claude Code with --chrome flag
  4. Call any claude-in-chrome MCP tool (e.g., tabs_context_mcp)

Minimal reproduction:

# Launch native host and send a ping (same as Chrome extension does)
node -e "
const {spawn} = require('child_process');
const proc = spawn('claude.exe', ['--chrome-native-host'], {stdio:['pipe','pipe','pipe']});
proc.stderr.on('data', d => console.log('stderr:', d.toString()));
proc.on('exit', c => console.log('exit:', c));
const msg = Buffer.from(JSON.stringify({type:'ping'}));
const len = Buffer.alloc(4);
len.writeUInt32LE(msg.length);
proc.stdin.write(Buffer.concat([len, msg]));
"

Expected Behavior

The native host should respond with {"type":"pong"} via stdout and maintain the connection for MCP communication.

Actual Behavior

The native host crashes immediately with exit code 3 (Bun panic):

[Claude Chrome Native Host] Initializing...
[Claude Chrome Native Host] Creating socket listener: \.\pipe\claude-mcp-browser-bridge-<username>

============================================================
Bun v1.3.5 (1e86cebd) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "claude.exe" "--chrome-native-host"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) jsc standalone_executable

panic(main thread): Internal assertion failure

oh no: Bun has crashed. This indicates a bug in Bun, not your code.

https://bun.report/1.3.5/e_11e86cebEugggC++08F+mvBoxhkf0389e__0shkwCA0eNrzzCtJLcpLzFFILC5OLSrJzM9TSEvMzCktSgUAiSkKPg

Crash is 100% reproducible — tested 5 consecutive times, all crashed with exit code 3.

Impact

  • The Chrome extension detects this as a disconnect (onDisconnect fires)
  • The MCP server reports "Browser extension is not connected"
  • All claude-in-chrome tools are completely non-functional on Windows
  • The named pipe (claude-mcp-browser-bridge-*) is created but non-functional — it responds with {"result":{"content":"Unknown method: ..."}} to all messages instead of forwarding to the extension

Root Cause Analysis

The Bun v1.3.5 runtime bundled with Claude Code v2.1.21 has an internal assertion failure when the native host process attempts to read from stdin. The crash trace points to a Bun-level bug in Windows stdio handling.

The full communication chain that fails:

Chrome extension → connectNative() → Chrome launches native host via cmd.exe
→ Extension sends {type:"ping"} → Chrome writes to native host stdin
→ Bun CRASHES on stdin read → native host exits with code 3
→ Extension receives onDisconnect → marks as "not connected"
→ MCP server cannot communicate → returns "Browser extension is not connected"

Bun Crash Report URL

https://bun.report/1.3.5/e_11e86cebEugggC++08F+mvBoxhkf0389e__0shkwCA0eNrzzCtJLcpLzFFILC5OLSrJzM9TSEvMzCktSgUAiSkKPg

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗