[FEATURE] No way to verify which org/account a `claude setup-token` token is scoped to, after generation
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
After merging a personal Claude account into an organization account, I regenerated a claude setup-token token and needed to confirm it was scoped to the org (not the old personal account).
With the token set as CLAUDE_CODE_OAUTH_TOKEN, /status shows only that a token is active, no org/email. ~/.claude.json's oauthAccount object (which populates emailAddress/organizationName/organizationType for interactive /login) stays all-null under token auth.
This is by-design per docs, account profile only populates for "saved" /login credentials, not env-var token auth, but there is no alternative way to check a token's org scope after it's generated. The only checkpoint is reading the org name on the browser authorization screen during setup-token itself, which is easy to miss and impossible to recheck later.
Evidence:
https://code.claude.com/docs/en/authentication.md#authentication-precedence (documents the precedence and the "saved login" condition for /status account info, but not any token-scope verification path).
Cause: Confirmed via docs — /status account fields are gated on the credential being a saved /login login, which env-var token auth is not.
What Should Happen?
I should be able to use the generated token associated to the merged account normally
Error Messages/Logs
When a feedback is sent via claude on the host machine (outside the podman container)
Feedback drafts
Type: missing capability
Title:
No way to verify which org/account a `claude setup-token` token is scoped to, after generation
Area:
setup-token / authentication
Failure mode: (none)
Task: debug
Details:
│ What happened: After merging a personal Claude account into an organization account, user regenerated a claude setup-token token and needed to confirm it was scoped to the org (not the old personal account). With the token set as CLAUDE_CODE_OAUTH_TOKEN, /status shows only that a token is active, no org/email. ~/.claude.json's oauthAccount object (which populates emailAddress/organizationName/organizationType for interactive /login) stays all-null under token auth. This is by-design per docs — account profile only populates for "saved" /login credentials, not env-var token auth — but there is no alternative way to check a token's org scope after it's generated. The only checkpoint is reading the org name on the browser authorization screen during setup-token itself, which is easy to miss and impossible to recheck later.
│ What the user said: "That particular token is not associated to the Claude Team account." / "I can't confirm which account I'm on right now when using this long lived token." / "do I need to relogin again? Is that really the fix? or is this a bug?"
│ Repro: CLAUDE_CODE_OAUTH_TOKEN=<token> claude, then /status — no organization/email shown, unlike a /login session. Same result checking ~/.claude.json → oauthAccount.* — all fields null.
│ Evidence: https://code.claude.com/docs/en/authentication.md#authentication-precedence (documents the precedence and the "saved login" condition for /status account info, but not any token-scope verification path).
│ Cause: Confirmed via docs — /status account fields are gated on the credential being a saved /login login, which env-var token auth is not.
Send transcript: yes · sends this conversation to Anthropic
Environment info (darwin arm64, v2.1.250, claude-sonnet-5, effort high, thinking adaptive, turn 101/524 with 2 subagents, drafted 1m ago) and 3 API request ids are always attached.
Couldn't send feedback (server returned 403). The draft is still queued. Try again later.
Steps to Reproduce
CLAUDE_CODE_OAUTH_TOKEN=<token> claude, then /status — no organization/email shown, unlike a /login session. Same result checking ~/.claude.json → oauthAccount.* — all fields null.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.250
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
Running inside a podman container, with yolobox setup.
Information gathered by Claude:
linux arm64, v2.1.250, claude-sonnet-5, effort high, thinking adaptive, turn 99/506 with 2 subagents, drafted 1m ago) and 3 API request ids are always attached.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗