Claude Code: Not logged in · Please run /login
Claude Code found no usable credential for the session: no claude.ai or Console login in its config directory, no ANTHROPIC_API_KEY in the environment and no apiKeyHelper. The exact message, why Claude Code prints it, and the fix.
Updated November 23, 2026 · Checked against Claude Code 2.x. Sessions run by the Claude Desktop app show 'Authentication required · Sign in again to continue' instead., reproduced in EnvHaven 1.9.0
The message
Not logged in · Please run /login
What it means
Claude Code found no usable credential for the session: no claude.ai or Console login in its config directory, no ANTHROPIC_API_KEY in the environment and no apiKeyHelper.
Fix
- Run
claude, then /login (orclaude auth loginfrom the shell), and sign in with your Claude subscription or Console account. - If you meant to use an API key, export ANTHROPIC_API_KEY in the same shell that starts claude.
- For CI and other places where nobody can sign in interactively, use ANTHROPIC_API_KEY, an apiKeyHelper script, or a long-lived token from
claude setup-token. - Run /status to confirm which credential Claude Code is using.
In an EnvHaven workspace
Yes, until Claude Code is signed in once. Sign in once from the workspace’s Launch menu (Sign in, or Set key for an API key); the sign-in stays on the workspace, across restarts and on every device.
Where this comes from
This message was produced by Claude Code (Claude Code 2.x. Sessions run by the Claude Desktop app show ‘Authentication required · Sign in again to continue’ instead.) itself, in a throwaway EnvHaven 1.9.0 container, on 2026-11-23; the text above is copied from that output.