Claude in Chrome: extension permanently disconnects after screenshot/scroll operations
Description
The Claude in Chrome browser extension frequently loses its connection during screenshot and scroll operations, entering an unrecoverable state that requires a full Chrome restart.
Environment
- OS: macOS (Darwin 25.1.0, Apple Silicon)
- Chrome: Latest stable
- Claude Code: Latest (installed via Homebrew)
- Node: v25.6.1 (native host runtime)
Steps to Reproduce
- Start a browser automation session via
tabs_context_mcp - Navigate to a page (
navigatetool) — works fine - Take a screenshot (
computertool, action:screenshot) — usually works - Scroll the page (
computertool, action:scroll) - Take another screenshot immediately after
Result: "Browser extension is not connected" or "Error capturing screenshot: Detached while handling command."
The extension then enters an infinite exponential backoff reconnection loop (100+ attempts over ~2.5 hours) and never recovers. Only a full Chrome restart resolves the issue.
Log Evidence
From ~/.claude/logs/:
1. Timeout triggers the disconnect
[WARN] [Claude in Chrome] Tool call timeout: computer (1c991a7a) after 120000ms, pending calls: 0
2. Delayed response arrives to dead context
[DEBUG] [Claude in Chrome] Bridge received: {"type":"tool_result","tool_use_id":"1c991a7a-...","content":"Error capturing screenshot: Detached while handling command.","is_error":true}
[Claude in Chrome] Received tool_result for unknown call: 1c991a7a
3. Infinite reconnection loop (never recovers)
[INFO] [Claude in Chrome] Bridge reconnecting in 2000ms (attempt 1)
[INFO] [Claude in Chrome] Bridge reconnecting in 15188ms (attempt 6)
...
[INFO] [Claude in Chrome] Bridge reconnecting in 30000ms (attempt 100)
Operation Timing Analysis
| Operation | Avg Time | Reliability |
|-----------|----------|-------------|
| tabs_context_mcp | ~50ms | Always works |
| navigate | ~350ms | Always works |
| 1st screenshot | ~2-5s | Usually works |
| scroll + screenshot | ~20s+ | Frequently disconnects |
Root Cause Analysis
- CDP connection fragility: The Chromium DevTools Protocol connection drops during slow operations (screenshots are ~20s)
- No graceful recovery: Once the CDP session detaches, there is no mechanism to re-establish it
- Orphaned tool calls: Timed-out calls leave no cleanup, and late responses arrive to dead contexts
- Exponential backoff never succeeds: The reconnection strategy maxes out at 30s intervals but never actually reconnects — only a Chrome restart works
Configuration
~/.claude/.mcp.jsonhas emptymcpServers: {}— no timeout or keepalive settings available- Native host script (
~/.claude/chrome/chrome-native-host) is a simpleexec nodewrapper with no error handling
Suggested Improvements
- CDP session recovery: Detect CDP detachment and re-establish the debugging session without requiring Chrome restart
- Reconnection cap: After N failed attempts, surface a clear error to the user instead of silent infinite retry
- Operation-specific timeouts: Screenshots need longer timeouts than navigation; consider per-operation timeout configuration
- Keepalive mechanism: Periodic health check pings on the CDP connection to detect disconnects early
- Serialized screenshot queue: Prevent overlapping screenshot operations that can race-condition the CDP session
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗