Chrome integration: native messaging stdin never receives data on Linux
Environment
- Claude Code version: 2.1.3
- Chrome extension version: 1.0.36
- OS: Ubuntu 24.04.3 LTS (Linux 6.8.0-90-generic)
- Chrome version: 143.0.7499.169
- Node.js: v24.3.0
Problem
The Claude in Chrome integration fails to connect. The Chrome extension reports "Native host has exited" immediately after calling connectNative().
Root Cause Investigation
After extensive debugging, I found that the native host never receives any data on stdin from Chrome, even though the connection is established:
- Native host starts correctly
- Socket
/tmp/claude-mcp-browser-bridge-mis created and listening - MCP clients can connect to the socket and send messages
- Native host attempts to forward messages to Chrome via stdout
- Chrome extension's
postMessage()never reaches the native host's stdin
Evidence
strace shows no stdin (fd 0) reads:
grep "read(0," /tmp/native-host-strace.log
# Returns empty - no reads from stdin ever occur
Native host log shows it starts but never receives ping:
[Claude Chrome Native Host] Initializing...
[Claude Chrome Native Host] Creating socket listener: /tmp/claude-mcp-browser-bridge-m
[Claude Chrome Native Host] Socket server listening for connections
[Claude Chrome Native Host] Socket permissions set to 0600
# No "Handling Chrome message type: ping" ever appears
Chrome extension console shows immediate disconnect:
chrome.runtime.connectNative("com.anthropic.claude_code_browser_extension")
// Returns Port object, then:
// Unchecked runtime.lastError: Native host has exited.
Native messaging host config is correct:
{
"name": "com.anthropic.claude_code_browser_extension",
"description": "Claude Code Browser Extension Native Host",
"path": "/home/user/.claude/chrome/chrome-native-host",
"type": "stdio",
"allowed_origins": ["chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"]
}
Manual testing confirms native host works:
When I manually send a properly-formatted native messaging ping to the native host, it responds correctly:
# 4-byte little-endian length prefix + JSON
printf '\x0f\x00\x00\x00{"type":"ping"}' | /home/user/.claude/chrome/chrome-native-host
# Output: pong response with timestamp
Expected Behavior
The Chrome extension should send {type:"ping"} via native messaging, receive {type:"pong"}, and maintain the connection for MCP communication.
Actual Behavior
The native host starts, creates the socket, but Chrome never sends any data to stdin. The native host eventually exits because stdin receives EOF without any messages.
Workarounds Attempted
- Restarting Chrome
- Reinstalling native messaging host config
- Killing all existing native host processes
- Verifying extension permissions (nativeMessaging is granted)
None resolved the issue.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗