[BUG] Claude Code always authenticates to Console instead of claude.ai Max subscription — ConnectionRefused on all platforms (Windows, WSL, VS Code)

Resolved 💬 3 comments Opened May 11, 2026 by lamvial1958 Closed May 14, 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?

Claude Code always authenticates via Console (API billing) instead of the claude.ai Max subscription, even when using claude auth login --claudeai. The OAuth URL always contains client_id=9d1c250a-e61b-44d9-88ed-5944d1962f5e and redirect_uri pointing to platform.claude.com, regardless of OS or installation method. All API calls fail with "Unable to connect to API (ConnectionRefused)" because the Console account has $0.00 balance.

Related to issue #39445 (marked stale but bug persists in v2.1.138).

What Should Happen?

claude auth login --claudeai should generate an OAuth URL targeting claude.ai with the correct subscription client ID, not the Console client ID. API calls should succeed using the active Max subscription.

Error Messages/Logs

API Error: Unable to connect to API (ConnectionRefused)
Retrying in Xs · attempt N/10

OAuth URL always contains:
client_id=9d1c250a-e61b-44d9-88ed-5944d1962f5e
redirect_uri=https://platform.claude.com/oauth/code/callback

Steps to Reproduce

  1. Have a claude.ai Max subscription and an Anthropic Console account on the same email
  2. Install Claude Code via native installer (curl -fsSL https://claude.ai/install.cmd)
  3. Run: claude auth login --claudeai
  4. Observe OAuth URL — client_id and redirect_uri point to platform.claude.com (Console)
  5. Complete authentication — Login successful
  6. Run any command in Claude Code
  7. Error: Unable to connect to API (ConnectionRefused)
  8. Welcome screen shows "API Usage Billing" instead of Max subscription

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.138 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Tested and reproduced on all of the following:

  • Windows 11 native installer (curl install.cmd)
  • Windows 11 winget install Anthropic.ClaudeCode
  • WSL2 Ubuntu 24.04 (native installer)
  • VS Code extension v2.1.138

Credentials file (~/.claude/.credentials.json) correctly shows:
subscriptionType: "max"
rateLimitTier: "default_claude_max_5x"

Despite correct credentials, OAuth always uses the Console client ID.

TCP connections confirmed ESTABLISHED to api.anthropic.com:443 (160.79.104.10) — network is not the issue.
TLS certificate: Google Trust Services — no interception.
No proxy configured. Firewall disabled during testing — error persists.

The bug appears to be the client_id hardcoded in the binary selecting Console
instead of claude.ai when the account has both a Max subscription and a Console organization.

View original on GitHub ↗

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