Not logged in, please run /login - Claude Code
Quick fix
Add hasCompletedOnboarding: true to ~/.claude.json and turn on "use custom Api key" in /config.
Symptom
Section titled “Symptom”Not logged in, please run /loginNewer Claude Code versions introduced an onboarding flow and a subscription channel choice. Even with cc-switch writing ANTHROPIC_BASE_URL and the other environment variables into settings.json correctly, if the global config file ~/.claude.json lacks hasCompletedOnboarding: true, or use custom Api key is set to false in /config (that is, it goes through the official subscription channel), the client still ignores the custom API configuration and forces an OAuth login. A case error in the permissions field of settings.json (read instead of Read) also breaks config parsing and triggers the same login block.
Add or change the hasCompletedOnboarding field to true in ~/.claude.json in your home directory. Create the file if it does not exist.
// ~/.claude.json{"hasCompletedOnboarding": true}Start Claude Code in a terminal, run the /config command, and check the last item, use custom Api key — make sure it is set to true.
Check ~/.claude/settings.json and make sure the permission names in the permissions.ask array are capitalized (change read to Read, for instance).
// ~/.claude/settings.json{"permissions": {"ask": ["Read"]}}
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Why does changing the configuration in the cc-switch UI or settings.json not skip the login?
- Because hasCompletedOnboarding, the trigger for skipping login, has to be written in ~/.claude.json, not in settings.json.
- Having configured a third-party API, how do I switch quickly back to the official Claude subscription plan?
- First clear the environment variables that are taken (on Linux run unset ANTHROPIC_BASE_URL; in Windows CMD run setx ANTHROPIC_BASE_URL ""), then create and switch to the official provider in cc-switch, and finally logout and login again.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.