在使用Claude中,因为网络或者价格的原因,我们通常会使用到国内LLM的模型,为了便于管理模型provider,通常还会搭配 CC Switch一起使用。
但是,每次重启电脑后,使用CC Switch设置代理后,会导致Claude中我们自定义的配置文件的丢失,只剩下 CC Switch覆盖进来的配置,类似如下:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "PROXY_MANAGED",
"ANTHROPIC_BASE_URL": "http://127.0.0.1:15721"
}目前作者暂时没有修复这个往年题,我们可以临时提供给如下方法绕过。
在CC Switch中,编辑在使用的模型供应商。

在配置JSON的地方,将我们之前自定义的配置加进去,修改如下:

下面是我自定义的配置,供参考。如果有问题请反馈修正。
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxxxx",
"ANTHROPIC_BASE_URL": "https://x.x.x.x/apps/anthropic",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "xxxxx",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "xxxxx",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "xxxxx",
"ANTHROPIC_MODEL": "xxxxx",
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"companyAnnouncements": [
"===== 提醒: 所有的PR都要进行Code reviews后才能合并进Main分支 ====="
],
"permissions": {
"allow": [
"WebSearch",
"Bash(npm run *)",
"Bash(git * main)",
"Bash(* --version)",
"Bash(* --help *)",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git push *)",
"Bash(cat *)",
"Bash(rm *)",
"Bash(echo *)",
"Bash(mkdir -p .git)"
],
"deny": [
"Bash(git push *)",
"Bash(curl *)"
],
"inherit_from_parent": false
},
"enabledPlugins": {
"python-development@claude-code-workflows": true,
"database-migrations@claude-code-workflows": true,
"pyright-lsp@claude-plugins-official": true,
"commit-commands@claude-plugins-official": true,
"everything-claude-code@everything-claude-code": true
},
"extraKnownMarketplaces": {
"everything-claude-code": {
"source": {
"source": "git",
"url": "https://github.com/affaan-m/everything-claude-code.git"
}
}
},
"autoUpdatesChannel": "stable",
"skipDangerousModePermissionPrompt": true,
"features": {
"enable_diff_view": true,
"auto_save_context": true,
"suggest_git_ignore": true
},
"CLAUDE_CODE_NEW_INIT": true,
"CLAUDE_CODE_DISABLE_AUTO_MEMORY": 0,
"CLAUDE_CODE_DISABLE_BACKGROUND_TASKS": 0,
"CLAUDE_CODE_DISABLE_CRON": 0,
"CLAUDE_CODE_DISABLE_FAST_MODE": 1,
"CLAUDE_CODE_ENABLE_TASKS": true,
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": true,
"CLAUDE_CODE_PLAN_MODE_REQUIRED": false,
"CLAUDE_CODE_SIMPLE": false,
"CLAUDE_CODE_TASK_LIST_ID": true,
"DISABLE_AUTOUPDATER": false,
"DISABLE_COST_WARNINGS": true,
"MCP_TOOL_TIMEOUT": 30000,
"statusLine": {
"type": "command",
"command": "npx -y @owloops/claude-powerline@latest --style=powerline"
}
}原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。