Description
When two Claude accounts share the same email address (e.g. a personal Pro subscription and a corporate Team/Pro seat under the same email), cux add detects the email match and updates the existing slot instead of creating a new one. This makes it impossible to register both accounts natively.
Steps to reproduce
- Add account A (
user@example.com — personal Pro) via cux add
- Log into account B (
user@example.com — corporate, different organizationUuid) via claude /login
- Run
cux add again
Expected: slot 3 created for account B
Actual: "Refreshed slot 1 (user@example.com)" — account B overwrites account A's token
Root cause
The deduplication logic in cux add uses emailAddress as the unique key. However, Anthropic's identity model allows the same email to be a member of multiple organizations, each with a distinct organizationUuid and independent rate limit windows. Two accounts with identical emailAddress but different organizationUuid are functionally separate accounts with separate tokens and separate 5h/7d usage buckets.
Secondary issue: usage cache collision
Even after manually adding the second account via filesystem/Keychain hacks, the usage cache (runtime/usage-cache.json) is also keyed by email. Both slots display identical usage metrics, making threshold-based auto-swap unreliable:
SLOT 01 user@example.com 5h: 40% ← correct
SLOT 03 user@example.com__… 5h: 40% ← wrong (actual: 4%)
The Anthropic usage API (GET /api/oauth/usage) is token-scoped and returns correct per-account data. The issue is the cache keying, not the API itself.
Proposed fix
Use organizationUuid (already present in oauth.json) as the deduplication key instead of (or in addition to) emailAddress. This uniquely identifies an account across all Anthropic subscription types.
The same change should apply to the usage cache key in runtime/usage-cache.json to ensure independent usage tracking per slot.
Workaround (until fixed)
- Temporarily alias slot 1's email in
state.json and rename its directory
- Run
cux add while logged into account B → creates slot 3
- Restore slot 1's original email and directory name
- Alias slot 3's email to
email__corp in state.json, Keychain entry, and accounts directory to prevent usage cache collision
This is fragile and breaks on any cux add refresh.
Environment
- cux version: cux 0.2.5
- OS: macOS (Apple Silicon)
- Claude plan: Pro (personal) + Pro (corporate Team seat)
- Same email: yes — different
organizationUuid per account
This issue was documented with AI assistance.
Description
When two Claude accounts share the same email address (e.g. a personal Pro subscription and a corporate Team/Pro seat under the same email),
cux adddetects the email match and updates the existing slot instead of creating a new one. This makes it impossible to register both accounts natively.Steps to reproduce
user@example.com— personal Pro) viacux adduser@example.com— corporate, differentorganizationUuid) viaclaude /logincux addagainExpected: slot 3 created for account B
Actual:
"Refreshed slot 1 (user@example.com)"— account B overwrites account A's tokenRoot cause
The deduplication logic in
cux addusesemailAddressas the unique key. However, Anthropic's identity model allows the same email to be a member of multiple organizations, each with a distinctorganizationUuidand independent rate limit windows. Two accounts with identicalemailAddressbut differentorganizationUuidare functionally separate accounts with separate tokens and separate 5h/7d usage buckets.Secondary issue: usage cache collision
Even after manually adding the second account via filesystem/Keychain hacks, the usage cache (
runtime/usage-cache.json) is also keyed by email. Both slots display identical usage metrics, making threshold-based auto-swap unreliable:The Anthropic usage API (
GET /api/oauth/usage) is token-scoped and returns correct per-account data. The issue is the cache keying, not the API itself.Proposed fix
Use
organizationUuid(already present inoauth.json) as the deduplication key instead of (or in addition to)emailAddress. This uniquely identifies an account across all Anthropic subscription types.The same change should apply to the usage cache key in
runtime/usage-cache.jsonto ensure independent usage tracking per slot.Workaround (until fixed)
state.jsonand rename its directorycux addwhile logged into account B → creates slot 3email__corpinstate.json, Keychain entry, and accounts directory to prevent usage cache collisionThis is fragile and breaks on any
cux addrefresh.Environment
organizationUuidper accountThis issue was documented with AI assistance.