claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[FEATURE] Support targeting specific Chrome instances/profiles for Claude in Chrome integration

Open johnhenry opened this issue 2 weeks ago • 0 comments

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When running multiple Chrome instances (either separate windows or separate Chrome profiles), Claude Code’s --chrome integration has no mechanism to specify which instance to target. The Native Messaging API connects to whichever Chrome process responds first, leading to unpredictable behavior. This is problematic for developers who: ∙ Use separate Chrome profiles for work vs personal browsing ∙ Run multiple Chrome instances to test different authenticated sessions ∙ Want deterministic, reproducible browser automation in their workflows

Proposed Solution

Add a mechanism to target a specific Chrome instance or profile. Options could include: 1. Extension-displayed instance ID: The Claude in Chrome extension displays a unique instance ID in its panel (e.g., Instance: abc123). Users pass this ID to the CLI: claude --chrome-instance=abc123. This makes targeting explicit and user-friendly—you see the ID in the browser you want to control, then reference it from the terminal. 2. Profile flag: claude --chrome --chrome-profile="Profile 1" to target a named Chrome profile 3. Port-based targeting: Support connecting to Chrome instances launched with --remote-debugging-port via a flag like --chrome-debug-port=9222 4. Config option: Add chromeProfile, chromeDebugPort, or chromeInstanceId to settings.json for persistent configuration 5. Interactive selection: When multiple Chrome instances are detected, prompt the user to select one (similar to how /chrome shows connection status)

Alternative Solutions

Expose the chrome instance selection via /chrome slash command interactively

Priority

High - Significant impact on productivity

Feature Category

API and model interactions

Use Case Example

Target a specific Chrome instance using the ID displayed in the extension panel

claude --chrome --chrome-instance=abc123

Or target a specific Chrome profile

claude --chrome --chrome-profile="Work"

Or target a Chrome instance with remote debugging enabled

claude --chrome --chrome-debug-port=9222

A developer testing an authenticated flow might have: ∙ Chrome Profile A: logged into staging environment ∙ Chrome Profile B: logged into production environment They need Claude Code to reliably interact with the staging profile without affecting their production session.

Additional Context

Related issues: ∙ #14370 covers detection in Chromium-based browsers (adjacent concern) ∙ #14391 covers native messaging host installation for non-Chrome browsers The underlying Native Messaging architecture doesn’t inherently support instance targeting, so this may require either: ∙ Enumerating running Chrome processes and their profiles ∙ Falling back to Chrome DevTools Protocol for targeted connections ∙ Documenting the --user-data-dir + --remote-debugging-port pattern as a workaround

johnhenry avatar Dec 23 '25 06:12 johnhenry