[BUG] Claude Code VS Code extension completes browser OAuth successfully but never receives the token, causing an infinite login loop
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/claudeviacurl -fsSL https://claude.ai/install.sh | sh - Subscription: Claude Team (SchoolStatus organization)
- Shell profile:
~/.local/binadded to PATH via~/.zshrc - VS Code launch method: Launched from terminal via
codecommand to ensure correct PATH inheritance
Steps to Reproduce
- Open Claude Code panel in VS Code
- Click "Claude.ai Subscription"
- Browser opens, select organization (SchoolStatus), click Authorize
- Browser shows "Build something great — You're all set up for Claude Code"
- 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 claudecorrectly returns~/.local/bin/claudeANTHROPIC_API_KEYenvironment 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/47c70924and deleted - Reinstalled Claude Code CLI from scratch today using the native installer
- PATH confirmed correct:
echo $PATH | tr ':' '\n' | grep local/binshows/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
- Open Claude Code panel in VS Code
- Click "Claude.ai Subscription"
- Browser opens, select organization (SchoolStatus), click Authorize
- Browser shows "Build something great — You're all set up for Claude Code"
- 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_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗