[FEATURE] First-class multi-account support: non-interactive account switching, path-independent credentials, and programmatic usage/limit visibility
Status Open
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 0 comments · opened Aug 27, 2026
Problem
Account switching in Claude Code is effectively unsupported, and working around it is painful. For users who legitimately hold multiple subscriptions (personal + work, or several Max seats across a team), the current model forces a pile of fragile external machinery:
/loginis interactive and browser-based only. There is no non-interactive or scriptable way to switch the account a session runs under, and no way to pre-authorize a set of accounts and pick between them.
- Credentials are bound to the config directory path. The stored credential (macOS keychain item) is keyed by a hash of
CLAUDE_CONFIG_DIR, so the only way to hold N accounts is N complete config-dir trees — duplicating settings, hooks, and MCP config per account, and keeping them all in sync by hand. Moving or renaming a config dir silently orphans its credential.
- Switching a running session to another account requires killing the process. There is no in-process account switch; you must terminate, change
CLAUDE_CONFIG_DIR, and relaunch with--resume, losing in-flight state and racing whatever the session was doing.
- No rate-limit failover. When a Max/Pro account hits its 5-hour or weekly cap, sessions just stall on the limit banner. There is no built-in "continue on my other account" path — users have to detect the cap by scraping terminal text and orchestrate the kill/relogin/resume dance externally.
- Usage/limit state is not exposed programmatically. The 5h/weekly usage meters exist only as rendered UI text. External tooling that wants to swap before hitting a cap has to screen-scrape the footer.
Suggested solution
Any subset of these would help enormously:
- Account profiles:
claude --account <name>/ a/accountspicker — multiple stored logins under one config dir, switchable without re-running the browser flow each time. - Decouple the credential store from the config-dir path, or at least survive a directory rename.
- Non-interactive switch: a CLI/headless way to select which stored account a new (or resumed) session uses.
- Programmatic usage visibility: expose the 5h/weekly utilization (and "rate limited until X") via a CLI command or status JSON so tooling can act before the cap.
- Graceful cap behavior: on hitting a limit, offer to continue on another authorized account (or at minimum exit with a distinct machine-readable status).
Context
- Related: #42775 (closed not-planned, locked) asked for the switching half of this; filing fresh per the lock message, with the credential-store and rate-limit-failover aspects added, since those are what make the workaround genuinely horrible rather than merely inconvenient.
- Platform: macOS (headless + interactive), Claude Code CLI, subscription auth (not API key — API key switching is easy; this is specifically about Max/Pro OAuth accounts).