Claude account switcher: save and switch a chat's Claude login in place
Saved accounts live under <CLAUDE_CONFIG_DIR>/pipelines-accounts/<slug>/ (0700 dir, 0600 files). Switching changes what /login changes: the claudeAiOauth entry of .credentials.json and oauthAccount of .claude.json (atomic temp+rename, mode and other keys kept) and the org caches /login drops, under Claude Code's own refresh, storage and config locks, so running CLIs continue on the new account without a restart. The active login's rotated tokens are written back to its slot first. Server: claude_accounts / claude_account_save / _use / _remove, chat-scoped and Claude-only; a switch moves the home's open chats to the new account's quota (usage.account.switched_at), clearing a reached limit. CLI: pipelines claude-account list|save|use|remove [--dir]. App: Claude account in the chat menu, and Switch to <account> on the usage-limit and usage-warning banners, with a confirmation snack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -799,6 +799,11 @@ type ChatAccountUsage struct {
|
||||
AsOf int64 `json:"as_of,omitempty"`
|
||||
Windows []ChatQuotaWindow `json:"windows,omitempty"`
|
||||
Unsupported bool `json:"unsupported,omitempty"`
|
||||
// SwitchedAt is when the operator last switched the chat's Claude account
|
||||
// to this one (epoch milliseconds). The report then stands for the new
|
||||
// account even with no windows yet, and a usage-limit refusal the chat
|
||||
// received before it no longer applies.
|
||||
SwitchedAt int64 `json:"switched_at,omitempty"`
|
||||
}
|
||||
|
||||
// ChatQuotaWindow is one rolling quota window. UsedPercent is 0-100 (it can
|
||||
|
||||
Reference in New Issue
Block a user