Expand description
The login email of an OAuth provider account, read from the account’s own
config dir — SPEC_ACCOUNT_EMAIL_IN_ARMORY_2026_09_23.md §4.
#3541 recorded the email only when the login transcript printed one, and
Claude’s login does not, so every Claude account showed its generic name
(claude-oauth). The CLI does record who is signed in: Claude writes
oauthAccount.emailAddress to .claude.json inside the config dir the
account’s SecretRef::OAuthConfigDir points at. Reading it there covers
accounts that authenticated before #3541 (the backfill) and follows a
re-login as a different user.
Functions§
- email_
from_ oauth_ dir - The email the provider CLI recorded in
dir, if any. Only Claude writes one today (claude, or itsclaude-codealias); other providers returnNoneand keep showing their name. The ambient~/.claudeis skipped: a legacy account bound there shares credentials with a terminalclaude, whose own config (~/.claude.json) is outside it, so the.claude.jsoninside may name a user no longer signed in. - identity_
key_ from_ oauth_ dir - The Anthropic identity a Claude config dir is signed in as: a short hash
of
oauthAccount.accountUuidandoauthAccount.organizationUuid(SPEC_RESUME_GATE_AND_SAME_IDENTITY_CONTINUATION_2026_09_25.md §4.1). Not the email: one email can belong to several organizations, a personal one and a Team one, and a session from one isn’t the other’s. Hashed because it goes into a log every srv on the host shares.Noneon the same terms asemail_from_oauth_dir, or when either id is missing. - oauth_
account 🔒 oauthAccountfrom the.claude.jsonClaude writes intodir.- refresh_
account_ email - Set
account.context.emailfrom its config dir when that differs from what is stored, and return the new email (the caller persists only that field,Store::identity_set_context_email). A different email replaces the stored one — an account re-authenticated as another user must not keep showing the old address (§4). An account whose dir reports no email is left as it is.