/login shows "Login successful" but immediately reverts to "Not logged in"
Status Closed — not planned
Reported on v2.1.92
Maintainer reply None cached
Activity 13 comments · opened Apr 7, 2026 · closed Jun 27, 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?
After running /login, it displays "Login successful" but the status bar still shows "Not logged in · Run /login". Any subsequent command fails with "Not logged in".
What Should Happen?
After successful login, authentication should persist and allow normal usage.
Error Messages/Logs
No error messages. /compact also failed with: EPERM: operation not permitted
Steps to Reproduce
- Open Claude Code on Windows
- Run /login
- See "Login successful"
- Type any message
- Get "Not logged in · Please run /login"
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.92
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
Subscription: Claude Pro. Installed via winget. Previously used npm install but migrated. Deleted .claude folder, reinstalled, ran as administrator — login succeeds every time but auth is never persisted.
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is NOT a duplicate. The linked issues are about different problems. My issue is specifically: /login shows ‘Login successful’ but auth is never persisted — status bar immediately reverts to ‘Not logged in’.
Additional repro: macOS + Claude Max + \
claude auth login\(v2.1.92)Same pattern as this issue: UI shows success, session is not actually authenticated.
redirect_uri=https://platform.claude.com/oauth/code/callback\(PKCE), scopes include \user:sessions:claude_code\, \org:create_api_key\, etc.alias claude='claude --bare'\, remove it or use \command claude\so \auth login\and the interactive CLI are the same binary/mode; otherwise login and TUI can diverge.Related: #44267 (OAuth completes in browser but CLI never finishes / persists session). 👍 following both for visibility.
Just hit this bug. Can confirm it's still on v2.1.142
I hit the same bug today:
[https://github.com/anthropics/claude-code/issues/59935](url)
macOS Sequoia 15.7.6 (24G707). Claude Code 2.1.143. iTerm and Terminal
I got the same thing, when running Claude in a docker container :/
Using a Dev Container I run into the same issue. I'm using a Docker volume to persist authentication and settings as proposed here:
https://code.claude.com/docs/en/devcontainer#persist-authentication-and-settings-across-rebuilds
Turned out the issue was that my user within Docker didn't have write access to the created volume. For me the solution was to create the mount point with correct permissions by adding this to the Dockerfile:
Notes: Needs to run as user. Needed to delete the volume and then rebuild the container to take effect.
Got the same issue with dev containers.
While permissions via
ls -lalooked fine to me, I had to add this to mydevcontainer.json:After that, there was no visible change to the permissions, but suddenly logins became persistent.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
I ran into the same error on a system where there was just no more available disk space - claude code printed "login successful" but since the required files couldn't be written it immediately reported "Not logged in. Run claude auth login to authenticate".
Seems like claude code should throw a visible error if it cannot write the required files to complete the login, this would catch above permission problems or my eventual disk space problem!
I was getting the exact same issue. Login Successful but no auth. Now I'm not a tech guy at all (4th time in terminal - please don't clown me) so maybe my system wasn't configured correctly. But in my case the root cause was a corrupted
PATHin~/.zshrc, not a Keychain persistence bug per se.My
.zshrchad a brokenexport PATH=...line where$HOMEand$PATHhad been written without the$(literal "HOME" and "PATH" text instead of expansion), duplicated across several appended lines from re-running an install script. End result:PATHwas missing/usr/bin,/bin,/usr/sbin,/sbinentirely — even basic commands likecatandrmreturned "command not found."My working theory: Claude Code shells out to macOS's
securityCLI (in/usr/bin) to write OAuth tokens to Keychain. With/usr/binmissing fromPATH, the OAuth flow itself completed fine ("Login successful"), but the credential write to Keychain silently failed, producing the "Not logged in · Please run /login" loop on the next check.Fix:
echo $PATH— confirm/usr/binand/binare present.~/.zshrc(or.bash_profile/.profile) for a badexport PATH=line missing$beforeHOME/PATH.export PATH="$HOME/.local/bin:$PATH"source ~/.zshrc, open a fresh terminal, runclaude, then/login.Worth checking your PATH even if
claudeitself runs fine — a partially broken PATH can still be enough to break the Keychain write while leaving the rest of the CLI functional.Hit the same issue just now, found this after Googling.
Max plan, Ghostty, MacOS
FYI: The instant local "fix" was, of course, /logout -> /login, but I figured this shouldn't even happen in the first place.
<img width="391" height="97" alt="Image" src="https://github.com/user-attachments/assets/a80a7bd7-476d-45a8-a6ab-dc8b3c214c6b" />
Max plan, Ghostty, MacOS
It seems that after successful login sometimes it lets one message go through and then completely fails again
✅ Solved
the working directory (from which the claude session had been launched) was gone, so recreating an empty dir allowed to just resume chatting