claude-code - 💡(How to fix) Fix [BUG] claude-in-chrome: socket protocol endianness mismatch on Linux/WSL — "Invalid message length" on connect

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Code Example

Chrome stdout logs (captured via nohup google-chrome > /tmp/chrome.log 2>&1):

  [Claude Chrome Native Host] Initializing...
  [Claude Chrome Native Host] Creating socket listener: /tmp/claude-mcp-browser-bridge-<user>/<pid>.sock
  [Claude Chrome Native Host] Socket server listening for connections
  [Claude Chrome Native Host] Handling Chrome message type: ping
  [Claude Chrome Native Host] Responding to ping
  [Claude Chrome Native Host] Handling Chrome message type: get_status
  [Claude Chrome Native Host] MCP client 1 connected. Total clients: 1
  [Claude Chrome Native Host] Invalid message length from MCP client 1: 268435456
  [Claude Chrome Native Host] MCP client 1 disconnected. Remaining clients: 0

Analysis: 268435456 = 0x10000000. A 16-byte message sent as little-endian (\x10\x00\x00\x00) read as big-endian yields exactly 0x10000000. This is an endianness mismatch in the Unix socket protocol between the Claude Code MCP client and the native host on Linux.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

claude-in-chrome doesn't work on Linux/WSL2. The MCP client connects to the native host Unix socket but is immediately rejected due to an endianness mismatch in the message length framing. The extension always shows "Browser extension is not connected"

What Should Happen?

tabs_context_mcp (and all mcp__claude-in-chrome__* tools) should successfully connect to the Chrome extension running in Linux Chrome (WSLg) and return the list of open tabs.

Error Messages/Logs

Chrome stdout logs (captured via nohup google-chrome > /tmp/chrome.log 2>&1):

  [Claude Chrome Native Host] Initializing...
  [Claude Chrome Native Host] Creating socket listener: /tmp/claude-mcp-browser-bridge-<user>/<pid>.sock
  [Claude Chrome Native Host] Socket server listening for connections
  [Claude Chrome Native Host] Handling Chrome message type: ping
  [Claude Chrome Native Host] Responding to ping
  [Claude Chrome Native Host] Handling Chrome message type: get_status
  [Claude Chrome Native Host] MCP client 1 connected. Total clients: 1
  [Claude Chrome Native Host] Invalid message length from MCP client 1: 268435456
  [Claude Chrome Native Host] MCP client 1 disconnected. Remaining clients: 0

Analysis: 268435456 = 0x10000000. A 16-byte message sent as little-endian (\x10\x00\x00\x00) read as big-endian yields exactly 0x10000000. This is an endianness mismatch in the Unix socket protocol between the Claude Code MCP client and the native host on Linux.

Steps to Reproduce

  1. Install Claude Code on WSL2 (Ubuntu 24.04)
  2. Launch Linux Chrome via WSLg: nohup google-chrome > /tmp/chrome.log 2>&1 &
  3. Install the Claude browser extension (fcoeoabgfenejglbffodgkkbkcdhcgfn), log in with the same account as Claude Code
  4. Verify native messaging host is configured: cat ~/.config/google-chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json
  5. Start Claude Code: claude --dangerously-skip-permissions
  6. Call mcp__claude-in-chrome__tabs_context_mcp → returns Browser extension is not connected
  7. Check grep "Invalid|MCP client" /tmp/chrome.log → see Invalid message length from MCP client 1: 268435456

Environment: Claude Code 2.1.145, Chrome 147.0.7727.101, Ubuntu 24.04 on WSL2/Windows 11

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.1.145

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING