Skip to content

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.

Error output
只要退出cc switch,重启后.claude下的auth.json会被强制替换
English translation

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`.

  1. Upgrade to a later cc-switch version that includes the fix; the original post did not specify the release version.

  2. 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.

ToolCodex
Version3.19.2(受影响版本)
PlatformsWindows

(No FAQ yet)

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.