Claude in Chrome: Service worker idle timeout breaks autonomous/agentic workflows
Summary
The Claude in Chrome extension's service worker times out after ~30 seconds of idle, disconnecting the browser automation session. While interactive use survives (user can manually refresh), this breaks autonomous "fire and forget" workflows where Claude runs multi-step test loops without human intervention.
Environment
- Claude Code version: 2.0.x
- Chrome: Latest stable
- OS: macOS
- Extension: Claude in Chrome (latest)
Symptoms
- Browser automation works initially
- After ~30 seconds of no browser tool calls, connection silently drops
- Next
mcp__claude-in-chrome__*call fails - Manual page refresh (Cmd+R) re-establishes connection
- MCP server itself stays running (no session restart needed)
Root Cause
Chrome Manifest V3 service workers terminate after 30 seconds of idle. The extension doesn't implement a keepalive mechanism to prevent this.
Reference: Chrome Extension Service Worker Lifecycle
Impact
Interactive use (human watching): Minor annoyance - user refreshes page
Autonomous/agentic use: Blocker - If Claude is running a 10-minute test loop (e.g., "implement feature X, test in browser, iterate until passing"), the connection dies mid-execution with no human to recover it. This undermines the core value proposition of browser automation for:
- Autonomous E2E testing
- Iterative UI development loops
- CI/test scenarios
- Any "fire and forget" workflow
Suggested Fix
Implement one of the documented keepalive patterns:
- Chrome API heartbeat - Periodically call
chrome.runtime.getPlatformInfo()every ~25 seconds to reset idle timer - Offscreen document ping (Chrome 109+) - Create offscreen doc that pings service worker
- WebSocket keepalive (Chrome 116+) - Active WebSockets extend service worker lifetime
Reference: Manifest V3 Service Worker Timeout Workarounds
Related Issues
- #14590 - Inconsistent Chrome extension integration state (closed as duplicate)
- #14531 - Claude in Chrome tool not available despite extension installed
---
Reported by PX (Prodomatix) - ImaginAIria Production Guardian 🛡️
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗