55| `spend limit reached` / `spend limit unavailable` | [使用限制](#spend-limit-reached) |55| `spend limit reached` / `spend limit unavailable` | [使用限制](#spend-limit-reached) |
56| `Not logged in · Please run /login` | [身份验证](#not-logged-in) |56| `Not logged in · Please run /login` | [身份验证](#not-logged-in) |
57| `Couldn't save your login` | [身份验证](#couldnt-save-your-login) |57| `Couldn't save your login` | [身份验证](#couldnt-save-your-login) |
58| `Sign in again to take your previous account or API key off the config file.` | [身份验证](#sign-in-again-to-take-your-previous-account-or-api-key-off-the-config-file) |
59| `Your account or API key may still be in the config file. Run claude auth logout.` | [身份验证](#your-account-or-api-key-may-still-be-in-the-config-file) |
58| `Authentication required · Sign in again to continue` | [身份验证](#not-logged-in) |60| `Authentication required · Sign in again to continue` | [身份验证](#not-logged-in) |
59| `Could not resolve authentication method` | [身份验证](#could-not-resolve-authentication-method) |61| `Could not resolve authentication method` | [身份验证](#could-not-resolve-authentication-method) |
60| `Invalid API key` | [身份验证](#invalid-api-key) |62| `Invalid API key` | [身份验证](#invalid-api-key) |
82| `Couldn't verify your organization's policy for remote control` | [Troubleshoot Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md#couldnt-verify-your-organizations-policy-for-remote-control) |84| `Couldn't verify your organization's policy for remote control` | [Troubleshoot Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md#couldnt-verify-your-organizations-policy-for-remote-control) |
83| `Remote Control is disabled by your organization's policy` | [Troubleshoot Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md#remote-control-is-disabled-by-your-organizations-policy) |85| `Remote Control is disabled by your organization's policy` | [Troubleshoot Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md#remote-control-is-disabled-by-your-organizations-policy) |
84| `Remote Control was turned off by your organization's policy` | [Troubleshoot Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md#remote-control-was-turned-off-by-your-organizations-policy) |86| `Remote Control was turned off by your organization's policy` | [Troubleshoot Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md#remote-control-was-turned-off-by-your-organizations-policy) |
87| `Session failed: working folder not found:` | [Remote Control 故障排除](https://code.claude.com/docs/zh-CN/remote-control.md#working-folder-not-found) |
88| `The program file this Remote Control started from is gone` | [Remote Control 故障排除](https://code.claude.com/docs/zh-CN/remote-control.md#program-file-is-gone) |
89| `Session failed: spawn error:` 后跟一条 `ENOENT` 消息 | [Remote Control 故障排除](https://code.claude.com/docs/zh-CN/remote-control.md#program-file-is-gone) |
85| `OAuth token revoked` / `OAuth token has expired` | [身份验证](#oauth-token-revoked-or-expired) |90| `OAuth token revoked` / `OAuth token has expired` | [身份验证](#oauth-token-revoked-or-expired) |
86| `Failed to authenticate: OAuth token revoked` | [身份验证](#oauth-token-revoked-or-expired) |91| `Failed to authenticate: OAuth token revoked` | [身份验证](#oauth-token-revoked-or-expired) |
87| `Your account does not have access to Claude. Please login again or contact your administrator.` | [身份验证](#oauth-token-revoked-or-expired) |92| `Your account does not have access to Claude. Please login again or contact your administrator.` | [身份验证](#oauth-token-revoked-or-expired) |
165| `Request too large for the API's 32MB request limit` | [请求错误](#request-too-large) |170| `Request too large for the API's 32MB request limit` | [请求错误](#request-too-large) |
166| `Image was too large` | [请求错误](#image-was-too-large) |171| `Image was too large` | [请求错误](#image-was-too-large) |
167| `API Error: an image in the conversation could not be processed and was removed` | [请求错误](#image-was-too-large) |172| `API Error: an image in the conversation could not be processed and was removed` | [请求错误](#image-was-too-large) |
173| `An image in the conversation exceeds the dimension limit for many-image requests` | [请求错误](#image-was-too-large) |
168| `Unable to resize image` | [请求错误](#unable-to-resize-image) |174| `Unable to resize image` | [请求错误](#unable-to-resize-image) |
169| `Request rejected as unprocessable by the model` | [请求错误](#request-rejected-as-unprocessable-by-the-model) |175| `Request rejected as unprocessable by the model` | [请求错误](#request-rejected-as-unprocessable-by-the-model) |
170| `PDF too large` / `PDF is password protected` / `pdftoppm is not installed` | [请求错误](#pdf-errors) |176| `PDF too large` / `PDF is password protected` / `pdftoppm is not installed` | [请求错误](#pdf-errors) |
229| `Error: --agents takes a JSON object, or a file path only with --print (-p)` | [命令行错误](#invalid-agents-configuration) |235| `Error: --agents takes a JSON object, or a file path only with --print (-p)` | [命令行错误](#invalid-agents-configuration) |
230| `Error: --agents file not found` | [命令行错误](#invalid-agents-configuration) |236| `Error: --agents file not found` | [命令行错误](#invalid-agents-configuration) |
231| `Error: Settings file exceeds the 2MiB limit` | [命令行错误](#settings-file-exceeds-the-2mib-limit) |237| `Error: Settings file exceeds the 2MiB limit` | [命令行错误](#settings-file-exceeds-the-2mib-limit) |
238| `Configuration error in` | [命令行错误](#configuration-error-in-claude-json) |
239| `Claude configuration file at <path> was empty and no backup holds anything: starting with defaults.` | [命令行错误](#claude-configuration-file-was-empty) |
232| `The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory` | [命令行错误](#the-current-directory-no-longer-exists) |240| `The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory` | [命令行错误](#the-current-directory-no-longer-exists) |
233| `Temp directory <dir> ... Refusing to use it` / `Claude Code's temporary directory <dir> could not be created` | [命令行错误](#temp-directory-refused-or-cannot-be-created) |241| `Temp directory <dir> ... Refusing to use it` / `Claude Code's temporary directory <dir> could not be created` | [命令行错误](#temp-directory-refused-or-cannot-be-created) |
234| `ENOSPC: no space left on device, mkdir '<dir>'` | [命令行错误](#temp-directory-refused-or-cannot-be-created) |242| `ENOSPC: no space left on device, mkdir '<dir>'` | [命令行错误](#temp-directory-refused-or-cannot-be-created) |
334| `cannot contain null bytes (\0)` | [工具错误](#path-cannot-contain-null-bytes) |342| `cannot contain null bytes (\0)` | [工具错误](#path-cannot-contain-null-bytes) |
335| `Path contains null bytes` | [工具错误](#path-cannot-contain-null-bytes) |343| `Path contains null bytes` | [工具错误](#path-cannot-contain-null-bytes) |
336| `command contains the invisible character U+FEFF (byte order mark) or U+180E (Mongolian vowel separator), and was not run` | [工具错误](#command-contains-an-invisible-character) |344| `command contains the invisible character U+FEFF (byte order mark) or U+180E (Mongolian vowel separator), and was not run` | [工具错误](#command-contains-an-invisible-character) |
345| `This call was not run. The command was approved before Claude Code restarted` | [工具错误](#command-approved-before-a-restart-was-not-run) |
337| `File is too large to read as an image (the limit is 128MB)` | [工具错误](#file-is-too-large-to-read-as-an-image) |346| `File is too large to read as an image (the limit is 128MB)` | [工具错误](#file-is-too-large-to-read-as-an-image) |
338| `Cannot read this as an image: <path> is a pipe or a device` | [工具错误](#file-is-too-large-to-read-as-an-image) |347| `Cannot read this as an image: <path> is a pipe or a device` | [工具错误](#file-is-too-large-to-read-as-an-image) |
339| `subagent_type is required: the general-purpose agent is not available in this session` | [工具错误](#subagent-type-is-required) |348| `subagent_type is required: the general-purpose agent is not available in this session` | [工具错误](#subagent-type-is-required) |
420| `Not loaded: rename <path>, then restart — its name uses "<name>", a name reserved for the skills synced from your claude.ai account` | [配置警告](#a-skill-command-or-workflow-wasnt-loaded-because-its-name-is-reserved) |429| `Not loaded: rename <path>, then restart — its name uses "<name>", a name reserved for the skills synced from your claude.ai account` | [配置警告](#a-skill-command-or-workflow-wasnt-loaded-because-its-name-is-reserved) |
421| `N skill or command names refused: run with --debug to see which ([names]), rename, then restart` | [配置警告](#skill-or-command-name-refused) |430| `N skill or command names refused: run with --debug to see which ([names]), rename, then restart` | [配置警告](#skill-or-command-name-refused) |
422| `Ignoring N permissions.allow entries from ... this workspace has not been trusted` | [配置警告](#workspace-has-not-been-trusted) |431| `Ignoring N permissions.allow entries from ... this workspace has not been trusted` | [配置警告](#workspace-has-not-been-trusted) |
432| `Make this change again later: <path> could not be updated, so it applies to this session only` | [配置警告](#make-this-change-again-later) |
423| `is a network path, which cannot be added as a working directory` | [配置警告](#working-directory-is-a-network-path) |433| `is a network path, which cannot be added as a working directory` | [配置警告](#working-directory-is-a-network-path) |
424| `Remote managed settings failed to load (<cause>)` | [配置警告](#remote-managed-settings-failed-to-load) |434| `Remote managed settings failed to load (<cause>)` | [配置警告](#remote-managed-settings-failed-to-load) |
435| `Your organization requires remote managed settings to load, but they could not be loaded` | [强制执行故障关闭式启动](https://code.claude.com/docs/zh-CN/server-managed-settings.md#enforce-fail-closed-startup) |
436| `Remote managed settings are still loading` | [配置警告](#remote-managed-settings-failed-to-load) |
437| `Remote managed settings did not load` | [配置警告](#remote-managed-settings-failed-to-load) |
438| `Claude Code couldn't load your organization's settings` / `Claude Code couldn't reach Anthropic to load your organization's settings` / `requires them before a session can start` | [配置警告](#couldnt-load-your-organizations-settings) |
439| `Claude Code can't start this session yet` | [配置警告](#couldnt-load-your-organizations-settings) |
440| `Your Claude session has expired. Sign in again to continue (claude auth login).` | [配置警告](#couldnt-load-your-organizations-settings) |
425| `Managed settings were not approved; exiting without applying them.` | [配置警告](#managed-settings-were-not-approved) |441| `Managed settings were not approved; exiting without applying them.` | [配置警告](#managed-settings-were-not-approved) |
426| `Your organization's managed settings need your approval, which couldn't be asked for here.` | [配置警告](#managed-settings-need-your-approval) |442| `Your organization's managed settings need your approval, which couldn't be asked for here.` | [配置警告](#managed-settings-need-your-approval) |
427| `Claude Code can't start: your organization's managed settings block the default model` / `Claude Code can't start: your organization allows only the models listed in "availableModels"` | [配置警告](#managed-settings-block-the-default-model) |443| `Claude Code can't start: your organization's managed settings block the default model` / `Claude Code can't start: your organization allows only the models listed in "availableModels"` | [配置警告](#managed-settings-block-the-default-model) |
454| `is ignored — managed settings set allowManagedReadPathsOnly` / `is ignored — managed settings set allowManagedDomainsOnly` | [配置警告](#sandbox-allow-entries-are-ignored-under-a-managed-lock) |470| `is ignored — managed settings set allowManagedReadPathsOnly` / `is ignored — managed settings set allowManagedDomainsOnly` | [配置警告](#sandbox-allow-entries-are-ignored-under-a-managed-lock) |
455| `Sandbox mask files left behind at write-deny paths` | [配置警告](#stale-sandbox-mask-files-left-by-a-killed-session) |471| `Sandbox mask files left behind at write-deny paths` | [配置警告](#stale-sandbox-mask-files-left-by-a-killed-session) |
456| `Stale sandbox mask files left by a killed session` | [配置警告](#stale-sandbox-mask-files-left-by-a-killed-session) |472| `Stale sandbox mask files left by a killed session` | [配置警告](#stale-sandbox-mask-files-left-by-a-killed-session) |
473| `Ubuntu's AppArmor restriction on user namespaces stops bubblewrap here` | [沙箱隔离故障排除](https://code.claude.com/docs/zh-CN/sandboxing.md#apparmor-restriction-stops-bubblewrap) |
474| `bwrap: setting up uid map: Permission denied` / `bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted` | [沙箱隔离故障排除](https://code.claude.com/docs/zh-CN/sandboxing.md#bwrap-uid-map-permission-denied) |
457| 响应质量似乎比平时低 | [响应质量](#responses-seem-lower-quality-than-usual) |475| 响应质量似乎比平时低 | [响应质量](#responses-seem-lower-quality-than-usual) |
458 476
459## 自动重试477## 自动重试
1031* 运行 `/login`,使用您的 Claude 订阅或 Console 账户进行身份验证1049* 运行 `/login`,使用您的 Claude 订阅或 Console 账户进行身份验证
1032* 如果您原本希望通过环境变量进行身份验证,请确认在启动 `claude` 的 shell 中已设置并导出 `ANTHROPIC_API_KEY`1050* 如果您原本希望通过环境变量进行身份验证,请确认在启动 `claude` 的 shell 中已设置并导出 `ANTHROPIC_API_KEY`
1033* 对于无法进行交互式登录的 CI 或自动化场景,请配置一个在启动时获取密钥的 [`apiKeyHelper`](https://code.claude.com/docs/zh-CN/settings-reference#apikeyhelper) 脚本1051* 对于无法进行交互式登录的 CI 或自动化场景,请配置一个在启动时获取密钥的 [`apiKeyHelper`](https://code.claude.com/docs/zh-CN/settings-reference#apikeyhelper) 脚本
1052* 如果有人重新登录同一个 claude.ai 账户和组织时,`claude -p` 作业因此消息而退出,请更新执行该登录的 Claude Code。在 v2.1.318 之前,Claude Code 会在该登录过程中、保存新登录之前删除已存储的登录。
1034* 请参阅[身份验证优先级](https://code.claude.com/docs/zh-CN/authentication.md#authentication-precedence),了解存在多个凭据时 Claude Code 使用哪一个1053* 请参阅[身份验证优先级](https://code.claude.com/docs/zh-CN/authentication.md#authentication-precedence),了解存在多个凭据时 Claude Code 使用哪一个
1035 1054
1036如果系统反复提示您登录,请参阅[未登录或令牌已过期](https://code.claude.com/docs/zh-CN/troubleshoot-install.md#not-logged-in-or-token-expired),了解系统时钟检查以及 macOS 凭据存储的恢复步骤。1055如果系统反复提示您登录,请参阅[未登录或令牌已过期](https://code.claude.com/docs/zh-CN/troubleshoot-install.md#not-logged-in-or-token-expired),了解系统时钟检查以及 macOS 凭据存储的恢复步骤。
1441* 在其他平台上,再次运行 `/login`1460* 在其他平台上,再次运行 `/login`
1442* 如果登录仍然无法保存,请参阅[未登录或令牌已过期](https://code.claude.com/docs/zh-CN/troubleshoot-install.md#not-logged-in-or-token-expired),了解钥匙串解锁命令和其他凭据存储恢复步骤1461* 如果登录仍然无法保存,请参阅[未登录或令牌已过期](https://code.claude.com/docs/zh-CN/troubleshoot-install.md#not-logged-in-or-token-expired),了解钥匙串解锁命令和其他凭据存储恢复步骤
1443 1462
1463### Sign in again to take your previous account or API key off the config file
1464
1465登录后出现此警告,表示您之前登录过的任何账户可能仍存储在 [`~/.claude.json`](https://code.claude.com/docs/zh-CN/claude-directory#ce-claude-json) 中:
1466
1467```text theme={null}
1468Sign in again to take your previous account or API key off the config file.
1469```
1470
1471如果在 Linux 或 Windows 上通过 Console 登录创建了 API 密钥,该 API 密钥也可能仍在 `~/.claude.json` 中。
1472
1473**解决方法:**
1474
1475* 在 shell 中运行 `claude auth login` 重新登录。随后 Claude Code 会重试保存操作,将被替换的账户或 API 密钥从文件中移除。
1476
1477### Your account or API key may still be in the config file
1478
1479您运行了 `/logout` 或 `claude auth logout`,Claude Code 已让此进程退出登录,但无法确认 [`~/.claude.json`](https://code.claude.com/docs/zh-CN/claude-directory#ce-claude-json) 中不再保存您的账户。原因可能是保存未生效,或者无法读回文件进行检查。
1480
1481```text theme={null}
1482Your account or API key may still be in the config file. Run claude auth logout.
1483```
1484
1485如果在 Linux 或 Windows 上通过 Console 登录创建了 API 密钥,该 API 密钥也可能仍在 `~/.claude.json` 中。
1486
1487**解决方法:**
1488
1489* 在 shell 中运行 `claude auth logout` 再次尝试保存。保存成功后,该命令会输出 `Successfully logged out from your Anthropic account.`
1490
1444### Couldn't start the local listener that receives the browser sign-in1491### Couldn't start the local listener that receives the browser sign-in
1445 1492
1446来自 `/login`、`claude auth login` 或 `claude setup-token` 的以下每条消息都表示 Claude Code 无法在 `127.0.0.1` 上打开供浏览器返回登录结果的端口。1493来自 `/login`、`claude auth login` 或 `claude setup-token` 的以下每条消息都表示 Claude Code 无法在 `127.0.0.1` 上打开供浏览器返回登录结果的端口。
2420Image was too large. Double press esc to go back and try again with a smaller image.2467Image was too large. Double press esc to go back and try again with a smaller image.
2421API Error: 400 ... image dimensions exceed max allowed size2468API Error: 400 ... image dimensions exceed max allowed size
2422API Error: an image in the conversation could not be processed and was removed.2469API Error: an image in the conversation could not be processed and was removed.
2470An image in the conversation exceeds the dimension limit for many-image requests (3000px). Run /compact to remove old images from context, or start a new session.
2423```2471```
2424 2472
2425`could not be processed and was removed` 行表示 API 拒绝了对话中的某张图片,例如超出大小或尺寸限制的图片。2473`could not be processed and was removed` 行表示 API 拒绝了对话中的某张图片,例如超出大小或尺寸限制的图片。
2434 2482
2435* 在粘贴之前调整图像大小。API 接受单个图像最长边最多 8000 像素的图像,或当上下文中有超过 20 张图像时最多 3000 像素。2483* 在粘贴之前调整图像大小。API 接受单个图像最长边最多 8000 像素的图像,或当上下文中有超过 20 张图像时最多 3000 像素。
2436* 拍摄相关区域的更紧密屏幕截图,而不是整个屏幕2484* 拍摄相关区域的更紧密屏幕截图,而不是整个屏幕
2485* 对于 `dimension limit for many-image requests` 消息,如果消息提及了 `/compact`,请在 Claude Code 提示符处运行它,或以更少的图片开始新会话
2486
2487`dimension limit for many-image requests` 消息显示的是 API 错误中注明的像素限制。
2437 2488
2438### 无法调整图像大小2489### 无法调整图像大小
2439 2490
3223 3274
3224* 将 `--settings` 指向一个小于 2 MiB 的常规 JSON 设置文件。有关格式,请参阅[设置](https://code.claude.com/docs/zh-CN/settings.md)。3275* 将 `--settings` 指向一个小于 2 MiB 的常规 JSON 设置文件。有关格式,请参阅[设置](https://code.claude.com/docs/zh-CN/settings.md)。
3225 3276
3277### Configuration error in \~/.claude.json
3278
3279Claude Code 无法解析 `~/.claude.json`,该文件保存您的账户详细信息、MCP 服务器和每个项目的状态。您的文件未被更改。在您修复该文件之前,每次[非交互式](https://code.claude.com/docs/zh-CN/headless.md)启动(例如 `claude -p`)都会以退出码 1 退出。
3280
3281当 Claude Code 找到[备份](https://code.claude.com/docs/zh-CN/claude-directory.md#cleaned-up-automatically)时,输出会指出该备份,并打印一行用于将其复制回来的 `cp` 命令:
3282
3283```text wrap theme={null}
3284Claude configuration file at /home/user/.claude.json is corrupted: <JSON parser's message>
3285The corrupted file has been backed up to: /home/user/.claude/backups/.claude.json.corrupted.1793664000000
3286A backup file exists at: /home/user/.claude/backups/.claude.json.backup.1793660400000
3287You can manually restore it by running: cp -f "/home/user/.claude/backups/.claude.json.backup.1793660400000" "/home/user/.claude.json"
3288
3289Configuration error in /home/user/.claude.json: <JSON parser's message>
3290```
3291
3292**解决方法:**
3293
3294* **输出中有 `cp` 行**:在终端中运行该行。在 Windows 上,请在 PowerShell 中运行。它会用备份(`~/.claude.json` 的较早版本)替换损坏的文件。
3295* **输出中没有 `cp` 行,或运行后错误再次出现**:修复 `~/.claude.json` 中的 JSON;如果 [`~/.claude/backups/`](https://code.claude.com/docs/zh-CN/claude-directory#cleaned-up-automatically) 中有另一个 `.claude.json.backup.<timestamp>` 文件,可将其复制覆盖该文件;或者将该文件重命名。当 `~/.claude.json` 处没有文件时,Claude Code 会以默认设置启动,该文件中保存的内容都将不存在。
3296
3297在 v2.1.318 之前,非交互式启动打印此错误后,`~/.claude.json` 中会只剩下默认值,因此下一次启动将在没有您配置的情况下运行。
3298
3299### Claude configuration file was empty and no backup holds anything
3300
3301启动时出现此消息,表示其指出的文件为空,且该文件的所有 [`.backup` 副本](https://code.claude.com/docs/zh-CN/claude-directory#cleaned-up-automatically)中都没有任何内容。Claude Code 已为该文件所保存的内容使用默认值启动。您的 `settings.json` 文件和 `.mcp.json` 是单独的文件。
3302
3303```text wrap theme={null}
3304Claude configuration file at /home/user/.claude.json was empty and no backup holds anything: starting with defaults.
3305```
3306
3307**解决方法:**
3308
3309* 重新设置您之前在该文件中配置的内容。例如,在终端中使用 `claude mcp add` 添加您 `user` 和 `local` 作用域的 [MCP 服务器](https://code.claude.com/docs/zh-CN/mcp.md#mcp-installation-scopes)。
3310* 如果 Claude Code 要求您重新登录,请重新登录
3311
3312在 v2.1.318 之前,Claude Code 会将没有备份的空文件报告为[已损坏](#configuration-error-in-claude-json)。
3313
3226### 当前目录已不存在3314### 当前目录已不存在
3227 3315
3228您从一个在 shell 进入后被删除或移动的目录中启动了 `claude`,例如被另一个 shell 删除的 worktree 或临时目录。Claude Code 无法读取其工作目录,因此无论是交互模式还是[非交互](https://code.claude.com/docs/zh-CN/headless.md)模式,它都会在启动会话前以退出码 1 退出。在 v2.1.239 之前,Claude Code 会崩溃,并在 stderr 上输出压缩后的 bundle 源代码和原始的 `ENOENT ... uv_cwd` 堆栈,而不是此消息。3316您从一个在 shell 进入后被删除或移动的目录中启动了 `claude`,例如被另一个 shell 删除的 worktree 或临时目录。Claude Code 无法读取其工作目录,因此无论是交互模式还是[非交互](https://code.claude.com/docs/zh-CN/headless.md)模式,它都会在启动会话前以退出码 1 退出。在 v2.1.239 之前,Claude Code 会崩溃,并在 stderr 上输出压缩后的 bundle 源代码和原始的 `ENOENT ... uv_cwd` 堆栈,而不是此消息。
3334* **`Error: Workspace not trusted. <folder> is your home directory`**:由于主目录的信任从不保存,先在那里运行 `claude` 也无济于事。请改为在项目目录中运行 `claude ultrareview`(先在那里运行一次 `claude` 以接受信任对话框),或追加 `--trust-workspace`。3422* **`Error: Workspace not trusted. <folder> is your home directory`**:由于主目录的信任从不保存,先在那里运行 `claude` 也无济于事。请改为在项目目录中运行 `claude ultrareview`(先在那里运行一次 `claude` 以接受信任对话框),或追加 `--trust-workspace`。
3335* **`No answer in time.` 后跟 `Error: Workspace not trusted`**:`Trust <folder>? [y/N]` 问题在 5 分钟内未得到回答。再次运行 `claude ultrareview` 并回答该问题。3423* **`No answer in time.` 后跟 `Error: Workspace not trusted`**:`Trust <folder>? [y/N]` 问题在 5 分钟内未得到回答。再次运行 `claude ultrareview` 并回答该问题。
3336* **`Ultrareview did not start: <folder> is not trusted`**:您在 `Trust <folder>? [y/N]` 问题处拒绝了,例如回答 `n` 或按 Enter。若要开始审查,请再次运行 `claude ultrareview` 并回答 `y`。3424* **`Ultrareview did not start: <folder> is not trusted`**:您在 `Trust <folder>? [y/N]` 问题处拒绝了,例如回答 `n` 或按 Enter。若要开始审查,请再次运行 `claude ultrareview` 并回答 `y`。
3337* **``Ultrareview did not start: `--trust-workspace` takes no value``**:`--trust-workspace` 后面跟着的不是标志,例如 PR 编号或 `false`。如果您不信任该文件夹,请不要使用该标志。要在本次运行中信任它,请将 PR 编号或基础分支放在该标志之前:`claude ultrareview 1234 --trust-workspace`。3425* **``Ultrareview did not start: `--trust-workspace` takes no value``**:`--trust-workspace` 后面跟了标志以外的内容,例如 PR 编号或 `false`。如果您不信任该文件夹,请不要使用该标志。若要在本次运行中信任它,请将 PR 编号或基础分支放在该标志之前:`claude ultrareview 1234 --trust-workspace`。
3338 3426
3339在 v2.1.309 之前,`claude ultrareview` 不接受 `--trust-workspace`。3427在 v2.1.309 之前,`claude ultrareview` 不接受 `--trust-workspace`。
3340 3428
3626 3714
3627以下相关消息会在命令运行之前就出现:3715以下相关消息会在命令运行之前就出现:
3628 3716
3629* `Shell command permission check failed for pattern "..."`:该命令的权限检查没有允许它。[注入命令的权限检查](https://code.claude.com/docs/zh-CN/skills.md#permission-checks-on-injected-commands)介绍了在各权限模式下哪些结果会导致中止,以及如何通过 `allowed-tools` 预先批准命令3717* `Shell command permission check failed for pattern "..."`:该命令的权限检查未允许它运行。[注入命令的权限检查](https://code.claude.com/docs/zh-CN/skills.md#permission-checks-on-injected-commands)介绍了在每种权限模式下哪些结果会导致中止,以及如何通过 `allowed-tools` 预先批准命令
3630* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``:该 skill 的 frontmatter 要求使用 bash,而机器上没有 bash。请安装 Git for Windows,或将 frontmatter 改为 `shell: powershell`。请参阅[注入命令的运行方式](https://code.claude.com/docs/zh-CN/skills.md#how-injected-commands-run)3718* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``:该 skill 的 frontmatter 要求 bash,而机器上没有安装 bash。请安装 Git for Windows,或将 frontmatter 改为 `shell: powershell`。请参阅[注入命令的运行方式](https://code.claude.com/docs/zh-CN/skills.md#how-injected-commands-run)
3631 3719
3632**解决方法:**3720**解决方法:**
3633 3721
3780 3868
3781* **您没有传入基础分支**:Claude Code 与仓库的默认分支进行了比较,并建议您显式传入基础分支,如上例所示3869* **您没有传入基础分支**:Claude Code 与仓库的默认分支进行了比较,并建议您显式传入基础分支,如上例所示
3782* **您传入的基础分支已存在于您的克隆中**:提示为 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``3870* **您传入的基础分支已存在于您的克隆中**:提示为 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``
3783* **您传入的基础分支不在您的克隆中**:Claude Code 在比较之前从 origin 获取了该分支。提示为 ``<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`)``;当 Claude Code 无法判断您的克隆是否为浅克隆时,会改为建议 `git fetch --unshallow origin`。在 v2.1.221 之前,对于每个获取的基础分支,提示都会建议 `git fetch --unshallow origin`,而在完整克隆上,该命令会失败并显示 `fatal: --unshallow on a complete repository does not make sense`。3871* **您传入的基础分支不在您的克隆中**:Claude Code 在比较前从 origin 获取了该分支。提示内容为 ``<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`)``;当 Claude Code 无法判断您的克隆是否为浅克隆时,它会改为建议 `git fetch --unshallow origin`。在 v2.1.221 之前,对于每个获取的基础分支,提示都会建议 `git fetch --unshallow origin`,而在完整克隆上该命令会失败,报错 `fatal: --unshallow on a complete repository does not make sense`。
3784 3872
3785**解决方法:**3873**解决方法:**
3786 3874
4666* **对于 Claude 编写的命令**:您无需修复任何内容。该消息会告诉 Claude 如何重写该命令。4754* **对于 Claude 编写的命令**:您无需修复任何内容。该消息会告诉 Claude 如何重写该命令。
4667* **对于 skill 或命令文件**:该消息跟在 `No shell command in <name> was run` 之后。请参阅[在何处找到该字符并将其移除](#no-shell-command-was-run)。4755* **对于 skill 或命令文件**:该消息跟在 `No shell command in <name> was run` 之后。请参阅[在何处找到该字符并将其移除](#no-shell-command-was-run)。
4668 4756
4757### Claude Code 重启前批准的命令未运行
4758
4759您批准的一条 shell 命令没有运行,Claude 会收到以下消息作为该命令的结果:
4760
4761```text wrap theme={null}
4762This call was not run. The command was approved before Claude Code restarted, and Claude Code could not confirm that the shell is back in the directory where it was approved. That directory may be gone or replaced, lie outside the directory where the session started, or be one that Claude Code needs approval to enter or is not allowed to examine. The shell's directory is <directory>. If the command still makes sense, cd to the directory it was meant for and make the call again; it may need approval again.
4763```
4764
4765该消息的第三句也可能改为 `It does not keep track of that directory across a restart in a session that has been in a worktree.`
4766
4767**处理方法:**
4768
4769* 让 Claude 继续;如果系统要求您再次批准该命令,请回应该提示。
4770
4669### File is too large to read as an image4771### File is too large to read as an image
4670 4772
4671Claude 尝试使用 [Read 工具](https://code.claude.com/docs/zh-CN/tools-reference.md#read-tool-behavior)将文件作为图像读取,但该文件大于 128 MB,这是 Read 从图像文件加载的上限。未读取任何内容,Claude 会收到以下错误作为工具结果:4773Claude 尝试使用 [Read 工具](https://code.claude.com/docs/zh-CN/tools-reference.md#read-tool-behavior)将文件作为图像读取,但该文件大于 128 MB,这是 Read 从图像文件加载的上限。未读取任何内容,Claude 会收到以下错误作为工具结果:
5818 5920
5819### Remote managed settings failed to load5921### Remote managed settings failed to load
5820 5922
5821您的会话符合使用[服务器托管设置](https://code.claude.com/docs/zh-CN/server-managed-settings.md)的条件,但 Claude Code 无法获取这些设置,或无法应用服务器返回的内容,因此会在交互式会话中显示此警告。5923您的会话符合使用[服务器托管设置](https://code.claude.com/docs/zh-CN/server-managed-settings.md)的条件,但 Claude Code 无法获取这些设置,或无法应用服务器返回的内容,因此会在交互式会话以及 Claude Desktop 的 Code 标签页中显示此警告。
5822 5924
5823括号中的原因说明了失败的内容,例如 `network error`、`request timed out` 或 `authentication rejected (401)`。原因 `no setting in the server response could be applied as written` 表示服务器已响应,但其返回的设置均未通过[验证](https://code.claude.com/docs/zh-CN/server-managed-settings.md#invalid-entries-in-delivered-settings)。在 v2.1.282 之前,此原因显示为 `server returned invalid settings`。5925括号中的原因说明了失败的内容,例如 `network error`、`request timed out` 或 `authentication rejected (401)`。原因 `no setting in the server response could be applied as written` 表示服务器已响应,但其返回的设置均未通过[验证](https://code.claude.com/docs/zh-CN/server-managed-settings.md#invalid-entries-in-delivered-settings)。在 v2.1.282 之前,此原因显示为 `server returned invalid settings`。
5824 5926
5827* **存在此前成功获取时缓存的设置**:Claude Code 使用该缓存策略运行会话([被保留的环境变量](https://code.claude.com/docs/zh-CN/server-managed-settings.md#fetch-and-caching-behavior)除外),该行显示 `using cached policy`。5929* **存在此前成功获取时缓存的设置**:Claude Code 使用该缓存策略运行会话([被保留的环境变量](https://code.claude.com/docs/zh-CN/server-managed-settings.md#fetch-and-caching-behavior)除外),该行显示 `using cached policy`。
5828* **无缓存**:Claude Code 在没有服务器托管设置的情况下运行会话,该行显示 `no remote policy applied`。5930* **无缓存**:Claude Code 在没有服务器托管设置的情况下运行会话,该行显示 `no remote policy applied`。
5829 5931
5932在 Code 标签页中,当您发送消息时,该警告会以一行的形式出现在对话中;当获取状态发生变化时,会出现新的一行。以下三条相关消息也以相同方式出现:
5933
5934* `Remote managed settings are still loading`:会话继续进行时,获取仍在运行
5935* `Remote managed settings did not load`:获取已结束,但未得到响应
5936* `Remote managed settings have now loaded`:设置在上述某条警告之后加载完成,该行的其余部分说明是否应用了远程策略
5937
5830**解决方法:**5938**解决方法:**
5831 5939
5832* 根据消息指出的原因处理:对于网络原因,请检查此计算机能否访问 `api.anthropic.com`;对于身份验证原因,请使用 `/status` 检查您的登录状态5940* 根据消息指出的原因处理:对于网络原因,请检查此计算机能否访问 `api.anthropic.com`;对于身份验证原因,请使用 `/status` 检查您的登录状态
5835 5943
5836在 v2.1.248 之前,Claude Code 仅在调试日志中报告设置获取失败。5944在 v2.1.248 之前,Claude Code 仅在调试日志中报告设置获取失败。
5837 5945
5946### Claude Code couldn't load your organization's settings
5947
5948您的会话尚未启动,因为必须先加载您组织的设置(包括其[服务器托管设置](https://code.claude.com/docs/zh-CN/server-managed-settings.md)),而 Claude Code 无法加载它们。例如:
5949
5950```text theme={null}
5951Claude Code couldn't reach Anthropic to load your organization's settings (could not connect). <Organization name> requires them before a session can start.
5952```
5953
5954如果消息出现在标题为 `Claude Code can't start this session yet` 的对话框中,设置一旦加载完成,对话框就会关闭,会话随即启动。
5955
5956在[非交互模式](https://code.claude.com/docs/zh-CN/headless.md)和[后台会话](https://code.claude.com/docs/zh-CN/agent-view.md)中,Claude Code 会改为打印该消息并以状态 1 退出。
5957
5958**解决方法:**
5959
5960* **`could not connect` 或 `the reply came from a network proxy, not Anthropic`**:请检查您的网络连接;如果在企业网络中,请让 IT 允许通过 HTTPS 访问 `api.anthropic.com/api/claude_code/policy_limits` 和 `api.anthropic.com/api/claude_code/settings`。然后选择 **Retry now**,或再次运行您的命令。
5961* **`timed out`、`Anthropic returned an error` 或 `Anthropic asked it to retry shortly`**:让对话框自动重试,或稍后再次运行您的命令。如果问题持续出现,请查看 [status.anthropic.com](https://status.anthropic.com)。
5962* **`still loading` 或 `couldn't verify your sign-in with Anthropic yet`**:让对话框自动重试,或再次运行您的命令。如果登录相关消息反复出现,请在 shell 中运行 `claude auth login` 重新登录。
5963* **`Your Claude session has expired`**:此计算机上存储的登录信息已失效,因此重试无济于事。在对话框中选择 **Sign in again** 关闭 Claude Code;然后在 shell 中运行 `claude auth login`,即使在会话无法启动时该命令也能正常工作。
5964* **`none of the settings the server returned could be applied as written`**:请让管理员修正组织的[服务器托管设置](https://code.claude.com/docs/zh-CN/server-managed-settings.md#invalid-entries-in-delivered-settings),然后重试。
5965
5838### Managed settings were not approved5966### Managed settings were not approved
5839 5967
5840您组织的[服务器托管设置](https://code.claude.com/docs/zh-CN/server-managed-settings.md)包含需要您批准的设置,而您拒绝了[安全批准对话框](https://code.claude.com/docs/zh-CN/server-managed-settings.md#security-approval-dialogs),因此 Claude Code 会在不应用这些设置的情况下退出:5968您组织的[服务器托管设置](https://code.claude.com/docs/zh-CN/server-managed-settings.md)包含需要您批准的设置,而您拒绝了[安全批准对话框](https://code.claude.com/docs/zh-CN/server-managed-settings.md#security-approval-dialogs),因此 Claude Code 会在不应用这些设置的情况下退出:
6294 6422
6295在 v2.1.257 之前,`claude doctor` 不会标记这些文件;当会话被终止时,更早的版本也会留下相同的占位文件。6423在 v2.1.257 之前,`claude doctor` 不会标记这些文件;当会话被终止时,更早的版本也会留下相同的占位文件。
6296 6424
6425### Make this change again later: \~/.claude.json could not be updated
6426
6427stderr 上的此通知表示对 [`~/.claude.json`](https://code.claude.com/docs/zh-CN/claude-directory#ce-claude-json) 的某项更改(例如登录或对信任提示的回答)未保存到该文件:
6428
6429```text theme={null}
6430Make this change again later: /home/user/.claude.json could not be updated, so it applies to this session only.
6431```
6432
6433**解决方法:**
6434
6435* 在之后的会话中再次进行该更改。例如,再次运行 `/login` 或再次回答信任提示。
6436
6297## 回复质量似乎低于预期6437## 回复质量似乎低于预期
6298 6438
6299如果 Claude 的回答似乎不如你预期的那样有能力,但没有显示错误,原因通常是对话状态而不是模型本身。Claude Code 不会无声地更改模型版本。它只能在这些情况下切换到备用模型:6439如果 Claude 的回答似乎不如你预期的那样有能力,但没有显示错误,原因通常是对话状态而不是模型本身。Claude Code 不会无声地更改模型版本。它只能在这些情况下切换到备用模型: