Chrome extension device name set via "switch_browser" (Connect flow) doesn't persist in `list_connected_browsers`
Bug: Chrome extension device name set via "switch_browser" (Connect flow) doesn't persist in list_connected_browsers
Summary
Naming a Chrome device during the "confirm in browser" pairing flow appears to only apply to the
current session's binding, not to the account-level device registry. A brand new session callinglist_connected_browsers right after still sees the device under its old generic name
(Browser 1/Browser 2/Browser 3), not the name just given it — so the rename never "sticks" for
future sessions.
Environment
- Claude Code CLI, macOS
- Chrome extension: Claude in Chrome, single Chrome profile, one machine with 3 connected browser
entries showing (2 believed to be stale/duplicate registrations from past reconnects)
Steps to reproduce
- In a session, call
list_connected_browsers— note the entries and their generic names
(Browser 1, Browser 2, Browser 3), all with isLocal: true.
- Call
switch_browser(the "open a confirmation screen in every connected Chrome extension" flow). - In the actual Chrome browser on the target machine, click "Connect" and give the device a custom
name (e.g. "MY-MACHINE") when prompted.
- Tool reports success:
Connected to browser "MY-MACHINE". - Immediately call
list_connected_browsersagain (same session, or ideally a fresh session).
Expected
The device entry that was just connected/named should show the new name (MY-MACHINE) inlist_connected_browsers, so a future session (including an unattended/scheduled one with no human
available to click "Connect") can reliably select it by name.
Actual
list_connected_browsers returns the exact same list as step 1 — same 3 devices, same generic
names (Browser 1/2/3), same deviceIds, same connectedAt timestamps. The rename from step 3
is not reflected anywhere in that account-level list, even though the connect/bind itself clearly
worked (the session's browser tools correctly operate on the intended Chrome — confirmed via
existing open tabs matching what was expected).
Why this matters
For any workflow that depends on repeatedly/reliably identifying "this machine's browser" across
independent sessions (e.g. scheduled/cron-triggered Claude Code runs with no human present to
disambiguate), a persistent, reliable device name is the only mechanism available — isLocal is not
trustworthy (observed true on every entry, including ones later confirmed to be stale/other-machine
registrations). If naming never persists past the session that set it, there's no way for an
unattended run to safely pick the right browser once more than one device is registered — which
happens easily over time as the extension reconnects (sleep/wake, network drop, extension
reload/update, Chrome restart) and appears to mint a brand-new device entry each time rather than
reusing/updating an existing one.
What we'd expect instead
- Either the name set during the Connect-flow pairing should persist to the account-level device
registry and be visible to list_connected_browsers in later sessions, or
- there should be some other durable, human-assignable identifier for a given browser install that
survives reconnects, so unattended sessions can target a specific machine reliably without a human
needing to click "Connect" every single time.
Happy to provide more repro detail/logs if useful.
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
Hitting this too, on a different setup — two separate Macs, one Chrome profile each, rather than one machine with stale registrations. Same result: named both via the Connect flow,
switch_browserconfirmsConnected to browser "MacBookProM2", andlist_connected_browsersin the same session still returnsBrowser 1/Browser 2. Verified twice, hours apart.Two things that might help whoever picks this up:
deviceIdis stable, so it's a usable workaround. The same two UUIDs survived reconnects and a full working day. Selecting by deviceId avoids the pairing dance entirely — the catch is you need to know which is which first.Identifying them without the dance: serve a random token on
127.0.0.1bound to loopback, thenselect_browsereach candidate and navigate to it. The browser that reads the token is on this machine; the other getsERR_CONNECTION_REFUSED. That's how I built a machine→deviceId map once and stopped being asked.Why it costs more than it looks: the "you must ask the user which browser" mandate is attached to
list_connected_browsers' output, so any session that calls it inherits the prompt. Skipping that call and going straight toselect_browseris what actually removes the interruption. With the name working, none of this would be necessary.Following up with a couple more data points from today, on a single Mac with 4 stale/duplicate device registrations (same setup pattern as the original report).
Confirms the original repro exactly:
switch_browser→ clicked Connect in Chrome, named the device "SJ AGENT" → tool reportedConnected to browser "SJ AGENT". Immediately calledlist_connected_browsersin the same session — same 4 devices, same generic names (Browser 1-4), same deviceIds, sameconnectedAttimestamps as before the rename. No trace of the new name anywhere in that response.One clarifying detail that might help narrow down where the bug actually is: the human doing the naming (not the agent) reports that from inside Chrome itself — the extension's own local UI — the name he set does appear to be showing/retained. So the write looks like it succeeds locally on the device, but never gets reflected back to (or read from) the account-level device registry that
list_connected_browsersqueries. That reads more like a sync/propagation gap between local extension state and the account-level API than a rename that fails outright.Tried @Zachzeller37's loopback-server suggestion — it doesn't work through the Claude-in-Chrome tools, but not because of anything about which machine is connected. Ran a plain
python3 -m http.serveron127.0.0.1, confirmed reachable viacurlfrom the same machine's own shell, then had the connected browser navigate to it — both in an existing tab and a brand-new tab. Both times the navigation silently reverted (back to the prior page, or tochrome://newtab/for the fresh tab) instead of showing the token, an error page, or anything else — thecomputertool even refused to screenshot it ("Can't interact with browser-internal or unparseable URLs"). The same tab loaded a normalhttps://site immediately afterward with no issue. This looks like the extension itself silently blocks/reverts navigation to loopback addresses (a reasonable SSRF-style guard on its own), which means it can't be used as a same-machine identity check as suggested — worth flagging so nobody else spends time on that exact approach as a workaround.deviceIdstability itself still holds up as the one reliable fact here (matches what's already been reported) — just still no safe way to map a deviceId to "this machine" without a human clicking Connect once.Reproduced on Windows 11 / Edge (single Edge install, single profile, one Claude extension installed —
fcoeoabgfenejglbffodgkkbkcdhcgfn), so this isn't macOS- or Chrome-specific. Same core result as the original report:switch_browserreturnedSelected browser "Extension Claude", and the very nextlist_connected_browserscall showedBrowser 1/Browser 2with no trace of the name.Two details differ from the original report, and I think they point somewhere slightly different than "stale cache":
1. The
connectedAttimestamps did refresh. The original notes "sameconnectedAttimestamps" after the connect flow. Here both entries updated — to within 38 ms of each other:Both entries responding to a single broadcast suggests both registrations are live, not that one is a leftover the list is caching.
2. The labels are positional, not identity-bound. Note the swap above:
9c906f95was "Browser 1" before and "Browser 2" after, withe72768aetaking the other slot — no action taken on either between those calls other than the broadcast. They appear to be assigned ordinally (most-recently-connected first) at list time rather than stored per device. That would explain why a user-set name has nowhere to live, and it also means a label is unsafe to act on even when one looks real — a session that recorded "Browser 1" from a previous run could act on the wrong device after any reconnect.Practical note for anyone hitting this meanwhile:
switch_browserstill works as a workaround, but not because it names anything — it routes on the user's physical click inside the browser, so it's label-independent. It does require a human at the keyboard, which doesn't help the unattended/scheduled case the original report raises.