[BUG] Claude Code VS Code extension completes browser OAuth successfully but never receives the token, causing an infinite login loop

Resolved 💬 5 comments Opened Apr 20, 2026 by joysmiths Closed Apr 20, 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?

Summary

The Claude Code VS Code extension completes browser OAuth successfully but never receives the token, causing an infinite login loop. The extension also does not recognize /status, /doctor, or /logout commands despite CLI being v2.1.114.

Environment

  • OS: macOS (MacBook Pro, zsh shell)
  • VS Code extension: Claude Code for VS Code v2.1.114 (by Anthropic, Auto Update enabled)
  • Claude Code CLI: v2.1.114, installed at ~/.local/bin/claude via curl -fsSL https://claude.ai/install.sh | sh
  • Subscription: Claude Team (SchoolStatus organization)
  • Shell profile: ~/.local/bin added to PATH via ~/.zshrc
  • VS Code launch method: Launched from terminal via code command to ensure correct PATH inheritance

Steps to Reproduce

  1. Open Claude Code panel in VS Code
  2. Click "Claude.ai Subscription"
  3. Browser opens, select organization (SchoolStatus), click Authorize
  4. Browser shows "Build something great — You're all set up for Claude Code"
  5. VS Code immediately re-prompts for login — token is never received

Additional Symptoms

  • Extension does not recognize /status, /doctor, or /logout — all return "no matching commands" before submitting
  • Extension shows "Invalid API key · Fix external API key" in chat
  • Extension appears locked to Claude Haiku 4.5 and won't allow model change
  • CLI works correctly in Mac Terminal: shows "Sonnet 4.6 · Claude Team · SchoolStatus"
  • which claude correctly returns ~/.local/bin/claude
  • ANTHROPIC_API_KEY environment variable is NOT set

Additional Context

  • Originally set up VS Code and Claude Code using Docker and pulled configuration from a git repository — this may mean the extension has a Docker/git-sourced internal Claude Code that differs from the native CLI installation
  • A previously stored invalid API key (provided by a colleague, since revoked) was found in VS Code history at ~/Library/Application Support/Code/User/History/47c70924 and deleted
  • Reinstalled Claude Code CLI from scratch today using the native installer
  • PATH confirmed correct: echo $PATH | tr ':' '\n' | grep local/bin shows /Users/Joy/.local/bin

Expected Behavior

Browser OAuth should complete and pass the token back to VS Code, logging the extension in with the Team subscription.

Actual Behavior

Browser OAuth completes ("Build something great" page) but VS Code never receives the token and immediately re-prompts for login.

What Should Happen?

Browser OAuth should complete and pass the token back to VS Code, logging the extension in with the Team subscription.

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code panel in VS Code
  2. Click "Claude.ai Subscription"
  3. Browser opens, select organization (SchoolStatus), click Authorize
  4. Browser shows "Build something great — You're all set up for Claude Code"
  5. VS Code immediately re-prompts for login — token is never received

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.114

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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