Expand description
Numbers for accounts that share a provider and an email
(docs/specs/SPEC_ACCOUNT_SWITCH_FROM_THE_COMPOSER_NO_BIND_2026_10_26.md §3.3).
Two Claude sign-ins of one address both show user@example.com. Each gets a
number, kept in context.seq and never reused, so ·2 stays ·2 when
·1 is deleted and across restarts. The number shows only while two or more
accounts share the key; a lone account shows its bare name.
Structs§
- Numbering
Update - One account’s numbering to write: its number (
None: it keeps the one it has) and the highest number its group has handed out.
Functions§
- carry_
over - An account is written again with a
contextthat doesn’t carry what the stored one had: a re-login that rebuilds it as{ "email": .. }, or a client holding a copy from before numbering. Keep the stored number when the new context has none and names the same address (or none: the email backfill settles that on the next list, and drops the number if it really changed). - names
- Whether
wanted(an id, name, display name, email, oremail ·N) namesa. A bare email that more than one account inallcarries names none of them: the caller reports the candidates instead of taking the first. - numbered_
label a’s name for a person:labelwith·Nafter it while another account shares its provider and email.allis every account that could be shown beside it.- numbering_
updates - The numbering to write. Each account with an email and no number gets the
group’s highest number ever handed out plus one, oldest first (creation time,
then id), so an existing group is numbered in the order its accounts were made.
“Ever”: every member records the group’s high-water mark (
seqmax), so deleting the account that held the highest number doesn’t free it for the next sign-in. - same_
email - Whether two emails are the same group’s: equal ignoring case and padding.