claude-code - 💡(How to fix) Fix [BUG] Claude Code bills API instead of Max subscription — OAuth returns null subscription metadata [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#58628Fetched 2026-05-14 03:43:19
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

Code Example

Pre-incident ~/.claude.json (working state from backup):
  "organizationType": "claude_max",
  "organizationRateLimitTier": "default_claude_max_20x"

Current post-OAuth state:
  "oauthAccount": null,
  "hasAvailableSubscription": false
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

After OAuth login, ~/.claude.json writes oauthAccount: null and hasAvailableSubscription: false for my personal Claude Max 20x org (6a3344e3-6ad4-44ef-a191-cc40aba0f8a9). The status bar shows "· API Usage Billing" on every model, so Claude Code falls through to billing my Console API credits instead of consuming the Max subscription.

Anthropic support has confirmed the Max subscription is active on this org. The OAuth backend is simply not returning organizationType / organizationRateLimitTier in the response for this specific org.

Proof this is server-side: I modified the OAuth URL's orgUUID param to swap to a different org on the same account (7e6c2941-f4cf-42db-b0a1-93f3b9224dd5). That org's metadata wrote correctly into ~/.claude.json. The OAuth flow itself works — the affected org's backend response is specifically missing subscription metadata.

I also removed Google SSO from the affected org and retried with email-only login — still returned null. SSO routing is not the cause.

What Should Happen?

After OAuth, ~/.claude.json should write: oauthAccount: { ... populated ... } hasAvailableSubscription: true organizationType: "claude_max" organizationRateLimitTier: "default_claude_max_20x"

Status bar should show Max subscription consumption, not "API Usage Billing".

Error Messages/Logs

Pre-incident ~/.claude.json (working state from backup):
  "organizationType": "claude_max",
  "organizationRateLimitTier": "default_claude_max_20x"

Current post-OAuth state:
  "oauthAccount": null,
  "hasAvailableSubscription": false

Steps to Reproduce

  1. Run /logout in Claude Code
  2. Delete keychain entries: Claude Code-credentials and Claude Code-credentials-ab061586
  3. Run claude to trigger fresh OAuth
  4. Complete OAuth in browser for org 6a3344e3-6ad4-44ef-a191-cc40aba0f8a9 (Claude Max 20x)
  5. Run: jq '.oauthAccount, .hasAvailableSubscription' ~/.claude.json
  6. Observe: returns null and false
  7. Status bar shows "· API Usage Billing" instead of Max subscription

Account: [email protected] Affected org UUID: 6a3344e3-6ad4-44ef-a191-cc40aba0f8a9

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.140 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Client-side causes exhaustively ruled out over 5+ hours:

  • No ANTHROPIC_API_KEY anywhere: env, shell rc, launchctl, settings.json, managed-settings.json, root-owned managed-settings
  • Both keychain entries fully deleted and re-created
  • Fresh CLAUDE_CONFIG_DIR tested
  • Switched between Sonnet 4.6 and Opus 4.7 — both reproduce
  • VS Code extension and standalone CLI reproduce identically
  • Google SSO removed from org, retested with email login — still null

Related: https://github.com/anthropics/claude-code/issues/58625 Also emailed [email protected] with same details.

Other orgs on this account (for backend cross-reference):

  • 7e6c2941-f4cf-42db-b0a1-93f3b9224dd5 (FEDCON team, Console — OAuth works correctly)
  • 8b7c680b-1c0e-4124-b824-dbfd2940d5ba (Personal Console — OAuth works correctly)

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 [BUG] Claude Code bills API instead of Max subscription — OAuth returns null subscription metadata [1 comments, 2 participants]