OAuth login completes but token is never saved — "Not logged in" persists on managed Windows machine

Open 💬 0 comments Opened Jun 22, 2026 by aarongphd

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?

Environment

  • OS: Windows 11 Enterprise (managed/domain-joined)
  • Claude Code version: 2.1.186
  • Install method: global
  • Shell: PowerShell 7

Describe the bug

After completing OAuth login (/login reports "Login successful"), Claude Code immediately shows "Not logged in · Please run /login" on the next command. The login loop repeats indefinitely.

Root cause investigation

~/.claude.json exists and contains full OAuth account profile data (accountUuid, emailAddress, organizationUuid, seatTier, etc.) but contains no token field (no accessToken, refreshToken, or equivalent). Windows Credential Manager also has no Claude/Anthropic entries. The token is not being persisted anywhere after the OAuth flow completes.

Additional finding: ~/.claude was originally a symbolic link pointing to an OneDrive path (C:\Users\...\OneDrive - Centre College of Kentucky\.claude) that no longer existed. This symlink has since been replaced with a real local directory, but the login issue persists after that fix.

Steps to reproduce

  1. Run claude on a managed Windows 11 domain machine
  2. Run /login — browser OAuth flow completes, "Login successful" is shown
  3. Run any command or /debug — shows "Not logged in · Please run /login"
  4. Inspect ~/.claude.json — oauthAccount object is present but contains no token fields

Actual behavior

Token is never written. Every session requires re-login, which also fails to persist.

What Should Happen?

OAuth token is saved to ~/.claude.json (or Credential Manager) and persists across commands.

Error Messages/Logs

Steps to Reproduce

  1. Run claude on a managed Windows 11 domain machine
  2. Run /login — browser OAuth flow completes, "Login successful" is shown
  3. Run any command or /debug — shows "Not logged in · Please run /login"
  4. Inspect ~/.claude.json — oauthAccount object is present but contains no token fields

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.186

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

  • Machine is domain-joined (Centre College, university managed)
  • Endpoint protection software may be present (not confirmed)
  • cachedExtraUsageDisabledReason: org_level_disabled present in .claude.json
  • Account is on team_standard seat tier under an organizational subscription

View original on GitHub ↗