Skip to content

Claude --chrome connects to wrong browser when multiple Chrome instances on LAN #25551

Description

@wstock

Description

When running claude --chrome on a machine with multiple Chrome instances on the same LAN (each with the Claude extension installed), the connection can go to the wrong browser. There's no way to specify which Chrome instance to connect to.

Environment

  • Ubuntu host (n100) running Claude Code with --chrome for automated token renewal via systemd timer
  • Windows gaming PC (BIGRIG) on the same LAN, also running Chrome with the Claude extension
  • Both machines logged into the same claude.ai account

Behavior

  • claude --chrome connects to whichever Chrome extension responds first
  • The automated renewal script on the Ubuntu host connected to BIGRIG's Chrome instead of the local one
  • switch_browser exists but requires manual user interaction (clicking "Connect"), making it unsuitable for unattended/automated use
  • No way to specify a target browser by name, hostname, or ID programmatically

Workaround

Added a navigator.platform check after connecting to detect if the browser is on the expected OS (Linux vs Win32) and log a warning. The OAuth flow works regardless of which browser handles it, so we proceed with a warning rather than failing.

Feature Request

It would be useful to have:

  1. A way to target a specific named browser in --chrome mode (e.g., --chrome-browser "n100")
  2. Or auto-prefer the local machine's Chrome over remote ones
  3. Or a non-interactive switch_browser that can specify a target by name

This would make --chrome reliable for unattended automation on multi-machine setups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestplatform:linuxIssue specifically occurs on LinuxstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions