auth.json Is Force-Replaced, Making Codex Unusable
Quick fix
Upgrade to a later version that includes the fix. Before upgrading, disable Codex takeover, sign in to official ChatGPT, then re-enable takeover.
Symptom
Section titled “Symptom”只要退出cc switch,重启后.claude下的auth.json会被强制替换As long as you exit cc switch, the auth.json under .claude is force-replaced after restart.
When proxy takeover is enabled, cc-switch creates a snapshot for `auth.json`. If you sign in to official ChatGPT during takeover, the restore logic on exit may write the old third-party API key from the snapshot back, overwriting the newly signed-in official credentials; automatic restoration after restart can repeat the issue.
The maintainer said the issue was identified and fixed for a later release. After the fix, restoration checks whether the current `auth.json` has valid official sign-in credentials. If so, it keeps them and writes the third-party key from the snapshot to `experimental_bearer_token` in `config.toml`.
Upgrade to a later cc-switch version that includes the fix; the original post did not specify the release version.
Temporary workaround before upgrading: first disable Codex takeover, sign in to official ChatGPT, then re-enable takeover so the snapshot includes the official sign-in credentials.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
(No FAQ yet)
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.