claude-code - 💡(How to fix) Fix claude-in-chrome tools stay disconnected after Claude Desktop uninstall, even with healthy native host [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#46447Fetched 2026-04-11 06:20:02
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

After having both Claude Desktop app and Claude Code CLI installed (both registered Chrome native messaging hosts whitelisting the same extension), uninstalling the Desktop app and cleaning up its stale registration leaves Claude Code CLI unable to connect to the Chrome extension, even though:

  • The correct CLI native host binary is running and listening on its socket
  • /mcp reports "Reconnected to claude-in-chrome" on each invocation
  • The Chrome extension is installed, running, and has no errors in its service worker

All mcp__claude-in-chrome__* tool calls return: Browser extension is not connected. Please ensure the Claude browser extension is installed and running...

Root Cause

Probable root causes (hypothesis)

Fix Action

Workaround

None found. The user cannot use mcp__claude-in-chrome__* tools in this state. Manually filling out web forms (the user's actual use case) becomes the only option.

Code Example

Spencer  30300  /Users/Spencer/.local/share/claude/versions/2.1.101 --chrome-native-host

---

$ ls -la /tmp/claude-mcp-browser-bridge-Spencer/
srw------- 1 Spencer wheel 0 Apr 10 16:27 30300.sock

$ lsof -U | grep claude-mcp-browser
2.1.101  30300 Spencer 4u unix 0x2fe55ca9efce4386 0t0 /tmp/claude-mcp-browser-bridge-Spencer/30300.sock

---

$ lsof -p 30733 | grep unix
2.1.101 30733 Spencer 10u unix 0x86fb3a3a1f2695d ->0xaa8e9767b44134e
2.1.101 30733 Spencer 15u unix 0xe703c1407595f04 ->0xbb71fcceeb8faa8f
2.1.101 30733 Spencer 17u unix 0x24b1cd9c3fc418b1 ->0xbc326801f15416f8
2.1.101 30733 Spencer 18u unix 0x4ceac7d720299d15 ->0x1861eae52c6ce846
2.1.101 30733 Spencer 19u unix 0x83c0a58246c40f44 ->0x50bf1a12c3715e7f
2.1.101 30733 Spencer 20u unix 0xc1a2438a5542d20e ->0x7cbf2877bc9444d0
2.1.101 30733 Spencer 22u unix 0x8600ac6864729481 ->0x4e4aa53d6df8c9f4
2.1.101 30733 Spencer 31u unix 0xcbc980a843931596 ->0xf20cb3ce36bc0ee0

---

$ claude mcp list
context7: npx -y @upstash/context7-mcp -Connected
token-counter: npx -y token-counter-mcp -Connected
dual-graph: http://localhost:8080/mcp (HTTP) -Failed to connect

$ claude mcp get claude-in-chrome
No MCP server found with name: claude-in-chrome
RAW_BUFFERClick to expand / collapse

Summary

After having both Claude Desktop app and Claude Code CLI installed (both registered Chrome native messaging hosts whitelisting the same extension), uninstalling the Desktop app and cleaning up its stale registration leaves Claude Code CLI unable to connect to the Chrome extension, even though:

  • The correct CLI native host binary is running and listening on its socket
  • /mcp reports "Reconnected to claude-in-chrome" on each invocation
  • The Chrome extension is installed, running, and has no errors in its service worker

All mcp__claude-in-chrome__* tool calls return: Browser extension is not connected. Please ensure the Claude browser extension is installed and running...

Environment

  • Claude Code version: 2.1.101
  • macOS: Darwin 25.3.0 (arm64)
  • Chrome extension: Claude for Chrome, ID fcoeoabgfenejglbffodgkkbkcdhcgfn
  • Previously installed: Claude Desktop app (since uninstalled)

Reproduction

  1. Install Claude Code CLI and Claude Desktop app on the same machine
  2. Install the Claude for Chrome extension and pair with Claude Desktop
  3. Observe both native host JSON files present:
    • ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json → points to CLI binary
    • ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json → points to /Applications/Claude.app/Contents/Helpers/chrome-native-host
  4. Both files whitelist the same extension ID
  5. The extension spawns the Desktop app's native host (com.anthropic.claude_browser_extension), not the CLI's
  6. Inside Claude Code CLI (claude --chrome), any mcp__claude-in-chrome__* tool call fails with "extension not connected"
  7. Uninstall Claude Desktop app (drag /Applications/Claude.app to Trash)
  8. Observe: com.anthropic.claude_browser_extension.json is NOT removed by uninstall; orphan Desktop native host process still running
  9. Manually remove stale JSON and kill orphan process
  10. Restart Chrome → fresh CLI native host spawns correctly at /Users/$USER/.claude/chrome/chrome-native-host2.1.101 --chrome-native-host
  11. Socket is created at /tmp/claude-mcp-browser-bridge-$USER/<pid>.sock
  12. Run /mcp in Claude Code CLI → reports "Reconnected to claude-in-chrome"
  13. Bug: mcp__claude-in-chrome__tabs_context_mcp still returns "extension not connected"
  14. Starting a fresh Claude Code session (claude --chrome --continue) does not fix it

Diagnostic evidence

Native host process is healthy and correct:

Spencer  30300  /Users/Spencer/.local/share/claude/versions/2.1.101 --chrome-native-host

Socket exists and the native host is listening as server:

$ ls -la /tmp/claude-mcp-browser-bridge-Spencer/
srw------- 1 Spencer wheel 0 Apr 10 16:27 30300.sock

$ lsof -U | grep claude-mcp-browser
2.1.101  30300 Spencer 4u unix 0x2fe55ca9efce4386 0t0 /tmp/claude-mcp-browser-bridge-Spencer/30300.sock

Claude Code CLI session has 8 open unix sockets, none matching the native host's kernel address:

$ lsof -p 30733 | grep unix
2.1.101 30733 Spencer 10u unix 0x86fb3a3a1f2695d ->0xaa8e9767b44134e
2.1.101 30733 Spencer 15u unix 0xe703c1407595f04 ->0xbb71fcceeb8faa8f
2.1.101 30733 Spencer 17u unix 0x24b1cd9c3fc418b1 ->0xbc326801f15416f8
2.1.101 30733 Spencer 18u unix 0x4ceac7d720299d15 ->0x1861eae52c6ce846
2.1.101 30733 Spencer 19u unix 0x83c0a58246c40f44 ->0x50bf1a12c3715e7f
2.1.101 30733 Spencer 20u unix 0xc1a2438a5542d20e ->0x7cbf2877bc9444d0
2.1.101 30733 Spencer 22u unix 0x8600ac6864729481 ->0x4e4aa53d6df8c9f4
2.1.101 30733 Spencer 31u unix 0xcbc980a843931596 ->0xf20cb3ce36bc0ee0

None of the peer addresses match 0x2fe55ca9efce4386 (the native host's listening socket).

claude-in-chrome is not a registered stdio MCP server:

$ claude mcp list
context7: npx -y @upstash/context7-mcp - ✓ Connected
token-counter: npx -y token-counter-mcp - ✓ Connected
dual-graph: http://localhost:8080/mcp (HTTP) - ✗ Failed to connect

$ claude mcp get claude-in-chrome
No MCP server found with name: claude-in-chrome

So claude-in-chrome appears to be a built-in integration module, not a managed MCP subprocess, which means /mcp reconnect cannot restart it as a child process.

Chrome extension service worker shows no errors. Extension ID matches the allowed_origins field in com.anthropic.claude_code_browser_extension.json.

Expected behaviour

After the Desktop app is uninstalled and stale config files are removed, Claude Code CLI's built-in Chrome integration should connect to the fresh native host socket that Chrome is spawning, without requiring any additional user action beyond restarting Chrome and/or running /mcp.

Actual behaviour

The CLI side remains permanently "disconnected" from the native host, even though both sides are alive and the Chrome native host is running the correct CLI binary. /mcp reports success but no actual kernel-level socket connection is established.

Probable root causes (hypothesis)

  1. Uninstall cleanup gap: The Claude Desktop uninstaller does not remove com.anthropic.claude_browser_extension.json or kill in-flight native host processes, leaving stale state that confuses the Chrome extension's backend selection.
  2. Discovery / reconnect gap in the built-in chrome integration: The CLI's built-in Chrome integration module appears to cache a "disconnected" state at session startup and does not re-scan for new native host sockets when /mcp is invoked, even though it reports reconnection success.
  3. Silent backend selection inside the extension: The Chrome extension supports both com.anthropic.claude_browser_extension (Desktop) and com.anthropic.claude_code_browser_extension (CLI) but provides no user-visible toggle to switch between them.

Suggested fixes

  1. Claude Desktop uninstaller should remove ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json and terminate any running chrome-native-host processes owned by the Desktop app
  2. /mcp should force the built-in claude-in-chrome integration to re-scan /tmp/claude-mcp-browser-bridge-$USER/ and re-establish the kernel-level socket connection, not just report success
  3. The Chrome extension should expose a settings UI to explicitly select "Claude Code" vs "Claude Desktop" as the backend, instead of silently picking one

Workaround

None found. The user cannot use mcp__claude-in-chrome__* tools in this state. Manually filling out web forms (the user's actual use case) becomes the only option.

extent analysis

TL;DR

The most likely fix involves modifying the Claude Desktop uninstaller to remove stale configuration files and terminate orphaned processes, and enhancing the /mcp command to force the claude-in-chrome integration to re-establish the kernel-level socket connection.

Guidance

  1. Modify the Claude Desktop uninstaller: Ensure it removes ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.anthropic.claude_browser_extension.json and terminates any running chrome-native-host processes owned by the Desktop app to prevent stale state.
  2. Enhance the /mcp command: Update the /mcp command to force the built-in claude-in-chrome integration to re-scan for new native host sockets and re-establish the kernel-level socket connection, rather than just reporting success.
  3. Expose backend selection in the Chrome extension: Consider adding a settings UI to the Chrome extension to allow users to explicitly select between "Claude Code" and "Claude Desktop" as the backend, improving user control and reducing silent failures.
  4. Verify socket connections: After applying fixes, verify that the kernel-level socket connection is established correctly by checking the socket existence and the native host process status.

Example

No specific code snippet is provided due to the complexity and specificity of the issue, but the enhancements to the /mcp command and the Chrome extension's backend selection would be critical steps in resolving the disconnect issue.

Notes

The provided guidance focuses on the hypothesized root causes and suggested fixes. Actual implementation details may vary based on the internal workings of the Claude Code CLI, the Chrome extension, and the native messaging host protocols.

Recommendation

Apply the suggested fixes, particularly modifying the uninstaller and enhancing the /mcp command, as these address the probable root causes of the issue. This approach should help in establishing a stable connection between the Claude Code CLI and the Chrome extension after the Desktop app is uninstalled.

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