Skip to main content

with_legacy_identity

Function with_legacy_identity 

Source
pub(crate) fn with_legacy_identity(head: Head) -> Head
Expand description

A head whose segment predates identity_key (recorded by a build before #3839) takes the identity from its own config dir’s .claude.json, so an agent’s first upgrade from such a build can still relocate (spec §4.1). That file names whoever is signed in there now, which for an account’s own dir is the login the session ran under unless the dir was since re-logged-into as someone else; a recorded key always wins. Unreadable (the dir is gone) stays unknown, which never relocates.