Skip to content

"Not logged in ? Please run /login" Claude Code error

Quick fix

Enable "API Proxy Takeover" in cc-switch when using hosted accounts like Copilot or Codex; direct upstream connections cause auth failures.

Error output
Not logged in ? Please run /login

Providers such as Copilot and Codex OAuth are hosted accounts that rely on cc-switch's local proxy for protocol conversion and Token management. If "API Proxy Takeover" is not enabled, cc-switch writes the upstream API address (e.g., https://api.githubcopilot.com) directly into the configuration file.

Since Claude Code cannot directly handle authentication and protocols from third-party platforms, direct requests result in authentication failures or model permission denied prompts. Additionally, calling the Copilot API directly without going through the proxy to merge tool calls and sub-agents causes session counts to be consumed abnormally fast.

  1. Enable the "API Proxy Takeover" feature in cc-switch to ensure the configuration file points to the local proxy address instead of directly to the upstream API.

    // ~/.claude/settings.json
    {
    "env": {
    "ANTHROPIC_BASE_URL": "http://127.0.0.1:15721",
    "ANTHROPIC_AUTH_TOKEN": "PROXY_MANAGED"
    }
    }
  2. Avoid using the "Open Terminal" function on provider cards to start providers requiring local routing; run the claude command via a regular terminal.

ToolClaude Code
Version3.15.0 - 3.19.1
PlatformsWindows
After enabling API Proxy Takeover, the model fields configured under the Copilot provider disappeared. Is this a bug?
No. After enabling proxy takeover, model configuration is managed uniformly by the proxy layer, so the direct upstream model fields are no longer retained in the configuration file.
Why does a simple conversation consume over a hundred call quotas after configuring Copilot?
Copilot bills per single conversation. If tool calls and sub-agent requests are not correctly merged via the proxy, each ToolCall is recorded as an independent session. Ensure you have enabled proxy takeover and are using a cc-switch version that has fixed this logic.

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.