24| :- | :- |24| :- | :- |
25| `API Error: 500 Internal server error` | [服务器错误](#api-error-500-internal-server-error) |25| `API Error: 500 Internal server error` | [服务器错误](#api-error-500-internal-server-error) |
26| `API Error: Repeated 529 Overloaded errors` | [服务器错误](#api-error-repeated-529-overloaded-errors) |26| `API Error: Repeated 529 Overloaded errors` | [服务器错误](#api-error-repeated-529-overloaded-errors) |
27| `Opus is experiencing high load` / `Fable is experiencing high load` | [服务器错误](#api-error-repeated-529-overloaded-errors) |
27| `Request timed out` | [服务器错误](#request-timed-out),或如果消息提到您的互联网连接,则为[网络](#unable-to-connect-to-api) |28| `Request timed out` | [服务器错误](#request-timed-out),或如果消息提到您的互联网连接,则为[网络](#unable-to-connect-to-api) |
28| `API Error: No response from API` | [服务器错误](#no-response-from-api) |29| `API Error: No response from API` | [服务器错误](#no-response-from-api) |
29| `Server error mid-response. The response above may be incomplete.` | [服务器错误](#the-response-above-may-be-incomplete) |30| `Server error mid-response. The response above may be incomplete.` | [服务器错误](#the-response-above-may-be-incomplete) |
30| `Connection lost mid-response` / `Your computer went to sleep mid-response` / `The response stopped arriving` | [服务器错误](#the-response-above-may-be-incomplete) |31| `Connection lost mid-response` / `Your computer went to sleep mid-response` / `The response stopped arriving` | [服务器错误](#the-response-above-may-be-incomplete) |
31| `Connection closed mid-response` / `Response stalled mid-stream` | [服务器错误](#the-response-above-may-be-incomplete) |32| `Connection closed mid-response` / `Response stalled mid-stream` | [服务器错误](#the-response-above-may-be-incomplete) |
33| `Part of the response never arrived` / `The response stream was malformed` | [服务器错误](#the-response-above-may-be-incomplete) |
34| `API Error: Content block not found` / `API Error: Content block already closed` / `API Error: Stream event unreadable` | [服务器错误](#the-response-above-may-be-incomplete) |
32| `Connection lost before a response was produced` / `Your computer went to sleep before a response was produced` / `The response stalled before a response was produced` | [自动重试](#automatic-retries) |35| `Connection lost before a response was produced` / `Your computer went to sleep before a response was produced` / `The response stalled before a response was produced` | [自动重试](#automatic-retries) |
33| `Connection closed while thinking` / `Response stalled while thinking` | [自动重试](#automatic-retries) |36| `Connection closed while thinking` / `Response stalled while thinking` | [自动重试](#automatic-retries) |
34| `Connection lost while your computer was asleep` | [自动重试](#automatic-retries) |37| `Connection lost while your computer was asleep` | [自动重试](#automatic-retries) |
49| `Could not update your spend limit` | [使用限制](#could-not-update-your-spend-limit) |52| `Could not update your spend limit` | [使用限制](#could-not-update-your-spend-limit) |
50| `spend limit reached` / `spend limit unavailable` | [使用限制](#spend-limit-reached) |53| `spend limit reached` / `spend limit unavailable` | [使用限制](#spend-limit-reached) |
51| `Not logged in · Please run /login` | [身份验证](#not-logged-in) |54| `Not logged in · Please run /login` | [身份验证](#not-logged-in) |
55| `Couldn't save your login` | [身份验证](#couldnt-save-your-login) |
56| `Authentication required · Sign in again to continue` | [身份验证](#not-logged-in) |
52| `Could not resolve authentication method` | [身份验证](#could-not-resolve-authentication-method) |57| `Could not resolve authentication method` | [身份验证](#could-not-resolve-authentication-method) |
53| `Invalid API key` | [身份验证](#invalid-api-key) |58| `Invalid API key` | [身份验证](#invalid-api-key) |
54| `Your apiKeyHelper script is failing` | [身份验证](#your-apikeyhelper-script-is-failing) |59| `Your apiKeyHelper script is failing` | [身份验证](#your-apikeyhelper-script-is-failing) |
69| `signed-in claude.ai account or organization changed on this machine` | [身份验证](#remote-control-stopped-because-the-signed-in-account-changed) |74| `signed-in claude.ai account or organization changed on this machine` | [身份验证](#remote-control-stopped-because-the-signed-in-account-changed) |
70| `Remote Control stopped — the app running this session is now signed in to a different Claude account` | [身份验证](#remote-control-stopped-because-the-app-running-the-session-signed-out-or-switched-accounts) |75| `Remote Control stopped — the app running this session is now signed in to a different Claude account` | [身份验证](#remote-control-stopped-because-the-app-running-the-session-signed-out-or-switched-accounts) |
71| `Remote Control stopped — the app running this session is signed out of Claude` | [身份验证](#remote-control-stopped-because-the-app-running-the-session-signed-out-or-switched-accounts) |76| `Remote Control stopped — the app running this session is signed out of Claude` | [身份验证](#remote-control-stopped-because-the-app-running-the-session-signed-out-or-switched-accounts) |
77| `Couldn't verify your organization's policy for remote control` | [Troubleshoot Remote Control](/docs/zh-CN/remote-control#couldnt-verify-your-organizations-policy-for-remote-control) |
72| `OAuth token revoked` / `OAuth token has expired` | [身份验证](#oauth-token-revoked-or-expired) |78| `OAuth token revoked` / `OAuth token has expired` | [身份验证](#oauth-token-revoked-or-expired) |
73| `API Error: 401 Invalid authentication credentials` | [身份验证](#api-error-401-invalid-authentication-credentials) |79| `API Error: 401 Invalid authentication credentials` | [身份验证](#api-error-401-invalid-authentication-credentials) |
74| `Login expired · Please run /login` | [身份验证](#login-expired) |80| `Login expired · Please run /login` | [身份验证](#login-expired) |
81| `Failed to start OAuth callback server` | [身份验证](#failed-to-start-oauth-callback-server) |
75| `Claude login not accepted · Run /login, then try again` | [身份验证](#claude-login-not-accepted) |82| `Claude login not accepted · Run /login, then try again` | [身份验证](#claude-login-not-accepted) |
76| `Artifacts need a claude.ai login` | [身份验证](#artifacts-need-a-claude-ai-login) |83| `Artifacts need a claude.ai login` | [身份验证](#artifacts-need-a-claude-ai-login) |
77| `Not signed in to the Cloud gateway — run /login.` | [身份验证](#administrator-policy-requires-a-cloud-gateway-sign-in) |84| `Not signed in to the Cloud gateway — run /login.` | [身份验证](#administrator-policy-requires-a-cloud-gateway-sign-in) |
78| `Administrator policy requires a Cloud gateway sign-in on this machine` | [身份验证](#administrator-policy-requires-a-cloud-gateway-sign-in) |85| `Administrator policy requires a Cloud gateway sign-in on this machine` | [身份验证](#administrator-policy-requires-a-cloud-gateway-sign-in) |
79| `Failed to authenticate: OAuth session expired and could not be refreshed` | [身份验证](#login-expired) |86| `Failed to authenticate: OAuth session expired and could not be refreshed` | [身份验证](#login-expired) |
87| `Could not refresh your login because another Claude Code process is refreshing it` | [身份验证](#could-not-refresh-your-login) |
88| `Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh` | [身份验证](#could-not-refresh-your-login) |
80| `Your account is on hold and can't use Claude Code. View details or appeal: https://claude.ai/restricted` | [身份验证](#your-account-is-on-hold) |89| `Your account is on hold and can't use Claude Code. View details or appeal: https://claude.ai/restricted` | [身份验证](#your-account-is-on-hold) |
81| `Your account is on hold and can't sign in to Claude Code. View details or appeal: https://claude.ai/restricted` | [身份验证](#your-account-is-on-hold) |90| `Your account is on hold and can't sign in to Claude Code. View details or appeal: https://claude.ai/restricted` | [身份验证](#your-account-is-on-hold) |
82| `Anthropic profile login expired · Re-authenticate your Anthropic profile` | [身份验证](#anthropic-profile-login-expired) |91| `Anthropic profile login expired · Re-authenticate your Anthropic profile` | [身份验证](#anthropic-profile-login-expired) |
120| `Couldn't reconnect to your Remote Control session` | [网络](#couldnt-reconnect-to-your-remote-control-session) |129| `Couldn't reconnect to your Remote Control session` | [网络](#couldnt-reconnect-to-your-remote-control-session) |
121| `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) |130| `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) |
122| `Couldn't share the transcript.` | [网络](#couldnt-share-the-transcript) |131| `Couldn't share the transcript.` | [网络](#couldnt-share-the-transcript) |
132| `Couldn't send feedback` | [网络](#couldnt-send-feedback) |
123| `Prompt is too long` / `Input is too long for requested model` | [请求错误](#prompt-is-too-long) |133| `Prompt is too long` / `Input is too long for requested model` | [请求错误](#prompt-is-too-long) |
124| `Prompt is too long · automatic compaction failed:` | [请求错误](#prompt-is-too-long) |134| `Prompt is too long · automatic compaction failed:` | [请求错误](#prompt-is-too-long) |
125| `Prompt is too long · this conversation is a single exchange` / `A single-exchange conversation cannot be compacted` | [请求错误](#prompt-is-too-long) |135| `Prompt is too long · this conversation is a single exchange` / `A single-exchange conversation cannot be compacted` | [请求错误](#prompt-is-too-long) |
131| `all upstreams failed (N attempted)` on a Claude apps gateway session | [上游错误消息](/docs/zh-CN/claude-apps-gateway-config#upstream-error-messages) |141| `all upstreams failed (N attempted)` on a Claude apps gateway session | [上游错误消息](/docs/zh-CN/claude-apps-gateway-config#upstream-error-messages) |
132| `Claude Code may not be enabled for your organization` after a Claude apps gateway sign-in | [Claude apps gateway 故障排除](/docs/zh-CN/claude-apps-gateway-deploy#troubleshooting) |142| `Claude Code may not be enabled for your organization` after a Claude apps gateway sign-in | [Claude apps gateway 故障排除](/docs/zh-CN/claude-apps-gateway-deploy#troubleshooting) |
133| `Context exceeds the ...-token limit by ... tokens` in `/context` output | [请求错误](#context-exceeds-the-token-limit) |143| `Context exceeds the ...-token limit by ... tokens` in `/context` output | [请求错误](#context-exceeds-the-token-limit) |
134| `Error during compaction: Conversation too long` | [请求错误](#error-during-compaction-conversation-too-long) |
135| `Request too large` | [请求错误](#request-too-large) |144| `Request too large` | [请求错误](#request-too-large) |
136| `Request too large for the API's 32MB request limit` | [请求错误](#request-too-large) |145| `Request too large for the API's 32MB request limit` | [请求错误](#request-too-large) |
137| `Image was too large` | [请求错误](#image-was-too-large) |146| `Image was too large` | [请求错误](#image-was-too-large) |
138| `Unable to resize image` | [请求错误](#unable-to-resize-image) |147| `Unable to resize image` | [请求错误](#unable-to-resize-image) |
139| `PDF too large` / `PDF is password protected` | [请求错误](#pdf-errors) |148| `PDF too large` / `PDF is password protected` / `pdftoppm is not installed` | [请求错误](#pdf-errors) |
140| `Extra inputs are not permitted` | [请求错误](#extra-inputs-are-not-permitted) |149| `Extra inputs are not permitted` | [请求错误](#extra-inputs-are-not-permitted) |
141| `API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid` / `Property keys should match pattern` | [请求错误](#tool-input-schema-is-invalid) |150| `API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid` / `Property keys should match pattern` | [请求错误](#tool-input-schema-is-invalid) |
151| `tool_use.name: String should have at most 200 characters` | [请求错误](#tool-use-name-over-200-characters) |
142| `There's an issue with the selected model` | [请求错误](#theres-an-issue-with-the-selected-model) |152| `There's an issue with the selected model` | [请求错误](#theres-an-issue-with-the-selected-model) |
143| `Model ... is not a recognized model id` | [请求错误](#model-is-not-a-recognized-model-id) |153| `Model ... is not a recognized model id` | [请求错误](#model-is-not-a-recognized-model-id) |
144| `Model ... not found` | [请求错误](#model-not-found) |154| `Model ... not found` | [请求错误](#model-not-found) |
155| `API error: ... · model not changed` | [请求错误](#api-error-model-not-changed) |
145| `Claude Opus is not available with the Claude Pro plan` | [请求错误](#claude-opus-is-not-available-with-the-claude-pro-plan) |156| `Claude Opus is not available with the Claude Pro plan` | [请求错误](#claude-opus-is-not-available-with-the-claude-pro-plan) |
146| `Claude Code ... does not support this model; version ... or newer is required` | [请求错误](#claude-code-does-not-support-this-model) |157| `Claude Code ... does not support this model; version ... or newer is required` | [请求错误](#claude-code-does-not-support-this-model) |
147| `Claude Code ... is older than the minimum version required by your organization's policy` | [请求错误](#claude-code-does-not-support-this-model) |158| `Claude Code ... is older than the minimum version required by your organization's policy` | [请求错误](#claude-code-does-not-support-this-model) |
148| `Model ... is restricted by your organization's settings` | [请求错误](#model-is-restricted-by-your-organizations-settings) |159| `Model ... is restricted by your organization's settings` | [请求错误](#model-is-restricted-by-your-organizations-settings) |
160| `Model ... is not available. Your organization restricts model selection.` | [请求错误](#model-is-restricted-by-your-organizations-settings) |
149| `Model switch ... blocked by a PreModelSwitch hook` | [请求错误](#model-switch-was-blocked-by-a-premodelswitch-hook) |161| `Model switch ... blocked by a PreModelSwitch hook` | [请求错误](#model-switch-was-blocked-by-a-premodelswitch-hook) |
150| `couldn't save it as your default` / `couldn't confirm it was saved as your default` | [请求错误](#couldnt-save-it-as-your-default) |162| `couldn't save it as your default` / `couldn't confirm it was saved as your default` | [请求错误](#couldnt-save-it-as-your-default) |
151| `thinking.type.enabled is not supported for this model` | [请求错误](#thinking-type-enabled-is-not-supported-for-this-model) |163| `thinking.type.enabled is not supported for this model` | [请求错误](#thinking-type-enabled-is-not-supported-for-this-model) |
155| `API Error: 400 due to tool use concurrency issues` | [请求错误](#tool-use-or-thinking-block-mismatch) |167| `API Error: 400 due to tool use concurrency issues` | [请求错误](#tool-use-or-thinking-block-mismatch) |
156| `API Error: 400 orphaned tool_result in conversation history` | [请求错误](#tool-use-or-thinking-block-mismatch) |168| `API Error: 400 orphaned tool_result in conversation history` | [请求错误](#tool-use-or-thinking-block-mismatch) |
157| `API Error: 400 duplicate tool_use ID in conversation history` | [请求错误](#tool-use-or-thinking-block-mismatch) |169| `API Error: 400 duplicate tool_use ID in conversation history` | [请求错误](#tool-use-or-thinking-block-mismatch) |
170| `Invalid data in redacted_thinking block` | [请求错误](#invalid-data-in-redacted-thinking-block) |
158| `[Unsupported tool content removed]` | [请求错误](#unsupported-tool-content-removed) |171| `[Unsupported tool content removed]` | [请求错误](#unsupported-tool-content-removed) |
159| `role 'system' must precede an 'assistant' message` | [请求错误](#role-system-must-precede-an-assistant-message) |172| `role 'system' must precede an 'assistant' message` | [请求错误](#role-system-must-precede-an-assistant-message) |
160| `Invalid encrypted_content in search_result block` / `Invalid encrypted_index in text block` / `Failed to decrypt web search result content` | [请求错误](#invalid-encrypted-content-in-search-result-block) |173| `Invalid encrypted_content in search_result block` / `Invalid encrypted_index in text block` / `Failed to decrypt web search result content` | [请求错误](#invalid-encrypted-content-in-search-result-block) |
174| `Invalid encrypted_stdout in encrypted_code_execution_result block` | [请求错误](#invalid-encrypted-content-in-search-result-block) |
161| `server_tool_use.name: Input should be` on every turn of a resumed session | [请求错误](#unsupported-tool-content-removed) |175| `server_tool_use.name: Input should be` on every turn of a resumed session | [请求错误](#unsupported-tool-content-removed) |
162| `<model> can't help with this. Start a new session to continue` | [请求错误](#usage-policy-refusal) |176| `<model> can't help with this. Start a new session to continue` | [请求错误](#usage-policy-refusal) |
163| `Claude Code is unable to respond to this request, which appears to violate our Usage Policy` | [请求错误](#usage-policy-refusal) |177| `Claude Code is unable to respond to this request, which appears to violate our Usage Policy` | [请求错误](#usage-policy-refusal) |
164| `<model>'s safeguards flagged this message` | [请求错误](#safety-measures-flagged-a-cybersecurity-topic) |178| `<model>'s safeguards flagged this message` | [请求错误](#safety-measures-flagged-a-cybersecurity-topic) |
165| `Opus 5.5's safeguards flagged this session` | [请求错误](#safety-measures-flagged-a-cybersecurity-topic) |179| `<model>'s safeguards flagged this session` | [请求错误](#safety-measures-flagged-a-cybersecurity-topic) |
166| `<model> has safety measures that flagged this message for a cybersecurity topic` | [请求错误](#safety-measures-flagged-a-cybersecurity-topic) |180| `<model> has safety measures that flagged this message for a cybersecurity topic` | [请求错误](#safety-measures-flagged-a-cybersecurity-topic) |
167| `Installation was killed before it could finish (exit code 137)` | [安装错误](#installation-was-killed-before-it-could-finish) |181| `Installation was killed before it could finish (exit code 137)` | [安装错误](#installation-was-killed-before-it-could-finish) |
168| `The connection dropped while downloading the update` | [安装错误](#the-connection-dropped-while-downloading-the-update) |182| `The connection dropped while downloading the update` | [安装错误](#the-connection-dropped-while-downloading-the-update) |
169| `Download timed out: exceeded the total deadline` | [安装错误](#the-connection-dropped-while-downloading-the-update) |183| `Download timed out: exceeded the total deadline` | [安装错误](#the-connection-dropped-while-downloading-the-update) |
170| `--bg and --print conflict` | [命令行错误](#command-line-errors) |184| `--bg and --print conflict` | [命令行错误](#conflict-between-bg-and-print) |
171| `Cloud sessions cannot be created from a --restricted session` | [命令行错误](#cloud-sessions-cannot-be-created-from-a-restricted-session) |185| `Cloud sessions cannot be created from a --restricted session` | [命令行错误](#cloud-sessions-cannot-be-created-from-a-restricted-session) |
172| `Cloud sessions are disabled by your organization's policy` | [命令行错误](#cloud-sessions-are-disabled-by-your-organizations-policy) |186| `Cloud sessions are disabled by your organization's policy` | [命令行错误](#cloud-sessions-are-disabled-by-your-organizations-policy) |
173| `Couldn't verify your organization's policy for cloud sessions` | [命令行错误](#cloud-sessions-are-disabled-by-your-organizations-policy) |187| `Couldn't verify your organization's policy for cloud sessions` | [命令行错误](#cloud-sessions-are-disabled-by-your-organizations-policy) |
174| `Error: --json-schema is not a valid JSON Schema` | [命令行错误](#command-line-errors) |188| `Error: --json-schema is not a valid JSON Schema` | [命令行错误](#the-json-schema-value-is-not-a-valid-json-schema) |
175| `Error: Invalid --agents configuration:` | [命令行错误](#invalid-agents-configuration) |189| `Error: Invalid --agents configuration:` | [命令行错误](#invalid-agents-configuration) |
190| `Error: --agents takes a JSON object, or a file path only with --print (-p)` | [命令行错误](#invalid-agents-configuration) |
191| `Error: --agents file not found` | [命令行错误](#invalid-agents-configuration) |
176| `Error: Settings file exceeds the 2MiB limit` | [命令行错误](#settings-file-exceeds-the-2mib-limit) |192| `Error: Settings file exceeds the 2MiB limit` | [命令行错误](#settings-file-exceeds-the-2mib-limit) |
177| `The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory` | [命令行错误](#the-current-directory-no-longer-exists) |193| `The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory` | [命令行错误](#the-current-directory-no-longer-exists) |
178| `Temp directory <dir> ... Refusing to use it` / `ENOSPC: no space left on device, mkdir '<dir>'` | [命令行错误](#temp-directory-refused-or-cannot-be-created) |194| `Temp directory <dir> ... Refusing to use it` / `ENOSPC: no space left on device, mkdir '<dir>'` | [命令行错误](#temp-directory-refused-or-cannot-be-created) |
207| `Single sign-on authorization needed` | [命令行错误](#single-sign-on-authorization-needed) |223| `Single sign-on authorization needed` | [命令行错误](#single-sign-on-authorization-needed) |
208| `Failed to resume the conversation` | [命令行错误](#failed-to-resume-the-conversation) |224| `Failed to resume the conversation` | [命令行错误](#failed-to-resume-the-conversation) |
209| `No conversation found with session ID: <session-id>` | [命令行错误](#no-conversation-found-with-the-session-id) |225| `No conversation found with session ID: <session-id>` | [命令行错误](#no-conversation-found-with-the-session-id) |
226| `Windows reported an error (EBADF) when Claude Code read this session's transcript file` | [命令行错误](#windows-reported-an-error-ebadf) |
210| `Cannot switch renderers in this session` | [命令行错误](#cannot-switch-renderers-in-this-session) |227| `Cannot switch renderers in this session` | [命令行错误](#cannot-switch-renderers-in-this-session) |
211| `Cannot switch renderers while work is running in the background` | [命令行错误](#cannot-switch-renderers-in-this-session) |228| `Cannot switch renderers while work is running in the background` | [命令行错误](#cannot-switch-renderers-in-this-session) |
212| `Couldn't open Claude Desktop` | [命令行错误](#couldnt-open-claude-desktop) |229| `Couldn't open Claude Desktop` | [命令行错误](#couldnt-open-claude-desktop) |
218| `Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load` | [命令行错误](#output-styles-are-saved-to-local-settings-which-this-session-doesnt-load) |235| `Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load` | [命令行错误](#output-styles-are-saved-to-local-settings-which-this-session-doesnt-load) |
219| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [Plugin 错误](#plugin-eval-is-currently-in-early-access) |236| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [Plugin 错误](#plugin-eval-is-currently-in-early-access) |
220| `Marketplace "<name>" is registered from an untrusted source` | [Plugin 错误](#marketplace-is-registered-from-an-untrusted-source) |237| `Marketplace "<name>" is registered from an untrusted source` | [Plugin 错误](#marketplace-is-registered-from-an-untrusted-source) |
238| `Claude Code refuses the marketplace name "<name>"` | [Plugin 错误](#claude-code-refuses-the-marketplace-name) |
239| `Marketplace name impersonates an official Anthropic/Claude marketplace` | [Plugin 错误](#claude-code-refuses-the-marketplace-name) |
221| `Marketplace "<name>" is already added from a different source` | [Plugin 错误](#marketplace-is-already-added-from-a-different-source) |240| `Marketplace "<name>" is already added from a different source` | [Plugin 错误](#marketplace-is-already-added-from-a-different-source) |
222| `"<name>" is another spelling of "<reserved>", a reserved marketplace name` | [Plugin 错误](#marketplace-name-is-another-spelling-of-a-reserved-name) |241| `"<name>" is another spelling of "<reserved>", a reserved marketplace name` | [Plugin 错误](#marketplace-name-is-another-spelling-of-a-reserved-name) |
223| `references ${user_config.*} in a shell-form command` | [Plugin 错误](#plugin-command-references-user-config) |242| `references ${user_config.*} in a shell-form command` | [Plugin 错误](#plugin-command-references-user-config) |
231| `Failed to load marketplace configuration` | [Plugin 错误](#failed-to-load-marketplace-configuration) |250| `Failed to load marketplace configuration` | [Plugin 错误](#failed-to-load-marketplace-configuration) |
232| `Marketplace configuration file is corrupted` | [Plugin 错误](#failed-to-load-marketplace-configuration) |251| `Marketplace configuration file is corrupted` | [Plugin 错误](#failed-to-load-marketplace-configuration) |
233| `Plugin "<name>@synced" is required by your organization and can't be disabled here` | [Plugin 错误](#plugin-is-required-by-your-organization) |252| `Plugin "<name>@synced" is required by your organization and can't be disabled here` | [Plugin 错误](#plugin-is-required-by-your-organization) |
253| `"<plugin>" was not uninstalled: it is still switched on in <file>` | [Plugin 错误](#plugin-was-not-uninstalled) |
254| `"<plugin>" was not uninstalled: <file> is there and could not be read` | [Plugin 错误](#plugin-was-not-uninstalled) |
234| `would be spawned with zero tools — refusing` | [工具错误](#agent-would-be-spawned-with-zero-tools) |255| `would be spawned with zero tools — refusing` | [工具错误](#agent-would-be-spawned-with-zero-tools) |
235| `File is covered by a Read deny rule in your permission settings` | [工具错误](#file-is-covered-by-a-read-deny-rule) |256| `File is covered by a Read deny rule in your permission settings` | [工具错误](#file-is-covered-by-a-read-deny-rule) |
257| `cannot contain null bytes (\0)` | [工具错误](#path-cannot-contain-null-bytes) |
258| `Path contains null bytes` | [工具错误](#path-cannot-contain-null-bytes) |
236| `subagent_type is required: the general-purpose agent is not available in this session` | [工具错误](#subagent-type-is-required) |259| `subagent_type is required: the general-purpose agent is not available in this session` | [工具错误](#subagent-type-is-required) |
237| `Error: this write left the memory index at MEMORY.md at ..., over its ... read limit` | [工具错误](#memory-index-is-over-its-read-limit) |260| `Error: this write left the memory index at MEMORY.md at ..., over its ... read limit` | [工具错误](#memory-index-is-over-its-read-limit) |
238| `pkill: refusing to run` | [工具错误](#pkill-pattern-matches-the-claude-code-process) |261| `pkill: refusing to run` | [工具错误](#pkill-pattern-matches-the-claude-code-process) |
241| `Its agent definition was not restored: the folder its definition file came from is not trusted` | [工具错误](#teammate-agent-definition-not-restored) |264| `Its agent definition was not restored: the folder its definition file came from is not trusted` | [工具错误](#teammate-agent-definition-not-restored) |
242| `Message too large for cross-session delivery` | [工具错误](#message-too-large-for-cross-session-delivery) |265| `Message too large for cross-session delivery` | [工具错误](#message-too-large-for-cross-session-delivery) |
243| `Too many messages to this session just now` | [工具错误](#too-many-messages-to-this-session-just-now) |266| `Too many messages to this session just now` | [工具错误](#too-many-messages-to-this-session-just-now) |
267| `Cross-session message was dropped at the recipient session's inbox` | [工具错误](#cross-session-message-dropped-at-the-inbox) |
244| `Refusing to send: reply target is a symlink` / `Refusing to send: cannot vet reply target` | [工具错误](#refusing-to-send-a-cross-session-message) |268| `Refusing to send: reply target is a symlink` / `Refusing to send: cannot vet reply target` | [工具错误](#refusing-to-send-a-cross-session-message) |
245| `Refusing to send: connected endpoint is not the expected process` / `Refusing to send: connected endpoint identity could not be read` | [工具错误](#refusing-to-send-a-cross-session-message) |
246| `Refusing to send: connected endpoint is not owned by this user` / `Refusing to send: connected endpoint owner could not be read` | [工具错误](#refusing-to-send-a-cross-session-message) |
247| `Refusing to send: connected endpoint is a different process with the expected pid` | [工具错误](#refusing-to-send-a-cross-session-message) |
248| `Refusing to read <path>: its symlink resolution changed after permission was checked (<reason>)` / `Refusing to search <path>: its symlink resolution changed after permission was checked` | [工具错误](#refusing-after-a-symlink-changed) |269| `Refusing to read <path>: its symlink resolution changed after permission was checked (<reason>)` / `Refusing to search <path>: its symlink resolution changed after permission was checked` | [工具错误](#refusing-after-a-symlink-changed) |
249| `Refusing to write <path>: its parent-directory symlink resolution changed after permission was checked` / `Refusing to write <path>: it is a symbolic link. Write to the link's target path instead` | [工具错误](#refusing-after-a-symlink-changed) |270| `Refusing to write <path>: its parent-directory symlink resolution changed after permission was checked` / `Refusing to write <path>: it is a symbolic link. Write to the link's target path instead` | [工具错误](#refusing-after-a-symlink-changed) |
250| `Refusing to write through symlink: <path>` / `Refusing to write into symlinked directory: <path>` | [工具错误](#refusing-after-a-symlink-changed) |271| `Refusing to write through symlink: <path>` / `Refusing to write into symlinked directory: <path>` | [工具错误](#refusing-after-a-symlink-changed) |
272| `Refusing to write <path>: where it leads on disk could not be determined` / `Refusing to read <path>: where it leads on disk could not be determined` | [工具错误](#refusing-after-a-symlink-changed) |
251| `Refusing to search <path>: a path one of its Read deny rules is written through changed while the search was being prepared` / `Refusing to search <path>: it could not be opened` | [工具错误](#refusing-after-a-symlink-changed) |273| `Refusing to search <path>: a path one of its Read deny rules is written through changed while the search was being prepared` / `Refusing to search <path>: it could not be opened` | [工具错误](#refusing-after-a-symlink-changed) |
252| `its permission check expired before it ran (too many concurrent file operations)` / `ripgrep was found only by name on PATH` | [工具错误](#refusing-after-a-symlink-changed) |274| `its permission check expired before it ran (too many concurrent file operations)` / `ripgrep was found only by name on PATH` | [工具错误](#refusing-after-a-symlink-changed) |
253| `task output swap refused (tasks dir moved or linked)` | [工具错误](#task-output-swap-refused) |275| `task output swap refused (tasks dir moved or linked)` | [工具错误](#task-output-swap-refused) |
254| `Command killed: its output file was replaced or could no longer be verified` | [工具错误](#task-output-swap-refused) |276| `Command killed: its output file was replaced or could no longer be verified` | [工具错误](#task-output-swap-refused) |
277| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` | [工具错误](#disk-quota-or-temp-filesystem-is-full) |
278| `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)` | [工具错误](#disk-quota-or-temp-filesystem-is-full) |
279| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [工具错误](#disk-quota-or-temp-filesystem-is-full) |
255| `the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text` | [工具错误](#the-source-file-is-not-valid-utf-8-text) |280| `the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text` | [工具错误](#the-source-file-is-not-valid-utf-8-text) |
256| `the source file has the replacement character U+FFFD` | [工具错误](#the-source-file-is-not-valid-utf-8-text) |281| `the source file has the replacement character U+FFFD` | [工具错误](#the-source-file-is-not-valid-utf-8-text) |
257| `Reading a local file from outside this session's connected folders, or through a link, needs the approval card` | [工具错误](#reading-a-local-file-from-outside-the-connected-folders) |282| `Reading a local file from outside this session's connected folders, or through a link, needs the approval card` | [工具错误](#reading-a-local-file-from-outside-the-connected-folders) |
279| `EACCES: permission denied, posix_spawn` | [后台会话错误](#eacces-when-starting-a-background-session) |304| `EACCES: permission denied, posix_spawn` | [后台会话错误](#eacces-when-starting-a-background-session) |
280| `exited before it became reachable` | [后台会话错误](#background-service-exited-before-it-became-reachable) |305| `exited before it became reachable` | [后台会话错误](#background-service-exited-before-it-became-reachable) |
281| `Couldn't start a background session (working directory no longer exists or is not accessible: ...)` | [后台会话错误](#working-directory-no-longer-exists-when-starting-a-background-session) |306| `Couldn't start a background session (working directory no longer exists or is not accessible: ...)` | [后台会话错误](#working-directory-no-longer-exists-when-starting-a-background-session) |
307| `Workspace not trusted.` when starting or restarting a background session | [后台会话错误](#workspace-not-trusted-when-dispatching-a-background-session) |
282| `Claude Code is being updated by npm on this machine (still not runnable after 2 min, ...)` | [后台会话错误](#eacces-when-starting-a-background-session) |308| `Claude Code is being updated by npm on this machine (still not runnable after 2 min, ...)` | [后台会话错误](#eacces-when-starting-a-background-session) |
283| `Claude Code process exited with code N` | [包装器和 IDE 错误](#claude-code-process-exited-with-code-n) |309| `Claude Code process exited with code N` | [包装器和 IDE 错误](#claude-code-process-exited-with-code-n) |
284| `The connection to Claude Code ended before this message completed` | [包装器和 IDE 错误](#the-connection-to-claude-code-ended-before-this-message-completed) |310| `The connection to Claude Code ended before this message completed` | [包装器和 IDE 错误](#the-connection-to-claude-code-ended-before-this-message-completed) |
291| `Claude Code's fullscreen renderer didn't finish starting last time on this machine` / `Claude Code's fullscreen renderer has repeatedly failed to start on this machine` | [配置警告](#fullscreen-failed-start-notice) |317| `Claude Code's fullscreen renderer didn't finish starting last time on this machine` / `Claude Code's fullscreen renderer has repeatedly failed to start on this machine` | [配置警告](#fullscreen-failed-start-notice) |
292| `Claude Code exited after an unrecoverable interface error (...)` | [配置警告](#exited-after-an-unrecoverable-interface-error) |318| `Claude Code exited after an unrecoverable interface error (...)` | [配置警告](#exited-after-an-unrecoverable-interface-error) |
293| `Agent descriptions are over the 15.0k-token limit` | [配置警告](#agent-descriptions-are-over-the-15000-token-limit) |319| `Agent descriptions are over the 15.0k-token limit` | [配置警告](#agent-descriptions-are-over-the-15000-token-limit) |
320| `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) |
294| `Ignoring N permissions.allow entries from ... this workspace has not been trusted` | [配置警告](#workspace-has-not-been-trusted) |321| `Ignoring N permissions.allow entries from ... this workspace has not been trusted` | [配置警告](#workspace-has-not-been-trusted) |
295| `is a network path, which cannot be added as a working directory` | [配置警告](#working-directory-is-a-network-path) |322| `is a network path, which cannot be added as a working directory` | [配置警告](#working-directory-is-a-network-path) |
296| `Remote managed settings failed to load (<cause>)` | [配置警告](#remote-managed-settings-failed-to-load) |323| `Remote managed settings failed to load (<cause>)` | [配置警告](#remote-managed-settings-failed-to-load) |
297| `Managed settings were not approved; exiting without applying them.` | [配置警告](#managed-settings-were-not-approved) |324| `Managed settings were not approved; exiting without applying them.` | [配置警告](#managed-settings-were-not-approved) |
325| `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) |
298| `MCP server <name> is blocked by enterprise managed policy` | [配置警告](#mcp-server-is-blocked-by-enterprise-managed-policy) |326| `MCP server <name> is blocked by enterprise managed policy` | [配置警告](#mcp-server-is-blocked-by-enterprise-managed-policy) |
299| `Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.` | [配置警告](#managed-settings-document-could-not-be-parsed) |327| `Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.` | [配置警告](#managed-settings-document-could-not-be-parsed) |
300| `Managed settings drop-in directory could not be read` | [配置警告](#managed-settings-document-could-not-be-parsed) |328| `Managed settings drop-in directory could not be read` | [配置警告](#managed-settings-document-could-not-be-parsed) |
313 自动重试341 自动重试
314</h2>342</h2>
315 343
316Claude Code 在显示错误之前,会以指数退避方式重试瞬时故障最多 10 次。它并不总是重试在 Claude 响应过程中途出现的故障。当您看到本页面上的错误之一时,Claude Code 已经对该故障进行了适用的重试;下面的列表说明哪些故障获得完整预算、哪些获得较小预算,以及哪些不获得预算。344Claude Code 在显示错误之前,会以指数退避方式重试瞬时故障最多 10 次。它并不总是重试在 Claude 响应过程中途出现的故障。当您看到本页面上的错误之一时,Claude Code 已经对该故障进行了适用的重试。
317 345
318Claude Code 重试这些故障:346Claude Code 重试这些故障:
319 347
390 418
391尾部句子指出了检查服务健康状况的位置,因提供商而异。Amazon Bedrock、Google Cloud 的 Agent Platform 和 Microsoft Foundry 配置会指出该提供商的服务状态。自定义 `ANTHROPIC_BASE_URL` 会指出网关主机。419尾部句子指出了检查服务健康状况的位置,因提供商而异。Amazon Bedrock、Google Cloud 的 Agent Platform 和 Microsoft Foundry 配置会指出该提供商的服务状态。自定义 `ANTHROPIC_BASE_URL` 会指出网关主机。
392 420
393这表示 API 内部出现了意外故障。它不是由您的提示、设置或账户引起的。421API 本身的 5xx 表示 API 内部出现了意外故障。它不是由您的提示、设置或账户引起的。
422
423当代理、负载均衡器或网关用 HTML 错误页面回复时,消息显示状态代码和页面的标题,例如 `API Error: 502 Bad Gateway`。对于没有标题的页面,消息显示状态代码及其标准名称。在 v2.1.281 之前,当页面有标题时状态代码被丢弃,当页面没有标题时打印页面的原始标记。
394 424
395**应该做什么:**425**应该做什么:**
396 426
416 446
417* 检查 [status.claude.com](https://status.claude.com) 或消息中指出的提供商状态页面,查看容量通知447* 检查 [status.claude.com](https://status.claude.com) 或消息中指出的提供商状态页面,查看容量通知
418* 几分钟后重试448* 几分钟后重试
419* 运行 `/model` 并切换到不同的模型以继续工作,因为容量是按模型跟踪的。当一个模型处于特别高的负载下时,Claude Code 会提示您这样做,例如 `Opus is experiencing high load, please use /model to switch to Sonnet`。449* 运行 `/model` 并切换到不同的模型以继续工作,因为容量是按模型跟踪的。当一个模型处于特别高的负载下时,Claude Code 会提示您这样做,例如 `Opus is experiencing high load, please use /model to switch to Sonnet`。在 Fable 模型上,消息指出 Fable。
450
451 在 Claude Desktop 应用运行的会话中,例如 Code 标签页或 Cowork,消息读作 `Opus is experiencing high load. Switch to Sonnet.`,您可以使用应用的模型选择器切换模型。
420 452
421<h3 id="request-timed-out">453<h3 id="request-timed-out">
422 Request timed out454 Request timed out
433**应该做什么:**465**应该做什么:**
434 466
435* 重试请求467* 重试请求
436* 对于长时间运行的任务,将工作分解为较小的提示
437* 如果是缓慢的网络或代理导致,请按照[自动重试](#automatic-retries)中的说明提高 `API_TIMEOUT_MS`468* 如果是缓慢的网络或代理导致,请按照[自动重试](#automatic-retries)中的说明提高 `API_TIMEOUT_MS`
438* 如果超时频繁且您的网络状况良好,请参阅下面的[网络和连接错误](#network-and-connection-errors)469* 如果超时频繁且您的网络状况良好,请参阅下面的[网络和连接错误](#network-and-connection-errors)
439 470
457**应该做什么:**488**应该做什么:**
458 489
459* 再次发送您的消息。您的原始消息仍在对话中,因此对于较长的提示,您可以输入 `try again` 而不是粘贴整个内容。490* 再次发送您的消息。您的原始消息仍在对话中,因此对于较长的提示,您可以输入 `try again` 而不是粘贴整个内容。
460* 如果重复出现,将其视为[网络或代理问题](#unable-to-connect-to-api)。接受连接但从不转发请求的代理会在每次尝试时产生此错误。491* 如果重复出现,将其视为[网络或代理问题](#unable-to-connect-to-api)。
461* 如果您网络上的代理或网关保持响应直到完成,请提高 `API_TIMEOUT_MS` 以便重试等待更长时间。在 Amazon Bedrock 上,也提高 `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`。492* 如果您网络上的代理或网关保持响应直到完成,请提高 `API_TIMEOUT_MS` 以便重试等待更长时间。在 Amazon Bedrock 上,也提高 `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`。
462* 如果第一次尝试持续超时,然后重试成功,请提高 `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` 以便第一次尝试也等待足够长的时间。493* 如果第一次尝试持续超时,然后重试成功,请提高 `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` 以便第一次尝试也等待足够长的时间。
463 494
474API Error: Connection lost mid-response. The response above may be incomplete.505API Error: Connection lost mid-response. The response above may be incomplete.
475API Error: Your computer went to sleep mid-response. The response above may be incomplete.506API Error: Your computer went to sleep mid-response. The response above may be incomplete.
476API Error: The response stopped arriving. The response above may be incomplete.507API Error: The response stopped arriving. The response above may be incomplete.
508API Error: Part of the response never arrived. The response above may be incomplete.
509API Error: The response stream was malformed. The response above may be incomplete.
477```510```
478 511
479* `Server error mid-response`:中流过载或 5xx 服务器错误。此变体需要 Claude Code v2.1.199 或更高版本;在此之前,该情况会丢弃部分输出并将整个轮次报告为错误。512* `Server error mid-response`:中流过载或 5xx 服务器错误。此变体需要 Claude Code v2.1.199 或更高版本;在此之前,该情况会丢弃部分输出并将整个轮次报告为错误。
480* `Connection lost mid-response`:连接断开。513* `Connection lost mid-response`:连接断开。您也会在代理或网关在响应完成之前干净地结束响应体时看到此变体。
481* `Your computer went to sleep mid-response`:Claude Code 检测到您的计算机在响应流式传输时进入睡眠状态。一旦您的计算机唤醒,Claude Code 会将连接视为断开并停止从中读取。514* `Your computer went to sleep mid-response`:Claude Code 检测到您的计算机在响应流式传输时进入睡眠状态。一旦您的计算机唤醒,Claude Code 会将连接视为断开并停止从中读取。
515* `Part of the response never arrived`:流事件在 API 和 Claude Code 之间被丢弃,因此后来的事件引用了从未到达的内容。在 v2.1.281 之前,此情况以 `API Error: Content block not found` 结束轮次。
516* `The response stream was malformed`:为已完成的内容块到达了事件,或事件到达时已损坏。损坏的事件是指其数据不是有效 JSON、其内容缺失或其内容与事件类型不匹配的事件。在 v2.1.284 之前,当具有无效 JSON 的事件在 Claude 完成其思考、文本块或工具调用后到达时,解析器的原始错误(例如以 `API Error: JSON Parse error` 开头的错误)出现。
482* `The response stopped arriving`:连接保持打开但停止传递数据,因此流式空闲监视程序中止了它。在 v2.1.222 之前,Claude Code 也可能在通过 `ANTHROPIC_BASE_URL` 或 `ANTHROPIC_AWS_BASE_URL` 到达的[网关](/docs/zh-CN/gateways)连接上报告此故障,同时服务器的保活 ping 仍在到达,因为它只在那里计算已解析的响应事件;升级会停止这些虚假超时。通过提供商基础 URL(如 `ANTHROPIC_BEDROCK_BASE_URL`)到达的网关不被字节监视程序包装;请参阅[流式空闲监视程序](/docs/zh-CN/network-config#streaming-idle-watchdogs)。517* `The response stopped arriving`:连接保持打开但停止传递数据,因此流式空闲监视程序中止了它。在 v2.1.222 之前,Claude Code 也可能在通过 `ANTHROPIC_BASE_URL` 或 `ANTHROPIC_AWS_BASE_URL` 到达的[网关](/docs/zh-CN/gateways)连接上报告此故障,同时服务器的保活 ping 仍在到达,因为它只在那里计算已解析的响应事件;升级会停止这些虚假超时。通过提供商基础 URL(如 `ANTHROPIC_BEDROCK_BASE_URL`)到达的网关不被字节监视程序包装;请参阅[流式空闲监视程序](/docs/zh-CN/network-config#streaming-idle-watchdogs)。
483 518
484在 v2.1.227 之前,`Connection lost mid-response` 读作 `Connection closed mid-response`,`The response stopped arriving` 读作 `Response stalled mid-stream`。519在 v2.1.227 之前,`Connection lost mid-response` 读作 `Connection closed mid-response`,`The response stopped arriving` 读作 `Response stalled mid-stream`。
485 520
521当丢弃、重复或损坏的流事件在 Claude 开始任何文本或工具调用之前到达时,您看不到此通知:
522
523* 如果 Claude 仅完成了其思考,Claude Code 会重新发出请求。当重新发出的流以相同方式中断时,轮次以 `Part of the response never arrived and no response was produced. Try again.` 或 `The response stream was malformed and no response was produced. Try again.` 结束。
524* 如果没有完成任何内容,Claude Code 会改为重新发送请求而不流式传输。如果您使用 [`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK`](/docs/zh-CN/env-vars) 关闭了该回退,轮次以 `API Error: Content block not found`(对于丢弃的事件)或 `API Error: Content block already closed`(对于重复的事件)结束。对于损坏的事件且回退关闭,轮次以 `API Error: Stream event unreadable` 或解析器的原始错误结束。
525
486在四种情况下,Claude Code 处理故障而不立即显示此通知:526在四种情况下,Claude Code 处理故障而不立即显示此通知:
487 527
488* 在响应的早期,Claude Code 要么重试故障,要么以不同的错误结束轮次。请参阅[自动重试](#automatic-retries)。528* 在响应的早期,Claude Code 要么重试故障,要么以不同的错误结束轮次。请参阅[自动重试](#automatic-retries)。
512<model> is temporarily unavailable, so auto mode cannot determine the safety of <tool> right now. Wait a moment and then try this action again.552<model> is temporarily unavailable, so auto mode cannot determine the safety of <tool> right now. Wait a moment and then try this action again.
513```553```
514 554
515当 Claude Code 可以确定故障类别时,它在 `temporarily unavailable` 后的括号中指出该类别,例如 `<model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now`。类别为 `(rate-limited)`、`(overloaded)`、`(server error)`、`(timed out)` 和 `(connection failed)`。速率限制、过载和服务器错误是暂时的,重试有效。如果 `(timed out)` 或 `(connection failed)` 重复出现,请检查您的连接;请参阅[无法连接到 API](#unable-to-connect-to-api)。在 v2.1.229 之前,消息从不指出类别,读作 `Wait briefly and then try this action again`。555当 Claude Code 可以确定故障类别时,它在 `temporarily unavailable` 后的括号中指出该类别,例如 `<model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now`。类别为 `(rate-limited)`、`(overloaded)`、`(server error)`、`(timed out)` 和 `(connection failed)`。如果 `(timed out)` 或 `(connection failed)` 重复出现,请检查您的连接;请参阅[无法连接到 API](#unable-to-connect-to-api)。在 v2.1.229 之前,消息从不指出类别,读作 `Wait briefly and then try this action again`。
516 556
517当没有类别适用时,消息出现时括号中没有类别;多个故障会产生该形式。在 [Amazon Bedrock](/docs/zh-CN/amazon-bedrock) 上,包括 [Mantle 端点](/docs/zh-CN/amazon-bedrock#use-the-mantle-endpoint),当您的 AWS 账户无法调用消息中指出的模型时,它也会出现,该故障在每次重试时重复,直到您的账户被授予访问该模型的权限。557当没有类别适用时,消息出现时括号中没有类别;多个故障会产生该形式。在 [Amazon Bedrock](/docs/zh-CN/amazon-bedrock) 上,包括 [Mantle 端点](/docs/zh-CN/amazon-bedrock#use-the-mantle-endpoint),当您的 AWS 账户无法调用消息中指出的模型时,它也会出现,该故障在每次重试时重复,直到您的账户被授予访问该模型的权限。
518 558
533**应该做什么:**573**应该做什么:**
534 574
535* 重试该操作;这通常在下一次尝试时成功575* 重试该操作;这通常在下一次尝试时成功
536* 运行 `claude --debug` 并重复该操作以在调试日志中查看底层分类器响应576* 运行 `claude --debug` 并重复该操作以在调试日志中查看详情
537 577
538当单独的 API 安全检查因早期对话内容而阻止分类器请求时:578当单独的 API 安全检查因早期对话内容而阻止分类器请求时:
539 579
668API Error: Usage credits required for 1M context · run /usage-credits to turn them on (they take effect after you restart Claude Code), or /model to switch to standard context708API Error: Usage credits required for 1M context · run /usage-credits to turn them on (they take effect after you restart Claude Code), or /model to switch to standard context
669```709```
670 710
671这是权限检查,而非配额耗尽。即使您的会话和周额度有剩余容量,它也会触发。有关哪些计划直接包含 1M 上下文以及哪些需要使用额度的信息,请参阅 [Extended context](/docs/zh-CN/model-config#extended-context)。Claude Code 在您使用 `/model` 选择模型时运行此检查,仅在直接连接到 Anthropic API 时;如果您将 `ANTHROPIC_BASE_URL` 指向 [LLM gateway](/docs/zh-CN/llm-gateway),`/model` 允许 `[1m]` 选择,网关决定请求是否成功。711在 Claude Desktop app 运行的会话中,提示不命名任何命令:它指向 claude.ai 使用设置页面,或在 Team 和 Enterprise 计划上说在 claude.ai/admin-settings/usage 启用使用额度或向您的管理员请求。
712
713这是权限检查,而非配额耗尽。即使您的会话和周额度有剩余容量,它也会触发。有关哪些计划直接包含 1M 上下文以及哪些需要使用额度的信息,请参阅 [Extended context](/docs/zh-CN/model-config#extended-context)。
672 714
673当此错误在对话中期出现,因为上下文增长超过 200K 令牌时,Claude Code 会自动将对话压缩回标准上下文限制以下,并之后将会话保持在该限制,因此无需采取任何操作。在 v2.1.172 之前的版本中,错误会在每个后续请求(包括 `/compact`)上重复;在这些版本上运行 `/clear` 以恢复。以下步骤适用于您明确选择 `[1m]` 模型的情况。715当此错误在对话中期出现,因为上下文增长超过 200K 令牌时,Claude Code 会自动将对话压缩回标准上下文限制以下,并之后将会话保持在该限制,因此无需采取任何操作。在 v2.1.172 之前的版本中,错误会在每个后续请求(包括 `/compact`)上重复;在这些版本上运行 `/clear` 以恢复。以下步骤适用于您明确选择 `[1m]` 模型的情况。
674 716
733 775
734尾部句子命名检查服务健康的位置,并因提供商而异。Amazon Bedrock、Google Cloud 的 Agent Platform 和 Microsoft Foundry 配置命名该提供商的服务状态,而不是 Anthropic 状态页面。自定义 `ANTHROPIC_BASE_URL` 命名网关主机。776尾部句子命名检查服务健康的位置,并因提供商而异。Amazon Bedrock、Google Cloud 的 Agent Platform 和 Microsoft Foundry 配置命名该提供商的服务状态,而不是 Anthropic 状态页面。自定义 `ANTHROPIC_BASE_URL` 命名网关主机。
735 777
778当代理、负载均衡器或 Claude Code 和 API 之间的网关用其自己的 HTML 429 页面回答时,`·` 后的文本是该页面的标题(如果有的话),例如 `Too Many Requests`。在 v2.1.281 之前,整个页面的标记被打印在 `·` 后。
779
736**要做什么:**780**要做什么:**
737 781
738* 运行 `/status` 并确认活跃凭证是您期望的。环境中的流浪 `ANTHROPIC_API_KEY` 可能会通过低层密钥而不是您的订阅路由请求。782* 运行 `/status` 并确认活跃凭证是您期望的。环境中的流浪 `ANTHROPIC_API_KEY` 可能会通过低层密钥而不是您的订阅路由请求。
839Not logged in · Please run /login883Not logged in · Please run /login
840```884```
841 885
886在 Claude Desktop 应用运行的会话中,例如 Code 标签页或 Cowork,消息读作 `Authentication required · Sign in again to continue`,您从应用中再次登录。
887
842**应该做什么:**888**应该做什么:**
843 889
844* 运行 `/login` 以使用您的 Claude 订阅或 Console 账户进行身份验证890* 运行 `/login` 以使用您的 Claude 订阅或 Console 账户进行身份验证
972* 在当前 shell 中取消设置 `ANTHROPIC_API_KEY` 并从您的 shell 配置文件中删除它,然后重新启动 `claude`1018* 在当前 shell 中取消设置 `ANTHROPIC_API_KEY` 并从您的 shell 配置文件中删除它,然后重新启动 `claude`
973* 如果消息说 `Update or unset`,您没有保存的登录可以回退。取消设置密钥并运行 `/login`,或将密钥替换为来自活跃 Console 组织的密钥。1019* 如果消息说 `Update or unset`,您没有保存的登录可以回退。取消设置密钥并运行 `/login`,或将密钥替换为来自活跃 Console 组织的密钥。
974* 之后运行 `/status` 以确认活跃凭证是您的订阅1020* 之后运行 `/status` 以确认活跃凭证是您的订阅
975* 如果未设置环境变量且错误仍然存在,则禁用的组织是与您的 `/login` 关联的组织。联系支持或使用不同账户登录。1021* 如果未设置环境变量且错误仍然存在,请联系支持或使用不同账户登录。
976 1022
977<h3 id="your-organization-has-disabled-api-key-authentication">1023<h3 id="your-organization-has-disabled-api-key-authentication">
978 您的组织已禁用 API 密钥身份验证1024 您的组织已禁用 API 密钥身份验证
985Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY to use your claude.ai account instead1031Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY to use your claude.ai account instead
986Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY and run /login to sign in with your claude.ai account1032Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY and run /login to sign in with your claude.ai account
987Your organization has disabled API key authentication · Unset the apiKeyHelper setting and run /login to sign in with your claude.ai account1033Your organization has disabled API key authentication · Unset the apiKeyHelper setting and run /login to sign in with your claude.ai account
1034Your organization has disabled API key authentication · Sign in again with your claude.ai account
988```1035```
989 1036
1037最后一种形式出现在 Claude Desktop 应用运行的会话中,例如 Code 标签页或 Cowork,您从应用中再次登录。
1038
990环境变量和 `apiKeyHelper` 优先于 `/login`,因此仅运行 `/login` 在任一仍在提供密钥时没有帮助。请参阅 [身份验证优先级](/docs/zh-CN/authentication#authentication-precedence)。1039环境变量和 `apiKeyHelper` 优先于 `/login`,因此仅运行 `/login` 在任一仍在提供密钥时没有帮助。请参阅 [身份验证优先级](/docs/zh-CN/authentication#authentication-precedence)。
991 1040
992**应该做什么:**1041**应该做什么:**
1021 例程被您的组织的策略禁用1070 例程被您的组织的策略禁用
1022</h3>1071</h3>
1023 1072
1024您的 Team 或 Enterprise 组织中的所有者已在组织级别关闭例程。当您尝试创建或运行例程时会出现错误,例如从 claude.ai/code 上的 [例程](/docs/zh-CN/routines) UI。在 Claude Code v2.1.227 或更高版本上,相同的设置也 [隐藏 CLI 中的 `/schedule`](/docs/zh-CN/routines#troubleshooting)。1073您的 Team 或 Enterprise 组织中的所有者已在组织级别关闭例程。当您尝试创建或运行例程时会出现错误,例如从 [Routines](/docs/zh-CN/routines) UI on claude.ai/code。在 Claude Code v2.1.227 或更高版本上,相同的设置也 [隐藏 `/schedule`](/docs/zh-CN/routines#troubleshooting) 在 CLI 中。
1025 1074
1026```text theme={null}1075```text theme={null}
1027Routines are disabled by your organization's policy.1076Routines are disabled by your organization's policy.
1038 Remote Control 需要 Anthropic API1087 Remote Control 需要 Anthropic API
1039</h3>1088</h3>
1040 1089
1041会话不是直接与 Anthropic API 通信,因此没有 claude.ai 后端供 [Remote Control](/docs/zh-CN/remote-control) 配对。1090会话不是直接与 Anthropic API 通信,因此 [Remote Control](/docs/zh-CN/remote-control) 需要。
1042 1091
1043```text theme={null}1092```text theme={null}
1044Remote Control is only available when using Claude via api.anthropic.com. CLAUDE_CODE_USE_BEDROCK is set, so this session is using Amazon Bedrock — unset it (or run in a shell without it) to use Remote Control.1093Remote Control is only available when using Claude via api.anthropic.com. CLAUDE_CODE_USE_BEDROCK is set, so this session is using Amazon Bedrock — unset it (or run in a shell without it) to use Remote Control.
1151**应该做什么:**1200**应该做什么:**
1152 1201
1153* 运行 `/login` 再次登录1202* 运行 `/login` 再次登录
1154* 如果重新身份验证后错误在同一会话中返回,首先运行 `/logout` 以完全清除存储的令牌,然后运行 `/login`
1155* 如果您使用 `CLAUDE_CODE_OAUTH_TOKEN` 环境变量进行身份验证,Claude Code 在请求失败并显示 401 后会继续发送您设置的值,而不是切换到保存的登录的令牌。[`/status`](/docs/zh-CN/commands) 将此凭证显示为读取 `CLAUDE_CODE_OAUTH_TOKEN` 的 `Auth token` 行。使用 [`claude setup-token`](/docs/zh-CN/authentication#generate-a-long-lived-token) 生成新令牌并使用它重新启动,或取消设置变量并运行 `/login`。在 v2.1.225 之前,Claude Code 可以在会话中用保存的登录的短期访问令牌替换变量的值,一旦该令牌过期,会话再次失败并显示 401 错误。1203* 如果您使用 `CLAUDE_CODE_OAUTH_TOKEN` 环境变量进行身份验证,Claude Code 在请求失败并显示 401 后会继续发送您设置的值,而不是切换到保存的登录的令牌。[`/status`](/docs/zh-CN/commands) 将此凭证显示为读取 `CLAUDE_CODE_OAUTH_TOKEN` 的 `Auth token` 行。使用 [`claude setup-token`](/docs/zh-CN/authentication#generate-a-long-lived-token) 生成新令牌并使用它重新启动,或取消设置变量并运行 `/login`。在 v2.1.225 之前,Claude Code 可以在会话中用保存的登录的短期访问令牌替换变量的值,一旦该令牌过期,会话再次失败并显示 401 错误。
1156* 对于跨启动的重复登录提示,请参阅 [故障排除](/docs/zh-CN/troubleshoot-install#not-logged-in-or-token-expired) 中的系统时钟检查和 macOS 凭证存储恢复步骤1204* 对于跨启动的重复登录提示,请参阅 [故障排除](/docs/zh-CN/troubleshoot-install#not-logged-in-or-token-expired) 中的系统时钟检查和 macOS 凭证存储恢复步骤
1157* 对于其他故障,包括 `403 Forbidden` 和 OAuth 浏览器问题,请参阅 [登录和身份验证](/docs/zh-CN/troubleshoot-install#login-and-authentication)1205* 对于其他故障,包括 `403 Forbidden` 和 OAuth 浏览器问题,请参阅 [登录和身份验证](/docs/zh-CN/troubleshoot-install#login-and-authentication)
1177 登录过期1225 登录过期
1178</h3>1226</h3>
1179 1227
1180Claude Code 尝试更新您保存的 claude.ai 或 Claude Console 登录,OAuth 服务拒绝了存储的刷新令牌,因此 Claude Code 清除了保存的凭证。之后,每个模型请求在到达 API 之前都会在本地停止,显示此消息,因为只有 `/login` 可以创建新凭证。1228Claude Code 尝试更新您保存的 claude.ai 登录,OAuth 服务拒绝了存储的刷新令牌,因此 Claude Code 清除了保存的凭证。之后,每个模型请求在到达 API 之前都会在本地停止,显示此消息,因为只有 `/login` 可以创建新凭证。
1181 1229
1182在 v2.1.206 之前,Claude Code 无论如何都会发送模型请求,使用环境中剩余的任何凭证,每个模型都会失败,显示 [所选模型有问题](#theres-an-issue-with-the-selected-model) 或 401,而不是登录提示。1230在 v2.1.206 之前,Claude Code 无论如何都会发送模型请求,使用环境中剩余的任何凭证,每个模型都会失败,显示 [所选模型有问题](#theres-an-issue-with-the-selected-model) 或 401,而不是登录提示。
1183 1231
1203* 在非交互式模式中,在同一环境中运行 `claude`,完成 `/login`,然后重新运行您的命令。对于无法交互式登录的自动化,使用 `ANTHROPIC_API_KEY` 进行身份验证或 [使用 `claude setup-token` 生成长期令牌](/docs/zh-CN/authentication#generate-a-long-lived-token)。1251* 在非交互式模式中,在同一环境中运行 `claude`,完成 `/login`,然后重新运行您的命令。对于无法交互式登录的自动化,使用 `ANTHROPIC_API_KEY` 进行身份验证或 [使用 `claude setup-token` 生成长期令牌](/docs/zh-CN/authentication#generate-a-long-lived-token)。
1204* 如果登录持续失败,请参阅 [登录和身份验证](/docs/zh-CN/troubleshoot-install#login-and-authentication)1252* 如果登录持续失败,请参阅 [登录和身份验证](/docs/zh-CN/troubleshoot-install#login-and-authentication)
1205 1253
1254<h3 id="could-not-refresh-your-login">
1255 无法刷新您的登录,因为另一个 Claude Code 进程正在刷新它
1256</h3>
1257
1258此消息不意味着您的登录被拒绝。您保存的 claude.ai 登录已过期,需要更新。另一个 Claude Code 进程在同一机器上持有共享刷新锁,或退出并留下它,刷新在此会话等待时没有进展。Claude Code 在发送前停止请求:
1259
1260```text theme={null}
1261Could not refresh your login because another Claude Code process is refreshing it (or exited mid-refresh) · Try again in a minute; if it keeps happening, close other Claude Code windows or sign in again with /login
1262```
1263
1264在 [非交互式模式](/docs/zh-CN/headless) (`-p`) 和 [Agent SDK](/docs/zh-CN/agent-sdk/overview) 中,消息如下所示,结构化错误代码为 `server_error`:
1265
1266```text theme={null}
1267Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh. This is usually transient; retry in a minute, and if it persists close other Claude Code processes or sign in again
1268```
1269
1270使用 API 密钥、[`CLAUDE_CODE_OAUTH_TOKEN`](/docs/zh-CN/env-vars) 或第三方提供商进行身份验证的会话不使用保存的登录,永远不会看到此消息。
1271
1272**应该做什么:**
1273
1274* 一分钟后重试。如果另一个进程首先完成刷新,此会话使用更新的登录。
1275* 如果消息持续返回,关闭其他 Claude Code 窗口和进程,然后重试。
1276* 如果在没有其他 Claude Code 进程运行的情况下返回,运行 `/login`。再次登录不会等待刷新锁。
1277
1278<h3 id="couldnt-save-your-login">
1279 无法保存您的登录
1280</h3>
1281
1282您使用 claude.ai 登录,但 Claude Code 无法将登录保存到其凭证存储,因此登录未完成。在 macOS 上,当登录钥匙链锁定时(例如在睡眠或空闲时),在 Claude Code 已在同一会话中读取或保存凭证之后,可能会发生这种情况。
1283
1284```text theme={null}
1285Couldn't save your login. If your Mac's keychain is locked, unlock it and log in again.
1286Couldn't save your login. Try logging in again.
1287```
1288
1289第一种形式出现在 macOS 上,第二种形式出现在其他地方。临时凭证存储故障(例如超时或不可读的存储)会产生相同的消息。
1290
1291**应该做什么:**
1292
1293* 在 macOS 上,解锁登录钥匙链,然后再次运行 `/login`
1294* 在其他平台上,再次运行 `/login`
1295* 如果登录仍然不保存,请参阅 [未登录或令牌过期](/docs/zh-CN/troubleshoot-install#not-logged-in-or-token-expired) 了解钥匙链解锁命令和其他凭证存储恢复步骤
1296
1297<h3 id="failed-to-start-oauth-callback-server">
1298 Failed to start OAuth callback server
1299</h3>
1300
1301当 `/login`、`claude auth login` 或 `claude setup-token` 通过浏览器登录您时,Claude Code 在 `127.0.0.1` 上打开一个监听端口,以便您的浏览器可以将登录结果返回给它。此消息意味着 Claude Code 无法打开该端口,登录在浏览器窗口或登录 URL 出现之前停止:
1302
1303```text theme={null}
1304Failed to start OAuth callback server: Failed to start server. Is port 0 in use?
1305```
1306
1307如果您的消息以 `Is port 0 in use?` 结尾,尝试在 IPv4 环回地址 `127.0.0.1` 上监听的尝试完全失败。因为故障发生在登录 URL 存在之前,`Paste code here if prompted` 流不可用作解决方法。
1308
1309**应该做什么:**
1310
1311* 要立即登录而不需要本地监听器:如果您使用 claude.ai 订阅,在登录有效的机器上运行 [`claude setup-token`](/docs/zh-CN/authentication#generate-a-long-lived-token) 并将其打印的令牌设置为此机器上的 `CLAUDE_CODE_OAUTH_TOKEN`。否则将 `ANTHROPIC_API_KEY` 设置为来自 [Claude Console](https://platform.claude.com/settings/keys) 的密钥。[身份验证优先级](/docs/zh-CN/authentication#authentication-precedence) 解释了 Claude Code 在存在多个凭证时如何选择。
1312* 要在此机器上改用浏览器登录,Claude Code 必须能够在 `127.0.0.1` 上监听。如果它在沙箱内运行,检查沙箱的策略是否允许在本地端口上监听,然后再次运行 `/login`。如果它应该能够但仍然失败,运行 `/feedback` 以便报告包含您的环境详细信息。
1313
1206<h3 id="claude-login-not-accepted">1314<h3 id="claude-login-not-accepted">
1207 Claude 登录未被接受1315 Claude login not accepted
1208</h3>1316</h3>
1209 1317
1210您尝试启动 [云会话](/docs/zh-CN/claude-code-on-the-web),服务器拒绝使用 401 创建它:它不接受此机器发送的 Claude 登录,通常是因为登录过期或被撤销。1318您尝试启动 [云会话](/docs/zh-CN/claude-code-on-the-web),服务器拒绝使用 401 创建它:它不接受此机器发送的 Claude 登录,通常是因为登录过期或被撤销。
1251 1359
1252当会话没有网关登录时,模型请求失败,显示此消息,例如因为您自策略到达机器后未运行 `/login`。1360当会话没有网关登录时,模型请求失败,显示此消息,例如因为您自策略到达机器后未运行 `/login`。
1253 1361
1254如果您还配置了 `ANTHROPIC_API_KEY`、`ANTHROPIC_AUTH_TOKEN` 或 `apiKeyHelper` 凭证,且托管设置设置了 `forceLoginMethod`,Claude Code 在启动时改为以以下消息退出:1362如果机器还持有 Anthropic 颁发的凭证且托管设置设置了 `forceLoginMethod` 或 `forceLoginOrgUUID`,Claude Code 在启动时改为以此消息退出:
1255 1363
1256```text theme={null}1364```text theme={null}
1257Administrator policy requires a Cloud gateway sign-in on this machine; the1365Administrator policy requires a Cloud gateway sign-in on this machine; the
1262**应该做什么:**1370**应该做什么:**
1263 1371
1264* 运行 `/login` 并在 **Cloud gateway** 屏幕上完成登录1372* 运行 `/login` 并在 **Cloud gateway** 屏幕上完成登录
1265* 对于启动消息,删除您配置的 `ANTHROPIC_API_KEY`、`ANTHROPIC_AUTH_TOKEN` 或 `apiKeyHelper` 设置,然后启动 `claude` 并运行 `/login`1373* 对于启动消息,删除您配置的 `ANTHROPIC_API_KEY`、`ANTHROPIC_AUTH_TOKEN` 或 `apiKeyHelper` 设置。要删除保存的 Console API 密钥,运行 `claude auth logout`,这也会删除保存的 claude.ai 登录。如果您使用 `CLAUDE_CODE_USE_*` 选择云提供商,会话然后以无登录启动。否则启动 `claude` 并运行 `/login`
1266* 如果您认为机器不应该需要网关,请要求管理该机器的管理员从其托管设置中删除 `forceLoginMethod` 和 `forceLoginGatewayUrl`1374* 如果您认为机器不应该需要网关,请要求管理该机器的管理员从其托管设置中删除 `forceLoginMethod` 和 `forceLoginGatewayUrl`
1267 1375
1268在 v2.1.265 上,回归也在某些 LLM 网关和代理配置中显示第一条消息,这些配置使用 API 密钥、`apiKeyHelper` 或自定义标头进行身份验证,即使机器上没有管理员要求。更新到 v2.1.266 或更高版本。您不需要更改您的配置。1376在 v2.1.265 上,回归也在某些 LLM 网关和代理配置中显示第一条消息,这些配置使用 API 密钥、`apiKeyHelper` 或自定义标头进行身份验证,即使机器上没有管理员要求。更新到 v2.1.266 或更高版本。您不需要更改您的配置。
1316 OAuth 范围要求1424 OAuth 范围要求
1317</h3>1425</h3>
1318 1426
1319存储的令牌早于较新功能需要的权限范围。您最常从 `/usage` 和状态行使用指示器看到这种情况:1427存储的令牌早于较新功能需要的权限范围:
1320 1428
1321```text theme={null}1429```text theme={null}
1322OAuth token does not meet scope requirement: user:profile1430OAuth token does not meet scope requirement: user:profile
1330 claude.ai 拒绝了会话令牌1438 claude.ai 拒绝了会话令牌
1331</h3>1439</h3>
1332 1440
1333[claude.ai 连接器](/docs/zh-CN/mcp#use-mcp-servers-from-claude-ai) 请求失败,因为 claude.ai 拒绝了您的 Claude Code 登录中的令牌,通常是已过期且无法刷新的登录。被拒绝的令牌是您的登录,而不是连接器在 claude.ai 中的自己的授权,因此再次授权连接器不会解决它。在 `/mcp` 中,连接器显示为 `connected · session token rejected`,其详细视图读作:1441[claude.ai 连接器](/docs/zh-CN/mcp#use-mcp-servers-from-claude-ai) 请求失败,因为 claude.ai 拒绝了您的 Claude Code 登录中的令牌。被拒绝的令牌是您的登录,而不是连接器在 claude.ai 中的自己的授权,因此再次授权连接器不会解决它。在 `/mcp` 中,连接器显示为 `session token rejected`,其详细视图读作:
1334 1442
1335```text theme={null}1443```text theme={null}
1336claude.ai rejected the session token. Run /login, then reconnect.1444claude.ai rejected the session token. Run /login, then reconnect.
1455* 如果提示说凭证由此环境管理,启动 Claude Code 的应用拥有凭证,此处的其他步骤不适用:重试或联系您的管理员1563* 如果提示说凭证由此环境管理,启动 Claude Code 的应用拥有凭证,此处的其他步骤不适用:重试或联系您的管理员
1456* 刷新您的 AWS 凭证以防过期凭证是原因:运行消息中命名的 [`awsAuthRefresh`](/docs/zh-CN/amazon-bedrock#advanced-credential-configuration) 命令(当设置时),或自己刷新您的 SSO 登录、访问密钥、API 密钥或代理令牌1564* 刷新您的 AWS 凭证以防过期凭证是原因:运行消息中命名的 [`awsAuthRefresh`](/docs/zh-CN/amazon-bedrock#advanced-credential-configuration) 命令(当设置时),或自己刷新您的 SSO 登录、访问密钥、API 密钥或代理令牌
1457* 如果您的凭证是最新的,确认 [IAM 配置](/docs/zh-CN/amazon-bedrock#iam-configuration) 中的 IAM 权限已附加到您使用的身份,并且所选模型已为您的账户和区域启用1565* 如果您的凭证是最新的,确认 [IAM 配置](/docs/zh-CN/amazon-bedrock#iam-configuration) 中的 IAM 权限已附加到您使用的身份,并且所选模型已为您的账户和区域启用
1458* 运行 `aws sts get-caller-identity` 以确认您的请求使用哪个身份;过时的 `AWS_PROFILE` 或默认配置文件是权限不匹配的常见原因1566* 运行 `aws sts get-caller-identity` 以确认您的请求使用哪个身份
1459 1567
1460<h3 id="google-cloud-credentials-expired-or-invalid">1568<h3 id="google-cloud-credentials-expired-or-invalid">
1461 Google Cloud 凭证已过期或无效1569 Google Cloud 凭证已过期或无效
1657No internet route — check your connection or VPN (EHOSTUNREACH)1765No internet route — check your connection or VPN (EHOSTUNREACH)
1658Couldn't connect through your proxy (ERR_PROXY_TUNNEL) — the proxy refused the tunnel: check its credentials and that it allows this host1766Couldn't connect through your proxy (ERR_PROXY_TUNNEL) — the proxy refused the tunnel: check its credentials and that it allows this host
1659Connection dropped (ECONNRESET)1767Connection dropped (ECONNRESET)
1660fetch failed
1661Request timed out. Check your internet connection and proxy settings1768Request timed out. Check your internet connection and proxy settings
1662```1769```
1663 1770
1677 1784
1678如果 `curl` 成功但 Claude Code 仍然失败,原因通常是运行时和网络之间的某些东西,而不是网络本身:1785如果 `curl` 成功但 Claude Code 仍然失败,原因通常是运行时和网络之间的某些东西,而不是网络本身:
1679 1786
1787* 通过运行 `echo $ANTHROPIC_BASE_URL` 检查 `ANTHROPIC_BASE_URL` 是否已设置,或在 PowerShell 中运行 `echo $env:ANTHROPIC_BASE_URL`,并在您的[设置文件](/docs/zh-CN/settings)的 `env` 块中查找它。当它被设置时,Claude Code 将模型请求发送到该地址而不是 `api.anthropic.com`,因此指向不再运行的本地代理或网关的遗留值会产生 `Connection refused`,即使 `curl` 到达 API。从您的 shell 配置文件或设置中删除它,并从新终端启动 Claude Code。
1680* 在 Linux 和 WSL 上,检查 `/etc/resolv.conf` 是否有无法到达的名称服务器。WSL 特别可以从主机继承损坏的解析器。1788* 在 Linux 和 WSL 上,检查 `/etc/resolv.conf` 是否有无法到达的名称服务器。WSL 特别可以从主机继承损坏的解析器。
1681* 在 macOS 上,已断开连接或卸载的 VPN 客户端可能会留下隧道接口或路由规则。检查 `ifconfig` 是否有陈旧的 `utun` 接口,并在系统设置中删除 VPN 的网络扩展。1789* 在 macOS 上,已断开连接或卸载的 VPN 客户端可能会留下隧道接口或路由规则。检查 `ifconfig` 是否有陈旧的 `utun` 接口,并在系统设置中删除 VPN 的网络扩展。
1682* Docker Desktop 和类似的容器运行时可以拦截出站流量。退出它们并重试以排除这种可能性。1790* Docker Desktop 和类似的容器运行时可以拦截出站流量。退出它们并重试以排除这种可能性。
1702 1810
1703* 如果消息名称代理变量,检查其值是否指向正确的代理,并要求您的网络团队允许通过它进行 HTTPS 连接到消息中的主机。请参阅[网络配置](/docs/zh-CN/network-config)。1811* 如果消息名称代理变量,检查其值是否指向正确的代理,并要求您的网络团队允许通过它进行 HTTPS 连接到消息中的主机。请参阅[网络配置](/docs/zh-CN/network-config)。
1704* 完成[无法连接到 API](#unable-to-connect-to-api) 中的检查。那里的 `curl` 测试和防火墙指导也适用于此检查。1812* 完成[无法连接到 API](#unable-to-connect-to-api) 中的检查。那里的 `curl` 测试和防火墙指导也适用于此检查。
1705* 如果您的组织通过[云网关](/docs/zh-CN/claude-apps-gateway)登录,并且此错误出现在首次运行时,请更新到 Claude Code v2.1.247 或更高版本。
1706* 如果您的网络是开放的,故障仍然存在,Claude Code 可能在您的国家[不可用](https://www.anthropic.com/supported-countries)1813* 如果您的网络是开放的,故障仍然存在,Claude Code 可能在您的国家[不可用](https://www.anthropic.com/supported-countries)
1707 1814
1708<h3 id="socket-is-closed">1815<h3 id="socket-is-closed">
1744* 阅读 `Response:` 子句以查看哪个系统回答。HTML 正文、没有 Anthropic 请求 id 或名称服务器(例如 `nginx` 或 `cloudflare`)意味着 Claude Code 和 API 之间的某些东西代替回答1851* 阅读 `Response:` 子句以查看哪个系统回答。HTML 正文、没有 Anthropic 请求 id 或名称服务器(例如 `nginx` 或 `cloudflare`)意味着 Claude Code 和 API 之间的某些东西代替回答
1745* 如果您通过[LLM 网关](/docs/zh-CN/llm-gateway-connect#troubleshoot-gateway-errors)路由,使用直接请求测试路由,并修复返回非 API 响应的跳跃1852* 如果您通过[LLM 网关](/docs/zh-CN/llm-gateway-connect#troubleshoot-gateway-errors)路由,使用直接请求测试路由,并修复返回非 API 响应的跳跃
1746* 在具有登录页面的网络上(例如访客 Wi-Fi),在浏览器中完成登录,然后重试1853* 在具有登录页面的网络上(例如访客 Wi-Fi),在浏览器中完成登录,然后重试
1747* 如果只有通过您的网关的非流式路由被破坏,设置 [`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1`](/docs/zh-CN/env-vars#variables) 以便在流中失败的请求转到正常重试路径而不是此回退,除非流式端点本身返回 `404`,Claude Code 仍然会回退1854* 如果只有通过您的网关的非流式路由被破坏,设置 [`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1`](/docs/zh-CN/env-vars#variables) 以关闭此回退,除非流式端点本身返回 `404`,Claude Code 仍然会回退
1748 1855
1749<h3 id="streaming-response-ended-before-any-complete-data-was-received">1856<h3 id="streaming-response-ended-before-any-complete-data-was-received">
1750 流式响应在接收任何完整数据之前结束1857 流式响应在接收任何完整数据之前结束
1897* 使用 `claude --remote-control` 启动新会话以创建新的 Remote Control 会话2004* 使用 `claude --remote-control` 启动新会话以创建新的 Remote Control 会话
1898* 对于其他 Remote Control 启动消息,请参阅[Remote Control 故障排除](/docs/zh-CN/remote-control#troubleshooting)2005* 对于其他 Remote Control 启动消息,请参阅[Remote Control 故障排除](/docs/zh-CN/remote-control#troubleshooting)
1899 2006
1900如果服务器报告之前的会话已消失,您不会看到此消息。Claude Code 在其位置启动新会话或显示 [`Previous session is unavailable — run /remote-control to start a new one`](/docs/zh-CN/remote-control#previous-session-is-unavailable),取决于[对话的重新连接记录](/docs/zh-CN/remote-control#resume-outcomes)。从 v2.1.227 到 v2.1.231,Claude Code 显示了以 `Remote Control could not resume the previous session under the current login` 开头的消息,[早期版本的行为也不同](/docs/zh-CN/remote-control#reconnect-history)。2007如果服务器报告之前的会话已消失,您不会看到此消息。Claude Code 在其位置启动新会话或显示 [`Previous session is unavailable — run /remote-control to start a new one`](/docs/zh-CN/remote-control#previous-session-is-unavailable)。
1901 2008
1902<h3 id="sessions-ended-while-this-machine-was-offline">2009<h3 id="sessions-ended-while-this-machine-was-offline">
1903 此机器离线时会话已结束2010 此机器离线时会话已结束
1931* 运行 `/feedback` 发送成绩单并描述发生了什么。如果 `/feedback` 在您的环境中不可用,请参阅[报告错误](#report-an-error)2038* 运行 `/feedback` 发送成绩单并描述发生了什么。如果 `/feedback` 在您的环境中不可用,请参阅[报告错误](#report-an-error)
1932* 如果其他请求也失败,检查您的网络连接并查看[无法连接到 API](#unable-to-connect-to-api)2039* 如果其他请求也失败,检查您的网络连接并查看[无法连接到 API](#unable-to-connect-to-api)
1933 2040
2041<h3 id="couldnt-send-feedback">
2042 无法发送反馈
2043</h3>
2044
2045您从 [`/feedback`、`/bug` 或 `/share` 对话框](/docs/zh-CN/commands#all-commands)发送了报告,上传到 Anthropic 失败。对话框保留您的文本,以便您可以重试。
2046
2047```text theme={null}
2048Couldn't send feedback (couldn't reach the service). If it keeps failing, you can file at https://github.com/anthropics/claude-code/issues instead.
2049```
2050
2051前缀后的文本名称失败的内容:
2052
2053* **`: not signed in. Run /login, then retry.`**:对话框仅在 Claude Code 打开时找到 Anthropic 凭证且到您发送时没有可用的凭证时上传。例如,您在此期间在此机器上注销,或您的登录不再可以刷新。
2054* **括号内容**:`(server returned <status>)` 是服务的响应代码;`(request timed out)` 和 `(couldn't reach the service)` 是网络故障。当 Claude Code 无法命名原因时,括号内容不存在。
2055
2056在[反馈草稿队列](/docs/zh-CN/tools-reference#sendfeedback-tool-behavior)中,相同的故障以 `The draft is still queued. Try again later.` 结束,草稿保留在队列中以供另一次尝试。
2057
2058**要做什么:**
2059
2060* 对于未登录的措辞,运行 `/login` 并再次发送
2061* 否则,再次发送;如果其他请求也失败,检查您的网络连接并查看[无法连接到 API](#unable-to-connect-to-api)
2062* 如果它继续失败,在 [github.com/anthropics/claude-code/issues](https://github.com/anthropics/claude-code/issues) 提交报告,如消息所说
2063
2064在 v2.1.281 之前,每次发送在 Remote Control **Stop** 或紧急跨会话消息在对话框打开时到达后都失败并显示此消息。在这些版本上,关闭对话框,重新打开它,然后再次发送。
2065
1934<h2 id="request-errors">2066<h2 id="request-errors">
1935 请求错误2067 请求错误
1936</h2>2068</h2>
2008* 运行 `/context` 以查看窗口消耗内容的分解:系统提示、工具、内存文件和消息2140* 运行 `/context` 以查看窗口消耗内容的分解:系统提示、工具、内存文件和消息
2009* 使用 `/mcp disable <name>` 禁用您未使用的 MCP 服务器,以从上下文中删除其工具定义2141* 使用 `/mcp disable <name>` 禁用您未使用的 MCP 服务器,以从上下文中删除其工具定义
2010* 修剪大型 `CLAUDE.md` 内存文件,或将说明移到仅在相关时加载的[路径范围规则](/docs/zh-CN/memory#path-specific-rules)中2142* 修剪大型 `CLAUDE.md` 内存文件,或将说明移到仅在相关时加载的[路径范围规则](/docs/zh-CN/memory#path-specific-rules)中
2011* 子代理从父会话继承每个 MCP 工具定义,这可能在第一轮之前填满其上下文窗口。在生成子代理之前,禁用您未使用的 MCP 服务器。
2012* 自动压缩默认开启,通常可防止此错误。如果您在 `/config` 中或使用 [`DISABLE_AUTO_COMPACT`](/docs/zh-CN/env-vars) 关闭了它,请将其重新打开。如果您保持关闭,请在窗口填满之前自己运行 `/compact`。2143* 自动压缩默认开启,通常可防止此错误。如果您在 `/config` 中或使用 [`DISABLE_AUTO_COMPACT`](/docs/zh-CN/env-vars) 关闭了它,请将其重新打开。如果您保持关闭,请在窗口填满之前自己运行 `/compact`。
2013 2144
2014有关上下文如何填满的交互式视图,请参阅[探索上下文窗口](/docs/zh-CN/context-window)。2145有关上下文如何填满的交互式视图,请参阅[探索上下文窗口](/docs/zh-CN/context-window)。
2017 上下文超过令牌限制2148 上下文超过令牌限制
2018</h3>2149</h3>
2019 2150
2020当对话超过模型的上下文窗口时,`/context` 在其输出顶部显示此警告。请求失败,显示 [`Prompt is too long`](#prompt-is-too-long),直到您释放空间。交互式会话将该错误显示为 `Context limit reached` 行。2151`/context` 在其输出顶部显示此警告,当对话超过模型的上下文窗口时。请求失败,显示 [`Prompt is too long`](#prompt-is-too-long),直到您释放空间。交互式会话将该错误显示为 `Context limit reached` 行。
2021 2152
2022```text theme={null}2153```text theme={null}
2023Context exceeds the 200k-token limit by 94k tokens — run /compact or /clear to continue.2154Context exceeds the 200k-token limit by 94k tokens — run /compact or /clear to continue.
2038 2169
2039在 v2.1.216 之前,`/context` 显示超过 100% 的使用情况,没有警告行解释这意味着什么或如何恢复。2170在 v2.1.216 之前,`/context` 显示超过 100% 的使用情况,没有警告行解释这意味着什么或如何恢复。
2040 2171
2041<h3 id="error-during-compaction-conversation-too-long">
2042 压缩期间出错:对话过长
2043</h3>
2044
2045`/compact` 本身失败,因为没有足够的可用上下文来保存它生成的摘要。
2046
2047```text theme={null}
2048Error during compaction: Conversation too long. Press esc twice to go up a few messages and try again.
2049```
2050
2051当窗口在自动压缩触发时已满,或当您在看到 [`Prompt is too long`](#prompt-is-too-long) 后运行 `/compact` 时,可能会发生这种情况。在交互式会话中,该错误是 `Context limit reached` 行。
2052
2053**要做什么:**
2054
2055* 按 Esc 两次打开消息列表并回退几轮。这会从上下文中删除最近的消息。然后再次运行 `/compact`。
2056* 如果回退没有释放足够的空间,运行 `/clear` 以启动新的会话。您之前的对话被保留,可以使用 `/resume` 重新打开。
2057
2058此消息和其他 `/compact` 失败以错误样式显示。在 v2.1.216 之前,它们以与成功命令输出相同的暗淡样式呈现,因此您可能会将失败的压缩读取为成功。
2059
2060<h3 id="request-too-large">2172<h3 id="request-too-large">
2061 请求过大2173 请求过大
2062</h3>2174</h3>
2140* 对于超大 PDF,要求 Claude 使用 Read 工具读取页面范围,而不是附加整个文件,或使用 `pdftotext` 等工具提取文本并按路径引用输出文件2252* 对于超大 PDF,要求 Claude 使用 Read 工具读取页面范围,而不是附加整个文件,或使用 `pdftotext` 等工具提取文本并按路径引用输出文件
2141* 对于受保护或无效的 PDF,删除密码或从其源应用程序重新导出文件,然后重试2253* 对于受保护或无效的 PDF,删除密码或从其源应用程序重新导出文件,然后重试
2142 2254
2255当 Claude 使用 Read 工具从 PDF 读取页面范围时,读取可能失败,显示不同的消息:
2256
2257```text theme={null}
2258pdftoppm is not installed. Install poppler-utils (e.g. `brew install poppler` or `apt-get install poppler-utils`) to enable PDF page rendering.
2259```
2260
2261页面范围读取使用 `pdftoppm` 呈现页面。使用消息提供的命令安装 poppler-utils,或在其他平台上安装将 `pdftoppm` 放在您的 `PATH` 上的 poppler 构建。请参阅[Read 工具行为](/docs/zh-CN/tools-reference#read-tool-behavior)以了解哪些 PDF 按页面范围读取。
2262
2143<h3 id="extra-inputs-are-not-permitted">2263<h3 id="extra-inputs-are-not-permitted">
2144 不允许额外输入2264 不允许额外输入
2145</h3>2265</h3>
2148 2268
2149```text theme={null}2269```text theme={null}
2150API Error: 400 ... Extra inputs are not permitted ... context_management2270API Error: 400 ... Extra inputs are not permitted ... context_management
2151API Error: 400 ... Unexpected value(s) for the `anthropic-beta` header
2152```2271```
2153 2272
2154Claude Code 发送 `context_management` 和 `effort` 等仅限测试版的字段,以及启用它们的 `anthropic-beta` 头。当网关转发正文但删除头时,API 会看到它不识别的字段。2273Claude Code 发送 `context_management` 和 `effort` 等仅限测试版的字段,以及启用它们的 `anthropic-beta` 头。当网关转发正文但删除头时,API 会看到它不识别的字段。
2185* 删除或[禁用](/docs/zh-CN/mcp#disable-a-server-without-removing-it)声明无效架构的 MCP 服务器。该错误仅按位置命名工具。在 v2.1.216 或更高版本上,检查每个服务器的日志,查找命名其输入架构会被拒绝的工具的行。如果没有日志命名一个,一次禁用一个服务器。2304* 删除或[禁用](/docs/zh-CN/mcp#disable-a-server-without-removing-it)声明无效架构的 MCP 服务器。该错误仅按位置命名工具。在 v2.1.216 或更高版本上,检查每个服务器的日志,查找命名其输入架构会被拒绝的工具的行。如果没有日志命名一个,一次禁用一个服务器。
2186* 如果您维护服务器,请修复工具的 `input_schema`。架构必须是有效的 JSON Schema,顶级属性名称必须为 1 到 64 个字符长,并仅使用 ASCII 字母和数字、`_`、`.` 和 `-`。请参阅[具有无效输入架构的工具](/docs/zh-CN/mcp#tools-with-invalid-input-schemas)。2305* 如果您维护服务器,请修复工具的 `input_schema`。架构必须是有效的 JSON Schema,顶级属性名称必须为 1 到 64 个字符长,并仅使用 ASCII 字母和数字、`_`、`.` 和 `-`。请参阅[具有无效输入架构的工具](/docs/zh-CN/mcp#tools-with-invalid-input-schemas)。
2187 2306
2307<h3 id="tool-use-name-over-200-characters">
2308 tool\_use.name 超过 200 个字符
2309</h3>
2310
2311对话历史中的工具调用携带的名称长度超过 API 在请求中接受的 200 个字符:
2312
2313```text theme={null}
2314API Error: 400 ... tool_use.name: String should have at most 200 characters
2315```
2316
2317Claude Code 在响应到达时以及加载保存的对话时将这样的名称切割为 200 个字符,因此调用失败,显示普通的 `No such tool available` 工具错误,对话继续而不显示此 API 错误。
2318
2319**要做什么:**
2320
2321* 运行 `claude update`,然后恢复对话。更新的版本在加载记录时修复过长的名称,因此卡住的对话再次工作。
2322
2323在 v2.1.281 之前,过长的名称保留在历史中,API 拒绝了重新发送对话的每个请求,包括 `/compact` 和 `--resume`,因此此错误重复,对话被卡住。
2324
2188<h3 id="theres-an-issue-with-the-selected-model">2325<h3 id="theres-an-issue-with-the-selected-model">
2189 所选模型存在问题2326 所选模型存在问题
2190</h3>2327</h3>
2202* **Agent SDK**:错误文本省略提示,因为模型是以编程方式设置的。在 TypeScript 中的 [`Options` 上设置 `model`](/docs/zh-CN/agent-sdk/typescript#options),或在 Python 中设置 [`ClaudeAgentOptions(model=...)`](/docs/zh-CN/agent-sdk/python#claudeagentoptions),并处理结构化的 `model_not_found` 错误以显示您自己的重试或模型选择器。2339* **Agent SDK**:错误文本省略提示,因为模型是以编程方式设置的。在 TypeScript 中的 [`Options` 上设置 `model`](/docs/zh-CN/agent-sdk/typescript#options),或在 Python 中设置 [`ClaudeAgentOptions(model=...)`](/docs/zh-CN/agent-sdk/python#claudeagentoptions),并处理结构化的 `model_not_found` 错误以显示您自己的重试或模型选择器。
2203* 使用别名(如 `sonnet` 或 `opus`)而不是完整的版本化 ID。别名解析为维护的默认值,因此它们不会过时。请参阅[模型配置](/docs/zh-CN/model-config)。2340* 使用别名(如 `sonnet` 或 `opus`)而不是完整的版本化 ID。别名解析为维护的默认值,因此它们不会过时。请参阅[模型配置](/docs/zh-CN/model-config)。
2204* 如果错误的模型在 CLI 中不断返回,则某处设置了过时的 ID。按[优先级顺序](/docs/zh-CN/model-config#setting-your-model)检查您可以设置模型的位置,并删除过时的值。2341* 如果错误的模型在 CLI 中不断返回,则某处设置了过时的 ID。按[优先级顺序](/docs/zh-CN/model-config#setting-your-model)检查您可以设置模型的位置,并删除过时的值。
2205* 新推出的模型可能在 Anthropic API 上可用,但在 Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 上可用之前。如果您在这些提供商之一上固定了新模型 ID 并看到此错误,请检查您提供商的模型目录以了解您所在地区的可用性,并保持固定前一个版本,直到新版本出现。
2206* Claude Code 将过期的 claude.ai 登录报告为[登录过期](#login-expired),而不是此错误。在 v2.1.206 之前,无法再刷新的过期登录对每个模型都失败,显示此错误;如果您在较旧版本上看到这种情况,请运行 `/login`。2342* Claude Code 将过期的 claude.ai 登录报告为[登录过期](#login-expired),而不是此错误。在 v2.1.206 之前,无法再刷新的过期登录对每个模型都失败,显示此错误;如果您在较旧版本上看到这种情况,请运行 `/login`。
2207* 对于 Google Cloud 的 Agent Platform 部署,请参阅 [Google Cloud 的 Agent Platform 故障排除](/docs/zh-CN/google-vertex-ai#troubleshooting)。2343* 对于 Google Cloud 的 Agent Platform 部署,请参阅 [Google Cloud 的 Agent Platform 故障排除](/docs/zh-CN/google-vertex-ai#troubleshooting)。
2208 2344
2216Model "claud-sonnet-5" is not a recognized model id. Did you mean 'claude-sonnet-5'?2352Model "claud-sonnet-5" is not a recognized model id. Did you mean 'claude-sonnet-5'?
2217```2353```
2218 2354
2219尾部提示命名最接近的匹配别名或模型 ID。当没有足够接近的内容时,它读取 `Run /model to see available models.`。2355尾部提示命名最接近的匹配别名或模型 ID。当没有足够接近的内容时,它读取 `Run /model to see available models.`。在 [Desktop app](/docs/zh-CN/desktop) 启动的会话中,无匹配提示读取 `Switch to a different model.`
2220 2356
2221Claude Code 在请求切换时在本地生成此错误,在发送任何 API 请求之前。它适用于通过 [Agent SDK](/docs/zh-CN/agent-sdk/typescript) `setModel()` 方法设置模型的情况,通过运行 Claude Code CLI 的应用程序(如 [Desktop app](/docs/zh-CN/desktop)),或当您从通过 [Remote Control](/docs/zh-CN/remote-control) 连接的设备选择模型时。在 v2.1.260 之前,检查不涵盖 Remote Control 选择,因此 Claude Code 应用了选择,下一个请求失败,显示[所选模型存在问题](#theres-an-issue-with-the-selected-model)。2357Claude Code 在请求切换时在本地生成此错误,在发送任何 API 请求之前。它适用于通过 [Agent SDK](/docs/zh-CN/agent-sdk/typescript) `setModel()` 方法设置模型的情况,通过运行 Claude Code CLI 的应用程序(如 [Desktop app](/docs/zh-CN/desktop)),或当您从通过 [Remote Control](/docs/zh-CN/remote-control) 连接的设备选择模型时。在 v2.1.260 之前,检查不涵盖 Remote Control 选择,因此 Claude Code 应用了选择,下一个请求失败,显示[所选模型存在问题](#theres-an-issue-with-the-selected-model)。
2222 2358
2245* 如果您输入了完整 ID,请根据您提供商的模型目录检查它。新推出的模型可能在 Anthropic API 上可用,但您的提供商或地区尚未提供。2381* 如果您输入了完整 ID,请根据您提供商的模型目录检查它。新推出的模型可能在 Anthropic API 上可用,但您的提供商或地区尚未提供。
2246* 在 v2.1.265 之前,`/model` 也以此错误拒绝了 `opusplan[1m]` 别名拼写。在这些版本上,更新 Claude Code,或在[设置](/docs/zh-CN/model-config#setting-your-model)中或使用 `--model` 设置模型。2382* 在 v2.1.265 之前,`/model` 也以此错误拒绝了 `opusplan[1m]` 别名拼写。在这些版本上,更新 Claude Code,或在[设置](/docs/zh-CN/model-config#setting-your-model)中或使用 `--model` 设置模型。
2247 2383
2384<h3 id="api-error-model-not-changed">
2385 检查选择的模型时出现 API 错误
2386</h3>
2387
2388您使用 `/model <name>` 选择了模型,或连接到会话的应用程序请求了切换。API 拒绝了 Claude Code 发送以验证模型的最小请求,原因没有自己的条目,例如速率限制或服务器错误。会话保持其当前模型,消息以说明这一点结尾:
2389
2390```text theme={null}
2391API error: 429 <the server's explanation> · model not changed
2392```
2393
2394消息的中间是 HTTP 状态和服务器自己的解释。
2395
2396**要做什么:**
2397
2398* 根据服务器的解释采取行动;对于速率限制或 5xx 状态,等待并再次选择模型
2399* 具有自己措辞的拒绝由周围条目涵盖,例如[模型未找到](#model-not-found)和[模型受您的组织设置限制](#model-is-restricted-by-your-organizations-settings)
2400
2248<h3 id="claude-opus-is-not-available-with-the-claude-pro-plan">2401<h3 id="claude-opus-is-not-available-with-the-claude-pro-plan">
2249 Claude Opus 在 Claude Pro 计划中不可用2402 Claude Opus 在 Claude Pro 计划中不可用
2250</h3>2403</h3>
2255Claude Opus is not available with the Claude Pro plan. If you have updated your subscription plan recently, run /logout and /login for the plan to take effect.2408Claude Opus is not available with the Claude Pro plan. If you have updated your subscription plan recently, run /logout and /login for the plan to take effect.
2256```2409```
2257 2410
2411在 Claude Desktop app 运行的会话中,消息说改为`登出并登入`而不是命名命令。
2412
2258**要做什么:**2413**要做什么:**
2259 2414
2260* 运行 `/model` 并选择您的计划包括的模型2415* 运行 `/model` 并选择您的计划包括的模型
2287 模型受您的组织设置限制2442 模型受您的组织设置限制
2288</h3>2443</h3>
2289 2444
2290您的组织管理员在 claude.ai 管理控制台中禁用了此模型,或它被托管设置中的 [`availableModels`](/docs/zh-CN/model-config#restrict-model-selection) 允许列表排除。当受限制的模型使用 `--model`、`ANTHROPIC_MODEL` 或 `model` 设置设置时,Claude Code 替换允许的模型并继续。为受限制的模型键入 `/model <name>` 被拒绝,显示 `Run /model to choose a different model.`,会话保持其当前模型。替换通知也可能在会话中期出现,在组织管理员在 claude.ai 管理控制台中禁用会话正在运行的模型之后。2445您的组织管理员在 claude.ai 管理控制台中禁用了此模型,或托管设置中的 [`availableModels`](/docs/zh-CN/model-config#restrict-model-selection) 允许列表或 [`deniedModels`](/docs/zh-CN/model-config#block-specific-models-or-versions) 列表排除了它。当受限制的模型使用 `--model`、`ANTHROPIC_MODEL` 或 `model` 设置设置时,通知在启动时出现,并命名会话使用的模型。如果托管设置没有为会话留下允许的模型,请参阅[托管设置阻止默认模型](#managed-settings-block-the-default-model)。替换通知也可能在会话中期出现,在组织管理员在 claude.ai 管理控制台中禁用会话正在运行的模型之后。
2291 2446
2292```text theme={null}2447```text theme={null}
2293Model "claude-opus-4-8" is restricted by your organization's settings. Using claude-sonnet-4-6 instead.2448Model "claude-opus-4-8" is restricted by your organization's settings. Using claude-sonnet-4-6 instead.
2294```2449```
2295 2450
2451为受限制的模型键入 `/model <name>` 被拒绝,会话保持其当前模型。对于在管理控制台中禁用的模型,拒绝读取 `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.`。对于托管设置排除的模型,它读取 `Model '<name>' is not available. Your organization restricts model selection.`
2452
2296以代理、技能或命令名称为前缀的通知意味着限制适用于该[子代理的请求模型](/docs/zh-CN/sub-agents#choose-a-model):子代理在替换模型上运行,您的会话模型保持不变。在 v2.1.223 之前,Claude Code 仅为使用 Agent 工具启动的子代理显示通知。2453以代理、技能或命令名称为前缀的通知意味着限制适用于该[子代理的请求模型](/docs/zh-CN/sub-agents#choose-a-model):子代理在替换模型上运行,您的会话模型保持不变。在 v2.1.223 之前,Claude Code 仅为使用 Agent 工具启动的子代理显示通知。
2297 2454
2298Claude Code 将模型族别名(`opus`、`sonnet`、`haiku` 或 `fable` 之一)视为对该族的请求,而不是对其最新版本的请求。在 Anthropic API 和 [Claude Platform on AWS](/docs/zh-CN/claude-platform-on-aws) 上,受限制的族别名解析为您的组织和 `availableModels` 允许列表允许的族的最新版本,替换通知命名该版本。Claude Code 仅当族的每个版本都受限制时才拒绝 `/model <alias>`。在 v2.1.205 之前,族别名基于其最新版本单独被替换或拒绝,即使同一族的较旧版本被允许。2455Claude Code 将模型族别名(`opus`、`sonnet`、`haiku` 或 `fable` 之一)视为对该族的请求,而不是对其最新版本的请求。在 Anthropic API 和 [Claude Platform on AWS](/docs/zh-CN/claude-platform-on-aws) 上,受限制的族别名解析为您的组织的设置允许的族的最新版本,替换通知命名该版本。Claude Code 仅当族的每个版本都受限制时才拒绝 `/model <alias>`。在 v2.1.205 之前,族别名基于其最新版本单独被替换或拒绝,即使同一族的较旧版本被允许。
2299 2456
2300**要做什么:**2457**要做什么:**
2301 2458
2354 2511
2355**要做什么:**2512**要做什么:**
2356 2513
2357* 运行 `claude update` 并重启 Claude Code。Opus 4.7 需要 v2.1.111 或更高版本。Opus 4.8 需要 v2.1.154 或更高版本。Sonnet 5 需要 v2.1.197 或更高版本。Opus 5 需要 v2.1.219 或更高版本。Opus 5.5 需要 v2.1.280 或更高版本2514* 运行 `claude update` 并重启 Claude Code。Opus 4.7 需要 v2.1.111 或更高版本。Opus 4.8 需要 v2.1.154 或更高版本。Sonnet 5 需要 v2.1.197 或更高版本。Opus 5 需要 v2.1.219 或更高版本。Opus 5.5 需要 v2.1.280 或更高版本。Sonnet 5.5 需要 v2.1.284 或更高版本
2358* 如果您无法升级,运行 `/model` 并选择 Opus 4.6 或 Sonnet 4.62515* 如果您无法升级,运行 `/model` 并选择 Opus 4.6 或 Sonnet 4.6
2359* 如果您在 [Agent SDK](/docs/zh-CN/agent-sdk/overview) 中遇到这个,升级 SDK 包。Opus 4.8 需要 TypeScript SDK v0.3.154 或更高版本和 Python SDK v0.2.88 或更高版本。Sonnet 5 需要 TypeScript SDK v0.3.197 或更高版本。Opus 5 需要 TypeScript SDK v0.3.219 或更高版本。Opus 5.5 需要 TypeScript SDK v0.3.280 或更高版本2516* 如果您在 [Agent SDK](/docs/zh-CN/agent-sdk/overview) 中遇到这个,升级 SDK 包。Opus 4.8 需要 TypeScript SDK v0.3.154 或更高版本和 Python SDK v0.2.88 或更高版本。Sonnet 5 需要 TypeScript SDK v0.3.197 或更高版本。Opus 5 需要 TypeScript SDK v0.3.219 或更高版本。Opus 5.5 需要 TypeScript SDK v0.3.280 或更高版本。Sonnet 5.5 需要 TypeScript SDK v0.3.284 或更高版本
2360 2517
2361<h3 id="effort-isnt-available-with-thinking-turned-off">2518<h3 id="effort-isnt-available-with-thinking-turned-off">
2362 关闭思考时努力不可用2519 关闭思考时努力不可用
2368API Error: Effort 'xhigh' isn't available with thinking turned off on this model · run /effort high to continue, or turn thinking back on (unset MAX_THINKING_TOKENS=0)2525API Error: Effort 'xhigh' isn't available with thinking turned off on this model · run /effort high to continue, or turn thinking back on (unset MAX_THINKING_TOKENS=0)
2369```2526```
2370 2527
2528`·` 后的提示因会话而异:在非交互式会话中,它读取 `use --effort high (or the effortLevel setting)`,在 Claude Desktop app 运行的会话中,它读取 `you can lower effort to High`。
2529
2371**要做什么:**2530**要做什么:**
2372 2531
2373* [降低努力级别](/docs/zh-CN/model-config#set-the-effort-level)到 `high` 或以下。2532* [降低努力级别](/docs/zh-CN/model-config#set-the-effort-level)到 `high` 或以下。
2374* 打开思考,例如通过取消设置 [`MAX_THINKING_TOKENS`](/docs/zh-CN/env-vars) 或从您的设置中删除 [`"alwaysThinkingEnabled": false`](/docs/zh-CN/settings-reference#alwaysthinkingenabled)。2533* 打开思考,例如通过取消设置 [`MAX_THINKING_TOKENS`](/docs/zh-CN/env-vars) 或从您的设置中删除 [`"alwaysThinkingEnabled": false`](/docs/zh-CN/settings-reference#alwaysthinkingenabled)。
2375 2534
2376在 v2.1.242 之前,Claude Code 显示了 API 自己的消息:`API Error: 400 output_config.effort 'xhigh' is not supported when thinking is disabled on this model. Use effort 'high' or below, or enable thinking.` 在 v2.1.251 之前,Claude Code 以您设置的努力级别发送请求,因此 Opus 5 拒绝了关闭思考时高于 `high` 的每个请求。Claude Code 现在向它知道拒绝该组合的模型(如 Opus 5)发送努力 `high`,因此在 v2.1.251 或更高版本上,此错误仅从 Claude Code 不知道拒绝它的模型到达您。2535在 v2.1.242 之前,Claude Code 显示了 API 自己的消息:`API Error: 400 output_config.effort 'xhigh' is not supported when thinking is disabled on this model. Use effort 'high' or below, or enable thinking.` 在 v2.1.251 之前,Claude Code 以您设置的努力级别发送请求,因此 Opus 5 拒绝了关闭思考时高于 `high` 的每个请求。Claude Code 现在向它知道拒绝该组合的模型(如 Opus 5)发送努力 `high`。
2377 2536
2378<h3 id="thinking-budget-exceeds-output-limit">2537<h3 id="thinking-budget-exceeds-output-limit">
2379 思考预算超过输出限制2538 思考预算超过输出限制
2385API Error: 400 ... max_tokens must be greater than thinking.budget_tokens2544API Error: 400 ... max_tokens must be greater than thinking.budget_tokens
2386```2545```
2387 2546
2388Claude Code 在 Anthropic API 上自动调整这些值。当 [`MAX_THINKING_TOKENS`](/docs/zh-CN/env-vars) 设置高于提供商的输出限制时,或当计划模式提高思考预算时,您通常在 Amazon Bedrock 或 Google Cloud 的 Agent Platform 上看到此错误。
2389
2390**要做什么:**2547**要做什么:**
2391 2548
2392* 降低 `MAX_THINKING_TOKENS`,或提高 [`CLAUDE_CODE_MAX_OUTPUT_TOKENS`](/docs/zh-CN/env-vars) 高于思考预算2549* 提高 [`CLAUDE_CODE_MAX_OUTPUT_TOKENS`](/docs/zh-CN/env-vars) 高于思考预算
2393* 请参阅[扩展思考](/docs/zh-CN/model-config#extended-thinking)以了解预算如何与输出长度交互2550* 请参阅[扩展思考](/docs/zh-CN/model-config#extended-thinking)以了解预算如何与输出长度交互
2394 2551
2395<h3 id="tool-use-or-thinking-block-mismatch">2552<h3 id="tool-use-or-thinking-block-mismatch">
2396 工具使用或思考块不匹配2553 工具使用或思考块不匹配
2397</h3>2554</h3>
2398 2555
2399对话历史以不一致的状态到达 API,通常在工具调用被中断或轮次在流中期被编辑后。2556对话历史以不一致的状态到达 API。
2400 2557
2401```text theme={null}2558```text theme={null}
2402API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.2559API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.
2413* 如果您使用 Opus 4.7 或 Opus 4.8,首先运行 `claude update`。v2.1.156 之前的版本可以在正常工具使用期间触发此错误,`/rewind` 不会清除它。2570* 如果您使用 Opus 4.7 或 Opus 4.8,首先运行 `claude update`。v2.1.156 之前的版本可以在正常工具使用期间触发此错误,`/rewind` 不会清除它。
2414* 运行 `/rewind`,或按 Esc 两次,回退到损坏轮次之前的检查点并从那里继续。请参阅[检查点](/docs/zh-CN/checkpointing)以了解如何创建和恢复检查点。2571* 运行 `/rewind`,或按 Esc 两次,回退到损坏轮次之前的检查点并从那里继续。请参阅[检查点](/docs/zh-CN/checkpointing)以了解如何创建和恢复检查点。
2415 2572
2573<h3 id="invalid-data-in-redacted-thinking-block">
2574 redacted\_thinking 块中的数据无效
2575</h3>
2576
2577API 拒绝了请求,返回 400,因为它无法接受对话历史中较早轮次携带的 `redacted_thinking` 块。
2578
2579```text theme={null}
2580API Error: 400 ... Invalid `data` in `redacted_thinking` block
2581```
2582
2583Claude Code 将对话的较早思考排除在请求之外并重试一次,因此会话继续而不显示错误。在 v2.1.282 之前,Claude Code 保留被拒绝的块,每个后来的轮次都以相同错误失败。
2584
2585**要做什么:**
2586
2587* 如果您在 v2.1.281 或更早版本上,每一轮都失败,显示此错误,运行 `claude update` 并恢复会话
2588* 如果错误持续,运行 `/clear` 以启动不携带该块的对话
2589
2416<h3 id="unsupported-tool-content-removed">2590<h3 id="unsupported-tool-content-removed">
2417 删除了不支持的工具内容2591 删除了不支持的工具内容
2418</h3>2592</h3>
2446 2620
2447**要做什么:**2621**要做什么:**
2448 2622
2449* 运行 `/clear` 以启动新对话。如果错误也在那里返回,原因在请求路径上,而不在保存的对话中。
2450* 如果错误在通过 [`ANTHROPIC_BASE_URL`](/docs/zh-CN/env-vars) 配置的代理或网关后的每一轮上重复,连接而不使用代理以确认源,并向操作它的人报告错误2623* 如果错误在通过 [`ANTHROPIC_BASE_URL`](/docs/zh-CN/env-vars) 配置的代理或网关后的每一轮上重复,连接而不使用代理以确认源,并向操作它的人报告错误
2624* 运行 `/clear` 以启动新对话。如果错误也在那里返回,原因在请求路径上,而不在保存的对话中。
2451 2625
2452在 v2.1.280 之前,Claude Code 不识别此措辞,因此当被拒绝的系统消息是 Claude Code 本身发送的时,错误也出现,对话的每个后来轮次都以相同方式失败。2626在 v2.1.280 之前,Claude Code 不识别此措辞,因此当被拒绝的系统消息是 Claude Code 本身发送的时,错误也出现,对话的每个后来轮次都以相同方式失败。
2453 2627
2458API 拒绝了请求,返回 400,因为对话历史包含它无法解密的托管网络搜索内容。措辞命名它无法读取的字段:2632API 拒绝了请求,返回 400,因为对话历史包含它无法解密的托管网络搜索内容。措辞命名它无法读取的字段:
2459 2633
2460```text theme={null}2634```text theme={null}
2461API Error: 400 messages.21.content.0: Invalid `encrypted_content` in `search_result` block2635API Error: 400 ... Invalid `encrypted_content` in `search_result` block
2462API Error: 400 messages.21.content.3.citations.0: Invalid `encrypted_index` in `text` block2636API Error: 400 ... Invalid `encrypted_index` in `text` block
2463API Error: 400 Failed to decrypt web search result content2637API Error: 400 ... Failed to decrypt web search result content
2638API Error: 400 ... Invalid `encrypted_stdout` in `encrypted_code_execution_result` block
2464```2639```
2465 2640
2466来自 API 的托管[网络搜索工具](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)的结果携带只有 API 可以读取的加密字段。API 拒绝重放它无法解密的内容的请求,如为不同组织生成的内容。2641来自 API 的托管[网络搜索工具](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)的结果携带只有 API 可以读取的加密字段。`encrypted_stdout` 措辞命名读取这样的结果的托管代码执行程序的输出,API 也加密。API 拒绝重放它无法解密的内容的请求,如为不同组织生成的内容。
2467 2642
2468Claude Code 自己的 [WebSearch 工具](/docs/zh-CN/tools-reference#websearch-tool-behavior)将搜索结果记录为纯文本,因此这些块通常通过代理或 [LLM gateway](/docs/zh-CN/llm-gateway) 到达对话,该网关自己运行了托管网络搜索。2643Claude Code 自己的 [WebSearch 工具](/docs/zh-CN/tools-reference#websearch-tool-behavior)将搜索结果记录为纯文本,因此这些块通常通过代理或 [LLM gateway](/docs/zh-CN/llm-gateway) 到达对话,该网关自己运行了托管网络搜索。
2469 2644
2470被拒绝的块保留在对话历史中,因此每个后来的轮次和 `/compact` 都以相同方式失败。2645对于三个网络搜索措辞,Claude Code 将搜索调用、结果和引用排除在它发送的内容之外并重试请求一次,因此会话继续而不显示错误。`encrypted_stdout` 措辞没有这样的恢复,因此该消息仍然到达您。在 v2.1.282 之前,Claude Code 也保留了被拒绝的网络搜索块,每个后来的轮次和 `/compact` 都以相同方式失败。
2471 2646
2472**要做什么:**2647**要做什么:**
2473 2648
2474* 运行 `/clear` 或启动新会话;新对话不携带被拒绝的块2649* 如果您在 v2.1.281 或更早版本上,每一轮都失败,显示网络搜索措辞之一,运行 `claude update` 并恢复会话
2650* 如果错误持续,或消息命名 `encrypted_stdout`,运行 `/rewind` 回退到添加内容的轮次之前的检查点,或运行 `/clear` 启动不携带它的对话
2475* 如果您在代理或网关后运行 Claude Code,向操作它的人报告错误2651* 如果您在代理或网关后运行 Claude Code,向操作它的人报告错误
2476 2652
2477<h3 id="usage-policy-refusal">2653<h3 id="usage-policy-refusal">
2478 使用政策拒绝2654 使用政策拒绝
2479</h3>2655</h3>
2480 2656
2481API 拒绝了响应,因为对话中的内容触发了[使用政策](https://www.anthropic.com/legal/aup)检查。消息包括您可以引用给支持的请求 ID,如果您认为拒绝不正确。2657API 拒绝了响应,因为对话中的内容触发了[使用政策](https://www.anthropic.com/legal/aup)检查。
2658
2659消息包括请求 ID 和消息 ID,您可以引用给支持,如果您认为拒绝不正确。
2482 2660
2483```text theme={null}2661```text theme={null}
2484API Error: Opus 4.6 can't help with this. Start a new session to continue.2662API Error: Opus 4.6 can't help with this. Start a new session to continue.
2508API Error: Opus 4.8's safeguards flagged this message. Our intentionally broad safeguards allow us to deliver more capabilities faster, but can sometimes flag legitimate cybersecurity work. Apply to the Cyber Verification Program to reduce these interruptions. Send feedback with /feedback or learn more: https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude2686API Error: Opus 4.8's safeguards flagged this message. Our intentionally broad safeguards allow us to deliver more capabilities faster, but can sometimes flag legitimate cybersecurity work. Apply to the Cyber Verification Program to reduce these interruptions. Send feedback with /feedback or learn more: https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude
2509```2687```
2510 2688
2511消息链接到[网络安全验证计划](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude),该计划为合法网络安全工作授予访问权限。在 Opus 5.5 上(需要 v2.1.280 或更高版本),消息以 `Opus 5.5's safeguards flagged this session` 开头。当标记的类别有可用的后备模型时,Claude Code [切换模型](/docs/zh-CN/model-config#automatic-model-fallback) 而不是显示此错误。2689消息链接到[网络安全验证计划](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude),该计划为合法网络安全工作授予访问权限。在 Opus 5.5 和 Sonnet 5.5 上,消息以 `<model>'s safeguards flagged this session` 开头。当标记的类别有可用的后备模型时,Claude Code [切换模型](/docs/zh-CN/model-config#automatic-model-fallback) 而不是显示此错误。
2512 2690
2513在 [Amazon Bedrock](/docs/zh-CN/amazon-bedrock)、[Google Cloud 的 Agent Platform](/docs/zh-CN/google-vertex-ai) 和 [Microsoft Foundry](/docs/zh-CN/microsoft-foundry) 上,网络安全标记会产生[使用政策拒绝](#usage-policy-refusal)消息。2691在 [Amazon Bedrock](/docs/zh-CN/amazon-bedrock)、[Google Cloud 的 Agent Platform](/docs/zh-CN/google-vertex-ai) 和 [Microsoft Foundry](/docs/zh-CN/microsoft-foundry) 上,网络安全标记会产生[使用政策拒绝](#usage-policy-refusal)消息。
2514 2692
2550 下载更新时连接断开2728 下载更新时连接断开
2551</h3>2729</h3>
2552 2730
2553在 `claude install`、`claude update` 或 [自动更新程序](/docs/zh-CN/setup#auto-updates) 获取 Claude Code 二进制文件时,与下载服务器的连接关闭,重试也没有恢复。当连接断开、传输停滞或下载的文件校验和失败时,Claude Code 会重试下载,总共最多尝试三次。已完成的 HTTP 错误(例如 404)不会重试,因为服务器已经响应。在 v2.1.202 之前,单个断开的连接会立即导致下载失败,并显示裸错误 `aborted`,而不是重试。2731与下载服务器的连接在 `claude install` 或 `claude update` 获取 Claude Code 二进制文件时关闭,重试也没有恢复。当连接断开、传输停滞或下载的文件校验和失败时,Claude Code 会重试下载,总共最多尝试三次。已完成的 HTTP 错误(例如 404)不会重试,因为服务器已经响应。在 v2.1.202 之前,单个断开的连接会立即导致下载失败,并显示裸错误 `aborted`,而不是重试。
2554 2732
2555```text theme={null}2733```text theme={null}
2556The connection dropped while downloading the update (attempt 3/3: aborted). Check your network — proxies sometimes cut off large downloads.2734The connection dropped while downloading the update (attempt 3/3: aborted). Check your network — proxies sometimes cut off large downloads.
2560 2738
2561保持连接但在 10 分钟内未完成的下载失败,显示 `Download timed out: exceeded the total deadline`。Claude Code 不会重试超时的下载,因为连接速度太慢而无法在截止时间内完成,在立即重试时也不会完成。以下步骤适用于两条消息。2739保持连接但在 10 分钟内未完成的下载失败,显示 `Download timed out: exceeded the total deadline`。Claude Code 不会重试超时的下载,因为连接速度太慢而无法在截止时间内完成,在立即重试时也不会完成。以下步骤适用于两条消息。
2562 2740
2563通常的原因是代理或网关在长传输完成前关闭它。Claude Code 二进制文件是一个大型下载,因此永远不会影响正常 API 流量的代理连接限制仍然可能中断它。2741代理或网关可以在长传输完成前关闭它,而 Claude Code 二进制文件是一个大型下载。
2564 2742
2565**应该做什么:**2743**应该做什么:**
2566 2744
2594 无效的 --agents 配置2772 无效的 --agents 配置
2595</h3>2773</h3>
2596 2774
2597您传递给 `--agents` 的值无效,因此 `claude` 以代码 1 退出,而不是启动会话。当您传递 `--safe-mode`、`--resume` 或 `--continue`,或设置 [`CLAUDE_CODE_SAFE_MODE`](/docs/zh-CN/env-vars#variables) 时,Claude Code 不会检查该值并启动会话。在 v2.1.242 之前,Claude Code 无论如何都会启动会话,并遗漏它无法加载的定义。2775您传递给 `--agents` 的值无效,因此 `claude` 以代码 1 退出,而不是启动会话。当您传递 `--safe-mode` 或设置 [`CLAUDE_CODE_SAFE_MODE`](/docs/zh-CN/env-vars#variables) 时,Claude Code 忽略 `--agents` 完全。使用 `--resume` 或 `--continue` 时,内联 JSON 值不被检查,会话启动;从文件读取的值在每次启动时被检查。在 v2.1.242 之前,Claude Code 无论如何都会启动会话。
2598 2776
2599```text theme={null}2777```text theme={null}
2600Error: Invalid --agents configuration:2778Error: Invalid --agents configuration:
2603 2781
2604第一行之后的内容取决于值如何失败。Claude Code 按顺序运行这些检查,并在第一个失败的检查处停止。如果您的值有两种问题,您只有在修复第一个问题后才会看到第二个问题:2782第一行之后的内容取决于值如何失败。Claude Code 按顺序运行这些检查,并在第一个失败的检查处停止。如果您的值有两种问题,您只有在修复第一个问题后才会看到第二个问题:
2605 2783
26061. 当值不能解析为 JSON 时,Claude Code 打印一行 `invalid JSON:` 行,其中包含 JSON 解析器自己的消息27841. 当值以 `{` 开头但不能解析为 JSON 时,或 `--agents` 文件的内容不能解析时,Claude Code 打印一行 `invalid JSON:` 行,其中包含 JSON 解析器自己的消息
26072. 当它解析但代理定义与 [CLI 定义的子代理](/docs/zh-CN/sub-agents#choose-the-subagent-scope) 的架构不匹配时,Claude Code 为每个问题打印一行27852. 当它解析但代理定义与 [CLI 定义的子代理](/docs/zh-CN/sub-agents#choose-the-subagent-scope) 的架构不匹配时,Claude Code 为每个问题打印一行
26083. 当代理名称以 `-` 开头时,Claude Code 打印 `<name>: agent names must not start with '-'`27863. 当代理名称以 `-` 开头时,Claude Code 打印 `<name>: agent names must not start with '-'`
2609 2787
2610当有超过 20 个问题行时,Claude Code 打印前 20 个,并用 `…and N more` 替换其余的。2788当有超过 20 个问题行时,Claude Code 打印前 20 个,并用 `…and N more` 替换其余的。
2611 2789
2790使用 `--print` 时,`--agents` 也接受[JSON 文件的路径](/docs/zh-CN/sub-agents#choose-the-subagent-scope)代替内联对象。在 v2.1.281 之前,`--agents` 仅接受内联 JSON,并将文件路径视为无效 JSON。文件形式有其自己的拒绝,打印在此消息的位置,包括这些:
2791
2792* **`Error: --agents takes a JSON object, or a file path only with --print (-p)`**:Claude Code 在交互式会话中将值读取为文件路径。将定义作为内联 JSON 传递,或添加 `-p` 从文件读取它们。
2793* **`Error: --agents file not found: <path>`**:该路径处不存在文件。不以 `{` 开头且不是有效 JSON 的值被读取为路径,因此您的 shell 损坏的内联 JSON 也可能以这种方式失败。检查路径或引用,然后再次运行命令。
2794
2612**要做什么:**2795**要做什么:**
2613 2796
2614* 修复消息列出的每个问题,然后再次运行命令。请参阅 [CLI 定义的子代理采用的字段](/docs/zh-CN/sub-agents#choose-the-subagent-scope)。2797* 修复消息列出的每个问题,然后再次运行命令。请参阅 [CLI 定义的子代理采用的字段](/docs/zh-CN/sub-agents#choose-the-subagent-scope)。
2668**要做什么:**2851**要做什么:**
2669 2852
2670* 修复诊断命名的架构部分,然后重新运行命令2853* 修复诊断命名的架构部分,然后重新运行命令
2671* 如果诊断是 `schema too large`,请减少架构的嵌套和 `$ref` 重用
2672* 请参阅[获取结构化输出](/docs/zh-CN/headless#get-structured-output)以获取工作架构和命令2854* 请参阅[获取结构化输出](/docs/zh-CN/headless#get-structured-output)以获取工作架构和命令
2673 2855
2674<h3 id="settings-file-exceeds-the-2mib-limit">2856<h3 id="settings-file-exceeds-the-2mib-limit">
2675 设置文件超过 2MiB 限制2857 设置文件超过 2MiB 限制
2676</h3>2858</h3>
2677 2859
2678您传递给 [`--settings`](/docs/zh-CN/cli-reference#cli-flags) 的文件大于 2 MiB,因此 `claude` 在启动时以代码 1 退出,而不是加载它。设置文件是一个小的 JSON 文档,所以这么大的文件通常意味着路径指向错误的文件。在 v2.1.214 之前,Claude Code 读取文件时没有大小检查,多 GB 的文件或诸如 `/dev/zero` 之类的设备文件会无限增长内存。2860您传递给 [`--settings`](/docs/zh-CN/cli-reference#cli-flags) 的文件大于 2 MiB,因此 `claude` 在启动时以代码 1 退出,而不是加载它。在 v2.1.214 之前,Claude Code 读取文件时没有大小检查,多 GB 的文件或诸如 `/dev/zero` 之类的设备文件会无限增长内存。
2679 2861
2680```text theme={null}2862```text theme={null}
2681Error: Settings file exceeds the 2MiB limit: /path/to/settings.json2863Error: Settings file exceeds the 2MiB limit: /path/to/settings.json
2756 启动远程控制时工作区不受信任2938 启动远程控制时工作区不受信任
2757</h3>2939</h3>
2758 2940
2759您在未信任的目录中使用 `claude remote-control` 或其 `claude rc` 别名启动了[远程控制](/docs/zh-CN/remote-control)服务器模式。该命令本身不显示工作区信任对话框,因此它以代码 1 退出并命名修复:2941您在未信任的目录中使用 `claude remote-control` 或其 `claude rc` 别名启动了[远程控制](/docs/zh-CN/remote-control)服务器模式,命令无法询问您是否信任它。当命令的标准输入或标准输出不是终端时,此消息会出现,例如因为其中之一被重定向或管道化。命令以代码 1 退出:
2760 2942
2761```text theme={null}2943```text theme={null}
2762Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog.2944Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog.
2763```2945```
2764 2946
2947两个也以 `Error: Workspace not trusted.` 开头的变体也出现在足够小的终端中,无法显示信任目录打开的内容,或一个没有报告其大小的终端。扩大窗口或切换到正常终端窗口,然后再次运行 `claude rc`。
2948
2765在您的主目录中,消息是不同的,因为工作区信任对话框永远不会保存主目录的信任,因此在那里接受它无法满足此检查。在 v2.1.214 之前,主目录显示上述消息,其建议无法在那里成功。2949在您的主目录中,消息是不同的,因为工作区信任对话框永远不会保存主目录的信任,因此在那里接受它无法满足此检查。在 v2.1.214 之前,主目录显示上述消息,其建议无法在那里成功。
2766 2950
2767```text theme={null}2951```text theme={null}
2768Error: Workspace not trusted. /Users/you is your home directory, and for security home-directory trust is never saved, so running `claude` here first won't help. Run `claude rc` from a project directory instead (run `claude` there once to accept the trust dialog).2952Error: Workspace not trusted. /Users/you is your home directory, and for security home-directory trust is never saved, so running `claude` here first won't help. Run `claude rc` from a project directory instead (run `claude` there once to accept the trust dialog).
2769```2953```
2770 2954
2955如果您在 [`Trust <directory>?` 问题](/docs/zh-CN/remote-control#requirements)处回答 `n` 或按 Enter,命令会打印一条 `Remote Control did not start` 消息,命名目录并以代码 1 退出。再次运行 `claude rc` 以回答 `y`。
2956
2771**要做什么:**2957**要做什么:**
2772 2958
2773* 在目录中运行 `claude`,接受[工作区信任对话框](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust),然后再次运行 `claude remote-control`2959* 首先从终端信任目录:在那里运行 `claude rc` 并回答 `y`,或运行 `claude` 并接受[工作区信任对话框](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust),然后再次运行您的原始命令
2774* 在您的主目录中,更改为项目目录并在那里启动远程控制2960* 在您的主目录中,更改为项目目录并在那里启动远程控制
2775 2961
2962在 v2.1.284 之前,命令从不询问,即使在终端中。
2963
2776<h3 id="not-carried-over-to-the-sessions-remote-control-starts">2964<h3 id="not-carried-over-to-the-sessions-remote-control-starts">
2777 未被远程控制启动的会话继承2965 未被远程控制启动的会话继承
2778</h3>2966</h3>
2834 无法从 Claude Desktop 导入服务器3022 无法从 Claude Desktop 导入服务器
2835</h3>3023</h3>
2836 3024
2837Claude Code 无法添加您在 `claude mcp add-from-claude-desktop` 中选择的其中一个服务器。该命令仍然导入其他选定的服务器,并为每个无法添加的服务器打印一行。在 v2.1.205 之前,第一个失败的服务器会停止导入,所有选定的服务器都不会被添加。3025Claude Code 无法添加您在 `claude mcp add-from-claude-desktop` 中选择的其中一个服务器。该命令仍然导入其他选定的服务器,并为每个无法添加的服务器打印一行。在 v2.1.205 之前,第一个失败的服务器会停止导入。
2838 3026
2839```text theme={null}3027```text theme={null}
2840Could not import my server: Invalid name my server. Names can only contain letters, numbers, hyphens, and underscores.3028Could not import my server: Invalid name my server. Names can only contain letters, numbers, hyphens, and underscores.
3083 Diff 对于 ultrareview 来说太大3271 Diff 对于 ultrareview 来说太大
3084</h3>3272</h3>
3085 3273
3274Diff 对于 ultrareview 来说太大:812 个文件,96,410 行更改(限制:500 个文件,8,000 行)。最大的文件:package-lock.json(41,904 行),dist/bundle.js(18,210 行),src/generated/api.ts(9,876 行)。传递更接近的基础分支(`/code-review ultra <branch>`)以缩小范围,或拆分更改。
3275
3086您的分支与基础分支之间的差异,包括未提交和暂存的更改,超过了 [ultrareview](/docs/zh-CN/ultrareview) 的大小限制,因此 `/code-review ultra` 和 `claude ultrareview` 子命令在云会话启动前拒绝审查。被拒绝的审查不使用免费运行,也不计费使用信用。消息命名生效的限制、您的差异大小以及贡献最多更改行的文件。在 v2.1.216 之前,消息仅显示原始差异统计。3276您的分支与基础分支之间的差异,包括未提交和暂存的更改,超过了 [ultrareview](/docs/zh-CN/ultrareview) 的大小限制,因此 `/code-review ultra` 和 `claude ultrareview` 子命令在云会话启动前拒绝审查。被拒绝的审查不使用免费运行,也不计费使用信用。消息命名生效的限制、您的差异大小以及贡献最多更改行的文件。在 v2.1.216 之前,消息仅显示原始差异统计。
3087 3277
3088```text theme={null}3278```text theme={null}
3269* 对于交互式会话,使用 `claude --resume` 打开[会话选择器](/docs/zh-CN/sessions#use-the-session-picker),按 `Ctrl+A` 将其扩展到此机器上的每个项目,然后选择会话3459* 对于交互式会话,使用 `claude --resume` 打开[会话选择器](/docs/zh-CN/sessions#use-the-session-picker),按 `Ctrl+A` 将其扩展到此机器上的每个项目,然后选择会话
3270* 使用 `claude -p` 或 [Agent SDK](/docs/zh-CN/agent-sdk/overview) 创建的会话不会出现在选择器中,因此重新检查 ID 与您的原始运行打印的 `session_id`3460* 使用 `claude -p` 或 [Agent SDK](/docs/zh-CN/agent-sdk/overview) 创建的会话不会出现在选择器中,因此重新检查 ID 与您的原始运行打印的 `session_id`
3271 3461
3462<h3 id="windows-reported-an-error-ebadf">
3463 Windows 报告了读取此会话的成绩单文件时的错误 (EBADF)
3464</h3>
3465
3466您在 Windows 上恢复了一个会话,其保存的[成绩单文件](/docs/zh-CN/sessions#where-transcripts-are-stored)正常打开,读取它然后失败,错误为 EBADF。系统错误没有说为什么读取失败,因此消息建议可能的原因和要尝试的内容:
3467
3468```text theme={null}
3469Windows reported an error (EBADF) when Claude Code read this session's transcript file, although the file had opened normally. This can happen when other software intercepts file reads — security, encryption or endpoint-management tools, for example. If it keeps happening for this conversation, try excluding the folder that holds Claude Code's session transcripts from such software (the .claude folder in your user profile, unless the app or CLAUDE_CONFIG_DIR points Claude Code elsewhere), or adding Claude Code to its allowed applications, then resume again.
3470```
3471
3472消息遵循命令自己的失败行,例如 `Failed to resume session <session-id>`。`claude --resume` 或 [`claude -p`](/docs/zh-CN/headless) 命令在显示它后以代码 1 退出。在会话内的 `/resume` 后,您当前的会话保持运行。
3473
3474**要做什么:**
3475
3476* 从扫描或拦截文件读取的软件(如安全、加密或端点管理工具)中排除保存会话成绩单的文件夹。成绩单默认位于 `%USERPROFILE%\.claude\projects` 下,或位于 [`CLAUDE_CONFIG_DIR`](/docs/zh-CN/env-vars) 命名的目录下
3477* 如果您无法添加排除项,改为将 Claude Code 添加到该软件的允许应用程序中
3478* 再次恢复会话
3479
3480在 v2.1.282 之前,失败没有解释:`claude --resume <session-id>` 在 `Failed to resume session <session-id>` 处结束,`-p` 运行仅打印系统错误文本,例如 `Failed to resume session: EBADF: bad file descriptor, read`。
3481
3272<h3 id="cannot-switch-renderers-in-this-session">3482<h3 id="cannot-switch-renderers-in-this-session">
3273 无法在此会话中切换渲染器3483 无法在此会话中切换渲染器
3274</h3>3484</h3>
3452* 将 marketplace 重命名为不拼写保留名称的名称并重新添加它3662* 将 marketplace 重命名为不拼写保留名称的名称并重新添加它
3453* 对于被忽略的条目警告,运行它给出的 `claude plugin marketplace remove` 命令,或从 `~/.claude/plugins/known_marketplaces.json` 中删除该条目3663* 对于被忽略的条目警告,运行它给出的 `claude plugin marketplace remove` 命令,或从 `~/.claude/plugins/known_marketplaces.json` 中删除该条目
3454 3664
3665<h3 id="claude-code-refuses-the-marketplace-name">
3666 Claude Code 拒绝 marketplace 名称
3667</h3>
3668
3669已注册的 marketplace 的名称 [冒充官方 Anthropic marketplace](/docs/zh-CN/plugins/marketplace-reference#reserved-names),根据该部分列出的规则。
3670
3671如果 marketplace 在这样的名称下注册时检查阻止了它,marketplace 和从中安装的 plugin 停止加载,因为 Claude Code 每次读取 marketplace 的目录时都会检查名称。当名称模仿官方名称时,`claude plugin list` 和 `/plugin` **Errors** 选项卡报告每个受影响的 plugin,消息开头为:
3672
3673```text theme={null}
3674Claude Code refuses the marketplace name "anthropic-plugins-v2"
3675```
3676
3677对于模仿名称,marketplace 自己的错误读作 `Claude Code refuses this marketplace's name: it looks like one of Anthropic's own`。`claude plugin marketplace add` 拒绝任何冒充名称,消息为 `Marketplace name impersonates an official Anthropic/Claude marketplace`。
3678
3679在 v2.1.282 之前,`claude plugin list` 和 `/plugin` 报告模仿名称的 plugin 也加载失败,没有将 marketplace 的名称命名为原因。
3680
3681**要做什么:**
3682
3683* 运行 `claude plugin marketplace remove <name>`。这也会卸载从 marketplace 安装的 plugin 并删除其保存的数据
3684* 要保留 marketplace,请等待其维护者重命名它,然后运行 `claude plugin marketplace update <name>`
3685* 如果您发布 marketplace,在您的 `marketplace.json` 中重命名它;用户随后更新 marketplace 而不是删除它
3686
3455<h3 id="marketplace-is-already-added-from-a-different-source">3687<h3 id="marketplace-is-already-added-from-a-different-source">
3456 Marketplace 已从不同的源添加3688 Marketplace 已从不同的源添加
3457</h3>3689</h3>
3654 3886
3655* 要求您的 claude.ai 组织的管理员在 claude.ai 上更改 plugin 的必需状态3887* 要求您的 claude.ai 组织的管理员在 claude.ai 上更改 plugin 的必需状态
3656 3888
3889<h3 id="plugin-was-not-uninstalled">
3890 Plugin 未被卸载
3891</h3>
3892
3893您运行了 [`claude plugin uninstall`](/docs/zh-CN/plugins/cli-reference#plugin-uninstall),或在 `/plugin` **Installed** 选项卡中选择了 **Uninstall**,卸载停止,消息开头为 `"<plugin>" was not uninstalled:`。
3894
3895当 Claude Code 从 `enabledPlugins` 中删除 plugin 的条目并读回该范围的设置文件时,要么 plugin 仍在那里被打开,要么可以打开它的文件无法读取或检查。在设置条目可以将其重新打开时删除 plugin 的保存选项、机密和数据会丢失它们,因此卸载停止:plugin 保持安装,它保存的任何内容都不会被删除。
3896
3897```text theme={null}
3898✘ Failed to uninstall plugin "formatter": "formatter" was not uninstalled: it is still switched on in /home/user/project/.claude/settings.local.json, although the settings change reported no error. It is still installed. Take it out of "enabledPlugins" in that file yourself, then uninstall it again.
3899```
3900
3901消息的中间部分命名文件和原因:
3902
3903* `it is still switched on in <file>, although the settings change reported no error`:设置写入报告成功但条目在读回文件时仍然存在
3904* `it is still switched on in <file>, and the settings change failed (<error>)`:文件无法保存,原因在括号中
3905* `<file> is there and could not be read`:文件存在但无法作为设置读取,例如因为它不是有效的 JSON,所以它可能仍然启用 plugin
3906* `<file> (not read: it is on a network path or is a link to one, or could not be checked)`:Claude Code 没有读取项目或本地设置文件,因为文件或保存它的 `.claude` 文件夹是指向网络位置的链接,或因为它无法检查该路径
3907
3908`claude plugin uninstall` 退出 1,使用 `--json` 时结果包含 `failureCode: "settings_still_on"`。`/plugin` 显示相同的消息。
3909
3910**要做什么:**
3911
3912* 遵循消息的最后一句:修复或替换它命名的设置文件,或自己从该文件中的 `enabledPlugins` 中删除 plugin 的条目,然后再次运行卸载
3913
3657<h2 id="tool-errors">3914<h2 id="tool-errors">
3658 工具错误3915 工具错误
3659</h2>3916</h2>
3703* 如果 Claude 应该能够更改文件,请在 `/permissions` 或[设置](/docs/zh-CN/settings-reference#permission-settings)中删除或缩小 `Read` 拒绝规则3960* 如果 Claude 应该能够更改文件,请在 `/permissions` 或[设置](/docs/zh-CN/settings-reference#permission-settings)中删除或缩小 `Read` 拒绝规则
3704* 如果文件必须保持不变,请保留该规则并为相同路径添加 `Edit` 拒绝规则以同时阻止 NotebookEdit 工具3961* 如果文件必须保持不变,请保留该规则并为相同路径添加 `Edit` 拒绝规则以同时阻止 NotebookEdit 工具
3705 3962
3963<h3 id="path-cannot-contain-null-bytes">
3964 路径不能包含空字节
3965</h3>
3966
3967文件工具调用的路径或模式参数包含空字节,文件系统和搜索工具无法接受。Read、Write、Edit、NotebookEdit、Glob 和 Grep 检查此项,消息命名工具和参数:
3968
3969```text theme={null}
3970Read file_path cannot contain null bytes (\0). Remove the null byte and try again.
3971```
3972
3973工具调用失败,Claude 看到错误,轮次继续。
3974
3975**应该做什么:**
3976
3977* 你这边不需要做任何事:错误作为工具的结果返回给 Claude,消息本身告诉 Claude 删除空字节并重试
3978
3979在 v2.1.281 之前,Read、Write、Edit 或 NotebookEdit 路径中的空字节会以命名 `Path contains null bytes` 的错误结束整个轮次,工具从不运行。
3980
3706<h3 id="subagent-type-is-required">3981<h3 id="subagent-type-is-required">
3707 subagent\_type 是必需的3982 subagent\_type 是必需的
3708</h3>3983</h3>
3839 4114
3840在 v2.1.236 之前,Claude Code 报告这些发送已发送。接收会话未读地丢弃了它们。4115在 v2.1.236 之前,Claude Code 报告这些发送已发送。接收会话未读地丢弃了它们。
3841 4116
4117<h3 id="cross-session-message-dropped-at-the-inbox">
4118 跨会话消息在收件人会话的收件箱处被丢弃
4119</h3>
4120
4121Claude 发送了[跨会话消息](/docs/zh-CN/cross-session-messaging)到此机器上你的另一个会话,该会话的收件箱在 Claude 在该会话中读取之前丢弃了它。该行命名收件人的地址,当收件人给出原因时,在破折号后添加原因:
4122
4123```text wrap theme={null}
4124Cross-session message was dropped at the recipient session's inbox (recipient: uds:/tmp/cc-socks/13605.sock) and not delivered — its queue of undelivered peer messages was full. Claude was told not to resend right away.
4125```
4126
4127一行可以覆盖多条丢弃的消息。然后它以复数形式开始,例如 `Cross-session messages (12) were dropped`。要找到地址属于哪个会话,请将其与 `/status` 在每个会话中显示的 [`Peer address` 行](/docs/zh-CN/cross-session-messaging#the-sessions-inbox-socket)进行比较。
4128
4129在破折号后,该行给出以下一个或多个原因:
4130
4131* `its queue of undelivered peer messages was full`:收件人已经持有尽可能多的来自其他会话的未送达消息,其队列允许
4132* `you sent faster than that session accepts`:发送会话的消息到达速度比收件人从一个发送者接受的速度快
4133* `it repeated your previous message`:该消息与发送会话不久前发送给该收件人的消息相同
4134* `a relay loop between sessions was cut`:该消息继续了会话相互发送消息的链,链已通过收件人太多次或增长太长
4135
4136**应该做什么:**
4137
4138* 假设收件人从未看到丢弃的消息。Claude Code 告诉 Claude 相同的内容,并告诉它改为在一条稍后的消息中包含仍然重要的任何内容,而不是立即重新发送
4139* 如果你的会话相互发送频繁更新,要求 Claude 发送更少、更大的消息,例如会话完成其工作时的一份报告
4140* 对于 `a relay loop between sessions was cut`,在其中一个会话中自己输入下一条指令。Claude 发送以响应你自己的提示的消息开始一条新链
4141
4142在 v2.1.238 之前,当收件人的收件箱丢弃消息时,发送会话没有收到报告。
4143
3842<h3 id="refusing-to-send-a-cross-session-message">4144<h3 id="refusing-to-send-a-cross-session-message">
3843 拒绝发送跨会话消息4145 拒绝发送跨会话消息
3844</h3>4146</h3>
3853 4155
3854* `reply target is a symlink`:符号链接位于目标会话的套接字路径。Claude Code 不通过它传递,因为那里的链接可能会将消息重定向到目标会话未创建的端点。4156* `reply target is a symlink`:符号链接位于目标会话的套接字路径。Claude Code 不通过它传递,因为那里的链接可能会将消息重定向到目标会话未创建的端点。
3855* `cannot vet reply target`:Claude Code 根本无法检查目标路径,例如因为读取失败并出现权限错误。4157* `cannot vet reply target`:Claude Code 根本无法检查目标路径,例如因为读取失败并出现权限错误。
3856* `connected endpoint is not the expected process`:持有套接字的进程不是消息寻址到的会话,因此地址已过时或另一个进程替换了套接字。
3857* `connected endpoint identity could not be read`:Claude Code 已连接但无法读取哪个进程持有另一端,因此无法确认目标。这可能是暂时的。
3858* `connected endpoint is not owned by this user`:持有套接字的进程以不同的用户帐户运行,因此它不是你的会话之一。
3859* `connected endpoint owner could not be read`:Claude Code 已连接但无法读取哪个用户帐户拥有另一端,因此无法确认端点是你的。
3860* `connected endpoint is a different process with the expected pid`:进程 id 与消息寻址到的进程 id 匹配,但 Claude Code 无法确认它是同一进程。通常该会话已退出,操作系统重用了其进程 id,因此地址已过时。
3861 4158
3862**应该做什么:**4159**应该做什么:**
3863 4160
3864* 通常不需要做任何事:检查防止消息到达除了它寻址到的会话之外的端点,什么都没有发送4161* 通常不需要做任何事:检查防止消息到达除了它寻址到的会话之外的端点,什么都没有发送
3865* 要求 Claude 再次列出你的会话并重新发送;由过时地址引起的拒绝在 Claude 发送到当前会话后清除
3866* 如果 `reply target is a symlink` 对一个会话重复,检查在该会话的套接字路径处创建了什么链接,显示在其 `/status` 下的 `Peer address`4162* 如果 `reply target is a symlink` 对一个会话重复,检查在该会话的套接字路径处创建了什么链接,显示在其 `/status` 下的 `Peer address`
3867* 对于 `connected endpoint identity could not be read`,重新发送;该条件可能是暂时的
3868* 如果 `connected endpoint is not owned by this user` 出现在共享机器上,该地址处的会话以另一个用户的帐户运行,因此 Claude 无法从你的帐户给它发消息
3869
3870在 v2.1.248 之前,Claude Code 没有检查端点的拥有用户或进程启动时间,因此命名这些检查的拒绝不会出现在早期版本上。
3871 4163
3872<h3 id="refusing-after-a-symlink-changed">4164<h3 id="refusing-after-a-symlink-changed">
3873 拒绝读取、写入或搜索路径4165 拒绝读取、写入或搜索路径
3883 4175
3884* `its symlink resolution changed after permission was checked`:路径上的符号链接或 Grep 或 Glob 搜索根在权限检查和操作之间被替换。在读取拒绝中,括号中的短语命名哪个比较失败。4176* `its symlink resolution changed after permission was checked`:路径上的符号链接或 Grep 或 Glob 搜索根在权限检查和操作之间被替换。在读取拒绝中,括号中的短语命名哪个比较失败。
3885* `its parent-directory symlink resolution changed after permission was checked`:写入路径通过的目录不再解析到批准的位置4177* `its parent-directory symlink resolution changed after permission was checked`:写入路径通过的目录不再解析到批准的位置
4178* `where it leads on disk could not be determined (a link on the way could not be examined, or the links do not resolve)`:Claude Code 无法跟随路径到磁盘上的最终位置,例如因为其上的符号链接形成循环
3886* `it is a symbolic link. Write to the link's target path instead`:符号链接位于批准的写入位置本身,例如 `CLAUDE.md` 是 `AGENTS.md` 的符号链接;消息指导 Claude 到链接的目标4179* `it is a symbolic link. Write to the link's target path instead`:符号链接位于批准的写入位置本身,例如 `CLAUDE.md` 是 `AGENTS.md` 的符号链接;消息指导 Claude 到链接的目标
3887* `Refusing to write through symlink: <path>. Resolve the symlink and pass the real target path explicitly.`:当另一个写入器打开文件时捕获的相同条件,例如写入符号链接的 `.mcp.json`4180* `Refusing to write through symlink: <path>. Resolve the symlink and pass the real target path explicitly.`:当另一个写入器打开文件时捕获的相同条件,例如写入符号链接的 `.mcp.json`
3888* `Refusing to write into symlinked directory: <path>`:持有文件的目录本身是符号链接,例如项目的 `.claude/` 目录链接到另一个位置4181* `Refusing to write into symlinked directory: <path>`:持有文件的目录本身是符号链接,例如项目的 `.claude/` 目录链接到另一个位置
3901 4194
3902在 v2.1.251 之前,Claude Code 仅对文件写入重新检查路径的解析,因此在权限检查后替换的链接可能会将读取或搜索重定向到不同的位置而没有消息。其中,仅父目录、通过符号链接和符号链接目录写入拒绝出现在早期版本上。4195在 v2.1.251 之前,Claude Code 仅对文件写入重新检查路径的解析,因此在权限检查后替换的链接可能会将读取或搜索重定向到不同的位置而没有消息。其中,仅父目录、通过符号链接和符号链接目录写入拒绝出现在早期版本上。
3903 4196
4197在 v2.1.280 之前,`where it leads on disk could not be determined` 拒绝没有出现。
4198
3904<h3 id="task-output-swap-refused">4199<h3 id="task-output-swap-refused">
3905 任务输出交换被拒绝4200 任务输出交换被拒绝
3906</h3>4201</h3>
3926* 或检查你的项目在 Claude Code 临时目录下的目录,示例消息中的 `/private/tmp/claude-501/-Users-you-my-project`。如果该路径是符号链接或不应该存在的目录,删除链接或目录本身而不是链接的目标,然后重启 Claude Code4221* 或检查你的项目在 Claude Code 临时目录下的目录,示例消息中的 `/private/tmp/claude-501/-Users-you-my-project`。如果该路径是符号链接或不应该存在的目录,删除链接或目录本身而不是链接的目标,然后重启 Claude Code
3927* 如果拒绝重复,进程在会话运行时替换、链接或删除 Claude Code 临时目录下的条目。将 [`CLAUDE_CODE_TMPDIR`](/docs/zh-CN/env-vars) 设置为没有其他东西管理的目录并重启4222* 如果拒绝重复,进程在会话运行时替换、链接或删除 Claude Code 临时目录下的条目。将 [`CLAUDE_CODE_TMPDIR`](/docs/zh-CN/env-vars) 设置为没有其他东西管理的目录并重启
3928 4223
4224<h3 id="disk-quota-or-temp-filesystem-is-full">
4225 磁盘配额或临时文件系统已满
4226</h3>
4227
4228Claude Code 将每个 Bash 和 PowerShell 命令的输出保存到其临时目录下的文件。当命令以非零代码退出且完全没有输出时,Claude Code 检查持有该文件的文件系统是否空间不足或 inode 不足,或你在其上的磁盘配额是否已用完。如果是这样,诊断出现在命令的结果中,代替空输出:
4229
4230```text wrap theme={null}
4231Your disk quota is full on the filesystem with Claude Code's temp directory /private/tmp/claude-501/-Users-you-my-project/1f0e62dc-4b0a-4f5e-9c2d-8a7b6c5d4e3f/tasks (EDQUOT), so any output this command printed was lost, and it may have failed because it could not write. Delete files you no longer need there, or restart Claude Code with CLAUDE_CODE_TMPDIR set to a directory on another filesystem.
4232```
4233
4234该消息命名什么用完了:
4235
4236* `Your disk quota is full ... (EDQUOT)`:你在该文件系统上的配额已用完。配额可以在文件系统仍显示可用空间时已满
4237* `The filesystem with Claude Code's temp directory ..., or your disk quota on it, is full (ENOSPC)`:文件系统或你在其上的配额没有剩余空间
4238* `Command output was lost: the temp filesystem at ... is full` 或 `... is out of inodes`:文件系统几乎没有剩余空间,或 inode 即将用完
4239
4240**应该做什么:**
4241
4242* 删除你在持有 Claude Code 临时目录的文件系统上不再需要的文件。对于 `EDQUOT`,删除计入你自己配额的文件。对于 `out of inodes`,删除许多文件而不是几个大文件,因为每个文件占用一个 inode,无论其大小如何
4243* 或使用设置为具有空间的文件系统上的目录的 [`CLAUDE_CODE_TMPDIR`](/docs/zh-CN/env-vars)重启 Claude Code
4244* 然后让 Claude 再次运行该命令。它打印的输出已丢失,未被截断
4245
3929<h3 id="the-source-file-is-not-valid-utf-8-text">4246<h3 id="the-source-file-is-not-valid-utf-8-text">
3930 源文件不是有效的 UTF-8 文本4247 源文件不是有效的 UTF-8 文本
3931</h3>4248</h3>
3993 后台会话中拒绝的命令4310 后台会话中拒绝的命令
3994</h3>4311</h3>
3995 4312
3996打开交互式对话框的命令在没有终端附加到后台会话时无法执行。`/install-github-app`、`/mcp` 设置列表和 MCP 服务器菜单中的身份验证操作会响应一条消息,该会话在[代理视图](/docs/zh-CN/agent-view)中的**需要输入**下显示,以便您可以找到它、附加并再次运行该命令。附加终端时,这些命令正常工作。4313打开交互式对话框的命令在没有终端附加到后台会话时无法执行。`/install-github-app`、`/mcp` 设置列表和 MCP 服务器菜单中的身份验证操作会响应一条消息。对于 `/install-github-app` 和 `/mcp` 设置列表,该会话也在[代理视图](/docs/zh-CN/agent-view)中的**需要输入**下显示,以便您可以找到它、附加并再次运行该命令。附加终端时,这些命令正常工作。
3997 4314
3998在 v2.1.216 之前,会话在其中一次拒绝后不会在**需要输入**下显示。在 v2.1.213 到 v2.1.215 中,附加终端时命令仍然有效,拒绝消息告诉您附加并再次运行该命令。从 v2.1.208 到 v2.1.212,Claude Code 即使附加了终端也拒绝了它们,消息如 `Can't open MCP settings in a background session`;在这些版本上,从常规 `claude` 会话运行该命令,或升级。在 v2.1.208 之前,它们在后台会话内打开了对话框。在仅 v2.1.208 中,Claude Code 也拒绝了后台会话中的 `/model` 选择器,`/upgrade` 打印了升级 URL 而不是打开浏览器。4315在 v2.1.216 之前,会话在拒绝 `/install-github-app` 或 `/mcp` 设置列表后不会在**需要输入**下显示。在 v2.1.213 到 v2.1.215 中,附加终端时命令仍然有效,拒绝消息告诉您附加并再次运行该命令。从 v2.1.208 到 v2.1.212,Claude Code 即使附加了终端也拒绝了它们,消息如 `Can't open MCP settings in a background session`;在这些版本上,从常规 `claude` 会话运行该命令,或升级。在 v2.1.208 之前,它们在后台会话内打开了对话框。在仅 v2.1.208 中,Claude Code 也拒绝了后台会话中的 `/model` 选择器,`/upgrade` 打印了升级 URL 而不是打开浏览器。
3999 4316
4000措辞命名该命令。`/mcp` 设置列表报告:4317措辞命名该命令。`/mcp` 设置列表报告:
4001 4318
4005 4322
4006**要做什么:**4323**要做什么:**
4007 4324
4008* 从代理视图附加到会话,其中它在**需要输入**下列出,然后再次运行该命令4325* 从代理视图附加到会话并再次运行该命令
4009* 或使用消息命名的形式,例如 `/mcp reconnect <server>`、`/mcp enable` 或 `/mcp disable`,这些不需要附加即可工作4326* 或使用消息命名的形式,例如 `/mcp reconnect <server>`、`/mcp enable` 或 `/mcp disable`,这些不需要附加即可工作
4010 4327
4011<h3 id="write-or-command-blocked-because-the-path-cannot-be-safely-resolved">4328<h3 id="write-or-command-blocked-because-the-path-cannot-be-safely-resolved">
4040**要做什么:**4357**要做什么:**
4041 4358
4042* 通常什么都不做:Claude 使用消息要求的本地拼写重试4359* 通常什么都不做:Claude 使用消息要求的本地拼写重试
4043* 如果文件在网络共享上而不是用网络路径拼写的本地文件,它在会话的本地工作区之外;改为从常规交互式会话编辑它
4044 4360
4045<h3 id="command-blocked-by-the-worktree-isolation-checks">4361<h3 id="command-blocked-by-the-worktree-isolation-checks">
4046 命令被 worktree 隔离检查阻止4362 命令被 worktree 隔离检查阻止
4277 4593
4278在 npm 安装上,在 `npm install -g @anthropic-ai/claude-code` 替换二进制文件时出现的 `EUNKNOWN` 与[重新安装期间的 `EACCES`](#eacces-when-starting-a-background-session) 有相同的原因,并在您在安装完成后重试时清除。4594在 npm 安装上,在 `npm install -g @anthropic-ai/claude-code` 替换二进制文件时出现的 `EUNKNOWN` 与[重新安装期间的 `EACCES`](#eacces-when-starting-a-background-session) 有相同的原因,并在您在安装完成后重试时清除。
4279 4595
4280Claude Code 通过 PowerShell 启动后台服务,以便服务在关闭终端后存活,在安装时使用 PowerShell 7,否则使用 Windows PowerShell 5.1。当两个 PowerShell 都无法运行时,Claude Code 直接启动服务,因此仅阻止 PowerShell 的策略不会导致此错误。如果您在没有 npm 安装运行时看到它,策略正在阻止 Claude Code 可执行文件本身。4596Claude Code 通过 PowerShell 启动后台服务,以便服务在关闭终端后存活,在安装时使用 PowerShell 7,否则使用 Windows PowerShell 5.1。当两个 PowerShell 都无法运行时,Claude Code 直接启动服务,因此仅阻止 PowerShell 的策略不会导致此错误。
4281 4597
4282在 v2.1.212 之前,Claude Code 仅使用 Windows PowerShell 5.1 启动服务,因此任何组策略阻止 PowerShell 5.1 的机器失败,出现 `Couldn't start the session — EUNKNOWN: unknown error, uv_spawn`,即使安装了 PowerShell 7。4598在 v2.1.212 之前,Claude Code 仅使用 Windows PowerShell 5.1 启动服务,因此任何组策略阻止 PowerShell 5.1 的机器失败,出现 `Couldn't start the session — EUNKNOWN: unknown error, uv_spawn`,即使安装了 PowerShell 7。
4283 4599
4341 启动后台会话时工作目录不再存在4657 启动后台会话时工作目录不再存在
4342</h3>4658</h3>
4343 4659
4344您尝试在不再存在的目录中启动[后台会话](/docs/zh-CN/agent-view)。当您从代理视图分派或在删除或移动您正在工作的目录后运行 `/background` 时,会发生这种情况。当您附加到或重启一个进程已退出且目录已消失的会话时,也会发生这种情况,因为新进程会在相同的目录中启动。Claude Code 不启动会话,消息命名缺失的目录:4660您尝试在不再存在的目录中启动[后台会话](/docs/zh-CN/agent-view)。Claude Code 不启动会话,消息命名缺失的目录:
4345 4661
4346```text theme={null}4662```text theme={null}
4347Couldn't start a background session (working directory no longer exists or is not accessible: /tmp/demo)4663Couldn't start a background session (working directory no longer exists or is not accessible: /tmp/demo)
4349 4665
4350在 v2.1.257 之前,会话似乎启动,然后在代理视图中显示为具有相同原因的失败行。4666在 v2.1.257 之前,会话似乎启动,然后在代理视图中显示为具有相同原因的失败行。
4351 4667
4668在 v2.1.281 之前,当您启动会话之前目录已经消失时,此消息也出现。该情况报告[`could not be resolved on disk`](#workspace-not-trusted-when-dispatching-a-background-session)。
4669
4352**要做什么:**4670**要做什么:**
4353 4671
4354* 重新创建消息命名的目录,或从存在的目录分派,然后重试4672* 重新创建消息命名的目录,或从存在的目录分派,然后重试
4355 4673
4674<h3 id="workspace-not-trusted-when-dispatching-a-background-session">
4675 分派后台会话时工作区不受信任
4676</h3>
4677
4678您在未[信任](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)的目录中启动或重启[后台会话](/docs/zh-CN/agent-view),工作区信任对话无法出现以询问您。Claude Code 不启动会话:
4679
4680```text theme={null}
4681Workspace not trusted. Run `claude` in /path/to/project once and accept the trust prompt, then retry.
4682```
4683
4684从会话自己的目录中的终端,相同的命令显示信任对话,并在您接受后启动会话。此消息出现在无法显示对话的地方,例如在脚本中,或当您从不同于其自己的目录重启会话时。
4685
4686两个变体命名不同的原因:
4687
4688* **`The home directory is trusted one session at a time`**:会话的目录是您的主目录。Claude Code 从不保存主目录的信任,因此在早期会话中接受那里的对话不计数。
4689* **`<path> could not be resolved on disk`**:Claude Code 无法在磁盘上找到会话的目录。
4690
4691**要做什么:**
4692
4693* 在消息命名的目录中运行 `claude` 并接受信任对话,然后再次运行该命令
4694* 对于主目录消息,从您的主目录中的终端运行该命令,以便对话可以出现,或改为从项目目录启动会话
4695* 对于 `could not be resolved on disk` 消息,重新创建目录,或从存在的目录启动新会话
4696
4356<h2 id="wrapper-and-ide-errors">4697<h2 id="wrapper-and-ide-errors">
4357 包装器和 IDE 错误4698 包装器和 IDE 错误
4358</h2>4699</h2>
4437 4778
4438* 确定哪些文件被跳过,以便您可以使用下面的步骤处理每个文件。该消息仅给出计数;`~/.claude/debug/<session-id>.txt` 中的调试日志在恢复运行时命名每个跳过的路径,因此在下次恢复之前使用 `/debug` 打开调试日志。在 macOS 或 Linux 上,您可以直接找到链接:`find . -type l` 用于符号链接,`find . -type f -links +1` 用于硬链接文件。4779* 确定哪些文件被跳过,以便您可以使用下面的步骤处理每个文件。该消息仅给出计数;`~/.claude/debug/<session-id>.txt` 中的调试日志在恢复运行时命名每个跳过的路径,因此在下次恢复之前使用 `/debug` 打开调试日志。在 macOS 或 Linux 上,您可以直接找到链接:`find . -type l` 用于符号链接,`find . -type f -links +1` 用于硬链接文件。
4439* 如果跳过的文件是您有意创建的链接,例如由点文件管理器管理的配置文件或由 pnpm 等工具硬链接的文件,rewind 保持其内容不变。要撤销会话对其所做的更改,请要求 Claude 反转编辑或自己编辑文件4780* 如果跳过的文件是您有意创建的链接,例如由点文件管理器管理的配置文件或由 pnpm 等工具硬链接的文件,rewind 保持其内容不变。要撤销会话对其所做的更改,请要求 Claude 反转编辑或自己编辑文件
4440* 如果您没有创建该链接,请在信任其内容之前检查该路径:某些内容在检查点后替换了该文件4781* 如果您没有创建该链接,请在信任其内容之前检查该路径
4441 4782
4442<h3 id="no-files-were-restored">4783<h3 id="no-files-were-restored">
4443 No files were restored4784 No files were restored
4528* 如果这是顶级会话,请退出并使用设置的 [`CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1`](/docs/zh-CN/env-vars) 重新启动。保存从重新启动时开始应用,因此在此之前发送的消息不会被保存。4869* 如果这是顶级会话,请退出并使用设置的 [`CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1`](/docs/zh-CN/env-vars) 重新启动。保存从重新启动时开始应用,因此在此之前发送的消息不会被保存。
4529* 要修复从同一终端或启动器的未来启动,请从其环境中删除 `CLAUDE_CODE_CHILD_SESSION`4870* 要修复从同一终端或启动器的未来启动,请从其环境中删除 `CLAUDE_CODE_CHILD_SESSION`
4530 4871
4872***
4873
4874title: "配置警告"
4875description: "了解 Claude Code 配置警告、其含义以及如何解决它们。"
4876-----------------------------------------------
4877
4531<h2 id="configuration-warnings">4878<h2 id="configuration-warnings">
4532 配置警告4879 配置警告
4533</h2>4880</h2>
4548 4895
4549**要做什么:**4896**要做什么:**
4550 4897
4551* 按照[全屏渲染](/docs/zh-CN/fullscreen#fullscreen-renderer-didnt-finish-starting)进行操作。它说明您获得哪个通知、Claude Code 在后续会话中执行的操作,以及如何再次尝试全屏或保持经典渲染器。4898* 按照[全屏渲染](/docs/zh-CN/fullscreen#fullscreen-renderer-didnt-finish-starting)进行操作。它说明您获得哪个通知、Claude Code 在后续会话中的操作,以及如何再次尝试全屏或保持经典渲染器。
4552* 如果已退出的会话打印了退出消息,请参阅 [Claude Code 在无法恢复的界面错误后退出](#exited-after-an-unrecoverable-interface-error)了解其名称。4899* 如果已死亡的会话打印了退出消息,请参阅[Claude Code 因无法恢复的界面错误而退出](#exited-after-an-unrecoverable-interface-error)了解其名称。
4553 4900
4554在 v2.1.236 之前,Claude Code 在启动失败后不打印通知,并继续在全屏渲染中启动会话。4901在 v2.1.236 之前,Claude Code 未打印通知,并在失败启动后继续在全屏渲染中启动会话。
4555 4902
4556<h3 id="exited-after-an-unrecoverable-interface-error">4903<h3 id="exited-after-an-unrecoverable-interface-error">
4557 Claude Code 在无法恢复的界面错误后退出4904 Claude Code 因无法恢复的界面错误而退出
4558</h3>4905</h3>
4559 4906
4560当 Claude Code 退出时会打印此消息,因为其终端界面遇到了无法恢复的错误,在任一渲染器中都可能发生。第二句仅在[全屏](/docs/zh-CN/fullscreen)渲染器启动时发生错误时出现:4907当 Claude Code 退出时,它会打印此消息,因为其终端界面在任一渲染器中遇到了无法恢复的错误。第二句仅在[全屏](/docs/zh-CN/fullscreen)渲染器启动时发生错误时出现:
4561 4908
4562```text theme={null}4909```text theme={null}
4563Claude Code exited after an unrecoverable interface error (<error>). It happened while the fullscreen renderer was starting, so the next launch will use the classic renderer (CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 forces that any time).4910Claude Code exited after an unrecoverable interface error (<error>). It happened while the fullscreen renderer was starting, so the next launch will use the classic renderer (CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 forces that any time).
4566**要做什么:**4913**要做什么:**
4567 4914
4568* 再次启动 Claude Code。要继续该对话,请在同一目录中运行 `claude --resume`。4915* 再次启动 Claude Code。要继续该对话,请在同一目录中运行 `claude --resume`。
4569* 如果消息提到全屏渲染器,[全屏渲染](/docs/zh-CN/fullscreen#fullscreen-renderer-didnt-finish-starting)说明下一次启动执行的操作,这取决于您如何打开全屏,以及如何再次尝试全屏或保持经典渲染器。4916* 如果消息命名全屏渲染器,[全屏渲染](/docs/zh-CN/fullscreen#fullscreen-renderer-didnt-finish-starting)说明下一次启动的操作,这取决于您如何打开全屏,以及如何再次尝试全屏或保持经典渲染器。
4570 4917
4571在 v2.1.236 之前,Claude Code 在此类错误后退出而不打印消息。4918在 v2.1.236 之前,Claude Code 在此类错误后退出而不打印消息。
4572 4919
4573<h3 id="agent-descriptions-are-over-the-15000-token-limit">4920<h3 id="agent-descriptions-are-over-the-15000-token-limit">
4574 Agent 描述超过 15.0k 令牌限制4921 代理描述超过 15.0k 令牌限制
4575</h3>4922</h3>
4576 4923
4577Claude Code 将此警告显示为对话视图中的启动通知,而不是在 stderr 上。您的[子代理](/docs/zh-CN/sub-agents)(除了内置代理)的组合描述超过 15,000 个令牌,按 Claude Code 的估计。每个代理计算其名称加上其 `description` frontmatter。Claude Code 加载每个代理,无论总数是否超过限制,因此警告不会改变加载的内容。4924Claude Code 将此警告显示为对话视图中的启动通知,而不是在 stderr 上。您的[子代理](/docs/zh-CN/sub-agents)(除了内置代理)的组合描述超过 Claude Code 估计的 15,000 个令牌。每个代理计算其名称加上其 `description` frontmatter。Claude Code 加载每个代理,无论总数是否超过限制,因此警告不会改变加载的内容。
4578 4925
4579```text theme={null}4926```text theme={null}
4580Agent descriptions are over the 15.0k-token limit (~16.2k tokens) · ask Claude to trim agent descriptions in .claude/agents/4927Agent descriptions are over the 15.0k-token limit (~16.2k tokens) · ask Claude to trim agent descriptions in .claude/agents/
4585* 缩短您的代理文件的 `description` frontmatter,或要求 Claude 为您修剪它们。4932* 缩短您的代理文件的 `description` frontmatter,或要求 Claude 为您修剪它们。
4586* 删除您不再使用的代理文件。4933* 删除您不再使用的代理文件。
4587 4934
4935<h3 id="a-skill-command-or-workflow-wasnt-loaded-because-its-name-is-reserved">
4936 技能、命令或工作流未被加载,因为其名称是保留的
4937</h3>
4938
4939技能文件夹、frontmatter `name`、`.claude/commands/` 中的文件或子文件夹,或[保存的工作流](/docs/zh-CN/workflows#save-the-workflow-for-reuse)使用名称 `anthropic-skills` 或以 `anthropic-skills:` 开头的名称。Claude Code [为从 claude.ai 同步的技能保留该名称](/docs/zh-CN/skills#names-reserved-for-synced-skills),不加载该项。
4940
4941Claude Code 将此警告显示为对话视图中的启动通知,而不是在 stderr 上:
4942
4943```text theme={null}
4944Not loaded: rename .claude/skills/anthropic-skills, then restart — its name uses "anthropic-skills", a name reserved for the skills synced from your claude.ai account
4945```
4946
4947通知命名它拒绝的第一项:要重命名的文件夹或文件、要编辑的 `name:` 行,或要重命名的工作流。当拒绝多个项时,通知以计数结尾,例如 `· 2 more`,[调试日志](/docs/zh-CN/debug-your-config)命名每一个。
4948
4949**要做什么:**
4950
4951* 重命名通知命名的项,或编辑它指向的 `name:` 行,然后重启会话。
4952
4953在 v2.1.282 之前,Claude Code 加载具有这些名称的技能和命令。
4954
4588<h3 id="workspace-has-not-been-trusted">4955<h3 id="workspace-has-not-been-trusted">
4589 工作区尚未被信任4956 工作区尚未被信任
4590</h3>4957</h3>
4591 4958
4592Claude Code 在项目的 `.claude/settings.json` 或 `.claude/settings.local.json` 中找到了 `permissions.allow` 规则或 `permissions.additionalDirectories` 条目,但没有应用它们,因为[项目设置中的允许规则需要工作区信任](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)。计数、设置名称和消息中命名的文件因您的配置而异。`deny` 和 `ask` 规则不受影响。4959Claude Code 在项目的 `.claude/settings.json` 或 `.claude/settings.local.json` 中找到了 `permissions.allow` 规则或 `permissions.additionalDirectories` 条目,但未应用它们,因为[来自项目设置的允许规则需要工作区信任](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)。计数、设置名称和消息中命名的文件因您的配置而异。`deny` 和 `ask` 规则不受影响。
4593 4960
4594```text theme={null}4961```text theme={null}
4595Ignoring 2 permissions.allow entries from .claude/settings.local.json: this workspace has not been trusted. Run Claude Code interactively here once and accept the trust dialog, or set projects["/Users/you/project"].hasTrustDialogAccepted: true in /Users/you/.claude.json.4962Ignoring 2 permissions.allow entries from .claude/settings.local.json: this workspace has not been trusted. Run Claude Code interactively here once and accept the trust dialog, or set projects["/Users/you/project"].hasTrustDialogAccepted: true in /Users/you/.claude.json.
4597 4964
4598**要做什么:**4965**要做什么:**
4599 4966
4600* 在目录中运行 `claude` 并接受信任对话框。[项目允许规则和工作区信任](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)说明该接受涵盖哪个文件夹。4967* 在目录中运行 `claude` 并接受信任对话框。[项目允许规则和工作区信任](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)说明该接受涵盖的文件夹。
4601* 在[非交互模式](/docs/zh-CN/headless)中使用 `-p` 时不显示对话框。使用消息打印的确切 `projects` 键在 `~/.claude.json` 中设置 `hasTrustDialogAccepted` 条目。4968* 在[非交互模式](/docs/zh-CN/headless)中使用 `-p` 不显示对话框。使用消息打印的确切 `projects` 键在 `~/.claude.json` 中设置 `hasTrustDialogAccepted` 条目。
4602* 如果消息提到 `.claude/settings.local.json` 并且您在 git 存储库外或主目录中启动了 Claude Code,请更新到 v2.1.200 或更高版本。版本 2.1.196 到 2.1.199 在这些工作区中将您自己的 `.claude/settings.local.json` 视为存储库提供的。在 v2.1.207 及更高版本上,如果您尚未信任该文件夹,在 git 存储库外更新是不够的:确定文件夹不在存储库内会运行 git,Claude Code 仅在您接受信任对话框后才运行该检查,因此请使用第一步。您的主目录和任何其他[配置主目录](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)是豁免的,不需要等待对话框。请参阅[项目允许规则和工作区信任](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)。4969* 如果消息命名 `.claude/settings.local.json` 并且您在 git 存储库外或主目录中启动了 Claude Code,请更新到 v2.1.200 或更高版本。版本 2.1.196 至 2.1.199 在这些工作区中将您自己的 `.claude/settings.local.json` 视为存储库提供的。在 v2.1.207 及更高版本上,如果您尚未信任该文件夹,在 git 存储库外更新是不够的:确定文件夹不在存储库内会运行 git,Claude Code 仅在您接受信任对话框后才运行该检查,因此请使用第一步。您的主目录和任何其他[配置主目录](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)是豁免的,不等待对话框。请参阅[项目允许规则和工作区信任](/docs/zh-CN/permissions#project-allow-rules-and-workspace-trust)。
4603 4970
4604<h3 id="working-directory-is-a-network-path">4971<h3 id="working-directory-is-a-network-path">
4605 工作目录是网络路径4972 工作目录是网络路径
4606</h3>4973</h3>
4607 4974
4608Claude Code 不会将网络路径添加为工作目录。查找网络路径可能会联系它命名的主机,在 Windows 上该联系可能会向主机发送您的凭据,因此 Claude Code 拒绝该路径而不查找它。当您使用此类路径运行 `/add-dir` 时,或作为启动时的警告,您会看到此消息。当它在启动时出现时,Claude Code 启动时不包含该目录。4975Claude Code 不将网络路径添加为工作目录。查找网络路径可以联系它命名的主机,在 Windows 上该联系可以向主机发送您的凭据,因此 Claude Code 拒绝该路径而不查找它。当您使用此类路径运行 `/add-dir` 时,或作为启动时的警告,您会看到此消息。当它在启动时出现时,Claude Code 启动时不包含该目录。
4609 4976
4610```text theme={null}4977```text theme={null}
4611\\server\share is a network path, which cannot be added as a working directory. On Windows, map the share to a drive letter and pass it at launch with --add-dir (a drive letter added mid-session does not yet carry remote-read trust).4978\\server\share is a network path, which cannot be added as a working directory. On Windows, map the share to a drive letter and pass it at launch with --add-dir (a drive letter added mid-session does not yet carry remote-read trust).
4631 远程托管设置加载失败4998 远程托管设置加载失败
4632</h3>4999</h3>
4633 5000
4634您的会话符合[服务器托管设置](/docs/zh-CN/server-managed-settings)的条件,但 Claude Code 无法获取它们,因此在交互式会话中显示此警告。括号中的原因命名失败的内容,例如 `network error`、`request timed out` 或 `authentication rejected (401)`,行的其余部分说明会话运行的策略:5001您的会话符合[服务器托管设置](/docs/zh-CN/server-managed-settings)的条件,但 Claude Code 无法获取它们或无法应用服务器返回的内容,因此在交互式会话中显示此警告。
5002
5003括号中的原因命名失败的内容,例如 `network error`、`request timed out` 或 `authentication rejected (401)`。原因 `no setting in the server response could be applied as written` 意味着服务器已应答,但它返回的设置都没有通过[验证](/docs/zh-CN/server-managed-settings#invalid-entries-in-delivered-settings)。在 v2.1.282 之前,此原因读取 `server returned invalid settings`。
4635 5004
4636* **从较早的成功获取缓存的设置**:Claude Code 在该缓存策略上运行会话,除了[扣留的环境变量](/docs/zh-CN/server-managed-settings#fetch-and-caching-behavior),该行读作 `using cached policy`。5005该行的其余部分说明会话运行的策略:
4637* **无缓存**:Claude Code 在没有服务器托管设置的情况下运行会话,该行读作 `no remote policy applied`。5006
5007* **从较早的成功获取缓存的设置**:Claude Code 在该缓存策略上运行会话,除了[扣留的环境变量](/docs/zh-CN/server-managed-settings#fetch-and-caching-behavior),行读取 `using cached policy`。
5008* **无缓存**:Claude Code 在没有服务器托管设置的情况下运行会话,行读取 `no remote policy applied`。
4638 5009
4639**要做什么:**5010**要做什么:**
4640 5011
4641* 对消息命名的原因采取行动:对于网络原因,检查此计算机是否可以到达 `api.anthropic.com`;对于身份验证原因,使用 `/status` 检查您的登录5012* 对消息命名的原因采取行动:对于网络原因,检查此计算机是否可以到达 `api.anthropic.com`;对于身份验证原因,使用 `/status` 检查您的登录
5013* 对于 `no setting in the server response could be applied as written`,要求您的管理员更正服务器上的设置
4642* 运行 `/status` 或 `claude doctor` 以获取完整诊断5014* 运行 `/status` 或 `claude doctor` 以获取完整诊断
4643 5015
4644在 v2.1.248 之前,Claude Code 仅在调试日志中报告失败的设置获取。5016在 v2.1.248 之前,Claude Code 仅在调试日志中报告失败的设置获取。
4647 托管设置未被批准5019 托管设置未被批准
4648</h3>5020</h3>
4649 5021
4650您的组织的[服务器托管设置](/docs/zh-CN/server-managed-settings)包括需要您批准的设置,而您拒绝了[安全批准对话框](/docs/zh-CN/server-managed-settings#security-approval-dialogs),因此 Claude Code 退出而不应用它们:5022您的组织的[服务器托管设置](/docs/zh-CN/server-managed-settings)包括需要您批准的设置,您拒绝了[安全批准对话框](/docs/zh-CN/server-managed-settings#security-approval-dialogs),因此 Claude Code 退出而不应用它们:
4651 5023
4652```text theme={null}5024```text theme={null}
4653Managed settings were not approved; exiting without applying them.5025Managed settings were not approved; exiting without applying them.
4656**要做什么:**5028**要做什么:**
4657 5029
4658* 再次启动 Claude Code 并批准对话框以在您的组织设置下继续。拒绝的对话框不被记住,因此在下一次启动时再次出现。5030* 再次启动 Claude Code 并批准对话框以在您的组织设置下继续。拒绝的对话框不被记住,因此在下一次启动时再次出现。
4659* 如果您对对话框列出的设置不确定,在批准前询问维护您的组织托管设置的人5031* 如果您对对话框列出的设置不确定,请在批准前询问维护您的组织托管设置的人
5032
5033<h3 id="managed-settings-block-the-default-model">
5034 托管设置阻止默认模型
5035</h3>
5036
5037您的组织的[托管设置](/docs/zh-CN/managed-settings)阻止默认选项解析到的模型以及它可以降级到的每个模型。将在默认选项上启动的会话在启动时退出,而不是运行被阻止的模型。您看到的消息取决于阻止它的设置。当 [`deniedModels`](/docs/zh-CN/model-config#block-specific-models-or-versions) 列表阻止它时,消息读取:
5038
5039```text theme={null}
5040Claude Code can't start: your organization's managed settings block the default model (claude-opus-5-5) in "deniedModels", and none of the models they allow can be used as the default instead. Ask your administrator to update "deniedModels" or "availableModels".
5041```
5042
5043当 `availableModels` 列表与 [`availableModelsMatch`](/docs/zh-CN/settings-reference#availablemodelsmatch) 设置为 `"exact"` 省略它时,消息读取:
5044
5045```text theme={null}
5046Claude Code can't start: your organization allows only the models listed in "availableModels", and none of them can be used as the default model (claude-opus-5-5 isn't listed). Ask your administrator to update "availableModels".
5047```
5048
5049**要做什么:**
5050
5051* 如果您管理设置,请将您的用户可以运行的模型添加到 `availableModels`,或缩小阻止每个回退的 `deniedModels` 条目。[阻止特定模型或版本](/docs/zh-CN/model-config#block-specific-models-or-versions)描述默认选项如何降级
5052* 如果您不管理它们,请将消息发送给您的管理员。您自己的设置文件无法扩大托管的 `availableModels` 或 `deniedModels` 列表
4660 5053
4661<h3 id="mcp-server-is-blocked-by-enterprise-managed-policy">5054<h3 id="mcp-server-is-blocked-by-enterprise-managed-policy">
4662 MCP 服务器被企业托管策略阻止5055 MCP 服务器被企业托管策略阻止
4663</h3>5056</h3>
4664 5057
4665您在 `/mcp` 中的服务器上选择了**重新连接**,或在那里重新打开了禁用的服务器,而[限制 MCP 服务器](/docs/zh-CN/managed-mcp)的设置阻止了该服务器。Claude Code 拒绝连接它并显示:5058您在 `/mcp` 中的服务器上选择了**重新连接**,或在那里重新打开了禁用的服务器,[限制 MCP 服务器](/docs/zh-CN/managed-mcp)的设置阻止了该服务器。Claude Code 拒绝连接它并显示:
4666 5059
4667```text theme={null}5060```text theme={null}
4668MCP server <name> is blocked by enterprise managed policy5061MCP server <name> is blocked by enterprise managed policy
4669```5062```
4670 5063
4671以下任何设置都可能产生该消息:5064这些设置中的任何一个都可以产生消息:
4672 5065
4673* 与服务器匹配的 [`deniedMcpServers`](/docs/zh-CN/managed-mcp#policy-based-control-with-allowlists-and-denylists) 条目,包括您自己的 `~/.claude/settings.json` 或项目的 `.claude/settings.json` 中的条目5066* 与服务器匹配的 [`deniedMcpServers`](/docs/zh-CN/managed-mcp#policy-based-control-with-allowlists-and-denylists) 条目,包括您自己的 `~/.claude/settings.json` 或项目的 `.claude/settings.json` 中的条目
4674* 服务器不匹配的 [`allowedMcpServers`](/docs/zh-CN/managed-mcp#policy-based-control-with-allowlists-and-denylists) 列表5067* 服务器不匹配的 [`allowedMcpServers`](/docs/zh-CN/managed-mcp#policy-based-control-with-allowlists-and-denylists) 列表
4675* [`strictPluginOnlyCustomization`](/docs/zh-CN/settings-reference#strictpluginonlycustomization) 且 `mcp` 被锁定,这阻止了在 `~/.claude.json` 和 `.mcp.json` 中配置的服务器5068* [`strictPluginOnlyCustomization`](/docs/zh-CN/settings-reference#strictpluginonlycustomization) 与 `mcp` 锁定,这阻止在 `~/.claude.json` 和 `.mcp.json` 中配置的服务器
4676* [`disableClaudeAiConnectors`](/docs/zh-CN/mcp#disable-claude-ai-connectors),当服务器是 claude.ai 连接器时5069* [`disableClaudeAiConnectors`](/docs/zh-CN/mcp#disable-claude-ai-connectors),当服务器是 claude.ai 连接器时
4677 5070
4678**要做什么:**5071**要做什么:**
4679 5072
4680* 检查您自己的用户和项目设置文件中的这些设置之一,并更改或删除它5073* 检查您自己的用户和项目设置文件中的这些设置之一,并更改或删除它
4681* 如果您自己的设置都不能解释该阻止,请询问您的管理员哪个托管设置阻止了该服务器5074* 如果您自己的设置都不能解释该阻止,请询问您的管理员哪个托管设置阻止了服务器
4682 5075
4683在 v2.1.257 之前,`/mcp` 中的**重新连接**和重新启用可能会连接一个中途策略更新阻止的服务器。5076在 v2.1.257 之前,`/mcp` 中的**重新连接**和重新启用可以连接中途策略更新阻止的服务器。
4684 5077
4685<h3 id="managed-settings-document-could-not-be-parsed">5078<h3 id="managed-settings-document-could-not-be-parsed">
4686 托管设置文档无法解析5079 托管设置文档无法解析
4687</h3>5080</h3>
4688 5081
4689您的组织部署了[托管设置](/docs/zh-CN/managed-settings),其中一个部署的文档存在但无法解析为 JSON 对象,因此 Claude Code 在启动时以代码 1 退出,而不是在没有文档携带的策略的情况下运行。该行在消息前命名失败的源:5082您的组织部署[托管设置](/docs/zh-CN/managed-settings),其中一个部署的文档存在但无法解析为 JSON 对象,因此 Claude Code 在启动时以代码 1 退出,而不是在没有文档携带的策略的情况下运行。该行在消息前命名失败的源:
4690 5083
4691```text theme={null}5084```text theme={null}
4692/Library/Application Support/ClaudeCode/managed-settings.json: Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.5085/Library/Application Support/ClaudeCode/managed-settings.json: Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.
4700 5093
4701[查找 Claude Code 删除的条目](/docs/zh-CN/managed-settings#find-entries-claude-code-dropped)列出了使每个源无法解析的原因。5094[查找 Claude Code 删除的条目](/docs/zh-CN/managed-settings#find-entries-claude-code-dropped)列出了使每个源无法解析的原因。
4702 5095
4703Claude Code 拒绝启动,即使另一个管理员源提供了有效的策略。您在交互式会话、`claude -p`、Agent SDK 会话、[后台会话](/docs/zh-CN/agent-view)和大多数子命令(包括 `claude doctor`)中看到此错误。拒绝故意失败关闭:Claude Code 无法解析的文档中的设置无法被强制执行,启动时不应用组织的控制会运行会话。5096Claude Code 拒绝启动,即使另一个管理员源提供有效策略。您在交互式会话、`claude -p`、Agent SDK 会话、[后台会话](/docs/zh-CN/agent-view)和大多数子命令(包括 `claude doctor`)中看到此错误。拒绝故意失败关闭:Claude Code 无法解析的文档中的设置无法被强制执行,启动时不运行会话会在没有组织控制的情况下运行。
4704 5097
4705可解析文档中的架构问题不会产生此错误。[查找 Claude Code 删除的条目](/docs/zh-CN/managed-settings#find-entries-claude-code-dropped)涵盖 Claude Code 对其所做的操作。5098可解析文档中的架构问题不会产生此错误。[查找 Claude Code 删除的条目](/docs/zh-CN/managed-settings#find-entries-claude-code-dropped)涵盖 Claude Code 对其所做的操作。
4706 5099
4707当 `managed-settings.d/` 目录存在但无法列出时,Claude Code 报告 `Managed settings drop-in directory could not be read:` 后跟基础错误。[查找 Claude Code 删除的条目](/docs/zh-CN/managed-settings#find-entries-claude-code-dropped)涵盖读取失败在启动时退出的情况。5100当 `managed-settings.d/` 目录存在但无法列出时,Claude Code 报告 `Managed settings drop-in directory could not be read:` 后跟基础错误。[查找 Claude Code 删除的条目](/docs/zh-CN/managed-settings#find-entries-claude-code-dropped)涵盖读取失败在启动时退出的时间。
4708 5101
4709**要做什么:**5102**要做什么:**
4710 5103
4715 otelHeadersHelper 失败5108 otelHeadersHelper 失败
4716</h3>5109</h3>
4717 5110
4718当 [`otelHeadersHelper`](/docs/zh-CN/settings-reference#otelheadershelper) 脚本失败或打印不符合[脚本要求](/docs/zh-CN/monitoring-usage#script-requirements)的输出时,Claude Code 在交互式会话中显示此警告作为终端界面中的通知,每个会话一次。5111当 [`otelHeadersHelper`](/docs/zh-CN/settings-reference#otelheadershelper) 脚本失败或打印不符合[脚本要求](/docs/zh-CN/monitoring-usage#script-requirements)的输出时,Claude Code 将此警告显示为终端界面中的通知,每个交互式会话一次。
4719 5112
4720当脚本继续失败时,导出失败,您的遥测后端从会话中接收不到任何内容。5113当脚本继续失败时,导出失败,您的遥测后端从会话中接收不到任何内容。
4721 5114
4731* 修复脚本使其在 30 秒内退出 0 并在 stdout 上打印字符串标头值的 JSON 对象。请参阅[脚本要求](/docs/zh-CN/monitoring-usage#script-requirements)。5124* 修复脚本使其在 30 秒内退出 0 并在 stdout 上打印字符串标头值的 JSON 对象。请参阅[脚本要求](/docs/zh-CN/monitoring-usage#script-requirements)。
4732* 如果您的组织通过[托管设置](/docs/zh-CN/managed-settings)部署脚本,请要求维护它们的人修复它。5125* 如果您的组织通过[托管设置](/docs/zh-CN/managed-settings)部署脚本,请要求维护它们的人修复它。
4733 5126
4734在[非交互模式](/docs/zh-CN/headless)中使用 `-p` 时,相同的失败在 stderr 上显示为 `otelHeadersHelper failed (OpenTelemetry export headers unavailable): <error>`。5127在[非交互模式](/docs/zh-CN/headless)中使用 `-p`,相同的失败在 stderr 上显示为 `otelHeadersHelper failed (OpenTelemetry export headers unavailable): <error>`。
4735 5128
4736<h3 id="headershelper-not-run">5129<h3 id="headershelper-not-run">
4737 headersHelper 未运行5130 headersHelper 未运行
4750**要做什么:**5143**要做什么:**
4751 5144
4752* 在消息命名的文件夹中运行 `claude`,接受信任对话框,然后再次运行您的 `-p` 或 SDK 命令5145* 在消息命名的文件夹中运行 `claude`,接受信任对话框,然后再次运行您的 `-p` 或 SDK 命令
4753* 自己在 `~/.claude.json` 中设置 `hasTrustDialogAccepted` 条目,使用消息打印的确切 `projects` 键5146* 在 `~/.claude.json` 中自己设置 `hasTrustDialogAccepted` 条目,使用消息打印的确切 `projects` 键
4754* 如果您在主目录中启动了会话,请从您已信任的项目目录工作。当您在主目录中接受信任对话框时,Claude Code 仅为当前会话保持该信任。5147* 如果您在主目录中启动了会话,请从您已信任的项目目录工作。当您在主目录中接受信任对话框时,Claude Code 仅为当前会话保持该信任。
4755 5148
4756<h3 id="malformed-tool-content-rule">5149<h3 id="malformed-tool-content-rule">
4757 格式错误的 Tool(content) 规则5150 格式错误的 Tool(content) 规则
4758</h3>5151</h3>
4759 5152
4760您的一个设置文件中的[权限规则](/docs/zh-CN/permissions#permission-rule-syntax)没有 `Tool` 或 `Tool(content)` 的形状,例如因为文本跟在右括号后或其中一个括号缺失。Claude Code 跳过该规则,并在交互式会话启动时在无效设置对话框中列出它,以及在 [`claude doctor`](/docs/zh-CN/debug-your-config#check-resolved-settings) 输出中:5153您的一个设置文件中的[权限规则](/docs/zh-CN/permissions#permission-rule-syntax)没有 `Tool` 或 `Tool(content)` 的形状,例如因为文本跟在右括号后或其中一个括号缺失。Claude Code 跳过规则,当交互式会话启动时在无效设置对话框中列出它,以及在 [`claude doctor`](/docs/zh-CN/debug-your-config#check-resolved-settings) 输出中:
4761 5154
4762```text theme={null}5155```text theme={null}
4763Invalid permission rule "Bash(ls) x" was skipped: Malformed Tool(content) rule. Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal5156Invalid permission rule "Bash(ls) x" was skipped: Malformed Tool(content) rule. Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal
4766**要做什么:**5159**要做什么:**
4767 5160
4768* 在消息列出的设置文件中,重写规则使其在其右括号处结束,例如用 `Bash(ls *)` 代替 `Bash(ls) x`5161* 在消息列出的设置文件中,重写规则使其在其右括号处结束,例如用 `Bash(ls *)` 代替 `Bash(ls) x`
4769* 将内容内的括号保留原样。它们是字面的,因此诸如 `Edit(./Finance (2024)/**)` 之类的规则在不转义的情况下是有效的5162* 将内容内的括号保留原样。它们是字面的,因此诸如 `Edit(./Finance (2024)/**)` 的规则在没有转义的情况下是有效的
4770 5163
4771在 v2.1.260 之前,Claude Code 将具有不匹配括号的规则报告为 `Mismatched parentheses`。5164在 v2.1.260 之前,Claude Code 将具有不匹配括号的规则报告为 `Mismatched parentheses`。
4772 5165
4773<h3 id="is-not-matched-by-file-permission-checks">5166<h3 id="is-not-matched-by-file-permission-checks">
4774 不被文件权限检查匹配5167 不匹配文件权限检查
4775</h3>5168</h3>
4776 5169
4777Claude Code 在您的[设置文件](/docs/zh-CN/settings#where-settings-live)、[托管设置](/docs/zh-CN/managed-settings)或 `--allowedTools`、`--disallowedTools` 或 `--settings` 标志值中找到了带有路径的 `Write`、`NotebookEdit`、`MultiEdit` 或 `Glob`[权限规则](/docs/zh-CN/permissions#read-and-edit)。它仅针对 `Edit` 和 `Read` 规则检查文件权限,因此它从不查询命名其他文件工具之一的路径规则。它保留规则并不改变其他任何内容;警告命名规则、其在括号中的源和要写入的替换:5170Claude Code 在您的[设置文件](/docs/zh-CN/settings#where-settings-live)、[托管设置](/docs/zh-CN/managed-settings)或 `--allowedTools`、`--disallowedTools` 或 `--settings` 标志值中找到了 `Write`、`NotebookEdit`、`MultiEdit` 或 `Glob` [权限规则](/docs/zh-CN/permissions#read-and-edit),其中包含路径。它仅针对 `Edit` 和 `Read` 规则检查文件权限,因此它从不查询命名其他文件工具之一的路径规则。它保留规则并不改变其他任何内容;警告命名规则、其括号中的源和要写入的替换:
4778 5171
4779```text theme={null}5172```text theme={null}
4780Permission deny rule (.claude/settings.json): Write(docs/**) is not matched by file permission checks — only Edit(path) rules are. Use Edit(docs/**) instead (Edit rules cover all file-editing tools).5173Permission deny rule (.claude/settings.json): Write(docs/**) is not matched by file permission checks — only Edit(path) rules are. Use Edit(docs/**) instead (Edit rules cover all file-editing tools).
4784 5177
4785* 将 `Write(path)`、`NotebookEdit(path)` 和旧版 `MultiEdit(path)` 规则替换为 `Edit(path)`。`Edit` 规则涵盖所有文件编辑工具。5178* 将 `Write(path)`、`NotebookEdit(path)` 和旧版 `MultiEdit(path)` 规则替换为 `Edit(path)`。`Edit` 规则涵盖所有文件编辑工具。
4786* 除了在 `--allowedTools` 中,Claude Code 接受 `Glob` 规则而不警告,将 `Glob(path)` 规则替换为 `Read(path)`。5179* 除了在 `--allowedTools` 中,Claude Code 接受 `Glob` 规则而不警告,将 `Glob(path)` 规则替换为 `Read(path)`。
4787* 在警告在括号中命名的源处修复规则:设置文件路径,或 `--allowed-tools` 和 `--disallowed-tools` 的标志本身。不存在于磁盘上的 `claude-settings-<hash>.json` 路径代表内联 `--settings` 值。修复您传递给该标志的 JSON。5180* 在警告括号中命名的源处修复规则:设置文件路径,或 `--allowed-tools` 和 `--disallowed-tools` 的标志本身。不存在于磁盘上的 `claude-settings-<hash>.json` 路径代表内联 `--settings` 值。修复您传递给该标志的 JSON。
4788* 将裸工具名称规则(例如 `Write` 或 `Glob`)保留原样。Claude Code 在[工具级别](/docs/zh-CN/permissions#match-all-uses-of-a-tool)匹配它们,不对它们警告。5181* 将诸如 `Write` 或 `Glob` 的裸工具名称规则保留原样。Claude Code 在[工具级别](/docs/zh-CN/permissions#match-all-uses-of-a-tool)匹配它们,不对它们发出警告。
4789* 如果源读作 `managed policy settings`,将警告转发给维护您的托管设置的人,因为您无法自己清除它。5182* 如果源读取 `managed policy settings`,将警告转发给维护您的托管设置的人,因为您无法自己清除它。
4790 5183
4791在[后台会话](/docs/zh-CN/agent-view)中或使用 `--output-format json` 或 `stream-json` 时,Claude Code 将警告写入调试日志而不是 stderr,因此机器读取的输出保持干净。使用 `--debug` 运行以在 `~/.claude/debug/<session-id>.txt` 处捕获它。在 v2.1.210 之前,Claude Code 接受这些规则而不警告。5184在[后台会话](/docs/zh-CN/agent-view)中或使用 `--output-format json` 或 `stream-json`,Claude Code 将警告写入调试日志而不是 stderr,因此机器读取输出保持干净。使用 `--debug` 运行以在 `~/.claude/debug/<session-id>.txt` 处捕获它。在 v2.1.210 之前,Claude Code 接受这些规则而不警告。
4792 5185
4793<h3 id="has-a-wildcard-before-the-rest-of-the-command">5186<h3 id="has-a-wildcard-before-the-rest-of-the-command">
4794 在命令的其余部分之前有通配符5187 在命令的其余部分之前有通配符
4795</h3>5188</h3>
4796 5189
4797Claude Code 在您的[设置文件](/docs/zh-CN/settings#where-settings-live)、[托管设置](/docs/zh-CN/managed-settings)或 `--allowedTools` 或 `--settings` 标志值中找到了一个 `Bash` 允许规则,其 `*` 在确定它是哪个命令的后续单词之前,例如 `Bash(git * main)` 或 `Bash(git -C * status *)`。`*` 匹配任何文本,包括在该位置插入的选项:`Bash(git * main)` 也批准 `git -c core.fsmonitor=<script> diff main`,其中 `-c` 使 git 运行命令命名的程序。[通配符模式](/docs/zh-CN/permissions#wildcard-patterns)显示匹配规则。5190Claude Code 找到了一个 `Bash` 允许规则,其 `*` 在后来的单词之前,该单词确定它是哪个命令,例如 `Bash(git * main)` 或 `Bash(git -C * status *)`,在您的[设置文件](/docs/zh-CN/settings#where-settings-live)、[托管设置](/docs/zh-CN/managed-settings)或 `--allowedTools` 或 `--settings` 标志值中。`*` 匹配任何文本,包括在该位置插入的选项:`Bash(git * main)` 也批准 `git -c core.fsmonitor=<script> diff main`,其中 `-c` 使 git 运行命令命名的程序。[通配符模式](/docs/zh-CN/permissions#wildcard-patterns)显示匹配规则。
4798 5191
4799警告存在是为了让您可以缩小通配符比您打算的更宽的规则。Claude Code 保留规则并不改变它的匹配方式;警告命名规则及其在括号中的源:5192警告存在是为了让您缩小通配符比您打算的更宽的规则。Claude Code 保留规则并不改变它如何匹配;警告命名规则及其括号中的源:
4800 5193
4801```text theme={null}5194```text theme={null}
4802Permission allow rule (.claude/settings.json): Bash(git -C * status *) has a wildcard before the rest of the command, so it also matches any options inserted at that position and approves them without a prompt. For git, options such as -c and --exec-path can run arbitrary commands. Replace that * with the exact value you mean, or only use * after the subcommand (for example Bash(git status *)).5195Permission allow rule (.claude/settings.json): Bash(git -C * status *) has a wildcard before the rest of the command, so it also matches any options inserted at that position and approves them without a prompt. For git, options such as -c and --exec-path can run arbitrary commands. Replace that * with the exact value you mean, or only use * after the subcommand (for example Bash(git status *)).
4806 5199
4807* 将子命令前的 `*` 替换为您的确切值:用 `Bash(git checkout main)` 代替 `Bash(git * main)`。5200* 将子命令前的 `*` 替换为您的确切值:用 `Bash(git checkout main)` 代替 `Bash(git * main)`。
4808* 将每个 `*` 移到子命令后:用 `Bash(git status *)` 代替 `Bash(git -C * status *)`。为您想允许的每个子命令写一个规则。5201* 将每个 `*` 移到子命令后:用 `Bash(git status *)` 代替 `Bash(git -C * status *)`。为您想允许的每个子命令写一个规则。
4809* 在警告在括号中命名的源处修复规则:设置文件路径或 `--allowed-tools` 标志本身。不存在于磁盘上的 `claude-settings-<hash>.json` 路径代表内联 `--settings` 值。修复您传递给该标志的 JSON。5202* 在警告括号中命名的源处修复规则:设置文件路径,或 `--allowed-tools` 标志本身。不存在于磁盘上的 `claude-settings-<hash>.json` 路径代表内联 `--settings` 值。修复您传递给该标志的 JSON。
4810* 如果源读作 `managed policy settings`,将警告转发给维护您的托管设置的人,因为您无法自己清除它。5203* 如果源读取 `managed policy settings`,将警告转发给维护您的托管设置的人,因为您无法自己清除它。
4811 5204
4812Claude Code 不对具有相同形状的拒绝和询问规则警告:它拒绝或提示它们匹配的额外命令,而不是批准它们。它也不对子命令在第一个 `*` 之前的规则警告,例如 `Bash(git commit *)`,或规则中除了选项外没有其他单词跟在 `*` 后的规则,例如 `Bash(git *)`,或关于 `:*` 前缀规则,例如 `Bash(git:*)`。5205Claude Code 不对具有相同形状的拒绝和询问规则发出警告:它拒绝或提示它们匹配的额外命令,而不是批准它们。它也不对子命令在第一个 `*` 之前的规则发出警告,例如 `Bash(git commit *)`,或规则中除了选项之外没有其他单词跟在 `*` 后的规则,例如 `Bash(git *)`,或关于 `:*` 前缀规则的规则,例如 `Bash(git:*)`。
4813 5206
4814在[后台会话](/docs/zh-CN/agent-view)中或使用 `--output-format json` 或 `stream-json` 时,Claude Code 将警告写入调试日志而不是 stderr,因此机器读取的输出保持干净。使用 `--debug` 运行以在 `~/.claude/debug/<session-id>.txt` 处捕获它。在 v2.1.246 之前,Claude Code 接受这些规则而不警告。5207在[后台会话](/docs/zh-CN/agent-view)中或使用 `--output-format json` 或 `stream-json`,Claude Code 将警告写入调试日志而不是 stderr,因此机器读取输出保持干净。使用 `--debug` 运行以在 `~/.claude/debug/<session-id>.txt` 处捕获它。在 v2.1.246 之前,Claude Code 接受这些规则而不警告。
4815 5208
4816<h3 id="crosssessioninbound-must-be-one-of-accept-hold-refuse">5209<h3 id="crosssessioninbound-must-be-one-of-accept-hold-refuse">
4817 crossSessionInbound 必须是 accept、hold、refuse 之一5210 crossSessionInbound 必须是 accept、hold 或 refuse 之一
4818</h3>5211</h3>
4819 5212
4820设置文件将 [`crossSessionInbound`](/docs/zh-CN/settings-reference#crosssessioninbound) 设置为 Claude Code 不识别的值,例如拼写错误 `"reject"`。警告的第二句取决于哪个文件保存该值;在用户、项目、本地或 `--settings` 文件中,它读作:5213设置文件将 [`crossSessionInbound`](/docs/zh-CN/settings-reference#crosssessioninbound) 设置为 Claude Code 不识别的值,例如拼写错误 `"reject"`。警告的第二句取决于哪个文件保存该值;在用户、项目、本地或 `--settings` 文件中,它读取:
4821 5214
4822```text theme={null}5215```text theme={null}
4823"crossSessionInbound" must be one of "accept", "hold", "refuse"; received "reject". This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.5216"crossSessionInbound" must be one of "accept", "hold", "refuse"; received "reject". This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.
4842CLAUDE_CODE_DISABLE_1M_CONTEXT is set, but the 200K limit isn't enforced for <model>, so this session can grow past it. To enforce it, set CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 (or the autoCompactWindow setting).5235CLAUDE_CODE_DISABLE_1M_CONTEXT is set, but the 200K limit isn't enforced for <model>, so this session can grow past it. To enforce it, set CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 (or the autoCompactWindow setting).
4843```5236```
4844 5237
4845Claude Code 为它识别为具有本地 1M 窗口的每个模型自己强制执行 200K 限制,对于它不识别的模型 ID,它在它假设的窗口处压缩。当其他配置击败该强制执行时出现警告:5238Claude Code 为它识别为具有本机 1M 窗口的每个模型自己强制执行 200K 限制,对于它不识别的模型 ID,它在它假设的窗口处压缩。当其他配置击败该强制执行时出现警告:
4846 5239
4847* 模型 ID 不是 Claude Code 识别的,例如[LLM 网关](/docs/zh-CN/llm-gateway)别名,并且您设置了 [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](/docs/zh-CN/env-vars) 或使用 [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](/docs/zh-CN/env-vars) 将假设的窗口提高到 200K 以上。在这种情况下,消息也提供 `or update to a Claude Code version that recognizes <model>` 作为补救。5240* 模型 ID 不是 Claude Code 识别的,例如[LLM 网关](/docs/zh-CN/llm-gateway)别名,并且您设置了 [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](/docs/zh-CN/env-vars) 或使用 [`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](/docs/zh-CN/env-vars) 将假设的窗口提高到 200K 以上。在这种情况下,消息也提供 `or update to a Claude Code version that recognizes <model>` 作为补救。
4848* 通过 [`ANTHROPIC_BETAS`](/docs/zh-CN/env-vars) 或 [`--betas`](/docs/zh-CN/cli-reference#cli-flags) 标志请求的 `context-1m` 测试版仍然在接受该测试版的模型上向 API 请求 1M 窗口,而没有任何东西在 200K 处压缩会话5241* 通过 [`ANTHROPIC_BETAS`](/docs/zh-CN/env-vars) 或 [`--betas`](/docs/zh-CN/cli-reference#cli-flags) 标志请求的 `context-1m` 测试版仍然要求 API 在接受该测试版的模型上使用 1M 窗口,而没有任何东西在 200K 处压缩会话
4849 5242
4850**要做什么:**5243**要做什么:**
4851 5244
4852* 设置 [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](/docs/zh-CN/env-vars) 或 [`autoCompactWindow`](/docs/zh-CN/settings-reference#autocompactwindow) 设置为 `200000`,以便自动压缩在 200K 边界处压缩5245* 设置 [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](/docs/zh-CN/env-vars),或 [`autoCompactWindow`](/docs/zh-CN/settings-reference#autocompactwindow) 设置为 `200000`,以便自动压缩在 200K 边界处压缩
4853* 如果消息命名此版本不识别的模型 ID,运行 `claude update`。识别 ID 为 1M 上下文模型的版本在没有进一步配置的情况下强制执行限制。5246* 如果消息命名此版本不识别的模型 ID,运行 `claude update`。识别 ID 为 1M 上下文模型的版本在没有进一步配置的情况下强制执行限制。
4854* 如果您希望会话使用模型的完整窗口,请取消设置 `CLAUDE_CODE_DISABLE_1M_CONTEXT`;警告仅报告 200K 限制未被强制执行5247* 如果您希望会话使用模型的完整窗口,请取消设置 `CLAUDE_CODE_DISABLE_1M_CONTEXT`;警告仅报告 200K 限制未被强制执行
4855 5248
4856在[后台会话](/docs/zh-CN/agent-view)中或使用 `--output-format json` 或 `stream-json` 时,Claude Code 将警告写入调试日志而不是 stderr。5249在[后台会话](/docs/zh-CN/agent-view)中或使用 `--output-format json` 或 `stream-json`,Claude Code 将警告写入调试日志而不是 stderr。
4857 5250
4858<h3 id="unrecognized-model-id-on-a-request">5251<h3 id="unrecognized-model-id-on-a-request">
4859 请求上无法识别的模型 ID5252 请求上无法识别的模型 ID
4865[claude-code:unrecognized_model] {"model":"my-proxy-model","query_source":"sdk"}5258[claude-code:unrecognized_model] {"model":"my-proxy-model","query_source":"sdk"}
4866```5259```
4867 5260
4868在读取 stderr 的脚本或工具中,匹配 `[claude-code:unrecognized_model]` 前缀。在前缀和一个空格之后,Claude Code 写入一行 JSON 对象。Claude Code 可能在后续版本中向其添加字段,因此忽略您不期望的任何字段。它至少写入这两个:5261在读取 stderr 的脚本或工具中,匹配 `[claude-code:unrecognized_model]` 前缀。在前缀和一个空格之后,Claude Code 写入一行 JSON 对象。Claude Code 可以在更高版本中向其添加字段,因此忽略您不期望的任何字段。它至少写入这两个:
4869 5262
4870* `model`:您配置的模型字符串5263* `model`:您配置的模型字符串
4871* `query_source`:使用模型的请求路径。Claude Code 为 `-p` 运行报告 `sdk`,为子代理报告以 `agent:` 开头的值。5264* `query_source`:使用模型的请求路径。Claude Code 为 `-p` 运行报告 `sdk`,为以 `agent:` 开头的值报告子代理。
4872 5265
4873Claude Code 根据您运行它的方式将行写入两个位置之一:5266Claude Code 根据您运行它的方式将行写入两个位置之一:
4874 5267
4875* 在[非交互模式](/docs/zh-CN/headless)中使用 `-p` 时,Claude Code 在每个 `--output-format` 下将其写入 stderr,因此您可以解析 stdout 而不过滤该行5268* 在[非交互模式](/docs/zh-CN/headless)中使用 `-p`,Claude Code 在每个 `--output-format` 下将其写入 stderr,因此您可以解析 stdout 而不过滤该行
4876* 在交互式会话或[后台会话](/docs/zh-CN/agent-view)中,Claude Code 将其写入调试日志;使用 `--debug` 运行以在 `~/.claude/debug/<session-id>.txt` 处捕获它5269* 在交互式会话或[后台会话](/docs/zh-CN/agent-view)中,Claude Code 将其写入调试日志;使用 `--debug` 运行以在 `~/.claude/debug/<session-id>.txt` 处捕获它
4877 5270
4878Claude Code 每个模型字符串每个进程写入该行一次。它为每个进一步的无法识别的 ID 写入单独的行,例如[子代理](/docs/zh-CN/sub-agents#choose-a-model)或[后台功能](/docs/zh-CN/costs#background-token-usage)使用的 ID。5271Claude Code 每个模型字符串每个进程写入该行一次。它为每个进一步的无法识别的 ID 写入单独的行,例如[子代理](/docs/zh-CN/sub-agents#choose-a-model)或[后台功能](/docs/zh-CN/costs#background-token-usage)使用的 ID。
4881 5274
4882**要做什么:**5275**要做什么:**
4883 5276
4884* 如果您故意设置了 ID,例如[LLM 网关](/docs/zh-CN/llm-gateway)别名,请向您的[设置文件](/docs/zh-CN/settings#where-settings-live)添加 [`modelOverrides`](/docs/zh-CN/model-config#override-model-ids-per-version) 条目,以 ID 作为其值。使用 Anthropic 模型 ID 作为键,而不是家族别名,例如 `opus`。对于示例行中的 `my-proxy-model`,添加此条目:5277* 如果您故意设置了 ID,例如[LLM 网关](/docs/zh-CN/llm-gateway)别名,请在您的[设置文件](/docs/zh-CN/settings#where-settings-live)中添加 [`modelOverrides`](/docs/zh-CN/model-config#override-model-ids-per-version) 条目,其中 ID 作为其值。使用 Anthropic 模型 ID 作为键,而不是系列别名,例如 `opus`。对于示例行中的 `my-proxy-model`,添加此条目:
4885 5278
4886 ```json theme={null}5279 ```json theme={null}
4887 {5280 {
4895 5288
4896* 如果 ID 命名比您的 Claude Code 版本更新的模型,运行 `claude update`5289* 如果 ID 命名比您的 Claude Code 版本更新的模型,运行 `claude update`
4897 5290
4898* 如果 ID 是拼写错误,在您可以[设置模型](/docs/zh-CN/model-config#setting-your-model)或[别名变量](/docs/zh-CN/model-config#environment-variables)的地方之一修复它。如果 `query_source` 以 `agent:` 开头,改为在您设置[子代理模型](/docs/zh-CN/sub-agents#choose-a-model)的地方修复它。5291* 如果 ID 是拼写错误,在您可以设置模型的[位置](/docs/zh-CN/model-config#setting-your-model)或[别名变量](/docs/zh-CN/model-config#environment-variables)中修复它。如果 `query_source` 以 `agent:` 开头,改为在您设置[子代理模型](/docs/zh-CN/sub-agents#choose-a-model)的地方修复它。
4899 5292
4900在 v2.1.233 之前,Claude Code 在为它不识别的模型 ID 发送请求时不写入行。5293在 v2.1.233 之前,Claude Code 在为它不识别的模型 ID 发送请求时不写入行。
4901 5294
4905 5298
4906`claude doctor` 在其诊断中打印此警告,`/status` 列出相同的行。当[沙箱](/docs/zh-CN/sandboxing)在文件系统隔离打开的情况下启用时,它在 Linux 和 WSL2 上出现。5299`claude doctor` 在其诊断中打印此警告,`/status` 列出相同的行。当[沙箱](/docs/zh-CN/sandboxing)在文件系统隔离打开的情况下启用时,它在 Linux 和 WSL2 上出现。
4907 5300
4908当沙箱命令运行时,沙箱通过在那里创建 0 字节只读占位符来保持对尚不存在的文件的写入拒绝,并在之后删除它。在该清理运行前被杀死的会话(例如通过 SIGKILL)留下占位符。后续会话在每次启动时再次只读绑定它们,因此设置写入(例如保存"是,不要再问")在其中一个所在的地方失败。5301当沙箱命令运行时,沙箱通过在那里创建 0 字节只读占位符来保持对尚不存在的文件的写入拒绝,并在之后删除它。在该清理运行前被杀死的会话,例如通过 SIGKILL,会留下占位符。后来的会话在每次启动时再次只读绑定它们,因此诸如保存"是,不要再问"之类的设置写入失败。
4909 5302
4910```text theme={null}5303```text theme={null}
4911- Stale sandbox mask files left by a killed session: /home/you/project/.claude/settings.local.json5304- Stale sandbox mask files left by a killed session: /home/you/project/.claude/settings.local.json
4915**要做什么:**5308**要做什么:**
4916 5309
4917* 退出在该项目中运行的任何其他 Claude Code 会话,然后使用 `rm` 删除每个列出的文件。警告列出最多三个文件并计数其余的,因此在删除后重新运行 `claude doctor` 直到警告不再出现。另一个会话的沙箱仍在使用的占位符是该会话写入保护的活跃部分5310* 退出在该项目中运行的任何其他 Claude Code 会话,然后使用 `rm` 删除每个列出的文件。警告列出最多三个文件并计数其余的,因此在删除后重新运行 `claude doctor` 直到警告不再出现。另一个会话的沙箱仍在使用的占位符是该会话写入保护的活跃部分
4918* 如果您使用"是,不要再问"保存的权限选择没有坚持,在删除占位符后再次保存它5311* 如果您使用"是,不要再问"保存的权限选择没有坚持,请在删除占位符后再次保存
4919 5312
4920在 v2.1.257 之前,`claude doctor` 没有标记这些文件;早期版本在会话被杀死时留下相同的占位符。5313在 v2.1.257 之前,`claude doctor` 没有标记这些文件;较早的版本在会话被杀死时留下相同的占位符。
4921 5314
4922<h2 id="responses-seem-lower-quality-than-usual">5315<h2 id="responses-seem-lower-quality-than-usual">
4923 回复质量似乎低于预期5316 回复质量似乎低于预期
4927 5320
4928* 配置的 [`--fallback-model`](/docs/zh-CN/cli-reference#cli-flags) 在可用性错误后接管该轮,并在记录中显示通知5321* 配置的 [`--fallback-model`](/docs/zh-CN/cli-reference#cli-flags) 在可用性错误后接管该轮,并在记录中显示通知
4929* Amazon Bedrock 或 Google Cloud 的 Agent Platform 启动检查发现你的默认模型不可用5322* Amazon Bedrock 或 Google Cloud 的 Agent Platform 启动检查发现你的默认模型不可用
4930* [自动模型备用](/docs/zh-CN/model-config#automatic-model-fallback) 在 Fable 5.1、Fable 5、Opus 5.5 和 Opus 5 上,当该类别有备用模型时,将会话移动到标记类别的备用模型,并在记录中显示通知5323* [自动模型备用](/docs/zh-CN/model-config#automatic-model-fallback) 在 Fable 5.1、Fable 5、Opus 5.5、Sonnet 5.5 和 Opus 5 上,当该类别有备用模型时,将会话移动到标记类别的备用模型,并在记录中显示通知
4931 5324
4932下面的模型选择检查捕获第二和第三种情况;第一种情况显示为记录通知而不是 `/model` 更改。[模型配置](/docs/zh-CN/model-config) 解释了每个备用何时适用。5325下面的模型选择检查捕获第二和第三种情况;第一种情况显示为记录通知而不是 `/model` 更改。[模型配置](/docs/zh-CN/model-config) 解释了每个备用何时适用。
4933 5326