claude-in-chrome: first tool call in a session reports "extension is not connected" — discovery waits only 1 ms for peer_connected

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 0 comments · opened Aug 6, 2026

Description

The first claude-in-chrome tool call in a new session frequently returns "Browser extension is not connected", even though the extension is installed, paired, signed into the right account, and connected. A retry a few seconds later succeeds with no user action.

The cause is a 1 ms wait in the bridge discovery path.

Root cause

In discoverAndSelectExtension() (claude-code 2.1.220):

  1. queryBridgeExtensions() sends list_extensions over the WebSocket bridge and waits up to 5000 ms for the reply.
  2. If the reply is an empty list, the code waits for a peer_connected event before giving up. That wait is DKt, and DKt = 1 — one millisecond.
  3. It then sets discoveryComplete = true with no selectedDeviceId. The next callTool throws No Chrome extension connected after discovery, which surfaces as the "Browser extension is not connected" text.

Later, when the extension registers with the bridge, the peer_connected handler resets discoveryComplete = false. The next tool call re-runs discovery and succeeds.

So the retry always works, and the first call always loses whenever the extension is not already registered at that exact instant. Chrome suspends an idle MV3 extension service worker, so "not already registered" is the common case at the start of a session.

Steps to reproduce

  1. Pair the Chrome extension. Confirm list_connected_browsers returns the browser.
  2. Leave Chrome idle long enough for the extension service worker to suspend.
  3. Start a new Claude Code session.
  4. Call mcp__claude-in-chrome__tabs_context_mcp as the first browser tool call.

Expected behavior

Discovery waits a few seconds for peer_connected before it reports the extension as disconnected.

Actual behavior

Discovery waits 1 ms. The first call returns:

Browser extension is not connected. Please ensure the Claude browser extension is installed and running (https://claude.ai/chrome), and that you are logged into claude.ai with the same account as Claude Code. ...

An immediate retry returns the browser normally.

Impact

The error text points the user at installation, account mismatch, and restarting Chrome. None of those is the problem. Users spend time on a setup that is already correct. Several open issues describe the same symptom and may share this cause: #83645, #70515, #84055.

Suggested fix

Raise the peer_connected grace window from 1 ms to a few seconds. A retry loop around the empty list_extensions result would also work.

Environment

  • claude-code 2.1.220 (native installer, Homebrew cask)
  • macOS 13.7.8, x86_64
  • Chrome extension fcoeoabgfenejglbffodgkkbkcdhcgfn, paired, isLocal: true
  • Bridge: wss://bridge.claudeusercontent.com

Note: the constant names above come from the minified bundle, so they will differ in source.

View original on GitHub ↗