Claude Code CLI always selects API Usage Billing org instead of Max plan on second Mac
Description
Claude Code CLI on MacBook Air always authenticates to the "API Usage Billing" organization instead of the Max plan (stripe_subscription) organization. The same account works correctly on MacBook Pro.
Environment
- MacBook Pro (works): macOS, Claude Code v2.1.42, user:
gouke - MacBook Air (broken): macOS, Claude Code v2.1.47 (also tested v2.1.42), user:
air-gouke - Plan: Claude Max (5x)
- Auth method: OAuth (claude.ai)
Symptoms
claude auth login→ browser opens → "Login successful"claude auth status→loggedIn: true, authMethod: "oauth_token", apiProvider: "firstParty"- Claude Code UI shows:
Sonnet 4.6 · API Usage Billing · <email>'s Organization - Any message →
API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid bearer token"}} - On claude.ai (browser), the account correctly shows Max plan with the correct organization
What we tried (all failed)
claude auth logout→claude auth login(multiple times)- Complete uninstall (
npm -g uninstall,rm -rf ~/.claude,rm ~/.claude.json, keychain cleanup) → reinstall → login - Tested with v2.1.42, v2.1.47, and latest
- Copied keychain credentials from working MacBook Pro
- Copied
.claude.jsonwith correctoauthAccount(billingType: "stripe_subscription") from MacBook Pro - Set
ANTHROPIC_ORG_IDenvironment variable to the correct org UUID - Verified on platform.claude.com: only one org exists ("personal org" with API plan)
- Verified on claude.ai: Max plan is active, correct org ID shown in account settings
Root cause hypothesis
The OAuth flow (claude.ai/oauth/authorize → redirect to platform.claude.com/oauth/code/callback) always resolves to the default API platform organization instead of the Max plan (stripe_subscription) organization. There is no way for the user to select which organization to authenticate with during the OAuth flow.
On MacBook Pro, the authentication was originally set up when this behavior worked correctly. On a new machine (MacBook Air), fresh authentication always picks the wrong org.
Related issues
- #20976 - Max plan shows as 'API Usage Billing' in CLI
- #22990 - Opus 4.5 API Usage Billing can't use claude CLI max plan anymore
- #17402 - /login reports success but bearer token is invalid
- #12383 - Claude Code for Desktop always shows 'Claude API Account'
- #12740 - Claude Code connects to Pro Account instead of selected Team organization
Expected behavior
Claude Code CLI should authenticate with the Max plan organization when the user has an active Max subscription, or provide a way to select/switch organizations during or after authentication.
Impact
Unable to use Claude Code CLI on any new machine. Spent 6+ hours troubleshooting with no resolution. The only working machine is the one where auth was originally configured before this bug appeared.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗