You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"claude -p" mode does not authenticate although interactive mode is authenticated.
claude -p "test"
Invalid API key · Please run /login
I have done web site authentication for Claude Code interactive mode and it works just fine. Documentation (and claude 4) says that: "The -p mode should use the same authentication as interactive mode." but clearly it is not working. I have nothing authentication related in my .claude/settings.json.
Steps to Reproduce
Run "claude /login"
Follow the instructions and authenticate using the web method
Ensure claude interactive mode is working by making any prompt
Quite interactive mode
Run "claude -p "test"
Expected Behavior
Claude Code would execute the test prompt
Actual Behavior
Claude Code responds with: Invalid API key · Please run /login
Additional Context
It used to work with beta version although there were random authentication issues and I had to sometimes do the /login again which every time causes a new Claude Code API key to be generated.
The text was updated successfully, but these errors were encountered:
Environment
Bug Description
"claude -p" mode does not authenticate although interactive mode is authenticated.
I have done web site authentication for Claude Code interactive mode and it works just fine. Documentation (and claude 4) says that: "The -p mode should use the same authentication as interactive mode." but clearly it is not working. I have nothing authentication related in my .claude/settings.json.
Steps to Reproduce
Expected Behavior
Claude Code would execute the test prompt
Actual Behavior
Claude Code responds with:
Invalid API key · Please run /login
Additional Context
It used to work with beta version although there were random authentication issues and I had to sometimes do the /login again which every time causes a new Claude Code API key to be generated.
The text was updated successfully, but these errors were encountered: