/login and /logout commands are not available (v1.0.11)
Resolved 💬 21 comments Opened Jun 4, 2025 by zacsims Closed Jan 17, 2026
💡 Likely answer: A maintainer (ant-kurt, collaborator)
responded on this thread — see the highlighted reply below.
My installation does not seem to pickup the /login or /logout commands. I have tried reinstalling and clearing cache but the problem persists.
21 Comments
Check
/statuscommand. In the following cases/loginis disabled:ANTHROPIC_API_KEYorANTHROPIC_AUTH_TOKENapiKeyHelperI'm having a similar issue, where the code sent by mail is not working to login to my Max sub:
!Image
Edit: after about 10 minutes it worked...
I unset ANTHROPIC_API_KEY and reinstalled and now I am facing the same error as @Custom156
edit: seems to have worked after a few tries
Make sure to clear any local environment variables containing Anthropic keys. If it still doesn't work, check that you're not running it inside tmux. I had to exit the terminal completely and re-run the claude command.
Going to close this one out since it's working - if you have suggestions on how to streamline this experience (making it more clear that API keys are in use etc), please continue to comment!
See above for workarounds.
This change was made to reduce confusion when external API keys or auth tokens are provided, but clearly this is causing more confusion! We're looking into restoring the commands and having them describe why they're unavailable, rather than just removing the commands wholesale.
To workaround this for now: make sure you are not providing an
ANTHROPIC_API_KEYenv var to the Claude Code process, it will disable/loginand/logout. We have an update in the next release that will make those commands only be disabled if the API key is provided AND approved in interactive mode (vs now, where the key doesn't have to be approved).This issue was introduced in
v1.0.11, as we started to look atANTHROPIC_API_KEYenvironment variable as a source of auth for Claude Code. This caused some commands (/login, /logout, /install-github-app) to be unavailable if a key was detected, with the intention of reducing conflicts (e.g. you cannot "log out" from an API key provided via env var).Workarounds
ANTHROPIC_API_KEY(see https://github.com/anthropics/claude-code/issues/1615#issuecomment-2943077411)/statuscommand that no residual key (or other auth source) is being detectedShort-term fixes
v1.0.12will introduce a requirement for API key approval for the key to be used (and thus the commands to be unavailable). If you intend to useclaude.aiauth (like Max) or a Console API login, you'll want to reject the API key specified on the environment.-pmode, you'll want to temporarily pin tov1.0.10Longer term
We're open to feedback on how best to serve both externally specified API keys for Claude Code (https://github.com/anthropics/claude-code/issues/1651) and developers who may have an API key on their environment for non-Claude Code purposes.
Input like https://github.com/anthropics/claude-code/issues/1615#issuecomment-2945712114 and https://github.com/anthropics/claude-code/issues/1618#issuecomment-2944312942 is valuable!
How do folks feel about these options?
/loginand/logoutare always available, and "error out" if external auth source exists/loginand/logoutare always available, and external auth sources (API key and auth token) now show as another choice, if present on the environment (likely excludingpolicies.json)Second option seems to be the most intuitive. Hiding the commands conditionally is unexpected and confusing, and an error during the command run explaining what's wrong would be better.
My scenario is getting oauth error after subscription expired, and given no option to login, while the
/statusshown I'm logged in and didn't show information about API key - it's likely shown only in/config. Confusing part was that everything worked with subscription before, and after the error popped up the API key was affecting lack of/loginand/logoutbut was not used to serve requests, and moreover I would be unpleasantly surprised it it would start to be used silently after my subscription died.So the current behaviour around the API key (don't use it when login is active) is good and expected, only the lack of commands was not.
Seconded; option two is best.
There seems to be some interaction with Bedrock configuration as well? I've unset CLAUDE_CODE_USE_BEDROCK, but I still get
API Provider: AWS Bedrockin/statusand I can't use/loginor/logout.same error
Using Bedrock or Vertex does hide the login and logout commands. If you did unset
CLAUDE_CODE_USE_BEDROCKthen/statusshould not show that - can you confirm the env var is''or not defined, and no other sources of config are specifying it? https://docs.anthropic.com/en/docs/claude-code/settings#settings-precedence@ant-kurt Earlier, setting CLAUDE_CODE_USE_BEDROCK to 0 or 1 allowed me to switch between the two. But now, it always authenticates via bedrock, and I have not been able to resolve it.
Here are my settings based on settings precedence.
Enterprise policies (see IAM documentation)
Command line arguments
Local project settings
Shared project settings
User settings
Env Variables
Steps taken to resolve
Hey team, I can confirm this is still an issue on
1.0.51 (Claude Code). I was able to temporarily fix this issue by manually installing an older versionnpm i -g @anthropic-ai/claude-code@1.0.24and wiping.claude/and.claude.jsonI have the
ANTHROPIC_API_KEYenv var set. When I run Claude Code (i.e.claude(version 1.0.55)), I get the message:I run
claude /logoutand so log out. I then runclaude; it asks me to choose a login method (1 or 2), and I choose 2 (Anthropic Console account (API usage billing)). It opens my browser to log me in. Claude Code says that login was successful and I click Enter. I am asked if I want to use theANTHROPIC_API_KEYor not (the latter is recommended). I choose to use theANTHROPIC_API_KEY, and Claude Code shows only "Welcome to Claude Code". I exit with CTRL+C twice.I know I can unset
ANTHROPIC_API_KEY, or select not to use it, but if it can't work usingANTHROPIC_API_KEY, perhaps the option to use it shouldn't be presented; and this variable should otherwise be ignored (with a message indicating that it has been ignored) ?This is still an issue for me as well
+1
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
unsetting all the vars worked
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.