Not logged in · Please run /login - Claude Code
Quick fix
With the Codex provider, do not start Claude Code from the cc-switch built-in terminal. Open a global terminal so local routing handles OAuth.
Symptom
Section titled “Symptom”Not logged in · Please run /loginWhen a provider that uses OAuth, such as Codex, is configured in cc-switch, starting Claude Code from the “Open Terminal” button in the cc-switch UI causes cc-switch to inject provider-specific settings, such as ANTHROPIC_BASE_URL and model names, directly into that terminal as environment variables.
Because Codex relies on OAuth rather than an API Key, this environment-variable injection bypasses the cc-switch Local Routing mechanism. Claude Code then tries to connect directly and reports that you are not logged in or that the model is not permitted. The correct mechanism is to rely on the local proxy configuration in ~/.claude/settings.json to take over traffic and complete authentication.
Complete OAuth authentication for the Codex provider in cc-switch and configure model mapping.
Go to cc-switch Settings - Routing - Local Routing (in older versions: Settings - Proxy - Local Proxy), and enable the routing master switch and Claude takeover.
Verify that takeover succeeded. In any terminal, run cat ~/.claude/settings.json and confirm that the output contains the local proxy configuration:
// ~/.claude/settings.json{"env": {"ANTHROPIC_BASE_URL": "http://127.0.0.1:15721","ANTHROPIC_AUTH_TOKEN": "PROXY_MANAGED"},"includeCoAuthoredBy": false}Do not use “Open Terminal” or quick-launch buttons inside cc-switch. Manually open the system global terminal, such as Terminal.app or iTerm2, and run the claude command directly. Traffic will then be taken over by local routing, and OAuth authentication will work.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
- Why does the model name shown in Claude Code after starting it in a global terminal, such as Sonnet 4.6, differ from the Codex model configured in cc-switch, such as gpt-5.4?
- In local routing takeover mode, Claude Code cannot correctly retrieve the actual model list, so the UI still shows default names such as opus and sonnet. This does not affect actual use. The underlying requests are correctly mapped by cc-switch to the Codex model configured in the provider settings.
- What should I do if enabling local routing shows “takeover failed”?
- This usually happens because ~/.claude/settings.json has not been created after the first Claude Code installation. Manually run Claude Code once to generate the file, then return to cc-switch and click takeover 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.