Skip to content

CodexSwitch 平台配置路径矩阵 ​

更新时间:2026-04-01 用途:明确 macOS / Linux / Windows 下 Codex 和 Claude 的目标配置路径差异


先说结论 ​

是的,macOS / Linux / Windows 的配置路径必须区分。

不能再把它们都写成一套固定路径。


Codex ​

平台主要配置文件
macOS~/.codex/config.toml
macOS~/.codex/auth.json
Linux~/.codex/config.toml
Linux~/.codex/auth.json
Windows%USERPROFILE%\\.codex\\config.toml
Windows%USERPROFILE%\\.codex\\auth.json

Claude ​

平台主要配置文件
macOS~/.claude.json
macOS~/.claude/
Linux~/.claude.json
Linux~/.claude/
Windows%USERPROFILE%\\.claude.json
Windows%USERPROFILE%\\.claude\\

CodexSwitch 自身状态 ​

平台路径
macOS~/.codex-switch/profiles.json
macOS~/.codex-switch/state.json
macOS~/.codex-switch/backups/
Linux~/.codex-switch/profiles.json
Linux~/.codex-switch/state.json
Linux~/.codex-switch/backups/
Windows%USERPROFILE%\\.codex-switch\\profiles.json
Windows%USERPROFILE%\\.codex-switch\\state.json
Windows%USERPROFILE%\\.codex-switch\\backups\\

当前策略 ​

Codex ​

  • Runtime Override
    • 推荐
    • 尽量不改 ~/.codex 源配置
  • Persistent Switch
    • 仅在确实需要时才使用

Claude ​

  • 当前优先走 Runtime Override
  • 不建议先做粗暴覆盖 ~/.claude.json

规则 ​

以后任何涉及“会改哪些文件”的文档、界面、预览,都应该基于平台来显示,不再写死成一套路径。