Recover a Claude subscription enrollment¶
If the gateway asks you to renew your Claude Code subscription credentials, run:
This command exists in CLI v1.0.2. It opens Claude sign-in and updates the
credential shared by the model families while preserving agent identity and
policies. If you already have a fresh local login, add --from-local.
Make one normal Claude request afterwards. If a previous onboarding attempt
reverted model routing, rerun preloop agents onboard "Claude Code" after
reconnecting.
Full onboarding with a workstation login requires a current access token. If it has expired, open Claude Code once so it renews, then rerun onboarding. A default enrollment sends Preloop an access-only copy of the workstation login. Claude Code renews the login and keeps its refresh grant. Preloop copies the renewed access token at session start, on prompt submission, and before and after tool calls. If a tool spans expiry and Claude Code renews after it finishes, Preloop watches for the new login in the background while the next model request retries.
The CLI update installs these hooks for existing routed enrollments. A fresh
CLI install also repairs them the first time a command loads the enrollment.
preloop update --yes repairs the subscription hooks and skips the interactive
agent integration refresh.
Onboarding and reconnect install the same hooks, including when approvals
are disabled. Existing enrollments can keep their local login. If a legacy
gateway copy expires later than the local login and still has a refresh grant,
the CLI can recover that pair first. A successful sync removes the shared
refresh grant from Preloop. If both copies changed, the later expiry wins.
At equal expiry, each copy keeps its access token. Sync asks the server to
remove any legacy refresh grant from its copy, even if the access tokens differ.
Unattended macOS¶
The workstation login uses the macOS login Keychain when that store was selected at enrollment. Over SSH or with the screen locked, renewal can work if the enrolled user's Keychain is already unlocked and both Claude Code and Preloop can read its credential item without a GUI approval. Locking the screen and locking the Keychain are separate. A locked Keychain or an access prompt that needs a GUI session prevents background sync.
The hook shows recovery instructions if it cannot read the Keychain. After
30 seconds past the copied login's expiry, a gateway retry also shows those
instructions. Unlock this Mac's Keychain in the enrolled user's session or run
preloop agents reconnect "Claude Code" --setup-token for an unattended host.
The dedicated token is kept in Preloop and serves gateway requests without
Keychain access.
Dedicated token¶
To use a dedicated token, choose --setup-token during onboarding or reconnect.
preloop agents onboard "Claude Code" --setup-token
preloop agents reconnect "Claude Code" --setup-token
Claude Code opens a browser for one additional approval. The CLI shows the
sign-in link so you can open it in a browser on another device and paste the
code into the terminal. Use an interactive terminal, such as an SSH session
with a TTY. Preloop stores the resulting access token and any expiry shown
by Claude Code. The CLI and model detail page warn within 14 days of a
recorded expiry. If Claude Code omits the expiry, the CLI reports
expiry unknown and starts reminding you when the token is 90 days old.
If the token expires or the provider revokes it, run reconnect with
--setup-token again.
A server receiving only a reference to a failed shared credential cannot import the fresh local login. It rejects that link with the reconnect command. A client that presents a fresh payload can repair the shared secret in place. Healthy shared credentials remain unchanged when attaching families, and consumed refresh tokens cannot replace the live lineage.
Offboard recovers a rotating grant before deleting enrollment state. For a
dedicated setup token it removes the token from Preloop.
Use a CLI that records the selected local credential store. An explicitly selected
file login can be restored over SSH while Keychain is locked. If the store is unavailable, unlock Keychain or explicitly select the file with
preloop agents sync-credentials "Claude Code". If local installation fails
after the server has sealed the grant, retry offboard on the same machine. Configuration backups
alone do not restore a refresh token that has already rotated.
Use offboard on the enrolled machine before removing a subscription model or replacing its credential with a different one. The console keeps the model and login available until hand-back completes.