解决:claude code 无法连接到 Anthropic 服务
输入 'hasCompletedOnboarding': true。打开claude.json文件。
·
先看问题
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ERR BAD REQUEST
lease check your internet connection and network settings.
Note: Claude Code might not be available in your country, Check supported countries atnttps://anthropic.com/supported-countriesS E:ltoollclaude code>

流程图
解决方法,手动添加绕开字段
1.打开文件夹

2.打开主文件夹

3.在这里搜索claude

4.打开如图所示claude.json文件
5.输入 "hasCompletedOnboarding": true,
{
"installMethod": "unknown",
"autoUpdates": true,
"firstStartTime": "2025-07-14T06:11:03.877Z",
"userID": "f5afdd05117c901a4a5a0761d08230bfcbb76f9fd380ff7bc144cc12c52e55aa",
"projects": {
"/home/nassi": {
"allowedTools": [],
"history": [],
"mcpContextUris": [],
"mcpServers": {},
"enabledMcpjsonServers": [],
"disabledMcpjsonServers": [],
"hasTrustDialogAccepted": false,
"projectOnboardingSeenCount": 0,
"hasClaudeMdExternalIncludesApproved": false,
"hasClaudeMdExternalIncludesWarningShown": false
}
}, //这里要加逗号,注意英文的
"hasCompletedOnboarding": true // 新增字段放在这里,注意位置
}
重新输入claude在命令行
claude

更多推荐
所有评论(0)