Codex still asks for a login when opened - CC Switch
Quick fix
Delete the Codex default configuration or the whole .codex folder to skip the login check.
Symptom
Section titled “Symptom”CC Switch 已部署 打开Codex仍要求登录CC Switch is deployed but opening Codex still asks for a login
After a Codex client version update, its local config files (usually in the .codex directory) may retain the old auth state or the default configuration, so even with CC Switch taking over the API requests the client still forces the official login screen at startup.
Some users try to work around this by registering an OpenAI account and logging in with an API Key, but the more effective answer is clearing those leftover local configs outright. Deleting the .codex folder containing the default configuration resets the client auth state so it no longer triggers the login flow, letting CC Switch inject the API credential normally.
Quit the Codex application completely.
Find and delete the .codex folder in the project root (or the whole codex install directory if it is installed standalone). This clears the default auth configuration.
删除 .codex 目录 rm -rf .codexRestart Codex. It should no longer show the login window and should use the provider interface configured in CC Switch directly.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Does deleting the .codex folder lose my conversation history?
- Yes — deleting that folder usually clears the local conversation history and cached configuration. If you need the history, make sure your CC Switch configuration supports cloud sync, or back up anything important before you start.
- Why do I still get a model-not-supported or 401 after deleting the configuration?
- If it still errors after the deletion, the CC Switch routing configuration may not be on, or your API Key may lack permissions. Check that CC Switch really took the request over and that the API Key is valid.
- Is there another way without deleting the folder?
- You can register an account on ChatGPT, create an API Key on the OpenAI API platform, and log in with it through "other methods". But that only routes around the login screen — the real fix is still clearing the leftover configuration.
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.