claude-code - 💡(How to fix) Fix [BUG] OAuth error: protocol mismatch on macOS [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#49239Fetched 2026-04-17 08:46:52
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

OAuth error: protocol mismatch

  • Browser authorization always succeeds but terminal always fails with the same error

Error Messages/Logs

  1. Terminal shows OAuth error: protocol mismatch
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?

Unable to authenticate with Claude Code via OAuth. After completing browser authorization successfully (browser shows "You're all set up for Claude Code. You can now close this window."), the terminal returns:

OAuth error: protocol mismatch

What I tried

  • Uninstalled and reinstalled Claude Code
  • Cleared ~/.claude and ~/Library/Application Support/ClaudeCode
  • Tried claude auth login from terminal
  • Tried manually copying the OAuth URL to browser
  • Browser authorization always succeeds but terminal always fails with the same error

What Should Happen?

Authentication should complete successfully after browser authorization, and Claude Code should start normally.

Error Messages/Logs

Steps to Reproduce

  1. Run claude and enter /login
  2. Select option 1 (Claude account with subscription)
  3. Browser opens and authorization completes successfully
  4. Terminal shows OAuth error: protocol mismatch

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.110 (npm-global)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

extent analysis

TL;DR

The "OAuth error: protocol mismatch" suggests a potential issue with the OAuth protocol configuration, which may require adjusting the authentication flow or checking the Claude Code configuration.

Guidance

  • Verify that the OAuth protocol configuration in Claude Code matches the expected protocol (e.g., HTTP vs. HTTPS) and check for any redirects or proxy settings that might cause a protocol mismatch.
  • Check the Anthropic API documentation to ensure that the OAuth flow is correctly implemented and that there are no specific requirements for the protocol.
  • Try running the claude auth login command with additional logging or debugging flags (if available) to gather more information about the error.
  • Consider checking the VS Code integrated terminal settings to ensure that it is not interfering with the OAuth flow.

Example

No code snippet is provided as the issue does not contain sufficient information to create a relevant example.

Notes

The issue may be related to the specific configuration of the Anthropic API or the Claude Code version being used. Without more information about the OAuth protocol configuration or the Anthropic API requirements, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Try adjusting the OAuth protocol configuration or checking for any redirects or proxy settings that might cause a protocol mismatch, as the issue seems to be related to the authentication flow.

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