[BUG] Subscription not detected in interactive CLI, while headless (--print) and Desktop/Web work — org-managed account

Resolved 💬 2 comments Opened Jun 13, 2026 by agentlabbusiness Closed Jun 16, 2026

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?

On the same Mac, with the same OAuth subscription credential, the interactive CLI does not detect my subscription: after /login it shows "Login successful", but then every action returns "Not logged in" and it falls back to the "API Usage Billing" prompt.

The SAME credential works everywhere else:

  • Claude Desktop app — works on subscription
  • claude.ai web — works
  • Headless CLI (claude --print -p "...") with NO ANTHROPIC_API_KEY in the environment — works for 10+ hours / hundreds of invocations via the Keychain OAuth token.

So the subscription token is valid and accepted by the API (headless proves it), but the interactive CLI path refuses to use it. My account is org-managed (organizationRole=admin); ~/.claude.json shows hasAvailableSubscription: false and oauthAccount.subscriptionType: null (false/null since 2026-05-07), with cachedExtraUsageDisabledReason: org_level_disabled. Persisted for weeks across versions.

What Should Happen?

Interactive claude should authenticate using the same subscription OAuth credential that the headless --print path and the Desktop app already use successfully, and run on the subscription — not report "Not logged in" or fall back to API billing.

Error Messages/Logs

- Interactive: `/login` → "Login successful", then any action → "Not logged in" / "API Usage Billing" prompt.
- ~/.claude.json: hasAvailableSubscription: false, oauthAccount.subscriptionType: null, cachedExtraUsageDisabledReason: org_level_disabled.
- Headless worker env (via `ps eww`) has NO ANTHROPIC_API_KEY, yet `claude --print` runs successfully → Keychain credential "Claude Code-credentials" is valid and accepted.

Steps to Reproduce

  1. Use an org-managed account that also has an active subscription (Desktop app + claude.ai both work on the subscription).
  2. Run claude interactively → /login → complete browser OAuth → "Login successful".
  3. Send any prompt → "Not logged in" / falls back to the "API Usage Billing" prompt; subscription is not used.
  4. In contrast, headless with no API key works: ANTHROPIC_API_KEY= claude --print -p "hi" → runs fine via the stored subscription credential.
  5. Re-login multiple times, removed ANTHROPIC_API_KEY from env, tested 2.1.126 / 2.1.145 / 2.1.176 — interactive remains broken in all.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.145 (also reproduced on 2.1.126 and 2.1.176)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Key diagnostic — same machine, same credential, different result by entry path:
| Path | Result |
|---|---|
| Desktop app (subscription) | works |
| claude.ai web | works |
| CLI headless claude --print (no ANTHROPIC_API_KEY) | works, 10+ h |
| CLI interactive claude + /login | "Login successful" → "Not logged in" / API billing |
Hypothesis: interactive startup gates on a hasAvailableSubscription / org-entitlement check that returns false for an org-managed account that nonetheless has a working subscription, so it switches to API billing; the headless path uses the OAuth token directly and is unaffected.
Related: #50933 — same "Login successful → Not logged in" symptom (closed as stale; there 2.1.0 worked, 2.1.1+ broke). This report adds the new signal that headless --print works with the same credential, so the token is valid and the bug is in the interactive subscription check.
Environment: macOS Apple Silicon, Darwin 24.6.0.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗