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:
- A way to target a specific named browser in
--chrome mode (e.g., --chrome-browser "n100")
- Or auto-prefer the local machine's Chrome over remote ones
- 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.
Description
When running
claude --chromeon 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
--chromefor automated token renewal via systemd timerBehavior
claude --chromeconnects to whichever Chrome extension responds firstswitch_browserexists but requires manual user interaction (clicking "Connect"), making it unsuitable for unattended/automated useWorkaround
Added a
navigator.platformcheck 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:
--chromemode (e.g.,--chrome-browser "n100")switch_browserthat can specify a target by nameThis would make
--chromereliable for unattended automation on multi-machine setups.