No way to identify which org/team a session is authenticated to when using CLAUDE_CODE_OAUTH_TOKEN

Status Open
Reported on v2.1.218
Maintainer reply None cached
Activity 0 comments · opened Jul 23, 2026

Problem

Running Claude Code against multiple Team-plan organizations concurrently — one terminal tab per org, each with CLAUDE_CODE_OAUTH_TOKEN set to a different org's token — is a supported pattern (each Team-plan account mints its own long-lived token via claude setup-token). However, there is no way, from within a running session, to determine which org/account a given session is actually authenticated against.

This matters for confirming billing/usage lands on the intended org, and for basic sanity-checking that an env-var override actually took effect as intended.

What I checked, all dead ends

  • /status — shows Auth token: CLAUDE_CODE_OAUTH_TOKEN, confirming an env-var override is active, but not which token/org.
  • ~/.claude.json's oauthAccount cache — contains real org data (organizationName, organizationUuid, emailAddress, seatTier, etc.) but appears to only populate from the default keychain /login flow. It never refreshed for a session running continuously for >20 minutes on an env-token override, even after closing all other claude processes to rule out cache races.
  • claude auth status --json — only returns {"loggedIn": true, "authMethod": "oauth_token", "apiProvider": "firstParty"}. No org/account fields.
  • No startup banner or terminal title shows org/account.
  • Local theme setting (~/.claude/settings.json) is machine-local, not synced per-account, so it can't even be (ab)used as a manual workaround signal.
  • claude.ai billing page has no usage log to cross-reference against a specific CLI session's activity.

The only way I found to verify org identity was via the website's "current session" rate-limit percentage (rolling ~5hr window) — watching it tick up during active use. This works but is indirect, slow, and easy to misread if other sessions on the same account are also active.

Suggested fix

Any of:

  • Add organization name/email to /status output (the data already exists in oauthAccount — just needs to be fetched/shown for env-token sessions too)
  • Show org/account in the startup banner or terminal title
  • Add org fields to claude auth status --json

Environment

  • Claude Code version: 2.1.218
  • macOS (Darwin), iTerm2
  • Auth: CLAUDE_CODE_OAUTH_TOKEN env var override (Team plan subscription token via claude setup-token)

🤖 Generated with Claude Code

View original on GitHub ↗