claude-code - 💡(How to fix) Fix CLI /login and /usage only see default (Max) org when account has multiple orgs [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48460Fetched 2026-04-16 06:59:33
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

My Anthropic account ([email protected]) belongs to two organizations:

  • Contele — Team plan, I'm the primary owner
  • Pessoal — Max plan (auto-created personal org)

In the Claude desktop app I can switch between them freely. In Claude Code CLI (2.1.109), /login doesn't offer the Team org — it silently authenticates against the Max org only, and /usage / /stats bill against Max even when Contele (Team) is set as the active org on the desktop app.

Error Message

"type": "error", "error": { → 503 "upstream connect error or disconnect/reset before headers. reset reason: overflow" [error] [sessions-bridge] Poll error, backing off: This operation was aborted

Root Cause

My Anthropic account ([email protected]) belongs to two organizations:

  • Contele — Team plan, I'm the primary owner
  • Pessoal — Max plan (auto-created personal org)

In the Claude desktop app I can switch between them freely. In Claude Code CLI (2.1.109), /login doesn't offer the Team org — it silently authenticates against the Max org only, and /usage / /stats bill against Max even when Contele (Team) is set as the active org on the desktop app.

Code Example

curl -H "Authorization: Bearer <claudeAiOauth.accessToken>" \
     -H "anthropic-beta: oauth-2025-04-20" \
     https://api.anthropic.com/api/oauth/profile

---

{
  "account": { "email": "[email protected]", "has_claude_max": true },
  "organization": {
    "uuid": "<max-org-uuid>",
    "organization_type": "claude_max",
    "name": "[email protected]'s Organization",
    "rate_limit_tier": "default_claude_max_20x"
  },
  "application": { "name": "Claude Code", "slug": "claude-code" }
}

---

curl -H "Authorization: Bearer <same-token>" \
     -H "anthropic-beta: oauth-2025-04-20" \
     https://api.anthropic.com/api/organizations

---

{
  "type": "error",
  "error": {
    "type": "permission_error",
    "message": "Invalid authorization",
    "details": { "error_code": "account_session_invalid" }
  }
}

---

GET /v1/environment_providers/private/organizations/<uuid>/environments
503 "upstream connect error or disconnect/reset before headers. reset reason: overflow"

---

[error] [sessions-bridge] Poll error, backing off: This operation was aborted
   [info]  [sessions-bridge] Backing off for 1000ms
RAW_BUFFERClick to expand / collapse

Summary

My Anthropic account ([email protected]) belongs to two organizations:

  • Contele — Team plan, I'm the primary owner
  • Pessoal — Max plan (auto-created personal org)

In the Claude desktop app I can switch between them freely. In Claude Code CLI (2.1.109), /login doesn't offer the Team org — it silently authenticates against the Max org only, and /usage / /stats bill against Max even when Contele (Team) is set as the active org on the desktop app.

Steps to reproduce

  1. Be a member of 2+ orgs on the same account (one Max, one Team)
  2. On the desktop app, switch active org to the Team one
  3. In CLI: /logout, then /login, complete OAuth in browser
  4. /status still reports Login method: Claude Max account and Organization: {email}'s Organization
  5. No UI or command to switch orgs

Tried the full logout/login cycle twice. Same result.

Expected

CLI should either:

  • Prompt for org selection after OAuth when the account has multiple orgs, or
  • Respect the active-org selection the user made in the desktop app, or
  • Expose a /switch-org command

...matching desktop app behavior.

Evidence

OAuth profile endpoint returns only the Max org:

curl -H "Authorization: Bearer <claudeAiOauth.accessToken>" \
     -H "anthropic-beta: oauth-2025-04-20" \
     https://api.anthropic.com/api/oauth/profile

Response (abridged):

{
  "account": { "email": "[email protected]", "has_claude_max": true },
  "organization": {
    "uuid": "<max-org-uuid>",
    "organization_type": "claude_max",
    "name": "[email protected]'s Organization",
    "rate_limit_tier": "default_claude_max_20x"
  },
  "application": { "name": "Claude Code", "slug": "claude-code" }
}

No mention of the Team org, which exists and is visible/active on claude.ai.

Organizations list endpoint rejects the same token:

curl -H "Authorization: Bearer <same-token>" \
     -H "anthropic-beta: oauth-2025-04-20" \
     https://api.anthropic.com/api/organizations

Returns:

{
  "type": "error",
  "error": {
    "type": "permission_error",
    "message": "Invalid authorization",
    "details": { "error_code": "account_session_invalid" }
  }
}

Suggests the OAuth token issued to Claude Code lacks the scope needed to enumerate the user's orgs — so the CLI likely can't offer an org picker even in principle.

Environment

  • Claude Code: 2.1.109
  • macOS 15.4 (Darwin 25.4.0)
  • Shell: zsh
  • ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN: both unset (pure OAuth / subscription)

Related anomalies seen in desktop app logs (possibly separate bugs, sharing in case useful)

  1. Recurring 503 on the environments endpoint, every 10–20 min since 05:44 BRT on 2026-04-15:

    GET /v1/environment_providers/private/organizations/<uuid>/environments
    → 503 "upstream connect error or disconnect/reset before headers. reset reason: overflow"
  2. sessions-bridge in an infinite poll/backoff loop in ~/Library/Logs/Claude/main.log:

    [error] [sessions-bridge] Poll error, backing off: This operation was aborted
    [info]  [sessions-bridge] Backing off for 1000ms

    Happens continuously; occasionally escalates to 2000ms/4000ms then resets.

Impact

Can't attribute Claude Code usage to my company's Team plan. Forced to burn Max quota on company work, while the Team seat I paid for sits idle from the CLI's perspective.

extent analysis

TL;DR

The most likely fix is to modify the OAuth flow in the Claude Code CLI to request the necessary scope to enumerate the user's organizations, allowing the CLI to prompt for org selection after authentication.

Guidance

  • The issue seems to be related to the OAuth token scope, which currently only returns the Max org and lacks the necessary permissions to list the user's organizations.
  • To verify the issue, try using the curl commands provided in the Evidence section to test the OAuth profile endpoint and organizations list endpoint with the same token.
  • The CLI likely needs to request an additional scope during the OAuth flow to access the user's organization list, which would allow it to prompt for org selection after authentication.
  • Consider checking the Anthropic API documentation for available scopes and how to request them during the OAuth flow.

Example

No code snippet is provided as the issue is related to the OAuth flow and scope, which requires modifications to the Claude Code CLI's authentication mechanism.

Notes

The provided information suggests that the issue is specific to the Claude Code CLI and its OAuth implementation. The desktop app's behavior and the related anomalies seen in the logs may be separate issues.

Recommendation

Apply a workaround by modifying the OAuth flow in the Claude Code CLI to request the necessary scope to enumerate the user's organizations, allowing the CLI to prompt for org selection after authentication. This would require changes to the CLI's authentication mechanism and may involve updating the Anthropic API documentation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix CLI /login and /usage only see default (Max) org when account has multiple orgs [1 comments, 2 participants]