122| `A request to MCP server "<name>" was sent without your stored credentials` | [身份验证](#couldnt-read-the-stored-credentials-for-mcp-server) |122| `A request to MCP server "<name>" was sent without your stored credentials` | [身份验证](#couldnt-read-the-stored-credentials-for-mcp-server) |
123| `This server's URL is missing or not a valid URL, so sign-in can't start` | [身份验证](#mcp-server-url-is-missing-or-not-a-valid-url) |123| `This server's URL is missing or not a valid URL, so sign-in can't start` | [身份验证](#mcp-server-url-is-missing-or-not-a-valid-url) |
124| `Issuer mismatch in authorization response (RFC 9207)` | [身份验证](#issuer-mismatch-in-authorization-response) |124| `Issuer mismatch in authorization response (RFC 9207)` | [身份验证](#issuer-mismatch-in-authorization-response) |
125| `Stopped an OAuth request` | [身份验证](#stopped-an-oauth-request) |
125| `Refusing to send credentials to non-https token endpoint` / `<short-name> from the MCP SDK for <server-url>` | [身份验证](#refusing-to-send-credentials-to-non-https-token-endpoint) |126| `Refusing to send credentials to non-https token endpoint` / `<short-name> from the MCP SDK for <server-url>` | [身份验证](#refusing-to-send-credentials-to-non-https-token-endpoint) |
126| `Cloud gateway session expired — run /login to reconnect.` | [身份验证](#cloud-gateway-session-expired) |127| `Cloud gateway session expired — run /login to reconnect.` | [身份验证](#cloud-gateway-session-expired) |
127| `Cloud gateway <url> no longer accepts this session` | [身份验证](#cloud-gateway-session-expired) |128| `Cloud gateway <url> no longer accepts this session` | [身份验证](#cloud-gateway-session-expired) |
153| `403` with `GitHub GraphQL is not available from Claude Code sessions` in a cloud session | [GitHub proxy](https://code.claude.com/docs/zh-CN/cloud-environments.md#github-proxy) |154| `403` with `GitHub GraphQL is not available from Claude Code sessions` in a cloud session | [GitHub proxy](https://code.claude.com/docs/zh-CN/cloud-environments.md#github-proxy) |
154| `The cloud environments service returned an empty response` / `The cloud environments service returned a response in an unexpected format` | [网络](#the-cloud-environments-service-returned-an-empty-or-unexpected-response) |155| `The cloud environments service returned an empty response` / `The cloud environments service returned a response in an unexpected format` | [网络](#the-cloud-environments-service-returned-an-empty-or-unexpected-response) |
155| `Failed to fetch session from Sessions API: Failed to fetch session logs` | [网络](#failed-to-fetch-session-from-sessions-api) |156| `Failed to fetch session from Sessions API: Failed to fetch session logs` | [网络](#failed-to-fetch-session-from-sessions-api) |
157| `Couldn't load the history of cloud session` | [网络](#couldnt-load-the-history-of-cloud-session) |
156| `Couldn't reconnect to your Remote Control session` | [网络](#couldnt-reconnect-to-your-remote-control-session) |158| `Couldn't reconnect to your Remote Control session` | [网络](#couldnt-reconnect-to-your-remote-control-session) |
157| `N sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.` | [网络](#sessions-ended-while-this-machine-was-offline) |159| `N sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.` | [网络](#sessions-ended-while-this-machine-was-offline) |
158| `Couldn't share the transcript.` | [网络](#couldnt-share-the-transcript) |160| `Couldn't share the transcript.` | [网络](#couldnt-share-the-transcript) |
180| `PDF too large` / `PDF is password protected` / `pdftoppm is not installed` | [请求错误](#pdf-errors) |182| `PDF too large` / `PDF is password protected` / `pdftoppm is not installed` | [请求错误](#pdf-errors) |
181| `Extra inputs are not permitted` | [请求错误](#extra-inputs-are-not-permitted) |183| `Extra inputs are not permitted` | [请求错误](#extra-inputs-are-not-permitted) |
182| `API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid` / `Property keys should match pattern` | [请求错误](#tool-input-schema-is-invalid) |184| `API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid` / `Property keys should match pattern` | [请求错误](#tool-input-schema-is-invalid) |
185| `/mcp` 中服务器旁显示的 `N tools left out` / `Claude wasn't given N tools because the Anthropic API would reject their input schemas` | [输入 schema 无效的工具](https://code.claude.com/docs/zh-CN/mcp.md#tools-with-invalid-input-schemas) |
183| `Tool "mcp__<server>__<tool>" is not sent to Claude: its name has <N> characters and the API accepts at most 128` | [请求错误](#mcp-tool-name-over-128-characters) |186| `Tool "mcp__<server>__<tool>" is not sent to Claude: its name has <N> characters and the API accepts at most 128` | [请求错误](#mcp-tool-name-over-128-characters) |
184| `tools.N.custom.name: String should have at most 128 characters` | [请求错误](#mcp-tool-name-over-128-characters) |187| `tools.N.custom.name: String should have at most 128 characters` | [请求错误](#mcp-tool-name-over-128-characters) |
185| `tool_use.name: String should have at most 200 characters` | [请求错误](#tool-use-name-over-200-characters) |188| `tool_use.name: String should have at most 200 characters` | [请求错误](#tool-use-name-over-200-characters) |
251| `Ultrareview did not start` | [命令行错误](#ultrareview-did-not-start) |254| `Ultrareview did not start` | [命令行错误](#ultrareview-did-not-start) |
252| `Remote Control did not start: "<question>" got no answer` | [命令行错误](#remote-control-did-not-start-got-no-answer) |255| `Remote Control did not start: "<question>" got no answer` | [命令行错误](#remote-control-did-not-start-got-no-answer) |
253| `` `<flag>` before `remote-control` is not carried over to the sessions Remote Control starts `` | [命令行错误](#not-carried-over-to-the-sessions-remote-control-starts) |256| `` `<flag>` before `remote-control` is not carried over to the sessions Remote Control starts `` | [命令行错误](#not-carried-over-to-the-sessions-remote-control-starts) |
257| `Remote Control did not start, because sessions would skip part or all of the --settings file` | [命令行错误](#remote-control-did-not-start-because-of-the-settings-file) |
258| `The settings file <file> has changed since Remote Control started, so this session did not start` | [命令行错误](#settings-file-changed-since-remote-control-started) |
254| `--sandbox is not supported by claude remote-control` / `--no-sandbox is not supported by claude remote-control` | [命令行错误](#sandbox-is-not-supported-by-claude-remote-control) |259| `--sandbox is not supported by claude remote-control` / `--no-sandbox is not supported by claude remote-control` | [命令行错误](#sandbox-is-not-supported-by-claude-remote-control) |
255| `` `claude import` is not yet available in this build `` | [命令行错误](#claude-import-is-not-yet-available-in-this-build) |260| `` `claude import` is not yet available in this build `` | [命令行错误](#claude-import-is-not-yet-available-in-this-build) |
256| `Could not read Claude Code config` | [命令行错误](#could-not-read-claude-code-config) |261| `Could not read Claude Code config` | [命令行错误](#could-not-read-claude-code-config) |
268| `No available ports for OAuth redirect` | [命令行错误](#no-available-ports-for-oauth-redirect) |273| `No available ports for OAuth redirect` | [命令行错误](#no-available-ports-for-oauth-redirect) |
269| `Shell command failed for pattern "..."`, from `/security-review` or any skill that injects dynamic context | [命令行错误](#security-review-fails-without-origin-head) |274| `Shell command failed for pattern "..."`, from `/security-review` or any skill that injects dynamic context | [命令行错误](#security-review-fails-without-origin-head) |
270| `Shell command permission check failed for pattern "..."`, from a skill that injects dynamic context | [命令行错误](#security-review-fails-without-origin-head) |275| `Shell command permission check failed for pattern "..."`, from a skill that injects dynamic context | [命令行错误](#security-review-fails-without-origin-head) |
276| ``Couldn't run `<command>` for <name>. A file named HEAD or .git in this folder or one above it may not be yours``,来自注入动态上下文的 skill | [注入命令的权限检查](https://code.claude.com/docs/zh-CN/skills.md#permission-checks-on-injected-commands) |
271| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [命令行错误](#security-review-fails-without-origin-head) |277| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [命令行错误](#security-review-fails-without-origin-head) |
272| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [命令行错误](#no-shell-command-was-run) |278| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [命令行错误](#no-shell-command-was-run) |
273| `Input must be provided either through stdin or as a prompt argument when using --print` | [命令行错误](#input-must-be-provided-when-using-print) |279| `Input must be provided either through stdin or as a prompt argument when using --print` | [命令行错误](#input-must-be-provided-when-using-print) |
425| `Workspace not trusted.` when starting or restarting a background session | [后台会话错误](#workspace-not-trusted-when-dispatching-a-background-session) |431| `Workspace not trusted.` when starting or restarting a background session | [后台会话错误](#workspace-not-trusted-when-dispatching-a-background-session) |
426| `Claude Code is being updated by npm on this machine (still not runnable after 2 min, ...)` | [后台会话错误](#eacces-when-starting-a-background-session) |432| `Claude Code is being updated by npm on this machine (still not runnable after 2 min, ...)` | [后台会话错误](#eacces-when-starting-a-background-session) |
427| `Claude Code process exited with code N` | [包装器和 IDE 错误](#claude-code-process-exited-with-code-n) |433| `Claude Code process exited with code N` | [包装器和 IDE 错误](#claude-code-process-exited-with-code-n) |
434| `Subprocess initialization did not complete within 60000ms` | [包装器和 IDE 错误](#subprocess-initialization-did-not-complete-within-60000ms) |
435| `Claude Code did not finish starting` | [包装器和 IDE 错误](#subprocess-initialization-did-not-complete-within-60000ms) |
428| `The connection to Claude Code ended before this message completed` | [包装器和 IDE 错误](#the-connection-to-claude-code-ended-before-this-message-completed) |436| `The connection to Claude Code ended before this message completed` | [包装器和 IDE 错误](#the-connection-to-claude-code-ended-before-this-message-completed) |
429| `Could not locate the Claude CLI on PATH` | [包装器和 IDE 错误](#could-not-locate-the-claude-cli-on-path) |437| `Could not locate the Claude CLI on PATH` | [包装器和 IDE 错误](#could-not-locate-the-claude-cli-on-path) |
430| `The Claude Code program for this computer, the <build> build, could not be found` | [包装器和 IDE 错误](#the-claude-code-program-for-this-computer-could-not-be-found) |438| `The Claude Code program for this computer, the <build> build, could not be found` | [包装器和 IDE 错误](#the-claude-code-program-for-this-computer-could-not-be-found) |
560| `CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS` | 无上限 | 设置 `CLAUDE_CODE_RETRY_WATCHDOG` 后,单个请求等待您套餐的[用量限制](#youve-hit-your-session-limit)(例如会话限制或每周限制)重置的最长时间(毫秒)。当重置时间晚于此上限时,请求会立即失败,除非使用额度仍有余量或 API 无法检查使用额度。在这些情况下,请求会被重试,如果在成功之前超过该上限,则请求失败。需要 Claude Code v2.1.301 或更高版本。 |568| `CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS` | 无上限 | 设置 `CLAUDE_CODE_RETRY_WATCHDOG` 后,单个请求等待您套餐的[用量限制](#youve-hit-your-session-limit)(例如会话限制或每周限制)重置的最长时间(毫秒)。当重置时间晚于此上限时,请求会立即失败,除非使用额度仍有余量或 API 无法检查使用额度。在这些情况下,请求会被重试,如果在成功之前超过该上限,则请求失败。需要 Claude Code v2.1.301 或更高版本。 |
561| [`CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 未设置 | 设置 `CLAUDE_CODE_RETRY_WATCHDOG` 后,当请求等待[用量限制](#youve-hit-your-session-limit)重置时,检查该限制是否已提前解除的最短间隔(毫秒)。当检查发现限制已解除时,请求会立即发出。请提供 `60000` 到 `10800000` 之间的纯数字。未设置或超出该范围时,不进行检查。关于 Claude Code 何时跳过这些检查,请参阅[环境变量参考](https://code.claude.com/docs/zh-CN/env-vars.md)。需要 Claude Code v2.1.305 或更高版本。 |569| [`CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 未设置 | 设置 `CLAUDE_CODE_RETRY_WATCHDOG` 后,当请求等待[用量限制](#youve-hit-your-session-limit)重置时,检查该限制是否已提前解除的最短间隔(毫秒)。当检查发现限制已解除时,请求会立即发出。请提供 `60000` 到 `10800000` 之间的纯数字。未设置或超出该范围时,不进行检查。关于 Claude Code 何时跳过这些检查,请参阅[环境变量参考](https://code.claude.com/docs/zh-CN/env-vars.md)。需要 Claude Code v2.1.305 或更高版本。 |
562| [`CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 500 | 当 API 以 `529` 过载错误拒绝请求时,该请求各次重试之间退避的起始延迟(毫秒)。当 API 容量已满时,可将其提高(最高 32000),以便在更长的时间窗口内分散重试。当 `CLAUDE_CODE_RETRY_WATCHDOG` 设置为 `1`,或被拒绝的请求是在[快速模式](https://code.claude.com/docs/zh-CN/fast-mode.md#handle-rate-limits)下发送时,此变量无效。需要 Claude Code v2.1.292 或更高版本。 |570| [`CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 500 | 当 API 以 `529` 过载错误拒绝请求时,该请求各次重试之间退避的起始延迟(毫秒)。当 API 容量已满时,可将其提高(最高 32000),以便在更长的时间窗口内分散重试。当 `CLAUDE_CODE_RETRY_WATCHDOG` 设置为 `1`,或被拒绝的请求是在[快速模式](https://code.claude.com/docs/zh-CN/fast-mode.md#handle-rate-limits)下发送时,此变量无效。需要 Claude Code v2.1.292 或更高版本。 |
563| [`CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 32000 | 当 API 以 `529` 过载错误拒绝请求时,该请求各次重试之间退避的上限(毫秒)。当 API 容量已满时,可将其提高(最高 64000),使后续重试之间的间隔持续拉大。当 `CLAUDE_CODE_RETRY_WATCHDOG` 设置为 `1`,或被拒绝的请求是在[快速模式](https://code.claude.com/docs/zh-CN/fast-mode.md#handle-rate-limits)下发送时,此变量无效。需要 Claude Code v2.1.296 或更高版本。 |571| [`CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 32000 | 当 API 以 `529` 过载错误拒绝请求时,该请求各次重试之间退避的上限(毫秒)。当 API 容量已满时,可将其提高(最高 300000),使后续重试之间的间隔持续拉大。高于 64000 的值需要 v2.1.323 或更高版本。在与 `CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS` 相同的情况下,此变量无效。需要 Claude Code v2.1.296 或更高版本。 |
564| [`API_TIMEOUT_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 600000 | 每次请求尝试接收其响应头的时限(毫秒)。它不限制流式响应在此之后持续的时长。为慢速网络或代理提高它。关于它如何限制首字节截止时间,请参阅 [No response from API](#no-response-from-api)。 |572| [`API_TIMEOUT_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 600000 | 每次请求尝试接收其响应头的时限(毫秒)。它不限制流式响应在此之后持续的时长。为慢速网络或代理提高它。关于它如何限制首字节截止时间,请参阅 [No response from API](#no-response-from-api)。 |
565| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](https://code.claude.com/docs/zh-CN/env-vars) | 未设置 | 超时的[非流式请求](#streaming-response-ended-before-any-complete-data-was-received)的重新发送次数限制。达到该限制时,请求失败。生成时间超过超时时间的 Claude 响应在每次重新发送时都会再次超时,因此请设置较低的数值(例如 `0`)以更快地失败。关于每次尝试的超时时间,请参阅[非流式尝试的等待时长](#how-long-a-non-streaming-attempt-waits)。需要 Claude Code v2.1.285 或更高版本。 |573| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](https://code.claude.com/docs/zh-CN/env-vars) | 未设置 | 超时的[非流式请求](#streaming-response-ended-before-any-complete-data-was-received)的重新发送次数限制。达到该限制时,请求失败。生成时间超过超时时间的 Claude 响应在每次重新发送时都会再次超时,因此请设置较低的数值(例如 `0`)以更快地失败。关于每次尝试的超时时间,请参阅[非流式尝试的等待时长](#how-long-a-non-streaming-attempt-waits)。需要 Claude Code v2.1.285 或更高版本。 |
566| [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 未设置 | 流式请求的第一个响应字节的截止时间(毫秒)。需要 Claude Code v2.1.242 或更高版本。对于当此未设置时 Claude Code 如何选择截止时间,请参阅 [No response from API](#no-response-from-api)。 |574| [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](https://code.claude.com/docs/zh-CN/env-vars) | 未设置 | 流式请求的第一个响应字节的截止时间(毫秒)。需要 Claude Code v2.1.242 或更高版本。对于当此未设置时 Claude Code 如何选择截止时间,请参阅 [No response from API](#no-response-from-api)。 |
825同一 Claude 回复中的后续调用可能会以此原因被拒绝:833同一 Claude 回复中的后续调用可能会以此原因被拒绝:
826 834
827```text theme={null}835```text theme={null}
828another call in this response was changed by a hook after auto mode reviewed it, or could not be confirmed unchanged836another call in this response was changed after auto mode reviewed it, or could not be confirmed unchanged
829```837```
830 838
831Claude 随后可以再次发出每个被拒绝的调用,以便服务器对其进行审查。如果打开了权限提示,请作出回应。除非 Claude 在回复中说明自动模式无法检查该调用,否则您无需执行其他任何操作。在这种情况下,请停止该更改或自行批准该调用,然后让 Claude 再次尝试该调用:839Claude 随后可以再次发出每个被拒绝的调用,以便服务器对其进行审查。如果打开了权限提示,请作出回应。除非 Claude 在回复中说明自动模式无法检查该调用,否则您无需执行其他任何操作。在这种情况下,请停止该更改或自行批准该调用,然后让 Claude 再次尝试该调用:
978 986
979### You've hit your monthly spend limit987### You've hit your monthly spend limit
980 988
981您的套餐包含的用量无法覆盖此请求,而本应为其付款的 [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) 已达到支出限制。这发生在您的套餐的用量窗口之一用完时,或当请求是仅由使用额度支付的请求时,例如对 [bills to usage credits](https://code.claude.com/docs/zh-CN/model-config.md#fable-and-usage-credits) 的模型的请求。消息会指明是谁的限制阻止了您。`·` 后的文本说明如何增加该限制,并因您的套餐和您是否管理计费而异:989您的套餐包含的用量无法覆盖此请求,而本应为其付款的 [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) 已达到支出限制。当您的套餐的用量窗口之一用完时,或当请求仅由使用额度支付时,您的套餐就无法覆盖该请求。一个例子是对 [bills to usage credits](https://code.claude.com/docs/zh-CN/model-config.md#fable-and-usage-credits) 的模型的请求。
990
991`·` 之前的文字指明阻止您的限制,例如您组织的月度支出限制,其后的文本说明如何增加该限制。在云端会话中或在 [Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md) 下,该文本不提供 URL,而关于您自己的 `monthly spend limit` 的消息不会说明如何提高它。其他会话会显示类似以下形式的消息:
982 992
983```text theme={null}993```text theme={null}
984You've hit your monthly spend limit · raise it at https://claude.ai/settings/usage?from=cc_cli_limit_message994You've hit your monthly spend limit · raise it at https://claude.ai/settings/usage?from=cc_cli_limit_message
1822 1832
1823在 v2.1.232 之前,Claude Code 仅在逐步推出时或您设置 `MCP_SDK_GENERATION=v2` 时才使用 v2 运行时。1833在 v2.1.232 之前,Claude Code 仅在逐步推出时或您设置 `MCP_SDK_GENERATION=v2` 时才使用 v2 运行时。
1824 1834
1835### Stopped an OAuth request
1836
1837此消息表示 Claude Code 停止了一个[针对 MCP 服务器的 OAuth 请求](https://code.claude.com/docs/zh-CN/mcp.md#authenticate-with-remote-mcp-servers),因为某个 OAuth 端点对其进行了重定向。在该消息的两种形式中,第一个地址都是发送重定向的地址:
1838
1839```text theme={null}
1840Stopped an OAuth request, which can hold secrets: https://auth.example.com redirected it to https://other.example.com. Ask the owner of https://auth.example.com to remove that redirect.
1841Stopped an OAuth request: https://auth.example.com redirected it more than 5 times. Ask the owner of https://auth.example.com to fix those redirects.
1842```
1843
1844**解决方法:**
1845
1846* 请第一个地址的运营者(例如 MCP 服务器的运营方)移除或修复该重定向。然后从 `/mcp` 再次尝试。
1847
1825### 拒绝向非 https 令牌端点发送凭据1848### 拒绝向非 https 令牌端点发送凭据
1826 1849
1827在 [v2 运行时](https://code.claude.com/docs/zh-CN/mcp.md#mcp-client-runtimes)上,Claude Code 只会将 [MCP OAuth](https://code.claude.com/docs/zh-CN/mcp.md#authenticate-with-remote-mcp-servers) 令牌请求发送到通过 HTTPS 提供服务的令牌端点,或位于 `localhost`、`127.0.0.1` 或 `::1` 的令牌端点。此消息表示服务器的令牌端点两者都不是,因此 Claude Code 在发送请求前就停止了。这发生在浏览器登录之后,因此浏览器步骤会先成功,并且每当 Claude Code 刷新该服务器的令牌时都会再次发生。1850在 [v2 运行时](https://code.claude.com/docs/zh-CN/mcp.md#mcp-client-runtimes)上,Claude Code 只会将 [MCP OAuth](https://code.claude.com/docs/zh-CN/mcp.md#authenticate-with-remote-mcp-servers) 令牌请求发送到通过 HTTPS 提供服务的令牌端点,或位于 `localhost`、`127.0.0.1` 或 `::1` 的令牌端点。此消息表示服务器的令牌端点两者都不是,因此 Claude Code 在发送请求前就停止了。这发生在浏览器登录之后,因此浏览器步骤会先成功,并且每当 Claude Code 刷新该服务器的令牌时都会再次发生。
2207 2230
2208### 云端会话中不允许访问该主机2231### 云端会话中不允许访问该主机
2209 2232
2210来自云端会话或云端定时任务的出站 HTTP 请求被环境的网络策略阻止。2233在云端会话或云端定时任务中,`403` 或 DNS 错误(例如 `ENOTFOUND`)可能意味着所请求的主机不在[云环境的允许列表](https://code.claude.com/docs/zh-CN/cloud-environments.md#access-levels)中。要确认这一点,请将该主机与该列表进行核对。带有以下标头的 `403` 可以确认请求已被阻止,但并非每个被阻止请求的 `403` 都带有该标头:
2211 2234
2212```text theme={null}2235```text theme={null}
2213HTTP 4032236HTTP 403
2290 2313
2291在 v2.1.296 之前,Claude Code 不会重试失败的读取,并且在读取失败后可能会以空对话打开该会话并报告成功,而不是输出此消息。2314在 v2.1.296 之前,Claude Code 不会重试失败的读取,并且在读取失败后可能会以空对话打开该会话并报告成功,而不是输出此消息。
2292 2315
2316### Couldn't load the history of cloud session
2317
2318此消息表示 Claude Code 找到了[您要求拉取到终端中的云端会话](https://code.claude.com/docs/zh-CN/claude-code-on-the-web.md#from-cloud-to-terminal),但对其对话历史的请求返回了未找到的结果:
2319
2320```text theme={null}
2321Couldn't load the history of cloud session session_01HJKLMNOPQRSTUVWXYZ. Check it at https://claude.ai/code/session_01HJKLMNOPQRSTUVWXYZ?from=cli
2322```
2323
2324**解决方法:**
2325
2326* 打开消息中的链接,在浏览器中检查该会话。如果该会话能在浏览器中打开,而相同的 Teleport 再次以这种方式失败,请[报告问题](#report-an-error)。
2327
2293### Couldn't reconnect to your Remote Control session2328### Couldn't reconnect to your Remote Control session
2294 2329
2295```text theme={null}2330```text theme={null}
2565 2600
2566Claude Code 通常会自动调整大型图像的大小。这些错误意味着无法解码或调整图像大小以适应 API 限制。2601Claude Code 通常会自动调整大型图像的大小。这些错误意味着无法解码或调整图像大小以适应 API 限制。
2567 2602
2603您看到的错误可能会指明不同的像素限制,例如在这些示例显示 `2000x2000px` 的位置显示 `2576x2576px`。
2604
2568**要做什么:**2605**要做什么:**
2569 2606
2570* 如果消息要求您转换图像,请将其转换为 PNG、JPEG、GIF 或 WebP,然后再次附加。Claude Code 可以从文件头为这些格式验证尺寸,而无需解码图像。2607* 如果消息要求您转换图像,请将其转换为 PNG、JPEG、GIF 或 WebP,然后再次附加。Claude Code 可以从文件头为这些格式验证尺寸,而无需解码图像。
2873* **hook 写入的原因**:PreModelSwitch hook 在[拒绝切换或要求确认](https://code.claude.com/docs/zh-CN/hooks.md#premodelswitch-decision-control)时提供了该原因。解决它要求的内容,或选择您的 hook 允许的模型。2910* **hook 写入的原因**:PreModelSwitch hook 在[拒绝切换或要求确认](https://code.claude.com/docs/zh-CN/hooks.md#premodelswitch-decision-control)时提供了该原因。解决它要求的内容,或选择您的 hook 允许的模型。
2874* **`PreModelSwitch hook <name> did not respond before its timeout`**:在其[超时](https://code.claude.com/docs/zh-CN/hooks.md#timeouts)之前不回答的 hook 阻止切换。修复挂起的命令或提高该 hook 的 `timeout`,然后再次切换。2911* **`PreModelSwitch hook <name> did not respond before its timeout`**:在其[超时](https://code.claude.com/docs/zh-CN/hooks.md#timeouts)之前不回答的 hook 阻止切换。修复挂起的命令或提高该 hook 的 `timeout`,然后再次切换。
2875* **`confirmation required, and this session cannot ask`**:hook 回答 `ask` 而没有原因,控制请求无法显示确认提示。[`-p` 运行](https://code.claude.com/docs/zh-CN/headless)中的 `/model` 命令以原因后的 `(run /model interactively to confirm)` 报告相同条件。从交互式会话进行切换,或更改 hook 对此模型的决定。2912* **`confirmation required, and this session cannot ask`**:hook 回答 `ask` 而没有原因,控制请求无法显示确认提示。[`-p` 运行](https://code.claude.com/docs/zh-CN/headless)中的 `/model` 命令以原因后的 `(run /model interactively to confirm)` 报告相同条件。从交互式会话进行切换,或更改 hook 对此模型的决定。
2876* **`so organization-managed PreModelSwitch hooks could not be checked`**:Claude Code 无法判断您的组织的[托管插件](https://code.claude.com/docs/zh-CN/settings-reference.md#enabledplugins)提供哪些 PreModelSwitch hook,例如因为托管插件加载失败。这些 hook 之一可能阻止切换,因此 Claude Code 拒绝而不是应用未检查的切换。原因的开头命名失败的内容。Claude Code 在每次切换尝试时重新检查,因此已清除的失败不再阻止;如果它继续失败,运行 `claude --debug` 并再次切换以捕获详细信息,然后修复插件或要求您的管理员修复它。2913* **`so organization-managed PreModelSwitch hooks could not be checked`**:v2.1.323 之前的 Claude Code 在无法判断您的[托管插件](https://code.claude.com/docs/zh-CN/settings-reference.md#enabledplugins)提供了哪些 PreModelSwitch hook 时会拒绝切换。此短语之前的文本指出了失败的内容。要停止拒绝,请更新 Claude Code。若还要让失败插件的 hook 运行起来,请修复该插件或联系管理员。有关详细信息,请在 shell 中启动 `claude --debug` 并切换模型,然后阅读[调试日志](https://code.claude.com/docs/zh-CN/hooks.md#debug-hooks)。
2877* **`a PreModelSwitch hook failed before answering`** 或 **`PreModelSwitch hooks were cancelled (the control stream closed) before answering`**:hook 运行在没有判决的情况下结束,Claude Code 不将其视为批准。运行 `claude --debug` 以查看失败的内容,然后再次切换。2914* **`a PreModelSwitch hook failed before answering`** 或 **`PreModelSwitch hooks were cancelled (the control stream closed) before answering`**:hook 运行在没有判决的情况下结束,Claude Code 不将其视为批准。运行 `claude --debug` 以查看失败的内容,然后再次切换。
2878 2915
2879在 v2.1.260 之前,托管插件拒绝读取 `plugin hooks could not be loaded, so PreModelSwitch hooks could not be checked; see the debug log`。Claude Code 重试了一次插件加载,然后在会话中拒绝了后来的切换,即使您的组织没有管理任何插件。在这些版本上重启会话以再次运行插件加载。2916在 v2.1.260 之前,托管插件拒绝读取 `plugin hooks could not be loaded, so PreModelSwitch hooks could not be checked; see the debug log`。Claude Code 重试了一次插件加载,然后在会话中拒绝了后来的切换,即使您的组织没有管理任何插件。在这些版本上重启会话以再次运行插件加载。
3499* **`Error: Workspace not trusted. <folder> is your home directory`**:由于主目录的信任从不保存,先在那里运行 `claude` 也无济于事。请改为在项目目录中运行 `claude ultrareview`(先在那里运行一次 `claude` 以接受信任对话框),或追加 `--trust-workspace`。3536* **`Error: Workspace not trusted. <folder> is your home directory`**:由于主目录的信任从不保存,先在那里运行 `claude` 也无济于事。请改为在项目目录中运行 `claude ultrareview`(先在那里运行一次 `claude` 以接受信任对话框),或追加 `--trust-workspace`。
3500* **`No answer in time.` 后跟 `Error: Workspace not trusted`**:`Trust <folder>? [y/N]` 问题在 5 分钟内未得到回答。再次运行 `claude ultrareview` 并回答该问题。3537* **`No answer in time.` 后跟 `Error: Workspace not trusted`**:`Trust <folder>? [y/N]` 问题在 5 分钟内未得到回答。再次运行 `claude ultrareview` 并回答该问题。
3501* **`Ultrareview did not start: <folder> is not trusted`**:您在 `Trust <folder>? [y/N]` 问题处拒绝了,例如回答 `n` 或按 Enter。若要开始审查,请再次运行 `claude ultrareview` 并回答 `y`。3538* **`Ultrareview did not start: <folder> is not trusted`**:您在 `Trust <folder>? [y/N]` 问题处拒绝了,例如回答 `n` 或按 Enter。若要开始审查,请再次运行 `claude ultrareview` 并回答 `y`。
3502* **``Ultrareview did not start: `--trust-workspace` takes no value``**:`--trust-workspace` 后面跟了非标志的内容,例如 PR 编号或 `false`。如果您不信任该文件夹,请不要使用该标志。如果要在本次运行中信任它,请将 PR 编号或基准分支放在该标志之前:`claude ultrareview 1234 --trust-workspace`。3539* **``Ultrareview did not start: `--trust-workspace` takes no value``**:`--trust-workspace` 后面跟着的不是标志,例如 PR 编号或 `false`。如果您不信任该文件夹,请不要使用此标志。若要在本次运行中信任它,请将 PR 编号或基础分支放在该标志之前:`claude ultrareview 1234 --trust-workspace`。
3503 3540
3504在 v2.1.309 之前,`claude ultrareview` 不接受 `--trust-workspace`。3541在 v2.1.309 之前,`claude ultrareview` 不接受 `--trust-workspace`。
3505 3542
3522您在 `remote-control` 动词之前使用了一个全局 `claude` 标志来启动 [Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md),而该标志会限制或配置 Remote Control 启动的会话,例如 `--settings`、`--setting-sources`、`--permission-mode`、`--disallowed-tools` 或 `--mcp-config`。放在动词之前的标志永远不会传递到这些会话。Claude Code 会拒绝启动,并指出该标志:3559您在 `remote-control` 动词之前使用了一个全局 `claude` 标志来启动 [Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md),而该标志会限制或配置 Remote Control 启动的会话,例如 `--settings`、`--setting-sources`、`--permission-mode`、`--disallowed-tools` 或 `--mcp-config`。放在动词之前的标志永远不会传递到这些会话。Claude Code 会拒绝启动,并指出该标志:
3523 3560
3524```text theme={null}3561```text theme={null}
3525Error: `--settings` before `remote-control` is not carried over to the sessions Remote Control starts, so Remote Control refuses to start rather than drop it — remove it, and give Remote Control's own options after the verb (see `claude remote-control --help`).3562Error: `--settings` before `remote-control` is not carried over to the sessions Remote Control starts, so Remote Control refuses to start rather than drop it — remove it, and give Remote Control's own options after the verb (see `claude remote-control --help`). Pass settings with `claude remote-control --settings <file>`.
3526```3563```
3527 3564
3528对于丢弃后无害的全局标志,例如 `--verbose`、`--model`,或由包装器注入的 `--session-id` 或 `--plugin-dir`,Claude Code 不会拒绝:它会忽略这些标志,Remote Control 照常启动。3565对于丢弃后无害的全局标志,例如 `--verbose`、`--model`,或由包装器注入的 `--session-id` 或 `--plugin-dir`,Claude Code 不会拒绝:它会忽略这些标志,Remote Control 照常启动。
3536 3573
3537在 v2.1.248 之前,当全局标志在前时,`claude remote-control` 不接受其自身的标志,命令会以 `unknown option` 错误失败。3574在 v2.1.248 之前,当全局标志在前时,`claude remote-control` 不接受其自身的标志,命令会以 `unknown option` 错误失败。
3538 3575
3576### 由于 `--settings` 文件,Remote Control 未启动
3577
3578您传给 [`claude remote-control --settings`](https://code.claude.com/docs/zh-CN/remote-control#start-a-remote-control-session) 的文件存在问题:
3579
3580```text theme={null}
3581Error: Remote Control did not start, because sessions would skip part or all of the --settings file ./rc-settings.json: Invalid or malformed JSON
3582```
3583
3584**解决方法:**
3585
3586* 修复消息中指出的问题,然后再次运行您的 `claude remote-control` 命令
3587
3588### The settings file has changed since Remote Control started
3589
3590在运行 `claude remote-control` 的终端中出现此消息,表示会话不会基于您传给 [`--settings`](https://code.claude.com/docs/zh-CN/remote-control#start-a-remote-control-session) 的文件的当前内容启动:
3591
3592```text theme={null}
3593Session failed: Error: The settings file /path/to/settings.json has changed since Remote Control started, so this session did not start. Restart `claude remote-control` to use it as it is now.
3594```
3595
3596**解决方法:**
3597
3598* 如果要使用该文件的当前内容,请停止 `claude remote-control` 并再次运行相同的命令。要恢复它之前提供服务的会话,请参阅[停止服务器后恢复会话](https://code.claude.com/docs/zh-CN/remote-control.md#resume-sessions-after-stopping-the-server)。
3599* 如果要保留 Remote Control 启动时使用的设置,请将文件内容恢复原样;如果 `claude remote-control` 已退出,则再次运行该命令
3600
3539### `--sandbox` or `--no-sandbox` is not supported by claude remote-control3601### `--sandbox` or `--no-sandbox` is not supported by claude remote-control
3540 3602
3541此错误表示启动您 [Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md) 服务器的命令在 `remote-control` 之后传入了 `--sandbox` 或 `--no-sandbox`,而 `claude remote-control` 不接受这两个标志中的任何一个。服务器以退出码 1 退出,而不会启动:3603此错误表示启动您 [Remote Control](https://code.claude.com/docs/zh-CN/remote-control.md) 服务器的命令在 `remote-control` 之后传入了 `--sandbox` 或 `--no-sandbox`,而 `claude remote-control` 不接受这两个标志中的任何一个。服务器以退出码 1 退出,而不会启动:
3806 3868
3807以下相关消息会在命令运行之前就出现:3869以下相关消息会在命令运行之前就出现:
3808 3870
3809* `Shell command permission check failed for pattern "..."`:该命令的权限检查未允许它运行。[注入命令的权限检查](https://code.claude.com/docs/zh-CN/skills.md#permission-checks-on-injected-commands)介绍了在各权限模式下哪些结果会导致中止,以及如何使用 `allowed-tools` 预先批准命令3871* `Shell command permission check failed for pattern "..."`:该命令的权限检查未允许它。请参阅[注入命令的权限检查](https://code.claude.com/docs/zh-CN/skills.md#permission-checks-on-injected-commands),了解在每种权限模式下哪些结果会导致中止,以及 `allowed-tools` 何时会预先批准命令
3810* ``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)3872* ``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)
3811 3873
3812**解决方法:**3874**解决方法:**
3813 3875
3960 4022
3961* **您没有传入基础分支**:Claude Code 与仓库的默认分支进行了比较,并建议您显式传入基础分支,如上例所示4023* **您没有传入基础分支**:Claude Code 与仓库的默认分支进行了比较,并建议您显式传入基础分支,如上例所示
3962* **您传入的基础分支已存在于您的克隆中**:提示为 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``4024* **您传入的基础分支已存在于您的克隆中**:提示为 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``
3963* **您传入的基础分支不在您的克隆中**: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`。4025* **您传入的基础分支不在您的克隆中**: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`。
3964 4026
3965**解决方法:**4027**解决方法:**
3966 4028
4490commands path escapes plugin directory: ./commands/deploy.md — it resolves to /home/user/shared/deploy.md, outside the plugin directory4552commands path escapes plugin directory: ./commands/deploy.md — it resolves to /home/user/shared/deploy.md, outside the plugin directory
4491```4553```
4492 4554
4493如果消息给出的是市场插件自身某个文件(例如 `hooks/hooks.json`)的完整路径,则表示 Claude Code 跳过了该文件。当 Claude Code 无法确认该文件位于插件之内,或者对于[本地市场](https://code.claude.com/docs/zh-CN/plugins/loading.md#in-place-and-copied-plugins)中的插件,无法确认其位于该市场之内时,就会出现这种情况。消息会在以下所示的组件名称下报告这些文件:4555如果某条消息给出了市场插件自身某个文件(例如 `hooks/hooks.json`)的完整路径,则表示 Claude Code 跳过了该文件。当 Claude Code 无法确认该文件位于插件内部,或者对于[本地市场](https://code.claude.com/docs/zh-CN/plugins/loading.md#in-place-and-copied-plugins)中的插件,无法确认该文件位于其市场内部时,就会跳过该文件。该消息会在下列组件名称下报告这些文件:
4494 4556
4495* `hooks/hooks.json`:`hooks`4557* `hooks/hooks.json`:`hooks`
4496* `monitors/monitors.json`:`monitors`4558* `monitors/monitors.json`:`monitors`
4497* `settings.json`:`settings`
4498* 插件根目录下的 `SKILL.md`:`skills`4559* 插件根目录下的 `SKILL.md`:`skills`
4499 4560
4500例如,以下消息针对的是一个解析到插件及其本地市场之外的 `hooks/hooks.json`:4561例如,以下消息针对的是一个解析到插件及其本地市场之外的 `hooks/hooks.json`:
5481您打开了一个在后台服务关闭期间结束的[后台会话](https://code.claude.com/docs/zh-CN/agent-view.md),而此后[会话记录清理](https://code.claude.com/docs/zh-CN/settings-reference.md#cleanupperioddays)已删除了其保存的对话,例如在机器关机数周之后。打开此类行通常会[恢复其已保存的对话](https://code.claude.com/docs/zh-CN/agent-view.md#sessions-show-as-failed-after-shutdown)。由于没有任何可恢复的内容,Claude Code 会拒绝,而不是在未经询问的情况下重新运行该会话的原始提示词:5542您打开了一个在后台服务关闭期间结束的[后台会话](https://code.claude.com/docs/zh-CN/agent-view.md),而此后[会话记录清理](https://code.claude.com/docs/zh-CN/settings-reference.md#cleanupperioddays)已删除了其保存的对话,例如在机器关机数周之后。打开此类行通常会[恢复其已保存的对话](https://code.claude.com/docs/zh-CN/agent-view.md#sessions-show-as-failed-after-shutdown)。由于没有任何可恢复的内容,Claude Code 会拒绝,而不是在未经询问的情况下重新运行该会话的原始提示词:
5482 5543
5483```text theme={null}5544```text theme={null}
5484This session's saved conversation is no longer on disk (it ended while the background service was off, and old transcripts are cleaned up), so there is nothing to resume. `claude rm 7c5dcf5d` deletes the row; `claude respawn 7c5dcf5d` runs its original prompt again instead.5545This session's saved conversation is no longer on disk (it ended while the background service was off, and old transcripts are cleaned up), so there is nothing to resume. `claude rm 7c5dcf5d` removes the row; `claude respawn 7c5dcf5d` runs its original prompt again instead.
5485```5546```
5486 5547
5487`claude attach <id>` 会打印这段文本。在 agent view 中,页脚较短,并以 `ctrl+x deletes the row` 结尾。5548`claude attach <id>` 会打印这段文本。在 agent view 中,页脚较短,并以 `ctrl+x removes the row` 结尾。
5488 5549
5489**解决方法:**5550**解决方法:**
5490 5551
5503 push them and run 'claude rm 7c5dcf5d' again, or discard the worktree and its commits: claude rm 7c5dcf5d --discard-unpushed a1b2c3d000000000000000000000000000000000@0123456789abcdef0123456789abcdef5564 push them and run 'claude rm 7c5dcf5d' again, or discard the worktree and its commits: claude rm 7c5dcf5d --discard-unpushed a1b2c3d000000000000000000000000000000000@0123456789abcdef0123456789abcdef
5504```5565```
5505 5566
5506当 Claude Code 无法汇总这些提交时,详情行会改为显示 `The worktree has unpushed commits`。在 [agent view](https://code.claude.com/docs/zh-CN/agent-view.md) 中,该会话的行会显示 `not deleted` 以及相同的原因。5567当 Claude Code 无法汇总这些提交时,详情行会改为显示 `The worktree has unpushed commits`。在 [agent view](https://code.claude.com/docs/zh-CN/agent-view.md) 中,该会话的行会显示 `not removed` 以及相同的原因。
5507 5568
5508远程上的提交不会阻止删除。您的 `origin` 远程默认分支的本地副本上的提交也不会阻止删除,前提是该分支已在您的主检出(即仓库目录本身,而非某个 worktree)中检出。5569远程上的提交不会阻止删除。您的 `origin` 远程默认分支的本地副本上的提交也不会阻止删除,前提是该分支已在您的主检出(即仓库目录本身,而非某个 worktree)中检出。
5509 5570
5780 5841
5781这些错误来自启动 Claude Code 的程序,例如 IDE 扩展或 [Agent SDK](https://code.claude.com/docs/zh-CN/agent-sdk/overview.md) 应用程序,而不是来自 Claude Code 本身。5842这些错误来自启动 Claude Code 的程序,例如 IDE 扩展或 [Agent SDK](https://code.claude.com/docs/zh-CN/agent-sdk/overview.md) 应用程序,而不是来自 Claude Code 本身。
5782 5843
5844### Subprocess initialization did not complete within 60000ms
5845
5846此错误表示由 [VS Code 扩展](https://code.claude.com/docs/zh-CN/vs-code.md)或 Agent SDK 应用程序启动的 Claude Code 进程未能及时报告其已就绪。扩展或应用程序随后将其停止。在 VS Code 对话中,该错误以 `Claude Code did not finish starting` 开头,例如:
5847
5848```text theme={null}
5849Claude Code did not finish starting: it did not answer in time. The output logs ("View output logs") show how far it got. Slow plugins, MCP servers, hooks, disks or network can each cause this.
5850```
5851
5852在扩展的输出日志中、其登录界面上以及 Agent SDK 应用程序中,该错误的措辞有所不同。它以 `Subprocess initialization did not complete within` 和时间限制开头,然后给出 Claude Code 报告的内容,例如:
5853
5854```text theme={null}
5855Subprocess initialization did not complete within 60000ms. Claude Code did not answer the initialize request and reported no SessionStart or Setup hook running. Slow plugins, MCP servers, hooks that Claude Code does not report, disks or network can each cause this.
5856```
5857
5858**应该怎么做:**
5859
5860* 要在 VS Code 中重试,请发送一条消息。如果错误是在您登录时出现的,请改为再次选择登录方式。
5861* 要查看 Claude Code 进行到了哪一步,请点击对话错误下方的 **View output logs**,或从命令面板运行 **Claude Code: Show Logs**。[报告问题](https://github.com/anthropics/claude-code/issues)时,请附上 `Subprocess initialization` 行前后的条目。
5862* 要检查您的网络,请参阅[网络配置](https://code.claude.com/docs/zh-CN/network-config.md)。如果消息提示您检查登录或身份验证,请参阅[登录和身份验证](https://code.claude.com/docs/zh-CN/troubleshoot-install.md#login-and-authentication)。
5863* 如果消息指出 [SessionStart](https://code.claude.com/docs/zh-CN/hooks.md#sessionstart) 或 [Setup](https://code.claude.com/docs/zh-CN/hooks.md#setup) hook 尚未完成,请[检查您的 hook 运行了多长时间](https://code.claude.com/docs/zh-CN/hooks.md#debug-hooks)。在 VS Code 中,Claude Code 报告这些 hook 正在运行的前 10 分钟不计入 60 秒限制。请让运行缓慢的 hook 更快完成、降低非异步 hook 的 [`timeout`](https://code.claude.com/docs/zh-CN/hooks#common-fields),或[移除该 hook](https://code.claude.com/docs/zh-CN/hooks.md#disable-or-remove-hooks)。
5864* 如果您的 Agent SDK 应用程序调用了 [`startup()`](https://code.claude.com/docs/zh-CN/agent-sdk/typescript#startup),请将 `initializeTimeoutMs` 设置得足以覆盖整个启动过程,或者不设置它,这样最多 10 分钟的已报告 hook 时间不会计入。
5865
5866在 VS Code 扩展 v2.1.304 和 TypeScript Agent SDK v0.3.304 之前,所有 hook 时间都计入限制。使用默认限制时,消息包含 `Subprocess initialization did not complete within 60000ms — check authentication and network connectivity`。如果您看到该措辞,请更新扩展或 SDK。
5867
5783### Claude Code 进程以代码 N 退出5868### Claude Code 进程以代码 N 退出
5784 5869
5785底层 `claude` 进程以非零代码退出。仅凭退出代码无法说明失败的原因:真正的错误在于进程自身的输出,包装器会在捕获时附加该输出,否则将其保留在日志中。5870底层 `claude` 进程以非零代码退出。仅凭退出代码无法说明失败的原因:真正的错误在于进程自身的输出,包装器会在捕获时附加该输出,否则将其保留在日志中。