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| `Request timed out` | [伺服器錯誤](#request-timed-out),或如果訊息提及您的網際網路連線,則為[網路](#unable-to-connect-to-api) |27| `Opus is experiencing high load` / `Fable is experiencing high load` | [伺服器錯誤](#api-error-repeated-529-overloaded-errors) |
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` | [疑難排解 Remote Control](/docs/zh-TW/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-TW/claude-apps-gateway-config#upstream-error-messages) |141| `all upstreams failed (N attempted)` on a Claude apps gateway session | [上游錯誤訊息](/docs/zh-TW/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-TW/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-TW/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 內部發生意外故障。它不是由您的提示、設定或帳戶引起的。421來自 API 本身的 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-TW/gateways)連線上報告此故障,同時伺服器的保活 ping 仍在到達,因為它只計算那裡解析的回應事件;升級會停止這些虛假逾時在這些路由上。通過提供者基礎 URL(例如 `ANTHROPIC_BEDROCK_BASE_URL`)到達的閘道不被位元組監視程式包裝;請參閱[串流空閒監視程式](/docs/zh-TW/network-config#streaming-idle-watchdogs)。517* `The response stopped arriving`:連線保持開啟但停止傳遞資料,因此串流空閒監視程式中止了它。在 v2.1.222 之前,Claude Code 也可能在通過 `ANTHROPIC_BASE_URL` 或 `ANTHROPIC_AWS_BASE_URL` 到達的[閘道](/docs/zh-TW/gateways)連線上報告此故障,同時伺服器的保活 ping 仍在到達,因為它只計算那裡解析的回應事件;升級會停止這些虛假逾時在這些路由上。通過提供者基礎 URL(例如 `ANTHROPIC_BEDROCK_BASE_URL`)到達的閘道不被位元組監視程式包裝;請參閱[串流空閒監視程式](/docs/zh-TW/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-TW/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-TW/amazon-bedrock) 上,包括 [Mantle 端點](/docs/zh-TW/amazon-bedrock#use-the-mantle-endpoint),當您的 AWS 帳戶無法叫用訊息中名稱的模型時,它也會出現,該故障在每次重試時重複,直到您的帳戶被授予存取該模型的權限。557當沒有類別符合時,訊息出現時括號中沒有類別;多個故障會產生該形式。在 [Amazon Bedrock](/docs/zh-TW/amazon-bedrock) 上,包括 [Mantle 端點](/docs/zh-TW/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這是權利檢查,而非配額耗盡。即使您的工作階段和每週額度有剩餘容量,它也會觸發。請參閱[擴展上下文](/docs/zh-TW/model-config#extended-context)以了解哪些方案直接包括 1M 上下文,哪些需要使用額度。Claude Code 在您使用 `/model` 選擇模型時執行此檢查,且僅在直接連接到 Anthropic API 時執行;如果您將 `ANTHROPIC_BASE_URL` 指向[LLM 閘道](/docs/zh-TW/llm-gateway),`/model` 允許 `[1m]` 選擇,閘道決定請求是否成功。711在 Claude 桌面應用程式執行的工作階段中,提示不會命名任何命令:它指向 claude.ai 使用量設定頁面,或在 Team 和 Enterprise 方案上說在 claude.ai/admin-settings/usage 開啟使用額度,或要求您的管理員。
712
713這是權利檢查,而非配額耗盡。即使您的工作階段和每週額度有剩餘容量,它也會觸發。請參閱[擴展上下文](/docs/zh-TW/model-config#extended-context)以了解哪些方案直接包括 1M 上下文,哪些需要使用額度。
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-TW/authentication#authentication-precedence)。1039環境變數和 `apiKeyHelper` 優先於 `/login`,因此在任一個仍在提供金鑰時單獨執行 `/login` 沒有幫助。請參閱[驗證優先順序](/docs/zh-TW/authentication#authentication-precedence)。
991 1040
992**該怎麼做:**1041**該怎麼做:**
1151**該怎麼做:**1200**該怎麼做:**
1152 1201
1153* 執行 `/login` 以再次登入1202* 執行 `/login` 以再次登入
1154* 如果在重新驗證後同一工作階段內錯誤返回,請先執行 `/logout` 以完全清除已儲存的權杖,然後執行 `/login`
1155* 如果您使用 `CLAUDE_CODE_OAUTH_TOKEN` 環境變數進行驗證,Claude Code 會在請求失敗並顯示 401 後繼續傳送您設定的值,而不是切換到已儲存登入的權杖。[`/status`](/docs/zh-TW/commands) 將此認證資格顯示為讀取 `CLAUDE_CODE_OAUTH_TOKEN` 的 `Auth token` 列。使用 [`claude setup-token`](/docs/zh-TW/authentication#generate-a-long-lived-token) 產生新的權杖並使用它重新啟動,或取消設定變數並執行 `/login`。在 v2.1.225 之前,Claude Code 可以在工作階段中期用已儲存登入的短期存取權杖替換變數的值,一旦該權杖過期,工作階段就會再次失敗,並顯示 401 錯誤。1203* 如果您使用 `CLAUDE_CODE_OAUTH_TOKEN` 環境變數進行驗證,Claude Code 會在請求失敗並顯示 401 後繼續傳送您設定的值,而不是切換到已儲存登入的權杖。[`/status`](/docs/zh-TW/commands) 將此認證資格顯示為讀取 `CLAUDE_CODE_OAUTH_TOKEN` 的 `Auth token` 列。使用 [`claude setup-token`](/docs/zh-TW/authentication#generate-a-long-lived-token) 產生新的權杖並使用它重新啟動,或取消設定變數並執行 `/login`。在 v2.1.225 之前,Claude Code 可以在工作階段中期用已儲存登入的短期存取權杖替換變數的值,一旦該權杖過期,工作階段就會再次失敗,並顯示 401 錯誤。
1156* 對於跨啟動的重複登入提示,請參閱[疑難排解](/docs/zh-TW/troubleshoot-install#not-logged-in-or-token-expired)中的系統時鐘檢查和 macOS 認證儲存復原步驟1204* 對於跨啟動的重複登入提示,請參閱[疑難排解](/docs/zh-TW/troubleshoot-install#not-logged-in-or-token-expired)中的系統時鐘檢查和 macOS 認證儲存復原步驟
1157* 對於其他失敗,包括 `403 Forbidden` 和 OAuth 瀏覽器問題,請參閱[登入和驗證](/docs/zh-TW/troubleshoot-install#login-and-authentication)1205* 對於其他失敗,包括 `403 Forbidden` 和 OAuth 瀏覽器問題,請參閱[登入和驗證](/docs/zh-TW/troubleshoot-install#login-and-authentication)
1203* 在非互動式模式中,在相同環境中執行 `claude`,完成 `/login`,然後重新執行您的命令。對於無法以互動方式登入的自動化,使用 `ANTHROPIC_API_KEY` 或[使用 `claude setup-token` 產生長期權杖](/docs/zh-TW/authentication#generate-a-long-lived-token)進行驗證。1251* 在非互動式模式中,在相同環境中執行 `claude`,完成 `/login`,然後重新執行您的命令。對於無法以互動方式登入的自動化,使用 `ANTHROPIC_API_KEY` 或[使用 `claude setup-token` 產生長期權杖](/docs/zh-TW/authentication#generate-a-long-lived-token)進行驗證。
1204* 如果登入持續失敗,請參閱[登入和驗證](/docs/zh-TW/troubleshoot-install#login-and-authentication)1252* 如果登入持續失敗,請參閱[登入和驗證](/docs/zh-TW/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-TW/headless)(`-p`) 和 [Agent SDK](/docs/zh-TW/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-TW/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-TW/troubleshoot-install#not-logged-in-or-token-expired)以取得鑰匙圈解鎖命令和其他認證資格儲存復原步驟
1296
1297<h3 id="failed-to-start-oauth-callback-server">
1298 無法啟動 OAuth 回呼伺服器
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 loopback 位址 `127.0.0.1` 上監聽的嘗試完全失敗。因為失敗發生在登入 URL 存在之前,`Paste code here if prompted` 流程不可用作為解決方法。
1308
1309**該怎麼做:**
1310
1311* 若要立即登入而無需本機監聽器:如果您使用 claude.ai 訂閱,請在登入有效的機器上執行 [`claude setup-token`](/docs/zh-TW/authentication#generate-a-long-lived-token),並將其列印的權杖設定為此機器上的 `CLAUDE_CODE_OAUTH_TOKEN`。否則將 `ANTHROPIC_API_KEY` 設定為 [Claude Console](https://platform.claude.com/settings/keys) 中的金鑰。[驗證優先順序](/docs/zh-TW/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 登入未被接受
1208</h3>1316</h3>
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-TW/mcp#use-mcp-servers-from-claude-ai)請求失敗,因為 claude.ai 拒絕了來自您的 Claude Code 登入的權杖,通常是已過期且無法更新的登入。被拒絕的權杖是您的登入,而不是連接器在 claude.ai 中的自身授權,因此再次授權連接器不會解決它。在 `/mcp` 中,連接器顯示為 `connected · session token rejected`,其詳細資訊檢視讀作:1441[claude.ai 連接器](/docs/zh-TW/mcp#use-mcp-servers-from-claude-ai)請求失敗,因為 claude.ai 拒絕了來自您的 Claude Code 登入的權杖。被拒絕的權杖是您的登入,而不是連接器在 claude.ai 中的自身授權,因此再次授權連接器不會解決它。在 `/mcp` 中,連接器顯示為 `connected · 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 認證資格,以防過期的認證資格是原因:執行訊息中命名的命令(如果設定了一個),或自己重新整理您的 SSO 登入、存取金鑰、API 金鑰或代理權杖1564* 重新整理您的 AWS 認證資格,以防過期的認證資格是原因:執行訊息中命名的命令(如果設定了一個),或自己重新整理您的 SSO 登入、存取金鑰、API 金鑰或代理權杖
1457* 如果您的認證資格是最新的,請確認 [IAM 設定](/docs/zh-TW/amazon-bedrock#iam-configuration)中的 IAM 權限已附加到您使用的身份,且所選模型已為您的帳戶和區域啟用1565* 如果您的認證資格是最新的,請確認 [IAM 設定](/docs/zh-TW/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">
1569 Google Cloud 認證資格已過期或無效
1570</h3>
1571
1572您的 [Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) Google Cloud 認證資格已過期或被拒絕:請求傳回 401,這是 Agent Platform 報告認證資格過期的方式。
1573
1574中間的動作提示會根據您的設定而異。穩定的部分是前導 `Google Cloud credentials expired or invalid`:
1575
1576```text theme={null}
1577Google Cloud credentials expired or invalid · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · API Error: 401 ...
1578```
1579
1580**該怎麼做:**
1581
1582* 如果提示說認證資格由此環境管理,啟動 Claude Code 的應用程式擁有認證資格,此處的其他步驟不適用:重試,或聯絡您的管理員
1583* 如果您使用應用程式預設認證資格進行驗證,請執行訊息中命名的 [`gcpAuthRefresh`](/docs/zh-TW/google-vertex-ai#advanced-credential-configuration) 命令或 `gcloud auth application-default login`,並完成登入,然後重試
1584* 如果您透過設定 `CLAUDE_CODE_SKIP_VERTEX_AUTH` 的 [LLM 閘道](/docs/zh-TW/llm-gateway)路由,請重新整理 `ANTHROPIC_AUTH_TOKEN` 或 `ANTHROPIC_CUSTOM_HEADERS` 中的閘道權杖,然後重試
1585* 如果您使用服務帳戶金鑰檔案進行驗證,請確認 `GOOGLE_APPLICATION_CREDENTIALS` 指向有效的金鑰。請參閱[設定 GCP 認證資格](/docs/zh-TW/google-vertex-ai#3-configure-gcp-credentials)
1586* 如果重新整理後錯誤重複,請在相同 shell 中使用 `gcloud auth application-default print-access-token` 確認身份在 Claude Code 外有效
1587
1588在 v2.1.273 之前,來自 Agent Platform 的 401 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,無法重新整理 Google Cloud 認證資格。
1589
1590<h3 id="google-cloud-authentication-failed">
1591 Google Cloud 驗證失敗
1592</h3>
1593
1594[Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) 傳回 403,它用於授權拒絕而不是過期的認證資格。通常您驗證的身份缺少 IAM 權限,或該模型未為您的專案啟用。
1595
1596中間的動作提示會根據您的設定而異。穩定的部分是前導 `Google Cloud authentication failed`:
1597
1598```text theme={null}
1599Google Cloud authentication failed · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · if credentials are current, check GCP IAM permissions and Vertex AI model access · API Error: 403 ...
1600```
1601
1602**該怎麼做:**
1603
1604* 如果提示說認證資格由此環境管理,啟動 Claude Code 的應用程式擁有認證資格,此處的其他步驟不適用:重試,或聯絡您的管理員
1605* 確認 [IAM 設定](/docs/zh-TW/google-vertex-ai#iam-configuration)中的角色已授予您驗證的身份
1606* 確認該模型已為您的專案啟用。請參閱[要求模型存取](/docs/zh-TW/google-vertex-ai#2-request-model-access)
1607
1608在 v2.1.273 之前,來自 Agent Platform 的 403 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,無法重新整理 Google Cloud 認證資格。
1609
1610<h3 id="microsoft-foundry-authentication-failed">
1611 Microsoft Foundry 驗證失敗
1612</h3>
1613
1614[Microsoft Foundry](/docs/zh-TW/microsoft-foundry) 傳回 401 或 403:請求上的 Azure 認證資格被拒絕,或其背後的身份沒有存取 Foundry 資源的權限。`/login` 無法鑄造 Azure 認證資格。中間的動作提示會根據您的設定而異。穩定的部分是前導 `Microsoft Foundry authentication failed`:
1615
1616```text theme={null}
1617Microsoft Foundry authentication failed · refresh your Foundry credential (ANTHROPIC_FOUNDRY_AUTH_TOKEN, ANTHROPIC_FOUNDRY_API_KEY, Azure sign-in for Entra, or your proxy token) and retry · if credentials are current, check access to the Foundry resource · API Error: 401 ...
1618```
1619
1620**該怎麼做:**
1621
1622* 如果提示說認證資格由此環境管理,啟動 Claude Code 的應用程式擁有認證資格,此處的其他步驟不適用:重試,或聯絡您的管理員
1623* 重新整理您在[設定 Azure 認證資格](/docs/zh-TW/microsoft-foundry#2-configure-azure-credentials)中設定的認證資格:輪換 `ANTHROPIC_FOUNDRY_API_KEY`、鑄造新的 `ANTHROPIC_FOUNDRY_AUTH_TOKEN`,或執行 `az login` 以便預設 Microsoft Entra 認證資格鏈可以再次登入
1624* 如果認證資格是最新的,請確認身份有權存取 Foundry 資源。請參閱 [Azure RBAC 設定](/docs/zh-TW/microsoft-foundry#azure-rbac-configuration)
1625
1626在 v2.1.273 之前,來自 Microsoft Foundry 的 401 或 403 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,無法重新整理 Azure 認證資格。
1627
1628<h3 id="could-not-load-aws-or-google-cloud-credentials">
1461 無法載入 AWS 或 Google Cloud 認證資格1629 無法載入 AWS 或 Google Cloud 認證資格
1462</h3>1630</h3>
1463 1631
1475* 執行您的提供者的登入命令,例如 `aws sso login --profile myprofile` 或 `gcloud auth application-default login`,然後重試。[Bedrock、Agent Platform 或 Foundry 認證資格未載入](/docs/zh-TW/troubleshoot-install#bedrock-agent-platform-or-foundry-credentials-not-loading)顯示如何在 Claude Code 外確認認證資格1643* 執行您的提供者的登入命令,例如 `aws sso login --profile myprofile` 或 `gcloud auth application-default login`,然後重試。[Bedrock、Agent Platform 或 Foundry 認證資格未載入](/docs/zh-TW/troubleshoot-install#bedrock-agent-platform-or-foundry-credentials-not-loading)顯示如何在 Claude Code 外確認認證資格
1476* 如果詳細資訊讀作 `AWS default-chain credential resolve timed out`,鏈掛起而不是失敗,因此改為遵循 [AWS default-chain credential resolve timed out](#aws-default-chain-credential-resolve-timed-out)1644* 如果詳細資訊讀作 `AWS default-chain credential resolve timed out`,鏈掛起而不是失敗,因此改為遵循 [AWS default-chain credential resolve timed out](#aws-default-chain-credential-resolve-timed-out)
1477 1645
1478<h3 id="google-cloud-authentication-failed">1646<h3 id="aws-default-chain-credential-resolve-timed-out">
1479 AWS default-chain credential resolve 逾時1647 AWS default-chain credential resolve 逾時
1480</h3>1648</h3>
1481 1649
1485API Error: Could not load AWS credentials · AWS default-chain credential resolve timed out. Check or refresh your AWS credentials and try again.1653API Error: Could not load AWS credentials · AWS default-chain credential resolve timed out. Check or refresh your AWS credentials and try again.
1486```1654```
1487 1655
1488常見原因是您的 AWS 設定檔中的 `credential_process` 命令等待它無法接收的輸入,以及其執行個體中繼資料服務 (IMDS) 永遠不會回答鏈探測的容器或 VM。1656常見原因是停滯對 AWS 的請求的網路或代理,包括 SSO 權杖重新整理,以及其執行個體中繼資料服務 (IMDS) 永遠不會回答鏈探測的容器或 VM。
1489 1657
1490在 v2.1.267 之前,訊息讀作 `API Error: AWS default-chain credential resolve timed out`。1658在 v2.1.267 之前,訊息讀作 `API Error: AWS default-chain credential resolve timed out`。
1491在 v2.1.207 之前,停滯的鏈使請求無限期等待,而不是失敗。1659在 v2.1.207 之前,停滯的鏈使請求無限期等待,而不是失敗。
1496* 在啟動 Claude Code 之前完成登入步驟,例如 `aws sso login --profile myprofile`,以便鏈從本機 SSO 快取解析,而不是等待瀏覽器流程1664* 在啟動 Claude Code 之前完成登入步驟,例如 `aws sso login --profile myprofile`,以便鏈從本機 SSO 快取解析,而不是等待瀏覽器流程
1497* 如果您的鏈執行合法需要超過 60 秒的互動式登入,例如透過 `aws-vault` 等包裝程式的 SSO 與 MFA,請使用 [`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](/docs/zh-TW/env-vars) 以毫秒為單位提高限制1665* 如果您的鏈執行合法需要超過 60 秒的互動式登入,例如透過 `aws-vault` 等包裝程式的 SSO 與 MFA,請使用 [`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](/docs/zh-TW/env-vars) 以毫秒為單位提高限制
1498 1666
1499<h3 id="microsoft-foundry-authentication-failed">1667<h3 id="bedrock-setup-verification-timed-out-waiting-for-aws">
1500 Bedrock 設定驗證逾時等待 AWS1668 Bedrock 設定驗證逾時等待 AWS
1501</h3>1669</h3>
1502 1670
1524* 在開啟精靈之前完成任何互動式登入,例如 `aws sso login --profile myprofile`1692* 在開啟精靈之前完成任何互動式登入,例如 `aws sso login --profile myprofile`
1525* 如果您的 AWS 設定檔中的認證資格協助程式合法需要超過 60 秒來提示您,請使用 [`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](/docs/zh-TW/env-vars) 以毫秒為單位提高限制1693* 如果您的 AWS 設定檔中的認證資格協助程式合法需要超過 60 秒來提示您,請使用 [`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](/docs/zh-TW/env-vars) 以毫秒為單位提高限制
1526 1694
1527<h3 id="could-not-load-aws-or-google-cloud-credentials">1695<h3 id="cloud-gateway-session-expired">
1528 雲端閘道工作階段已過期1696 雲端閘道工作階段已過期
1529</h3>1697</h3>
1530 1698
1547* 在工作階段中執行 `/login` 並完成瀏覽器登入1715* 在工作階段中執行 `/login` 並完成瀏覽器登入
1548* 對於非互動式啟動,在相同環境中啟動 `claude`,執行 `/login`,然後重新執行您的命令1716* 對於非互動式啟動,在相同環境中啟動 `claude`,執行 `/login`,然後重新執行您的命令
1549 1717
1550<h3 id="aws-default-chain-credential-resolve-timed-out">1718<h3 id="sign-in-timed-out-while-waiting-for-you-to-continue">
1551 登入逾時,等待您繼續1719 登入逾時,等待您繼續
1552</h3>1720</h3>
1553 1721
1561 1729
1562* 執行 `/login` 並在登入過期之前確認帳戶1730* 執行 `/login` 並在登入過期之前確認帳戶
1563 1731
1564<h3 id="bedrock-setup-verification-timed-out-waiting-for-aws">1732<h3 id="gateway-refused-the-request">
1565 閘道拒絕了請求1733 閘道拒絕了請求
1566</h3>1734</h3>
1567 1735
1578 1746
1579在 v2.1.273 之前,閘道工作階段上的 403 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,再次登入不會清除拒絕。1747在 v2.1.273 之前,閘道工作階段上的 403 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,再次登入不會清除拒絕。
1580 1748
1581<h3 id="cloud-gateway-session-expired">
1582 Google Cloud 認證資格已過期或無效
1583</h3>
1584
1585您的 [Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) Google Cloud 認證資格已過期或被拒絕:請求傳回 401,這是 Agent Platform 報告認證資格過期的方式。
1586
1587中間的動作提示會根據您的設定而異。穩定的部分是前導 `Google Cloud credentials expired or invalid`:
1588
1589```text theme={null}
1590Google Cloud credentials expired or invalid · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · API Error: 401 ...
1591```
1592
1593**該怎麼做:**
1594
1595* 如果提示說認證資格由此環境管理,啟動 Claude Code 的應用程式擁有認證資格,此處的其他步驟不適用:重試,或聯絡您的管理員
1596* 如果您使用應用程式預設認證資格進行驗證,請執行訊息中命名的 [`gcpAuthRefresh`](/docs/zh-TW/google-vertex-ai#advanced-credential-configuration) 命令或 `gcloud auth application-default login`,並完成登入,然後重試
1597* 如果您透過設定 `CLAUDE_CODE_SKIP_VERTEX_AUTH` 的 [LLM 閘道](/docs/zh-TW/llm-gateway)路由,請重新整理 `ANTHROPIC_AUTH_TOKEN` 或 `ANTHROPIC_CUSTOM_HEADERS` 中的閘道權杖,然後重試
1598* 如果您使用服務帳戶金鑰檔案進行驗證,請確認 `GOOGLE_APPLICATION_CREDENTIALS` 指向有效的金鑰。請參閱[設定 GCP 認證資格](/docs/zh-TW/google-vertex-ai#3-configure-gcp-credentials)
1599* 如果重新整理後錯誤重複,請在相同 shell 中使用 `gcloud auth application-default print-access-token` 確認身份在 Claude Code 外有效
1600
1601在 v2.1.273 之前,來自 Agent Platform 的 401 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,無法重新整理 Google Cloud 認證資格。
1602
1603<h3 id="sign-in-timed-out-while-waiting-for-you-to-continue">
1604 Google Cloud 驗證失敗
1605</h3>
1606
1607[Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) 傳回 403,它用於授權拒絕而不是過期的認證資格。通常您驗證的身份缺少 IAM 權限,或該模型未為您的專案啟用。
1608
1609中間的動作提示會根據您的設定而異。穩定的部分是前導 `Google Cloud authentication failed`:
1610
1611```text theme={null}
1612Google Cloud authentication failed · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · if credentials are current, check GCP IAM permissions and Vertex AI model access · API Error: 403 ...
1613```
1614
1615**該怎麼做:**
1616
1617* 如果提示說認證資格由此環境管理,啟動 Claude Code 的應用程式擁有認證資格,此處的其他步驟不適用:重試,或聯絡您的管理員
1618* 確認 [IAM 設定](/docs/zh-TW/google-vertex-ai#iam-configuration)中的角色已授予您驗證的身份
1619* 確認該模型已為您的專案啟用。請參閱[要求模型存取](/docs/zh-TW/google-vertex-ai#2-request-model-access)
1620
1621在 v2.1.273 之前,來自 Agent Platform 的 403 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,無法重新整理 Google Cloud 認證資格。
1622
1623<h3 id="gateway-refused-the-request">
1624 Microsoft Foundry 驗證失敗
1625</h3>
1626
1627[Microsoft Foundry](/docs/zh-TW/microsoft-foundry) 傳回 401 或 403:請求上的 Azure 認證資格被拒絕,或其背後的身份沒有存取 Foundry 資源的權限。`/login` 無法鑄造 Azure 認證資格。中間的動作提示會根據您的設定而異。穩定的部分是前導 `Microsoft Foundry authentication failed`:
1628
1629```text theme={null}
1630Microsoft Foundry authentication failed · refresh your Foundry credential (ANTHROPIC_FOUNDRY_AUTH_TOKEN, ANTHROPIC_FOUNDRY_API_KEY, Azure sign-in for Entra, or your proxy token) and retry · if credentials are current, check access to the Foundry resource · API Error: 401 ...
1631```
1632
1633**該怎麼做:**
1634
1635* 如果提示說認證資格由此環境管理,啟動 Claude Code 的應用程式擁有認證資格,此處的其他步驟不適用:重試,或聯絡您的管理員
1636* 重新整理您在[設定 Azure 認證資格](/docs/zh-TW/microsoft-foundry#2-configure-azure-credentials)中設定的認證資格:輪換 `ANTHROPIC_FOUNDRY_API_KEY`、鑄造新的 `ANTHROPIC_FOUNDRY_AUTH_TOKEN`,或執行 `az login` 以便預設 Microsoft Entra 認證資格鏈可以再次登入
1637* 如果認證資格是最新的,請確認身份有權存取 Foundry 資源。請參閱 [Azure RBAC 設定](/docs/zh-TW/microsoft-foundry#azure-rbac-configuration)
1638
1639在 v2.1.273 之前,來自 Microsoft Foundry 的 401 或 403 顯示通用 `Please run /login` 或 `Failed to authenticate` 訊息,無法重新整理 Azure 認證資格。
1640
1641<h2 id="network-and-connection-errors">1749<h2 id="network-and-connection-errors">
1642 網路和連線錯誤1750 網路和連線錯誤
1643</h2>1751</h2>
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-TW/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-TW/network-config)。1811* 如果訊息命名代理變數,檢查其值是否指向正確的代理,並要求您的網路團隊允許通過它到訊息中主機的 HTTPS 連線。請參閱[網路設定](/docs/zh-TW/network-config)。
1704* 完成[無法連線到 API](#unable-to-connect-to-api) 中的檢查。那裡的 `curl` 測試和防火牆指導也適用於此檢查。1812* 完成[無法連線到 API](#unable-to-connect-to-api) 中的檢查。那裡的 `curl` 測試和防火牆指導也適用於此檢查。
1705* 如果您的組織通過[雲端閘道](/docs/zh-TW/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-TW/llm-gateway-connect#troubleshoot-gateway-errors)路由,使用直接請求測試路由,並修復返回非 API 回應的跳躍1852* 如果您通過[LLM 閘道](/docs/zh-TW/llm-gateway-connect#troubleshoot-gateway-errors)路由,使用直接請求測試路由,並修復返回非 API 回應的跳躍
1746* 在具有登入頁面的網路上(例如訪客 Wi-Fi),在瀏覽器中完成登入,然後重試1853* 在具有登入頁面的網路上(例如訪客 Wi-Fi),在瀏覽器中完成登入,然後重試
1747* 如果只有通過您的閘道的非串流路由損壞,設定 [`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1`](/docs/zh-TW/env-vars#variables),以便在串流中途失敗的請求進入正常重試路徑而不是此回退,除非串流端點本身傳回 `404`,Claude Code 仍然會回退1854* 如果只有通過您的閘道的非串流路由損壞,設定 [`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1`](/docs/zh-TW/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-TW/remote-control#troubleshooting)2005* 對於其他 Remote Control 啟動訊息,請參閱[Remote Control 疑難排解](/docs/zh-TW/remote-control#troubleshooting)
1899 2006
1900如果伺服器改為報告前一個工作階段已消失,您不會看到此訊息。Claude Code 會在其位置啟動新工作階段或顯示 [`Previous session is unavailable — run /remote-control to start a new one`](/docs/zh-TW/remote-control#previous-session-is-unavailable),取決於[對話的重新連線記錄](/docs/zh-TW/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-TW/remote-control#reconnect-history)。2007如果伺服器改為報告前一個工作階段已消失,您不會看到此訊息。Claude Code 會在其位置啟動新工作階段或顯示 [`Previous session is unavailable — run /remote-control to start a new one`](/docs/zh-TW/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-TW/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-TW/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>
1953Context limit reached · /compact or /clear to continue2085Context limit reached · /compact or /clear to continue
1954```2086```
1955 2087
1956當設定了 [`DISABLE_COMPACT`](/docs/zh-TW/env-vars) 時,該行僅命名 `/clear`。較長形式的錯誤,例如下面的壓縮失敗形式,保留 `Prompt is too long ·` 的措辭。在 `-p` 輸出和文字記錄中,文字保持為 `Prompt is too long`。2088當設定了 [`DISABLE_COMPACT`](/docs/zh-TW/env-vars) 時,該行僅命名 `/clear`。較長形式的錯誤(例如下面的壓縮失敗形式)保留 `Prompt is too long ·` 的措辭。在 `-p` 輸出和文字記錄中,文字保持為 `Prompt is too long`。
1957 2089
1958當您在 [使用者設定](/docs/zh-TW/settings-reference#autocompactenabled) 中關閉自動壓縮時,該行也會說明這一點:2090當您在[使用者設定](/docs/zh-TW/settings-reference#autocompactenabled)中關閉自動壓縮時,該行也會說明這一點:
1959 2091
1960```text theme={null}2092```text theme={null}
1961Context limit reached · /compact or /clear to continue · auto-compact is off · /config to turn it on2093Context limit reached · /compact or /clear to continue · auto-compact is off · /config to turn it on
1962```2094```
1963 2095
1964`/config` 中的 **Auto-compact** 切換會將 `autoCompactEnabled` 寫入使用者設定。該提示僅在 `/config` 變更會生效時出現。例如,當 [`DISABLE_AUTO_COMPACT`](/docs/zh-TW/env-vars) 或 [`DISABLE_COMPACT`](/docs/zh-TW/env-vars) 關閉自動壓縮時,它不會出現。當更高優先級的範圍(例如專案或受管設定)將 `autoCompactEnabled` 設定為 `false` 時,它也不會出現。在 v2.1.235 之前,該行不包含自動壓縮提示。2096`/config` 中的**自動壓縮**切換會將 `autoCompactEnabled` 寫入使用者設定。該提示僅在 `/config` 變更會生效時出現。例如,當 [`DISABLE_AUTO_COMPACT`](/docs/zh-TW/env-vars) 或 [`DISABLE_COMPACT`](/docs/zh-TW/env-vars) 關閉自動壓縮時,它不會出現。當更高優先級的範圍(例如專案或受管設定)將 `autoCompactEnabled` 設定為 `false` 時,它也不會出現。在 v2.1.235 之前,該行沒有自動壓縮提示。
1965 2097
1966Amazon Bedrock 將此狀況報告為 `Input is too long for requested model.`,Claude Code 以相同方式處理。在 v2.1.217 之前,Claude Code 沒有識別 Bedrock 的措辭,因此自動壓縮從未在其上觸發,`/compact` 失敗並出現相同錯誤。2098Amazon Bedrock 將此狀況報告為 `Input is too long for requested model.`,Claude Code 以相同方式處理。在 v2.1.217 之前,Claude Code 沒有識別 Bedrock 的措辭,因此自動壓縮從未在其上觸發,`/compact` 失敗並出現相同錯誤。
1967 2099
1968[Claude apps gateway](/docs/zh-TW/claude-apps-gateway-config#upstream-error-messages) 在雲端上游以提供者自己的錯誤形狀拒絕請求時,將此狀況報告為 `capability_rejected: prompt_too_long`。Claude Code 將該令牌視為與 `Prompt is too long` 相同。在 v2.1.228 之前,Claude Code 沒有識別該令牌,因此自動壓縮沒有在其上觸發。2100[Claude 應用程式閘道](/docs/zh-TW/claude-apps-gateway-config#upstream-error-messages)在雲端上游以提供者自己的錯誤形狀拒絕請求時,將此狀況報告為 `capability_rejected: prompt_too_long`。Claude Code 將該令牌視為與 `Prompt is too long` 相同。在 v2.1.228 之前,Claude Code 沒有識別該令牌,因此自動壓縮沒有在其上觸發。
1969 2101
1970當自動壓縮在此輪上執行並在基礎錯誤(例如不可用的模型或驗證失敗)上失敗時,該訊息在分隔符後命名該錯誤:2102當自動壓縮在此輪上執行並因基礎錯誤(例如不可用的模型或驗證失敗)而失敗時,該訊息在分隔符後命名該錯誤:
1971 2103
1972```text theme={null}2104```text theme={null}
1973Prompt is too long · automatic compaction failed: <the underlying error>2105Prompt is too long · automatic compaction failed: <the underlying error>
1974```2106```
1975 2107
1976首先解決命名的錯誤;在您這樣做之前,`/compact` 會在相同錯誤上失敗。在 v2.1.229 之前,失敗的自動壓縮會顯示 `Prompt is too long` 而不顯示原因。2108首先解決命名的錯誤;在您這樣做之前,`/compact` 會因相同錯誤而失敗。在 v2.1.229 之前,失敗的自動壓縮會顯示 `Prompt is too long` 而不顯示原因。
1977 2109
1978當自動壓縮在此錯誤上執行時,它通常會總結您最舊的交換並保留最新的。作為最後手段,Claude Code 會以不同方式進行總結:2110當自動壓縮在此錯誤上執行時,它通常會總結您最舊的交換並保留最新的。作為最後手段,Claude Code 會以不同方式進行總結:
1979 2111
1980* 當它無法總結任何完整交換時,Claude Code 會逐字保留您最新的提示,並總結其前面的所有內容。2112* 當它無法總結任何完整交換時,Claude Code 會逐字保留您最新的提示,並總結其前面的所有內容。
1981* 在這種情況下,當對話不以您的提示結尾時,Claude Code 會改為總結整個對話。2113* 在這種情況下,當對話不以您的提示結尾時,Claude Code 會改為總結整個對話。
1982 2114
1983Claude Code 在它會轉發的內容不包含模型回覆且您自己的文字少於約 1,000 個令牌(例如在超大貼上後發送的短重試)時跳過此恢復。執行 `/clear` 以重新開始。在 v2.1.269 之前,每當壓縮無法總結完整交換時就會失敗,因此處於該狀態的工作階段在每輪上都會再次遇到此錯誤。2115當它要轉發的內容不包含模型回覆且您自己的文字少於約 1,000 個令牌(例如在超大貼上後發送的簡短重試)時,Claude Code 會跳過此恢復。執行 `/clear` 以重新開始。在 v2.1.269 之前,每當壓縮無法總結完整交換時,壓縮就會失敗,因此處於該狀態的工作階段在每一輪都會再次遇到此錯誤。
1984 2116
1985單一交換對話沒有較早的輪次可以總結。當自動壓縮會在其上執行時,Claude Code 會跳過嘗試並解釋填充請求的內容。當 API 在其錯誤中不報告令牌計數時,訊息讀取:2117單一交換對話沒有更早的輪次可以總結。當自動壓縮會在其上執行時,Claude Code 會跳過嘗試並解釋請求中填充的內容。當 API 在其錯誤中不報告令牌計數時,訊息讀取為:
1986 2118
1987```text theme={null}2119```text theme={null}
1988Prompt is too long · this conversation is a single exchange and cannot be compacted — the request size comes mostly from system prompt, tool definitions, or attachments.2120Prompt is too long · this conversation is a single exchange and cannot be compacted — the request size comes mostly from system prompt, tool definitions, or attachments.
1989```2121```
1990 2122
1991當 API 在其錯誤中報告令牌計數時,Claude Code 將其與自己對對話大小的估計進行比較,以判斷請求的大部分是什麼:對話自己的內容,或 Claude Code 與其一起發送的系統提示、工具定義和附加內容。當對話自己的內容是請求的大部分時,訊息讀取:2123當 API 在其錯誤中報告令牌計數時,Claude Code 會將其與自己對對話大小的估計進行比較,以判斷請求的大部分是什麼:對話自己的內容,或 Claude Code 與其一起發送的系統提示、工具定義和附加內容。當對話自己的內容是請求的大部分時,訊息讀取為:
1992 2124
1993```text theme={null}2125```text theme={null}
1994Prompt is too long · the request is ~<request tokens> tokens (limit <limit>) and this conversation's own content is most of it. A single-exchange conversation cannot be compacted; start with less content (smaller files or pasted text).2126Prompt is too long · the request is ~<request tokens> tokens (limit <limit>) and this conversation's own content is most of it. A single-exchange conversation cannot be compacted; start with less content (smaller files or pasted text).
1995```2127```
1996 2128
1997當請求的大部分在對話之外時,訊息讀取:2129當請求的大部分在對話之外時,訊息讀取為:
1998 2130
1999```text theme={null}2131```text theme={null}
2000Prompt is too long · the request is ~<request tokens> tokens (limit <limit>) but this conversation is only ~<conversation tokens> tokens — the rest is system prompt, tool definitions, and attachment content. A single-exchange conversation cannot be compacted; reduce attached files/tools or start with less context.2132Prompt is too long · the request is ~<request tokens> tokens (limit <limit>) but this conversation is only ~<conversation tokens> tokens — the rest is system prompt, tool definitions, and attachment content. A single-exchange conversation cannot be compacted; reduce attached files/tools or start with less context.
2001```2133```
2002 2134
2003在 v2.1.162 之前,Claude Code 嘗試了壓縮,並在失敗時顯示裸露的 `Prompt is too long`。2135在 v2.1.162 之前,Claude Code 無論如何都嘗試壓縮,並在失敗時顯示裸露的 `Prompt is too long`。
2004 2136
2005**該怎麼辦:**2137**該怎麼辦:**
2006 2138
2007* 執行 `/compact` 以總結較早的輪次並釋放空間,或執行 `/clear` 以重新開始。如果 `/compact` 回答 `Not enough messages to compact.`,對話是單一交換,沒有較早的內容可以總結,因此空間由該單一提示和 Claude Code 與每個請求一起發送的內容佔用:執行 `/clear` 並使用較少的貼上文字或較小的附加檔案重新發送,或使用下面的步驟減少工具定義和記憶檔案2139* 執行 `/compact` 以總結較早的輪次並釋放空間,或執行 `/clear` 以重新開始。如果 `/compact` 回答 `Not enough messages to compact.`,對話是單一交換,沒有更早的內容可以總結,因此空間由該單一提示和 Claude Code 與每個請求一起發送的內容佔用:執行 `/clear` 並使用較少的貼上文字或較小的附加檔案重新發送,或使用下面的步驟減少工具定義和記憶檔案
2008* 執行 `/context` 以查看視窗消耗內容的分解:系統提示、工具、記憶檔案和訊息2140* 執行 `/context` 以查看視窗中消耗的內容的細目:系統提示、工具、記憶檔案和訊息
2009* 使用 `/mcp disable <name>` 禁用您未使用的 MCP 伺服器,以從上下文中移除其工具定義2141* 使用 `/mcp disable <name>` 禁用您未使用的 MCP 伺服器,以從上下文中移除其工具定義
2010* 修剪大型 `CLAUDE.md` 記憶檔案,或將指示移至 [路徑範圍規則](/docs/zh-TW/memory#path-specific-rules),這些規則僅在相關時載入2142* 修剪大型 `CLAUDE.md` 記憶檔案,或將指示移至[路徑範圍規則](/docs/zh-TW/memory#path-specific-rules),這些規則僅在相關時載入
2011* 子代理繼承父工作階段的每個 MCP 工具定義,這可能在第一輪之前填滿其上下文視窗。在生成子代理之前,禁用您未使用的 MCP 伺服器。
2012* 自動壓縮預設為開啟,通常可防止此錯誤。如果您在 `/config` 中或使用 [`DISABLE_AUTO_COMPACT`](/docs/zh-TW/env-vars) 關閉了它,請將其重新開啟。如果您保持關閉,請在視窗填滿之前自己執行 `/compact`。2143* 自動壓縮預設為開啟,通常可防止此錯誤。如果您在 `/config` 中或使用 [`DISABLE_AUTO_COMPACT`](/docs/zh-TW/env-vars) 關閉了它,請將其重新開啟。如果您保持關閉,請在視窗填滿之前自己執行 `/compact`。
2013 2144
2014請參閱 [探索上下文視窗](/docs/zh-TW/context-window) 以互動方式查看上下文如何填滿。2145請參閱[探索上下文視窗](/docs/zh-TW/context-window)以獲得上下文如何填滿的互動式檢視。
2015 2146
2016<h3 id="context-exceeds-the-token-limit">2147<h3 id="context-exceeds-the-token-limit">
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)而失敗。互動式工作階段將該錯誤顯示為 `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.
2024```2155```
2025 2156
2026當您超過的限制是小於模型上下文視窗的壓縮視窗(例如 1M 上下文模型上的 200K 邊界)時,警告讀取方式不同。壓縮視窗可以位於模型的上下文視窗下方,因此在其之外的請求仍然可以成功。2157當您超過的限制是壓縮視窗(例如 1M 上下文模型上的 200K 邊界)時,警告的讀取方式不同。壓縮視窗可以位於模型的上下文視窗下方,因此超過它的請求仍然可以成功。
2027 2158
2028```text theme={null}2159```text theme={null}
2029Context is 94k tokens past the 200k-token compaction window — run /compact to reduce usage.2160Context is 94k tokens past the 200k-token compaction window — run /compact to reduce usage.
2033 2164
2034**該怎麼辦:**2165**該怎麼辦:**
2035 2166
2036* 在多輪對話中,執行 `/compact` 以總結較早的輪次並釋放空間。若要重新開始,請執行 `/clear`2167* 在多輪對話中,執行 `/compact` 以總結較早的輪次並釋放空間。若要改為重新開始,請執行 `/clear`
2037* 有關減少使用量的更多方式,請參閱 [Prompt is too long](#prompt-is-too-long)2168* 有關減少使用的更多方式,請參閱[提示詞過長](#prompt-is-too-long)
2038
2039在 v2.1.216 之前,`/context` 顯示使用量超過 100%,沒有警告行解釋這意味著什麼或如何恢復。
2040 2169
2041<h3 id="error-during-compaction-conversation-too-long">2170在 v2.1.216 之前,`/context` 顯示超過 100% 的使用情況,沒有警告行解釋這意味著什麼或如何恢復。
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 2171
2060<h3 id="request-too-large">2172<h3 id="request-too-large">
2061 請求過大2173 請求過大
2062</h3>2174</h3>
2063 2175
2064原始請求正文在令牌化之前超過了 API 的 32MB 限制,通常是由於大型貼上內容、工具結果或附加檔案。此限制與 [上下文視窗](#prompt-is-too-long) 分開。2176原始請求正文在令牌化之前超過了 API 的 32MB 限制,通常是因為大型貼上內容、工具結果或附加檔案。此限制與[上下文視窗](#prompt-is-too-long)分開。
2065 2177
2066```text theme={null}2178```text theme={null}
2067Request too large (max 32MB). Accumulated images and attachments in the conversation pushed the request over the limit. Run /compact, or double press esc to go back and remove attachments.2179Request too large (max 32MB). Accumulated images and attachments in the conversation pushed the request over the limit. Run /compact, or double press esc to go back and remove attachments.
2070當請求直接進入 Claude API 且 API 本身拒絕它時,Claude Code 會測量對話並根據恢復是否可行來措辭訊息。通過代理、閘道或雲端提供者,您會收到一般訊息。測量的形式:2182當請求直接進入 Claude API 且 API 本身拒絕它時,Claude Code 會測量對話並根據恢復是否可行來措辭訊息。通過代理、閘道或雲端提供者,您會收到一般訊息。測量的形式:
2071 2183
2072* `Request too large (max 32MB; 20.1MB of about 33.4MB is images or documents).`:影像或文件將請求推過限制。Claude Code 會在去除它們後重試。2184* `Request too large (max 32MB; 20.1MB of about 33.4MB is images or documents).`:影像或文件將請求推過限制。Claude Code 會在去除它們後重試。
2073* `Request too large for the API's 32MB request limit`:訊息本身超過限制,因此訊息說 `compacting cannot make it fit`,Claude Code 不會重試。在 [非互動模式](/docs/zh-TW/headless) 中,訊息告訴您減少輸入或改為開始新工作階段。2185* `Request too large for the API's 32MB request limit`:訊息本身超過限制,因此訊息說 `compacting cannot make it fit`,Claude Code 不會重試。在[非互動模式](/docs/zh-TW/headless)中,訊息告訴您減少輸入或改為開始新工作階段。
2074 2186
2075在 v2.1.212 之前,具有足夠累積影像的對話在每輪上都失敗,出現 `Request too large (max 32MB). Double press esc to go back and try with a smaller file.` 在 v2.1.229 之前,Claude Code 為每次拒絕顯示附加建議,即使壓縮無法幫助。2187在 v2.1.212 之前,具有足夠累積影像的對話在每一輪都因 `Request too large (max 32MB). Double press esc to go back and try with a smaller file.` 而失敗。在 v2.1.229 之前,Claude Code 對每個拒絕都顯示附加建議,即使壓縮無法幫助。
2076 2188
2077**該怎麼辦:**2189**該怎麼辦:**
2078 2190
2079* 如果訊息說 `compacting cannot make it fit`,按 Esc 兩次以回退到添加大型內容的輪次之前,或執行 `/clear` 以重新開始2191* 如果訊息說 `compacting cannot make it fit`,按 Esc 兩次以回到添加大型內容的輪次之前,或執行 `/clear` 以重新開始
2080* 否則,執行 `/compact`,它會刪除累積的影像和附加檔案2192* 否則,執行 `/compact`,它會刪除累積的影像和附加檔案
2081* 按路徑參考大型檔案而不是貼上其內容,以便 Claude 可以分塊讀取它們2193* 按路徑參考大型檔案而不是貼上其內容,以便 Claude 可以分塊讀取它們
2082* 對於影像,請參閱下面的 [Image was too large](#image-was-too-large)2194* 對於影像,請參閱下面的[影像過大](#image-was-too-large)
2083 2195
2084<h3 id="image-was-too-large">2196<h3 id="image-was-too-large">
2085 影像過大2197 影像過大
2092API Error: 400 ... image dimensions exceed max allowed size2204API Error: 400 ... image dimensions exceed max allowed size
2093```2205```
2094 2206
2095Claude Code 用文字佔位符替換無法處理的影像並重試,因此後續訊息成功。在 2.1.142 之前的版本上,貼上的影像可能保留在對話中,並在後續每條訊息上重複相同的錯誤。若要在這些版本上恢復,按 Esc 兩次並回退到添加影像的輪次之前。2207Claude Code 用文字佔位符替換無法處理的影像並重試,因此後續訊息成功。在 2.1.142 之前的版本上,貼上的影像可能保留在對話中,並在後續每條訊息上重複相同的錯誤。若要在這些版本上恢復,按 Esc 兩次並回到添加影像的輪次之前。
2096 2208
2097**該怎麼辦:**2209**該怎麼辦:**
2098 2210
2099* 在貼上之前調整影像大小。API 接受單個影像最長邊最多 8000 像素的影像,或當許多影像在上下文中時為 2000 像素。2211* 在貼上之前調整影像大小。API 接受單個影像最長邊最多 8000 像素的影像,或當許多影像在上下文中時最多 2000 像素。
2100* 拍攝相關區域的更緊密螢幕截圖,而不是整個螢幕2212* 拍攝相關區域的更緊密螢幕截圖,而不是整個螢幕
2101 2213
2102<h3 id="unable-to-resize-image">2214<h3 id="unable-to-resize-image">
2103 無法調整影像大小2215 無法調整影像大小
2104</h3>2216</h3>
2105 2217
2106Claude Code 無法在將附加影像發送到 API 之前對其進行縮小。2218Claude Code 無法在將附加影像發送到 API 之前將其縮小。
2107 2219
2108```text theme={null}2220```text theme={null}
2109Unable to resize image — image processing is unavailable and dimensions could not be read from the file header. Please convert the image to PNG, JPEG, GIF, or WebP.2221Unable to resize image — image processing is unavailable and dimensions could not be read from the file header. Please convert the image to PNG, JPEG, GIF, or WebP.
2115Unable to resize image — its pixels could not be decoded (the file may be damaged, or use an encoding Claude Code cannot read), and it is over the … API limit (… raw, … base64), so it cannot be sent. Re-save it as a PNG or JPEG and try again.2227Unable to resize image — its pixels could not be decoded (the file may be damaged, or use an encoding Claude Code cannot read), and it is over the … API limit (… raw, … base64), so it cannot be sent. Re-save it as a PNG or JPEG and try again.
2116```2228```
2117 2229
2118Claude Code 通常會自動調整大型影像的大小。這些錯誤意味著無法解碼或調整影像大小以適應 API 限制。2230Claude Code 通常會自動調整大型影像的大小。這些錯誤意味著影像無法解碼或調整大小以符合 API 限制。
2119 2231
2120**該怎麼辦:**2232**該怎麼辦:**
2121 2233
2122* 如果訊息要求您轉換影像,請將其轉換為 PNG、JPEG、GIF 或 WebP,然後再次附加。Claude Code 可以從檔案標頭驗證這些格式的尺寸,而無需解碼影像。2234* 如果訊息要求您轉換影像,請將其轉換為 PNG、JPEG、GIF 或 WebP 並再次附加。Claude Code 可以從檔案標頭驗證這些格式的尺寸,而無需解碼影像。
2123* 如果訊息報告尺寸或大小限制,請在附加之前將影像調整大小或重新壓縮到該限制以下。2235* 如果訊息報告尺寸或大小限制,請在附加之前將影像調整大小或重新壓縮到該限制以下。
2124* 如果訊息命名原因,例如 CMYK JPEG、動畫 WebP 或可能損壞的檔案,請以訊息建議的格式重新保存影像並再次附加。2236* 如果訊息命名原因(例如 CMYK JPEG、動畫 WebP 或可能損壞的檔案),請以訊息建議的格式重新保存影像並再次附加。
2125 2237
2126<h3 id="pdf-errors">2238<h3 id="pdf-errors">
2127 PDF 錯誤2239 PDF 錯誤
2128</h3>2240</h3>
2129 2241
2130您附加的 PDF 無法處理。訊息在此處以非互動形式顯示;在互動式工作階段中,它們會提示您按 Esc 兩次並重試。2242您附加的 PDF 無法處理。訊息在此以非互動形式顯示;在互動式工作階段中,它們會提示您按 Esc 兩次並重試。
2131 2243
2132```text theme={null}2244```text theme={null}
2133PDF too large (max 100 pages, 20MB). Try reading the file a different way (e.g., extract text with pdftotext).2245PDF too large (max 100 pages, 20MB). Try reading the file a different way (e.g., extract text with pdftotext).
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-TW/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 會看到它不識別的欄位。
2155 2274
2156**該怎麼辦:**2275**該怎麼辦:**
2157 2276
2158* 配置您的閘道以轉發 `anthropic-beta` 標頭。請參閱 [feature pass-through](/docs/zh-TW/llm-gateway-protocol#feature-pass-through) 以了解閘道必須轉發的內容。2277* 配置您的閘道以轉發 `anthropic-beta` 標頭。請參閱[功能傳遞](/docs/zh-TW/llm-gateway-protocol#feature-pass-through)以了解閘道必須轉發的內容。
2159* 作為備用方案,在啟動前設定 [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`](/docs/zh-TW/env-vars)。[Disable pre-release capabilities](/docs/zh-TW/llm-gateway-protocol#disable-pre-release-capabilities) 涵蓋確切範圍。2278* 作為備用,在啟動前設定 [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`](/docs/zh-TW/env-vars)。[禁用預發行功能](/docs/zh-TW/llm-gateway-protocol#disable-pre-release-capabilities)涵蓋確切範圍。
2160 2279
2161<h3 id="tool-input-schema-is-invalid">2280<h3 id="tool-input-schema-is-invalid">
2162 工具輸入架構無效2281 工具輸入架構無效
2163</h3>2282</h3>
2164 2283
2165請求中的工具聲明了 `input_schema`,該架構未通過 API 的 JSON Schema 驗證,因此 API 拒絕了整個請求。`tools.` 後面的數字是失敗工具在請求的工具清單中的位置,而不是您可以查找的名稱。2284請求中的工具聲明了 `input_schema`,該架構未通過 API 的 JSON Schema 驗證,因此 API 拒絕了整個請求。`tools.` 後面的數字是失敗工具在請求的工具列表中的位置,而不是您可以查找的名稱。
2166 2285
2167```text theme={null}2286```text theme={null}
2168API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid2287API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid
2173 2292
2174Claude Code [在載入伺服器的工具時排除輸入架構會失敗此驗證的 MCP 工具](/docs/zh-TW/mcp#tools-with-invalid-input-schemas),因此請求通常永遠不會包含一個。2293Claude Code [在載入伺服器的工具時排除輸入架構會失敗此驗證的 MCP 工具](/docs/zh-TW/mcp#tools-with-invalid-input-schemas),因此請求通常永遠不會包含一個。
2175 2294
2176在 [標誌擷取關閉的部署](/docs/zh-TW/env-vars#features-that-need-feature-flag-fetching) 上,或在標誌從未到達的機器上,Claude Code 在伺服器的日誌中記錄哪個工具會被拒絕,但仍然發送它,因此此錯誤仍然可能發生。2295在[標誌擷取關閉的部署](/docs/zh-TW/env-vars#features-that-need-feature-flag-fetching)上,或在標誌從未到達的機器上,Claude Code 在伺服器的日誌中記錄哪個工具會被拒絕,但無論如何都會發送它,因此此錯誤仍然可能發生。
2177 2296
2178該錯誤也可能發生在工具的架構在 `$schema` 中聲明 JSON Schema 方言而不是 draft 2020-12 的工具上。Claude Code 不會根據 JSON Schema 元架構檢查這些架構,儘管頂級屬性名稱檢查仍然適用。2297該錯誤也可能發生在工具的架構在 `$schema` 中聲明 JSON Schema 方言而不是 draft 2020-12 的情況下。Claude Code 不會根據 JSON Schema 元架構檢查這些架構,儘管頂級屬性名稱檢查仍然適用。
2179 2298
2180在 v2.1.216 之前,沒有部署執行排除檢查。2299在 v2.1.216 之前,沒有部署執行排除檢查。
2181 2300
2182**該怎麼辦:**2301**該怎麼辦:**
2183 2302
2184* 如果您的 Claude Code 版本早於 v2.1.216,請執行 `claude update`。2303* 如果您的 Claude Code 版本早於 v2.1.216,請執行 `claude update`。
2185* 移除或 [禁用](/docs/zh-TW/mcp#disable-a-server-without-removing-it) 聲明無效架構的 MCP 伺服器。該錯誤僅按位置命名工具。在 v2.1.216 或更新版本上,檢查每個伺服器的日誌以查找命名工具的行,其輸入架構會被拒絕。如果沒有日誌命名一個,請逐個禁用伺服器。2304* 移除或[禁用](/docs/zh-TW/mcp#disable-a-server-without-removing-it)聲明無效架構的 MCP 伺服器。該錯誤僅按位置命名工具。在 v2.1.216 或更高版本上,檢查每個伺服器的日誌以查找命名輸入架構會被拒絕的工具的行。如果沒有日誌命名一個,請一次禁用一個伺服器。
2186* 如果您維護伺服器,請修復工具的 `input_schema`。架構必須是有效的 JSON Schema,頂級屬性名稱必須為 1 到 64 個字元長,並且只能使用 ASCII 字母和數字、`_`、`.` 和 `-`。請參閱 [Tools with invalid input schemas](/docs/zh-TW/mcp#tools-with-invalid-input-schemas)。2305* 如果您維護伺服器,請修復工具的 `input_schema`。架構必須是有效的 JSON Schema,頂級屬性名稱必須是 1 到 64 個字元長,並且只使用 ASCII 字母和數字、`_`、`.` 和 `-`。請參閱[輸入架構無效的工具](/docs/zh-TW/mcp#tools-with-invalid-input-schemas)。
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`,因此此錯誤重複出現,對話被卡住。
2187 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>
2191 2328
2192配置的模型名稱未被識別,或您的帳戶缺乏對其的存取權限。從 v2.1.160 開始,尾部提示(此處以其互動形式顯示)因表面而異。2329配置的模型名稱未被識別,或您的帳戶缺少對其的存取權限。從 v2.1.160 開始,尾部提示(此處以其互動形式顯示)因表面而異。
2193 2330
2194```text theme={null}2331```text theme={null}
2195There's an issue with the selected model (claude-...). It may not exist or you may not have access to it. Run /model to pick a different model.2332There's an issue with the selected model (claude-...). It may not exist or you may not have access to it. Run /model to pick a different model.
2199 2336
2200* **互動式 CLI**:執行 `/model` 以從您帳戶可用的模型中選擇。2337* **互動式 CLI**:執行 `/model` 以從您帳戶可用的模型中選擇。
2201* **非互動模式 (`-p`)**:使用有效的別名或 ID 傳遞 `--model`,或設定 [`ANTHROPIC_MODEL`](/docs/zh-TW/env-vars)。錯誤文字在此表面上顯示 `Run --model`。2338* **非互動模式 (`-p`)**:使用有效的別名或 ID 傳遞 `--model`,或設定 [`ANTHROPIC_MODEL`](/docs/zh-TW/env-vars)。錯誤文字在此表面上顯示 `Run --model`。
2202* **Agent SDK**:錯誤文字省略提示,因為模型是以程式設計方式設定的。在 TypeScript 中的 [`Options` 上設定 `model`](/docs/zh-TW/agent-sdk/typescript#options),或在 Python 中設定 [`ClaudeAgentOptions(model=...)`](/docs/zh-TW/agent-sdk/python#claudeagentoptions),並處理結構化 `model_not_found` 錯誤以顯示您自己的重試或模型選擇器。2339* **Agent SDK**:錯誤文字省略提示,因為模型是以程式設計方式設定的。在 TypeScript 中的 [`Options` 上設定 `model`](/docs/zh-TW/agent-sdk/typescript#options),或在 Python 中設定 [`ClaudeAgentOptions(model=...)`](/docs/zh-TW/agent-sdk/python#claudeagentoptions),並處理結構化的 `model_not_found` 錯誤以顯示您自己的重試或模型選擇器。
2203* 使用別名(例如 `sonnet` 或 `opus`)而不是完整版本化 ID。別名解析為維護的預設值,因此它們不會過時。請參閱 [Model configuration](/docs/zh-TW/model-config)。2340* 使用別名(例如 `sonnet` 或 `opus`)而不是完整的版本化 ID。別名解析為維護的預設值,因此它們不會過時。請參閱[模型配置](/docs/zh-TW/model-config)。
2204* 如果錯誤的模型在 CLI 中不斷出現,則在某處設定了過時的 ID。按 [優先順序](/docs/zh-TW/model-config#setting-your-model) 檢查您可以設定模型的位置,並移除過時的值。2341* 如果錯誤的模型在 CLI 中不斷出現,則某處設定了過時的 ID。按[優先順序](/docs/zh-TW/model-config#setting-your-model)檢查您可以設定模型的位置,並移除過時的值。
2205* 新推出的模型可能在 Anthropic API 上可用,但在 Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 上可用之前。如果您在其中一個提供者上固定了新模型 ID 並看到此錯誤,請檢查您提供者的模型目錄以了解您區域的可用性,並保持固定先前版本,直到新版本出現。2342* Claude Code 將過期的 claude.ai 登入報告為[登入已過期](#login-expired),而不是此錯誤。在 v2.1.206 之前,無法再刷新的過期登入對每個模型都失敗,並出現此錯誤;如果您在較舊版本上看到此錯誤,請執行 `/login`。
2206* Claude Code 將過期的 claude.ai 登入報告為 [Login expired](#login-expired),而不是此錯誤。在 v2.1.206 之前,無法再刷新的過期登入對每個模型失敗,出現此錯誤;如果您在較舊版本上看到這種情況,請執行 `/login`。
2207* 對於 Google Cloud 的 Agent Platform 部署,請參閱 [Google Cloud 的 Agent Platform 故障排除](/docs/zh-TW/google-vertex-ai#troubleshooting)。2343* 對於 Google Cloud 的 Agent Platform 部署,請參閱 [Google Cloud 的 Agent Platform 故障排除](/docs/zh-TW/google-vertex-ai#troubleshooting)。
2208 2344
2209<h3 id="model-is-not-a-recognized-model-id">2345<h3 id="model-is-not-a-recognized-model-id">
2210 模型不是公認的模型 ID2346 模型不是公認的模型 ID
2211</h3>2347</h3>
2212 2348
2213您傳遞給模型切換的模型字串不是模型別名、此 Claude Code 版本知道的模型 ID,也不是以 `claude-` 開頭的 ID。常見原因是 ID 中的拼寫錯誤、顯示名稱(例如 `Sonnet 5`,其中需要 ID `claude-sonnet-5`),或只有較新 Claude Code 版本識別的別名。Claude Code 立即拒絕切換。在 v2.1.200 之前,Claude Code 保存字串並在下一個請求上失敗,出現 [There's an issue with the selected model](#theres-an-issue-with-the-selected-model)。2349您傳遞給模型切換的模型字串不是模型別名、此 Claude Code 版本知道的模型 ID,也不是以 `claude-` 開頭的 ID。常見原因是 ID 中的拼寫錯誤、顯示名稱(例如 `Sonnet 5`,其中需要 ID `claude-sonnet-5`),或只有較新 Claude Code 版本識別的別名。Claude Code 立即拒絕切換。在 v2.1.200 之前,Claude Code 保存字串並在下一個請求時因[選定的模型有問題](#theres-an-issue-with-the-selected-model)而失敗。
2214 2350
2215```text theme={null}2351```text theme={null}
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.` 代替。在[桌面應用程式](/docs/zh-TW/desktop)為您啟動的工作階段中,無匹配提示讀取 `Switch to a different model.`
2220 2356
2221Claude Code 在請求切換的時刻在本地產生此錯誤,在任何 API 請求之前。它適用於通過 [Agent SDK](/docs/zh-TW/agent-sdk/typescript) `setModel()` 方法設定模型、由執行 Claude Code CLI 的應用程式(例如 [Desktop app](/docs/zh-TW/desktop))設定,或當您從通過 [Remote Control](/docs/zh-TW/remote-control) 連接的裝置選擇模型時。在 v2.1.260 之前,檢查不涵蓋 Remote Control 選擇,因此 Claude Code 應用了選擇,下一個請求失敗,出現 [There's an issue with the selected model](#theres-an-issue-with-the-selected-model)。2357Claude Code 在請求切換的時刻在本地產生此錯誤,在發送任何 API 請求之前。它適用於通過 [Agent SDK](/docs/zh-TW/agent-sdk/typescript) `setModel()` 方法設定模型、由[桌面應用程式](/docs/zh-TW/desktop)之類的應用程式為您執行 Claude Code CLI 時,或當您從通過[遠端控制](/docs/zh-TW/remote-control)連接的裝置選擇模型時。在 v2.1.260 之前,檢查不涵蓋遠端控制選擇,因此 Claude Code 應用了選擇,下一個請求因[選定的模型有問題](#theres-an-issue-with-the-selected-model)而失敗。
2222 2358
2223**該怎麼辦:**2359**該怎麼辦:**
2224 2360
2225* 執行 `/model` 不帶引數以開啟選擇器並從您帳戶可用的模型中選擇,然後傳遞那裡顯示的別名或 ID2361* 執行 `/model` 而不帶引數以開啟選擇器並從您帳戶可用的模型中選擇,然後傳遞那裡顯示的別名或 ID
2226* 如果您使用了較新 Claude Code 版本支援的別名,請執行 `claude update`。以 `claude-` 開頭的完整 ID 即使模型比您的 Claude Code 版本更新,也會通過此本地檢查。伺服器仍然可能需要該模型的最低版本;請參閱 [Claude Code does not support this model](#claude-code-does-not-support-this-model)。2362* 如果您使用了較新 Claude Code 版本支援的別名,請執行 `claude update`。以 `claude-` 開頭的完整 ID 通過此本地檢查,即使模型比您的 Claude Code 版本更新。伺服器仍然可以要求該模型的最低版本;請參閱 [Claude Code 不支援此模型](#claude-code-does-not-support-this-model)。
2227* v2.1.200 之前保存的模型不會被此檢查修復。如果過時的值不斷出現,請從 [Setting your model](/docs/zh-TW/model-config#setting-your-model) 下列出的位置移除它。2363* v2.1.200 之前保存的模型不會被此檢查修復。如果過時的值不斷出現,請從[設定您的模型](/docs/zh-TW/model-config#setting-your-model)下列出的位置移除它。
2228* 檢查僅在 Anthropic API 上執行。在任何其他提供者或閘道上,包括自訂 `ANTHROPIC_BASE_URL`,提供者定義模型名稱,因此 Claude Code 接受任何字串並將其傳遞。Claude Code 仍然可以在請求時寫入 [unrecognized-model diagnostic line](#unrecognized-model-id-on-a-request),在每個提供者上。2364* 檢查僅在 Anthropic API 上執行。在任何其他提供者或閘道上,包括自訂 `ANTHROPIC_BASE_URL`,提供者定義模型名稱,因此 Claude Code 接受任何字串並將其傳遞。Claude Code 仍然可以在請求時寫入[無法識別的模型診斷行](#unrecognized-model-id-on-a-request),在每個提供者上。
2229 2365
2230<h3 id="model-not-found">2366<h3 id="model-not-found">
2231 找不到模型2367 找不到模型
2232</h3>2368</h3>
2233 2369
2234您使用 `/model <name>` 選擇了模型,Claude Code 無法確認存在具有該名稱的模型。當名稱不是 [model alias](/docs/zh-TW/model-config#model-aliases) 或 Claude Code 在本地接受的另一種拼寫時,`/model` 使用最小 API 請求驗證它,此錯誤通常是您的 API 端點的答案。無法成為模型 ID 的名稱(例如包含空格的名稱)會收到相同訊息。2370您使用 `/model <name>` 選擇了模型,Claude Code 無法確認存在具有該名稱的模型。當名稱不是 [Claude Code 在本地接受的模型別名](/docs/zh-TW/model-config#model-aliases)或其他拼寫時,`/model` 使用最小 API 請求驗證它,此錯誤通常是您的 API 端點的答案。無法成為模型 ID 的名稱(例如包含空格的名稱)會收到相同訊息。
2235 2371
2236```text theme={null}2372```text theme={null}
2237Model 'claude-opus-9' not found2373Model 'claude-opus-9' not found
2241 2377
2242**該怎麼辦:**2378**該怎麼辦:**
2243 2379
2244* 執行 `/model` 不帶引數並從您帳戶可用的模型中選擇,或使用 [model alias](/docs/zh-TW/model-config#model-aliases)(例如 `sonnet`),它解析為維護的預設值2380* 執行 `/model` 而不帶引數並從您帳戶可用的模型中選擇,或使用[模型別名](/docs/zh-TW/model-config#model-aliases)(例如 `sonnet`),該別名解析為維護的預設值
2245* 如果您輸入了完整 ID,請根據您提供者的模型目錄檢查它。新推出的模型可能在 Anthropic API 上可用,但您的提供者或區域尚未提供。2381* 如果您輸入了完整 ID,請根據您提供者的模型目錄檢查它。新推出的模型可能在 Anthropic API 上可用,然後您的提供者或地區才提供它。
2246* 在 v2.1.265 之前,`/model` 也以此錯誤拒絕了 `opusplan[1m]` 別名拼寫。在這些版本上,更新 Claude Code,或在 [settings](/docs/zh-TW/model-config#setting-your-model) 中或使用 `--model` 設定模型。2382* 在 v2.1.265 之前,`/model` 也以此錯誤拒絕了 `opusplan[1m]` 別名拼寫。在這些版本上,更新 Claude Code,或在[設定](/docs/zh-TW/model-config#setting-your-model)中或使用 `--model` 代替設定模型。
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)
2247 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>
2251 2404
2252您的有效訂閱方案不包括您選擇的模型。2405您的有效訂閱計畫不包括您選擇的模型。
2253 2406
2254```text theme={null}2407```text theme={null}
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 桌面應用程式執行的工作階段中,訊息說改為 `sign out and sign in again` 而不是命名命令。
2412
2258**該怎麼辦:**2413**該怎麼辦:**
2259 2414
2260* 執行 `/model` 並選擇您的方案包括的模型2415* 執行 `/model` 並選擇您的計畫包括的模型
2261* 如果您最近升級了方案但仍然看到這個,請執行 `/logout` 然後 `/login`。儲存的令牌反映您登入時的方案,因此在現有工作階段中在網路上升級不會生效,直到您重新驗證。2416* 如果您最近升級了計畫但仍然看到此訊息,請執行 `/logout` 然後 `/login`。儲存的令牌反映您登入時的計畫,因此在現有工作階段中在 claude.ai 上升級不會生效,直到您重新驗證。
2262* 請參閱 [claude.com/pricing](https://claude.com/pricing) 以了解每個方案包括哪些模型2417* 請參閱 [claude.com/pricing](https://claude.com/pricing) 以了解每個計畫包括哪些模型
2263 2418
2264<h3 id="claude-code-does-not-support-this-model">2419<h3 id="claude-code-does-not-support-this-model">
2265 Claude Code 不支援此模型2420 Claude Code 不支援此模型
2266</h3>2421</h3>
2267 2422
2268API 因為您的 Claude Code 版本低於所需最低版本而拒絕了請求,出現 400。您選擇的模型需要較新版本(伺服器按模型檢查),或您的組織政策需要一個。400 帶有錯誤代碼 `claude_code_version_too_old`,訊息說明適用的最低版本。2423API 因為您的 Claude Code 版本低於所需的最低版本而拒絕了請求,並返回 400。您選擇的模型需要較新版本(伺服器按模型檢查),或您組織的政策需要一個。400 攜帶錯誤代碼 `claude_code_version_too_old`,訊息說明適用的最低版本。
2269 2424
2270```text theme={null}2425```text theme={null}
2271API Error: 400 Claude Code 2.1.219 does not support this model; version 2.1.255 or newer is required. Run 'claude update', or update the Claude desktop app, then try again.2426API Error: 400 Claude Code 2.1.219 does not support this model; version 2.1.255 or newer is required. Run 'claude update', or update the Claude desktop app, then try again.
2272```2427```
2273 2428
2274組織政策措辭讀取:2429組織政策措辭讀取為:
2275 2430
2276```text theme={null}2431```text theme={null}
2277API Error: 400 Claude Code 2.1.240 is older than the minimum version required by your organization's policy. Run 'claude update', or update the Claude desktop app, to continue.2432API Error: 400 Claude Code 2.1.240 is older than the minimum version required by your organization's policy. Run 'claude update', or update the Claude desktop app, to continue.
2279 2434
2280**該怎麼辦:**2435**該怎麼辦:**
2281 2436
2282* 執行 `claude update`,或更新 Claude 桌面應用程式,然後開始新的工作階段2437* 執行 `claude update` 或更新 Claude 桌面應用程式,然後啟動新工作階段
2283* 對於按模型措辭,您可以通過使用 `/model` 切換到另一個模型來在目前工作階段中繼續工作2438* 對於按模型措辭,您可以通過使用 `/model` 切換到另一個模型來在目前工作階段中繼續工作
2284* 對於組織政策措辭,在繼續之前更新2439* 對於組織政策措辭,在繼續之前更新
2285 2440
2286<h3 id="model-is-restricted-by-your-organizations-settings">2441<h3 id="model-is-restricted-by-your-organizations-settings">
2287 模型受您的組織設定限制2442 模型受您組織的設定限制
2288</h3>2443</h3>
2289 2444
2290您的組織管理員已在 claude.ai 管理控制台中禁用此模型,或它被受管設定中的 [`availableModels`](/docs/zh-TW/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-TW/model-config#restrict-model-selection) 允許清單或 [`deniedModels`](/docs/zh-TW/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
2296以代理、技能或命令名稱為前綴的通知意味著限制適用於該 [子代理的請求模型](/docs/zh-TW/sub-agents#choose-a-model):子代理在替換模型上執行,您的工作階段模型保持不變。在 v2.1.223 之前,Claude Code 僅對使用 Agent 工具啟動的子代理顯示通知。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
2453前綴為代理、技能或命令名稱的通知意味著限制適用於該[子代理的請求模型](/docs/zh-TW/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-TW/claude-platform-on-aws) 上,受限制的系列別名解析為您的組織和 `availableModels` 允許清單允許的系列的最新版本,替換通知命名該版本。Claude Code 僅在系列的每個版本都受限制時拒絕 `/model <alias>`。在 v2.1.205 之前,系列別名基於其最新版本單獨替換或拒絕,即使同一系列的較舊版本被允許。2455Claude Code 將模型系列別名(`opus`、`sonnet`、`haiku` 或 `fable` 之一)視為對該系列的請求,而不是對其最新版本的請求。在 Anthropic API 和[AWS 上的 Claude Platform](/docs/zh-TW/claude-platform-on-aws) 上,受限制的系列別名解析為您組織的設定允許的系列的最新版本,替換通知命名該版本。Claude Code 僅當系列的每個版本都受限制時才拒絕 `/model <alias>`。在 v2.1.205 之前,系列別名基於其最新版本單獨被替換或拒絕,即使允許同一系列的較舊版本。
2299 2456
2300**該怎麼辦:**2457**該怎麼辦:**
2301 2458
2302* 執行 `/model` 以從您的組織允許的模型中選擇。受限制的模型在選擇器中隱藏。2459* 執行 `/model` 以從您組織允許的模型中選擇。受限制的模型在選擇器中隱藏。
2303* 如果受限制的模型在 `--model`、`ANTHROPIC_MODEL`、設定檔案的 `model` 欄位或 [subagent](/docs/zh-TW/sub-agents#choose-a-model)、技能或命令的 `model` frontmatter 中設定,請移除或更新該值,以便通知不會再次出現2460* 如果受限制的模型是在 `--model`、`ANTHROPIC_MODEL`、設定檔案的 `model` 欄位或[子代理](/docs/zh-TW/sub-agents#choose-a-model)、技能或命令的 `model` frontmatter 中設定的,請移除或更新該值,以便通知不會再次出現
2304* 如果您需要存取受限制的模型,請要求您的組織管理員啟用它。請參閱 [Organization model restrictions](/docs/zh-TW/model-config#organization-model-restrictions)。2461* 如果您需要存取受限制的模型,請要求您的組織管理員啟用它。請參閱[組織模型限制](/docs/zh-TW/model-config#organization-model-restrictions)。
2305 2462
2306<h3 id="model-switch-was-blocked-by-a-premodelswitch-hook">2463<h3 id="model-switch-was-blocked-by-a-premodelswitch-hook">
2307 模型切換被 PreModelSwitch hook 阻止2464 模型切換被 PreModelSwitch hook 阻止
2308</h3>2465</h3>
2309 2466
2310[PreModelSwitch hook](/docs/zh-TW/hooks#premodelswitch) 沒有批准您或用戶端請求的模型切換,因此工作階段保持其目前模型。當切換來自 [Agent SDK](/docs/zh-TW/agent-sdk/overview) 主機或 [Remote Control](/docs/zh-TW/remote-control) 而不是您輸入的命令時,訊息讀取 `Model switch blocked by a PreModelSwitch hook` 而不命名目標模型。2467[PreModelSwitch hook](/docs/zh-TW/hooks#premodelswitch) 沒有批准您或用戶端請求的模型切換,因此工作階段保留其目前模型。當切換來自 [Agent SDK](/docs/zh-TW/agent-sdk/overview) 主機或[遠端控制](/docs/zh-TW/remote-control)而不是您輸入的命令時,訊息讀取 `Model switch blocked by a PreModelSwitch hook` 而不命名目標模型。
2311 2468
2312```text theme={null}2469```text theme={null}
2313Model switch to Opus 4.6 was blocked by a PreModelSwitch hook: Opus 4.6 is retired for this project. Use a newer model.2470Model switch to Opus 4.6 was blocked by a PreModelSwitch hook: Opus 4.6 is retired for this project. Use a newer model.
2315 2472
2316冒號後的原因說明拒絕切換的原因:2473冒號後的原因說明拒絕切換的原因:
2317 2474
2318* **hook 寫入的原因**:PreModelSwitch hook 在 [拒絕切換或要求確認](/docs/zh-TW/hooks#premodelswitch-decision-control) 時提供了該原因。解決它要求的內容,或選擇您的 hook 允許的模型。2475* **hook 寫入的原因**:PreModelSwitch hook 在[拒絕切換或要求確認](/docs/zh-TW/hooks#premodelswitch-decision-control)時提供了該原因。解決它要求的內容,或選擇您的 hook 允許的模型。
2319* **`PreModelSwitch hook <name> did not respond before its timeout`**:在其 [timeout](/docs/zh-TW/hooks#timeouts) 之前沒有回答的 hook 會阻止切換。修復掛起的命令或提高該 hook 的 `timeout`,然後再次切換。2476* **`PreModelSwitch hook <name> did not respond before its timeout`**:在其[超時](/docs/zh-TW/hooks#timeouts)之前沒有回答的 hook 會阻止切換。修復掛起的命令或提高該 hook 的 `timeout`,然後再次切換。
2320* **`confirmation required, and this session cannot ask`**:hook 回答 `ask` 而沒有原因,控制請求無法顯示確認提示。[`-p` 執行](/docs/zh-TW/headless) 中的控制請求以原因後的 `(run /model interactively to confirm)` 報告相同狀況。從互動式工作階段進行切換,或更改 hook 對此模型的決定。2477* **`confirmation required, and this session cannot ask`**:hook 回答了 `ask` 而沒有原因,控制請求無法顯示確認提示。[`-p` 執行](/docs/zh-TW/headless)中的 `/model` 命令以 `(run /model interactively to confirm)` 報告相同狀況在原因之後。從互動式工作階段進行切換,或更改 hook 對此模型的決定。
2321* **`so organization-managed PreModelSwitch hooks could not be checked`**:Claude Code 無法判斷您的組織的 [managed plugins](/docs/zh-TW/settings-reference#enabledplugins) 提供哪些 PreModelSwitch hook,例如因為受管外掛程式無法載入。其中一個 hook 可能會阻止切換,因此 Claude Code 拒絕而不是應用未檢查的切換。原因的開始命名失敗的內容。Claude Code 在每次切換嘗試時重新檢查,因此已清除的失敗停止阻止;如果它繼續失敗,執行 `claude --debug` 並再次切換以捕獲詳細資訊,然後修復外掛程式或要求您的管理員修復它。2478* **`so organization-managed PreModelSwitch hooks could not be checked`**:Claude Code 無法判斷您組織的[受管外掛程式](/docs/zh-TW/settings-reference#enabledplugins)提供哪些 PreModelSwitch hook,例如因為受管外掛程式無法載入。其中一個 hook 可能會阻止切換,因此 Claude Code 拒絕而不是應用未檢查的切換。原因的開始命名失敗的內容。Claude Code 在每次切換嘗試時重新檢查,因此已清除的失敗停止阻止;如果它繼續失敗,請執行 `claude --debug` 並再次切換以捕獲詳細資訊,然後修復外掛程式或要求您的管理員修復它。
2322* **`a PreModelSwitch hook failed before answering`** 或 **`PreModelSwitch hooks were cancelled (the control stream closed) before answering`**:hook 執行在沒有判決的情況下結束,Claude Code 不將其視為批准。執行 `claude --debug` 以查看失敗的內容,然後再次切換。2479* **`a PreModelSwitch hook failed before answering`** 或 **`PreModelSwitch hooks were cancelled (the control stream closed) before answering`**:hook 執行在沒有判決的情況下結束,Claude Code 不將其視為批准。執行 `claude --debug` 以查看失敗的內容,然後再次切換。
2323 2480
2324在 v2.1.260 之前,受管外掛程式拒絕讀取 `plugin hooks could not be loaded, so PreModelSwitch hooks could not be checked; see the debug log`。Claude Code 重試外掛程式載入一次,然後在工作階段中拒絕後續切換,即使您的組織沒有受管外掛程式。在這些版本上重新啟動工作階段以再次執行外掛程式載入。2481在 v2.1.260 之前,受管外掛程式拒絕讀取 `plugin hooks could not be loaded, so PreModelSwitch hooks could not be checked; see the debug log`。Claude Code 重試外掛程式載入一次,然後在工作階段中拒絕後續切換,即使您的組織沒有受管外掛程式。在這些版本上重新啟動工作階段以再次執行外掛程式載入。
2327 無法將其保存為您的預設值2484 無法將其保存為您的預設值
2328</h3>2485</h3>
2329 2486
2330您選擇了一個模型以保存為您的預設值,例如使用 `/model <name>` 或 `/model` 選擇器中的 Enter,Claude Code 無法將選擇寫入您的使用者設定檔案 `~/.claude/settings.json`。切換本身已應用,因此目前工作階段在您選擇的模型上執行,但您的預設值保持不變,下一個工作階段在舊值上開始。2487您選擇了模型以保存為預設值,例如使用 `/model <name>` 或 `/model` 選擇器中的 Enter,Claude Code 無法將選擇寫入您的使用者設定檔案 `~/.claude/settings.json`。切換本身已應用,因此目前工作階段在您選擇的模型上執行,但您的預設值保持不變,下一個工作階段在舊值上啟動。
2331 2488
2332```text theme={null}2489```text theme={null}
2333Set model to Fable 5.1 for this session only · couldn't save it as your default: ~/.claude/settings.json can't be written (EROFS)2490Set model to Fable 5.1 for this session only · couldn't save it as your default: ~/.claude/settings.json can't be written (EROFS)
2335 2492
2336檔案路徑後的原因說明失敗的內容:2493檔案路徑後的原因說明失敗的內容:
2337 2494
2338* **`can't be written (<code>)`**:寫入失敗,出現括號中的作業系統錯誤代碼,例如當檔案或它連結到的檔案位於拒絕寫入的檔案系統上時的 `EROFS`。使檔案可寫入並再次切換。如果另一個工具產生檔案,請在該工具中設定 `model` 鍵;請參閱 [A change you made in Claude Code is lost in new sessions](/docs/zh-TW/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions)。2495* **`can't be written (<code>)`**:寫入因作業系統錯誤代碼(括號中)失敗,例如當檔案或它連結到的檔案位於拒絕寫入的檔案系統上時的 `EROFS`。使檔案可寫入並再次切換。如果另一個工具生成檔案,請在該工具中設定 `model` 鍵;請參閱[您在 Claude Code 中所做的變更在新工作階段中丟失](/docs/zh-TW/settings#a-change-you-made-in-claude-code-is-lost-in-new-sessions)。
2339* **`isn't valid JSON`**:磁碟上的檔案不解析,Claude Code 保持不動而不是覆蓋它無法讀回的內容。修復語法錯誤,然後再次切換;請參閱 [Fix a broken settings file](/docs/zh-TW/settings#fix-a-broken-settings-file)。2496* **`isn't valid JSON`**:磁碟上的檔案不解析,Claude Code 保持不動而不是覆蓋它無法讀回的內容。修復語法錯誤,然後再次切換;請參閱[修復損壞的設定檔案](/docs/zh-TW/settings#fix-a-broken-settings-file)。
2340 2497
2341以 `couldn't confirm it was saved as your default (~/.claude/settings.json is still being written)` 結尾的通知意味著寫入在三秒後未完成。它在背景中繼續,因此預設值可能仍然被保存;檢查您的下一個工作階段開始的模型,或再次執行 `/model <name>`。2498以 `couldn't confirm it was saved as your default (~/.claude/settings.json is still being written)` 結尾的通知意味著寫入在三秒後未完成。它在背景中繼續,因此預設值仍然可能被保存;檢查您的下一個工作階段啟動的模型,或再次執行 `/model <name>`。
2342 2499
2343在 v2.1.265 之前,通知說模型被 `saved as your default for new sessions`,即使寫入失敗。2500在 v2.1.265 之前,通知說模型是 `saved as your default for new sessions` 即使寫入失敗。
2344 2501
2345<h3 id="thinking-type-enabled-is-not-supported-for-this-model">2502<h3 id="thinking-type-enabled-is-not-supported-for-this-model">
2346 此模型不支援 thinking.type.enabled2503 此模型不支援 thinking.type.enabled
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-TW/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-TW/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 關閉思考時無法使用 Effort
2363</h3>2520</h3>
2364 2521
2365您關閉了 [extended thinking](/docs/zh-TW/model-config#extended-thinking) 並以 [effort level](/docs/zh-TW/model-config#adjust-effort-level) 高於 `high` 執行。模型不接受該組合,因此 API 拒絕了請求。2522您關閉了[延伸思考](/docs/zh-TW/model-config#extended-thinking)並以[努力級別](/docs/zh-TW/model-config#adjust-effort-level) `high` 以上執行。模型不接受該組合,因此 API 拒絕了請求。
2366 2523
2367```text theme={null}2524```text theme={null}
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 桌面應用程式執行的工作階段中,它讀取 `you can lower effort to High`。
2529
2371**該怎麼辦:**2530**該怎麼辦:**
2372 2531
2373* [降低努力級別](/docs/zh-TW/model-config#set-the-effort-level) 至 `high` 或以下。2532* [降低努力級別](/docs/zh-TW/model-config#set-the-effort-level)至 `high` 或以下。
2374* 打開思考,例如通過取消設定 [`MAX_THINKING_TOKENS`](/docs/zh-TW/env-vars) 或從您的設定中移除 [`"alwaysThinkingEnabled": false`](/docs/zh-TW/settings-reference#alwaysthinkingenabled)。2533* 打開思考,例如通過取消設定 [`MAX_THINKING_TOKENS`](/docs/zh-TW/env-vars) 或從您的設定中移除 [`"alwaysThinkingEnabled": false`](/docs/zh-TW/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 思考預算超過輸出限制
2380</h3>2539</h3>
2381 2540
2382配置的擴展思考預算超過最大回應長度,因此實際答案沒有剩餘空間。2541配置的延伸思考預算超過最大回應長度,因此沒有空間留給實際答案。
2383 2542
2384```text theme={null}2543```text theme={null}
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-TW/env-vars) 設定高於提供者的輸出限制,或當計畫模式提高思考預算時,您通常在 Amazon Bedrock 或 Google Cloud 的 Agent Platform 上看到此錯誤。
2389
2390**該怎麼辦:**2547**該怎麼辦:**
2391 2548
2392* 降低 `MAX_THINKING_TOKENS`,或提高 [`CLAUDE_CODE_MAX_OUTPUT_TOKENS`](/docs/zh-TW/env-vars) 高於思考預算2549* 將 [`CLAUDE_CODE_MAX_OUTPUT_TOKENS`](/docs/zh-TW/env-vars) 提高到思考預算以上
2393* 請參閱 [Extended thinking](/docs/zh-TW/model-config#extended-thinking) 以了解預算如何與輸出長度互動2550* 請參閱[延伸思考](/docs/zh-TW/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.
2406API Error: 400 ... thinking blocks ... cannot be modified2563API Error: 400 ... thinking blocks ... cannot be modified
2407```2564```
2408 2565
2409所有變體都意味著相同的事情:歷史記錄中 `tool_use`、`tool_result` 和 `thinking` 區塊的序列不再與 API 期望的相符。2566所有變體意味著相同的事情:歷史記錄中 `tool_use`、`tool_result` 和 `thinking` 區塊的序列不再與 API 期望的相符。
2410 2567
2411**該怎麼辦:**2568**該怎麼辦:**
2412 2569
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 兩次,以回退到損壞輪次之前的檢查點並從那裡繼續。請參閱 [Checkpointing](/docs/zh-TW/checkpointing) 以了解檢查點如何建立和恢復。2571* 執行 `/rewind` 或按 Esc 兩次,以回到損壞輪次之前的檢查點並從那裡繼續。請參閱[檢查點](/docs/zh-TW/checkpointing)以了解檢查點如何建立和恢復。
2572
2573<h3 id="invalid-data-in-redacted-thinking-block">
2574 redacted\_thinking 區塊中的資料無效
2575</h3>
2576
2577API 因為它無法接受對話歷史記錄中較早輪次攜帶的 `redacted_thinking` 區塊而拒絕了請求,並返回 400。
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` 以啟動不攜帶該區塊的對話
2415 2589
2416<h3 id="unsupported-tool-content-removed">2590<h3 id="unsupported-tool-content-removed">
2417 移除了不支援的工具內容2591 移除了不支援的工具內容
2418</h3>2592</h3>
2419 2593
2420當 Claude Code 直接連接到 Anthropic API 並載入或預覽已保存的工作階段時,它會移除 Anthropic API 不接受的工具內容,並在兩個思考區塊之間移除的內容所在的位置留下此行:2594當 Claude Code 直接連接到 Anthropic API 並載入或預覽已保存的工作階段時,它會移除 Anthropic API 不接受的工具內容,並在移除的內容位於兩個思考區塊之間的位置留下此行:
2421 2595
2422```text theme={null}2596```text theme={null}
2423[Unsupported tool content removed]2597[Unsupported tool content removed]
2424```2598```
2425 2599
2426當 API 格式以外的內容回答時,此類內容到達工作階段檔案,通常是通過 [`ANTHROPIC_BASE_URL`](/docs/zh-TW/env-vars) 設定的第三方代理,它轉譯另一個提供者的工具呼叫。Claude Code 僅在工作階段直接連接到 Anthropic API 時移除它,並在工作階段通過代理或在另一個提供者上執行時按原樣載入已保存的歷史記錄。在 v2.1.246 之前,Claude Code 將工具使用及其結果發送回 API,已恢復工作階段的每輪都失敗,出現 400 錯誤,例如 `messages.1.content.0.server_tool_use.name: Input should be 'web_search', 'web_fetch', ...`。2600當 Anthropic API 以外的東西以 API 的格式回答時,此類內容會到達工作階段檔案,通常是通過 [`ANTHROPIC_BASE_URL`](/docs/zh-TW/env-vars) 設定的第三方代理,它轉譯另一個提供者的工具呼叫。Claude Code 僅在工作階段直接連接到 Anthropic API 時移除它,並在工作階段通過代理或在另一個提供者上執行時按原樣載入已保存的歷史記錄。在 v2.1.246 之前,Claude Code 將工具使用及其結果發送回 API,已繼續工作階段的每一輪都因 400 錯誤(例如 `messages.1.content.0.server_tool_use.name: Input should be 'web_search', 'web_fetch', ...`)而失敗。
2427 2601
2428**該怎麼辦:**2602**該怎麼辦:**
2429 2603
2430* 當您看到佔位符行時,無需執行任何操作。工作階段在沒有移除內容的情況下繼續。2604* 當您看到佔位符行時,無需採取任何行動。工作階段繼續而不包含移除的內容。
2431* 如果已恢復工作階段的每輪都失敗,出現 400 錯誤,請執行 `claude update` 並再次恢復工作階段。v2.1.246 之前的版本不會移除內容。2605* 如果已繼續工作階段的每一輪都因 400 錯誤而失敗,請執行 `claude update` 並再次繼續工作階段。v2.1.246 之前的版本不會移除內容。
2432 2606
2433<h3 id="role-system-must-precede-an-assistant-message">2607<h3 id="role-system-must-precede-an-assistant-message">
2434 role 'system' 必須在 'assistant' 訊息之前2608 角色 'system' 必須在 'assistant' 訊息之前
2435</h3>2609</h3>
2436 2610
2437API 因為系統訊息位於它不接受的對話位置而拒絕了請求,出現 400:2611API 因為系統訊息位於它不接受的對話位置而拒絕了請求,並返回 400:
2438 2612
2439```text theme={null}2613```text theme={null}
2440API Error: 400 messages.6: role 'system' must precede an 'assistant' message or end the array; ...2614API Error: 400 messages.6: role 'system' must precede an 'assistant' message or end the array; ...
2441```2615```
2442 2616
2443Claude Code 將其某些提醒和附加文字作為系統訊息發送到對話中。當 API 拒絕其位置時,Claude Code 會重試請求一次,將該文字作為普通使用者訊息發送。API 的同級位置措辭,例如 `use the top-level 'system' parameter for the initial system prompt`,會得到相同的恢復。2617Claude Code 將其某些提醒和附加文字作為系統訊息在對話內發送。當 API 拒絕一個的位置時,Claude Code 重試請求一次,將該文字作為普通使用者訊息發送。API 的同級放置措辭(例如 `use the top-level 'system' parameter for the initial system prompt`)獲得相同的恢復。
2444 2618
2445當錯誤確實出現時,被拒絕的系統訊息不是 Claude Code 可以移除的。這通常意味著 Claude Code 和 API 之間的代理或 [LLM gateway](/docs/zh-TW/llm-gateway) 添加了自己的系統訊息或重新排序了對話。2619當錯誤確實出現時,被拒絕的系統訊息不是 Claude Code 可以移除的。這通常意味著 Claude Code 和 API 之間的代理或 [LLM 閘道](/docs/zh-TW/llm-gateway)添加了自己的系統訊息。
2446 2620
2447**該怎麼辦:**2621**該怎麼辦:**
2448 2622
2449* 執行 `/clear` 以開始新的對話。如果錯誤也在那裡返回,原因在於請求路徑上,而不是在已保存的對話中。2623* 如果錯誤在通過 [`ANTHROPIC_BASE_URL`](/docs/zh-TW/env-vars) 配置的代理或閘道後面的每一輪上重複,請連接而不使用代理以確認來源,並向操作它的人報告錯誤
2450* 如果錯誤在通過 [`ANTHROPIC_BASE_URL`](/docs/zh-TW/env-vars) 配置的代理或閘道後面重複出現,請連接而不使用代理以確認來源,並向操作它的人報告錯誤2624* 執行 `/clear` 以啟動新對話。如果錯誤也在那裡返回,原因在請求路徑上,而不是在已保存的對話中。
2451 2625
2452在 v2.1.280 之前,Claude Code 沒有識別此措辭,因此當被拒絕的系統訊息是 Claude Code 本身發送的時,錯誤也會出現,對話的每個後續輪次都失敗了相同的方式。2626在 v2.1.280 之前,Claude Code 沒有識別此措辭,因此當被拒絕的系統訊息是 Claude Code 本身發送的時,錯誤也出現,對話的每個後續輪次都以相同方式失敗。
2453 2627
2454<h3 id="invalid-encrypted-content-in-search-result-block">2628<h3 id="invalid-encrypted-content-in-search-result-block">
2455 搜尋結果區塊中的無效 encrypted\_content2629 搜尋結果區塊中的加密內容無效
2456</h3>2630</h3>
2457 2631
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 託管 [web search tool](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 tool](/docs/zh-TW/tools-reference#websearch-tool-behavior) 將搜尋結果記錄為純文字,因此這些區塊通常通過代理或 [LLM gateway](/docs/zh-TW/llm-gateway) 到達對話,該代理或閘道本身執行了託管網路搜尋。2643Claude Code 自己的 [WebSearch 工具](/docs/zh-TW/tools-reference#websearch-tool-behavior)將搜尋結果記錄為純文字,因此這些區塊通常通過執行託管網路搜尋本身的代理或 [LLM 閘道](/docs/zh-TW/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 拒絕回應,因為對話中的內容觸發了 [Usage Policy](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.
2488 2666
2489訊息命名拒絕的模型,或當沒有記錄模型時命名 `Claude`。2667訊息命名拒絕的模型,或當沒有記錄模型時命名 `Claude`。
2490 2668
2491檢查評估完整對話,而不僅是您的最新提示,因此在同一工作階段中發送新訊息通常會重新觸發相同的拒絕。使用 `--continue` 或 `--resume` 退出並重新開啟工作階段後也是如此,因為磁碟上的文字記錄仍然包含觸發內容。在 [Amazon Bedrock](/docs/zh-TW/amazon-bedrock)、[Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) 和 [Microsoft Foundry](/docs/zh-TW/microsoft-foundry) 上,此訊息也涵蓋模型的安全措施標記為網路安全主題的請求。請參閱 [Safety measures flagged a cybersecurity topic](#safety-measures-flagged-a-cybersecurity-topic)。2669檢查評估完整對話,而不僅是您的最新提示,因此在同一工作階段中發送新訊息通常會重新觸發相同的拒絕。使用 `--continue` 或 `--resume` 退出並重新開啟工作階段時也是如此,因為磁碟上的文字記錄仍然包含觸發內容。在 [Amazon Bedrock](/docs/zh-TW/amazon-bedrock)、[Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) 和 [Microsoft Foundry](/docs/zh-TW/microsoft-foundry) 上,此訊息也涵蓋模型的安全措施標記為網路安全主題的請求。請參閱[安全措施標記了網路安全主題](#safety-measures-flagged-a-cybersecurity-topic)。
2492 2670
2493在 v2.1.219 之前,訊息讀取 `Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.`2671在 v2.1.219 之前,訊息讀取 `Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.`
2494 2672
2495**該怎麼辦:**2673**該怎麼辦:**
2496 2674
2497* 按 Esc 兩次或執行 `/rewind` 以回退到觸發拒絕的輪次之前的檢查點,然後重新措辭或採取不同的方法。請參閱 [Checkpointing](/docs/zh-TW/checkpointing)。2675* 按 Esc 兩次或執行 `/rewind` 以回到觸發拒絕的輪次之前的檢查點,然後重新措辭或採取不同的方法。請參閱[檢查點](/docs/zh-TW/checkpointing)。
2498* 如果您無法識別哪個輪次導致了它,執行 `/clear` 以在同一專案中開始新的對話。您之前的對話保存在磁碟上,並在 `/resume` 中保持可用。2676* 如果您無法識別哪一輪導致了它,請執行 `/clear` 以在同一專案中啟動新對話。您之前的對話保存在磁碟上,並在 `/resume` 中保持可用。
2499* 在 [非互動模式](/docs/zh-TW/headless) (`-p`) 中,其中倒帶不可用,使用重新措辭的提示在沒有 `--continue` 的新工作階段中重試。政策檢查因模型而異,因此使用 `--model` 切換到不同的模型也可能在某些情況下解決拒絕。2677* 在[非互動模式](/docs/zh-TW/headless)(`-p`) 中,其中無法進行倒帶,請在沒有 `--continue` 的新工作階段中使用重新措辭的提示重試。政策檢查因模型而異,因此使用 `--model` 切換到不同的模型也可能在某些情況下解決拒絕。
2500 2678
2501<h3 id="safety-measures-flagged-a-cybersecurity-topic">2679<h3 id="safety-measures-flagged-a-cybersecurity-topic">
2502 安全措施標記了網路安全主題2680 安全措施標記了網路安全主題
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訊息連結到 [Cyber Verification Program](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-TW/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-TW/model-config#automatic-model-fallback)而不是顯示此錯誤。
2512 2690
2513在 [Amazon Bedrock](/docs/zh-TW/amazon-bedrock)、[Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) 和 [Microsoft Foundry](/docs/zh-TW/microsoft-foundry) 上,網路安全標記會改為產生 [Usage Policy refusal](#usage-policy-refusal) 訊息。2691在 [Amazon Bedrock](/docs/zh-TW/amazon-bedrock)、[Google Cloud 的 Agent Platform](/docs/zh-TW/google-vertex-ai) 和 [Microsoft Foundry](/docs/zh-TW/microsoft-foundry) 上,網路安全標記會產生[使用政策拒絕](#usage-policy-refusal)訊息。
2514 2692
2515防護本身是伺服器端的,早於 v2.1.203;自那時以來的用戶端版本僅更改了訊息的措辭。2693安全措施本身是伺服器端的,早於 v2.1.203;自那時以來的用戶端版本僅更改了訊息的措辭。
2516從 v2.1.203 到 v2.1.218,訊息讀取 `<model> has safety measures that flagged this message for a cybersecurity topic. To learn about the Cyber Verification Program and apply for access, visit our help center:` 後跟相同的說明中心連結,互動式工作階段附加 `If you were not engaging in a cybersecurity topic, please send feedback via /feedback.`2694從 v2.1.203 到 v2.1.218,訊息讀取 `<model> has safety measures that flagged this message for a cybersecurity topic. To learn about the Cyber Verification Program and apply for access, visit our help center:` 後跟相同的幫助中心連結,互動式工作階段附加 `If you were not engaging in a cybersecurity topic, please send feedback via /feedback.`
2517在 v2.1.203 之前,它讀取 `<model>'s safeguards flagged this message for a cybersecurity topic. If your work requires this access, you can apply for an exemption:` 後跟豁免表單連結。2695在 v2.1.203 之前,它讀取 `<model>'s safeguards flagged this message for a cybersecurity topic. If your work requires this access, you can apply for an exemption:` 後跟豁免表單連結。
2518 2696
2519**該怎麼辦:**2697**該怎麼辦:**
2520 2698
2521* 如果您的工作需要此內容,請通過 [Cyber Verification Program](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude) 申請存取權限2699* 如果您的工作需要此內容,請通過[網路安全驗證計畫](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude)申請存取權限
2522* 如果您的請求不是關於網路安全主題,執行 `/feedback` 以報告誤報2700* 如果您的請求不是關於網路安全主題,請執行 `/feedback` 以報告誤報
2523* 若要在同一工作階段中繼續工作,按 Esc 兩次或執行 `/rewind` 以回退到觸發標記的輪次之前的檢查點,然後採取不同的方法。請參閱 [Checkpointing](/docs/zh-TW/checkpointing)。2701* 若要在同一工作階段中繼續工作,請按 Esc 兩次或執行 `/rewind` 以回到觸發標記的輪次之前的檢查點,然後採取不同的方法。請參閱[檢查點](/docs/zh-TW/checkpointing)。
2524 2702
2525<h2 id="installation-errors">2703<h2 id="installation-errors">
2526 安裝錯誤2704 安裝錯誤
2550 下載更新時連線中斷2728 下載更新時連線中斷
2551</h3>2729</h3>
2552 2730
2553在 `claude install`、`claude update` 或 [自動更新程式](/docs/zh-TW/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
2573 命令列錯誤2751 命令列錯誤
2574</h2>2752</h2>
2575 2753
2576這些錯誤來自 `claude` 命令列及其子命令、您在提示符處提交的命令名稱,以及 `/security-review` 等命令,這些命令在執行提示之前透過執行 shell 命令來收集上下文。它們也來自 `/tui`,它會重新啟動 CLI。2754這些錯誤來自 `claude` 命令列及其子命令、您在提示符提交的命令名稱,以及執行 shell 命令以收集內容的命令(例如 `/security-review`),然後才執行其提示。它們也來自 `/tui`,它會重新啟動 CLI。
2577 2755
2578<h3 id="conflict-between-bg-and-print">2756<h3 id="conflict-between-bg-and-print">
2579 \--bg 和 --print 之間的衝突2757 \--bg 和 --print 之間的衝突
2580</h3>2758</h3>
2581 2759
2582此訊息需要 Claude Code v2.1.198 或更新版本。您在同一個 `claude` 呼叫中結合了 `--bg` 與 `-p` 或 `--print`。`--bg` 啟動一個[背景工作階段](/docs/zh-TW/agent-view#from-your-shell),您稍後可以使用 `claude agents` 附加到該工作階段,而 `--print` 以[非互動方式](/docs/zh-TW/headless)執行,永遠不會啟動 `claude agents` 附加到的互動工作階段。在 v2.1.198 之前,此組合會無聲地建立一個永遠無法附加的背景工作。2760此訊息需要 Claude Code v2.1.198 或更新版本。您在同一個 `claude` 呼叫中結合了 `--bg` 與 `-p` 或 `--print`。`--bg` 啟動一個[背景工作階段](/docs/zh-TW/agent-view#from-your-shell),您稍後可以使用 `claude agents` 附加到該工作階段,而 `--print` 以[非互動模式](/docs/zh-TW/headless)執行,永遠不會啟動 `claude agents` 附加到的互動工作階段。在 v2.1.198 之前,此組合會無聲地建立一個永遠無法附加的背景工作。
2583 2761
2584```text theme={null}2762```text theme={null}
2763--bg 和 --print 衝突:--print 永遠不會啟動 `claude agents` 附加到的互動工作階段,所以工作將無法附加。提示是位置引數 — 移除 --print:`claude --bg '<task>'`。
2585```2764```
2586 2765
2587**該怎麼做:**2766**該怎麼做:**
2588 2767
2589* 移除 `-p` 或 `--print`。`--bg` 將提示作為其位置引數,所以 `claude --bg "<task>"` 是完整命令。請參閱[從您的 shell 分派新代理](/docs/zh-TW/agent-view#from-your-shell)。2768* 移除 `-p` 或 `--print`。`--bg` 將提示作為其位置引數,所以 `claude --bg "<task>"` 是完整命令。請參閱[從您的 shell 分派新代理](/docs/zh-TW/agent-view#from-your-shell)。
2590* 若要以非互動方式執行提示並列印結果而不是建立背景工作階段,請移除 `--bg` 並執行 `claude -p "<task>"`2769* 若要以非互動模式執行提示並列印結果而不是建立背景工作階段,請移除 `--bg` 並執行 `claude -p "<task>"`
2591 2770
2592<h3 id="invalid-agents-configuration">2771<h3 id="invalid-agents-configuration">
2593 無效的 --agents 設定2772 無效的 --agents 設定
2594</h3>2773</h3>
2595 2774
2596您傳遞給 `--agents` 的值無效,所以 `claude` 以代碼 1 結束而不是啟動工作階段。當您傳遞 `--safe-mode`、`--resume` 或 `--continue`,或設定 [`CLAUDE_CODE_SAFE_MODE`](/docs/zh-TW/env-vars#variables) 時,Claude Code 不會檢查該值並啟動工作階段。在 v2.1.242 之前,Claude Code 仍然啟動工作階段並省略了它無法載入的定義。2775您傳遞給 `--agents` 的值無效,所以 `claude` 以代碼 1 結束而不是啟動工作階段。當您傳遞 `--safe-mode` 或設定 [`CLAUDE_CODE_SAFE_MODE`](/docs/zh-TW/env-vars#variables) 時,Claude Code 會完全忽略 `--agents`。使用 `--resume` 或 `--continue` 時,內嵌 JSON 值不會被檢查且工作階段會啟動;從檔案讀取的值在每次啟動時都會被檢查。在 v2.1.242 之前,Claude Code 無論如何都會啟動工作階段。
2597 2776
2598```text theme={null}2777```text theme={null}
2599Error: 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-TW/sub-agents#choose-the-subagent-scope) 的架構時,Claude Code 每個問題列印一行27852. 當它解析但代理定義與 [CLI 定義的子代理](/docs/zh-TW/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 '-'`
2787
2788當有超過 20 行問題時,Claude Code 會列印前 20 行,並用 `…and N more` 取代其餘部分。
2789
2790使用 `--print` 時,`--agents` 也接受 [JSON 檔案的路徑](/docs/zh-TW/sub-agents#choose-the-subagent-scope)代替內嵌物件。在 v2.1.281 之前,`--agents` 只接受內嵌 JSON,並將檔案路徑視為無效 JSON。檔案形式有其自己的拒絕,列印在此訊息的位置,包括這些:
2609 2791
2610當有超過 20 行問題時,Claude Code 列印前 20 行並用 `…and N more` 替換其餘部分。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 也可能以這種方式失敗。檢查路徑或引號,然後再次執行命令。
2611 2794
2612**該怎麼做:**2795**該怎麼做:**
2613 2796
2617 無法從 --restricted 工作階段建立雲端工作階段2800 無法從 --restricted 工作階段建立雲端工作階段
2618</h3>2801</h3>
2619 2802
2620當您使用 [`--restricted`](/docs/zh-TW/cli-reference#cli-flags) 啟動工作階段時,Claude Code 拒絕從中建立[雲端工作階段](/docs/zh-TW/claude-code-on-the-web#from-terminal-to-cloud),因為新工作階段將在受限制的程序之外執行,不會強制執行受限制的模式。Claude Code 在用戶端拒絕,在聯絡伺服器之前,所以不會建立雲端工作階段:2803當您使用 [`--restricted`](/docs/zh-TW/cli-reference#cli-flags) 啟動工作階段時,Claude Code 拒絕從它建立[雲端工作階段](/docs/zh-TW/claude-code-on-the-web#from-terminal-to-cloud),因為新工作階段會在受限程序外執行,不會強制執行受限模式。Claude Code 在用戶端拒絕,在聯絡伺服器之前,所以不會建立任何雲端工作階段:
2621 2804
2622```text theme={null}2805```text theme={null}
2623Cloud sessions cannot be created from a --restricted session: they would not enforce it.2806Cloud sessions cannot be created from a --restricted session: they would not enforce it.
2625 2808
2626**該怎麼做:**2809**該怎麼做:**
2627 2810
2628* 在受限制的工作階段中本地執行任務2811* 在受限工作階段中本地執行工作
2629* 如果您控制工作階段的啟動方式,啟動一個沒有 `--restricted` 的新 `claude` 工作階段,並從那裡建立雲端工作階段2812* 如果您控制工作階段的啟動方式,請啟動新的 `claude` 工作階段而不使用 `--restricted`,並從那裡建立雲端工作階段
2630 2813
2631在 v2.1.248 之前,Claude Code 沒有 `--restricted` 旗標;較早的版本以未知選項錯誤拒絕該旗標。2814在 v2.1.248 之前,Claude Code 沒有 `--restricted` 旗標;較早的版本會以未知選項錯誤拒絕該旗標。
2632 2815
2633<h3 id="cloud-sessions-are-disabled-by-your-organizations-policy">2816<h3 id="cloud-sessions-are-disabled-by-your-organizations-policy">
2634 您的組織政策已停用雲端工作階段2817 您的組織政策已停用雲端工作階段
2640Cloud sessions are disabled by your organization's policy. Contact your organization admin to enable them.2823Cloud sessions are disabled by your organization's policy. Contact your organization admin to enable them.
2641```2824```
2642 2825
2643當您[從終端建立雲端工作階段](/docs/zh-TW/claude-code-on-the-web#from-terminal-to-cloud)時會出現此訊息,當您提交需要雲端工作階段的命令時,例如 `/teleport`、`/remote-env` 或 `/web-setup`。在 v2.1.268 之前,提交其中一個命令會傳回 [`Unknown command`](#unknown-command)。2826當您[從終端建立雲端工作階段](/docs/zh-TW/claude-code-on-the-web#from-terminal-to-cloud)時會出現此訊息,當您提交需要雲端工作階段的命令時,例如 `/teleport`、`/remote-env` 或 `/web-setup`。在 v2.1.268 之前,提交其中一個命令會傳回[`Unknown command`](#unknown-command)。
2644 2827
2645這是伺服器端組織政策,所以無法從本地設定、環境變數或 CLI 旗標覆蓋。2828這是伺服器端組織政策,所以無法從本地設定、環境變數或 CLI 旗標覆蓋。
2646 2829
2655 \--json-schema 值不是有效的 JSON Schema2838 \--json-schema 值不是有效的 JSON Schema
2656</h3>2839</h3>
2657 2840
2658您傳遞給 [`--json-schema`](/docs/zh-TW/cli-reference#cli-flags) 的架構在[非互動模式](/docs/zh-TW/headless#get-structured-output)中未能通過 JSON Schema 編譯,所以 `claude` 以代碼 1 結束而不是執行提示。在 v2.1.205 之前,無效的架構產生無結構的輸出且沒有錯誤,任何使用 `format` 關鍵字的架構都被視為無效。2841您傳遞給 [`--json-schema`](/docs/zh-TW/cli-reference#cli-flags) 的架構在[非互動模式](/docs/zh-TW/headless#get-structured-output)中無法通過 JSON Schema 編譯,所以 `claude` 以代碼 1 結束而不是執行提示。在 v2.1.205 之前,無效的架構會產生無結構的輸出而沒有錯誤,任何使用 `format` 關鍵字的架構都被視為無效。
2659 2842
2660```text theme={null}2843```text theme={null}
2661Error: --json-schema is not a valid JSON Schema: data/type must be equal to one of the allowed values2844Error: --json-schema is not a valid JSON Schema: data/type must be equal to one of the allowed values
2663 2846
2664第二個冒號後的文字是驗證器的診斷,並命名失敗的關鍵字或位置。使用 `format` 關鍵字的架構,例如 `"format": "email"`,是有效的:Claude Code 接受 `format` 作為註釋,不強制執行它。2847第二個冒號後的文字是驗證器的診斷,並命名失敗的關鍵字或位置。使用 `format` 關鍵字的架構,例如 `"format": "email"`,是有效的:Claude Code 接受 `format` 作為註釋,不強制執行它。
2665 2848
2666Claude Code 在架構編譯之前執行兩個檢查:它以 `Error: --json-schema is not valid JSON` 拒絕不可解析的 JSON 值,以及有效但不是物件的 JSON 以 `Error: --json-schema must be a JSON object` 拒絕。2849Claude Code 在架構編譯之前執行兩項檢查:它拒絕不可解析的 JSON 值,並顯示 `Error: --json-schema is not valid JSON`,以及有效但不是物件的 JSON,並顯示 `Error: --json-schema must be a JSON object`。
2667 2850
2668**該怎麼做:**2851**該怎麼做:**
2669 2852
2670* 修復診斷命名的架構部分,然後重新執行命令2853* 修復診斷命名的架構部分,然後重新執行命令
2671* 如果診斷是 `schema too large`,請減少架構的巢狀和 `$ref` 重複使用
2672* 請參閱[取得結構化輸出](/docs/zh-TW/headless#get-structured-output)以取得有效的架構和命令2854* 請參閱[取得結構化輸出](/docs/zh-TW/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-TW/cli-reference#cli-flags) 的檔案大於 2 MiB,所以 `claude` 在啟動時以代碼 1 結束而不是載入它。設定檔是一個小型 JSON 文件,所以這麼大的檔案通常意味著路徑指向錯誤的檔案。在 v2.1.214 之前,Claude Code 讀取檔案時沒有大小檢查,多 GB 檔案或 `/dev/zero` 等裝置檔案會無限制地增加記憶體。2860您傳遞給 [`--settings`](/docs/zh-TW/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
2682```2864```
2683 2865
2684Claude Code 以相同方式拒絕不是常規檔案的 `--settings` 路徑:裝置、FIFO 或 socket 報告 `Error: Cannot use settings file (Not a regular file (device, FIFO, or socket))` 後跟路徑,目錄報告 `EISDIR` 原因。2866Claude Code 以相同方式拒絕不是常規檔案的 `--settings` 路徑:裝置、FIFO 或通訊端會報告 `Error: Cannot use settings file (Not a regular file (device, FIFO, or socket))`,後面跟著路徑,目錄會報告 `EISDIR` 原因。
2685 2867
2686**該怎麼做:**2868**該怎麼做:**
2687 2869
2691 目前目錄不再存在2873 目前目錄不再存在
2692</h3>2874</h3>
2693 2875
2694您從一個在您的 shell 進入後被刪除或移動的目錄啟動 `claude`,例如 worktree 或另一個 shell 移除的臨時目錄。Claude Code 無法讀取其工作目錄,所以它在啟動工作階段之前以代碼 1 結束,在互動和[非互動](/docs/zh-TW/headless)模式中都是如此。在 v2.1.239 之前,Claude Code 使用縮小的套件來源和原始 `ENOENT ... uv_cwd` 堆疊在 stderr 上崩潰,而不是此訊息。2876您從一個在您的 shell 進入後被刪除或移動的目錄啟動 `claude`,例如另一個 shell 移除的 worktree 或臨時目錄。Claude Code 無法讀取其工作目錄,所以它在啟動工作階段之前以代碼 1 結束,在互動和[非互動](/docs/zh-TW/headless)模式中都是如此。在 v2.1.239 之前,Claude Code 會因縮小的套件來源和原始 `ENOENT ... uv_cwd` 堆疊在 stderr 上而崩潰,而不是顯示此訊息。
2695 2877
2696```text theme={null}2878```text theme={null}
2697The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory.2879The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory.
2698error: The current working directory was deleted, so that command didn't work. Please cd into a different directory and try again.2880error: The current working directory was deleted, so that command didn't work. Please cd into a different directory and try again.
2699```2881```
2700 2882
2701兩種形式的原因和修復都是相同的。2883原因和修復對兩種形式都是相同的。
2702 2884
2703當 Claude Code 因為不同的原因(例如權限變更)無法讀取工作目錄時,訊息會命名錯誤代碼:`Can't read the current directory (EACCES). Start Claude Code from a different directory.`2885當 Claude Code 因不同的原因(例如權限變更)無法讀取工作目錄時,訊息會命名錯誤代碼:`Can't read the current directory (EACCES). Start Claude Code from a different directory.`
2704 2886
2705在 macOS 上,`~/Desktop`、`~/Documents`、`~/Downloads` 或 iCloud Drive 中目錄的 `EPERM` 通常意味著 macOS 阻止您的終端應用程式存取該資料夾。讀取該資料夾的其他命令也會以相同方式失敗:即使使用 `sudo`,`ls` 也會報告 `Operation not permitted`。2887在 macOS 上,`~/Desktop`、`~/Documents`、`~/Downloads` 或 iCloud Drive 中目錄的 `EPERM` 通常表示 macOS 阻止您的終端應用程式存取該資料夾。讀取該資料夾的其他命令也會以相同方式失敗:即使使用 `sudo`,`ls` 也會報告 `Operation not permitted`。
2706 2888
2707**該怎麼做:**2889**該怎麼做:**
2708 2890
2709* 變更到存在的目錄,例如您的主目錄或專案目錄,然後再次執行 `claude`2891* 變更為存在的目錄,例如您的主目錄或專案目錄,然後再次執行 `claude`
2710* 如果目錄在相同路徑重新建立,您的 shell 仍然保有已刪除的目錄。執行 `cd "$PWD"` 或離開並重新進入目錄,然後執行 `claude`2892* 如果目錄在相同路徑被重新建立,您的 shell 仍然持有已刪除的目錄。執行 `cd "$PWD"` 或離開並重新進入目錄,然後執行 `claude`
2711* 對於 macOS 上的 `EPERM`,使用 Cmd+Q 結束您的終端應用程式,重新開啟它,返回該資料夾,然後執行 `claude`。如果該資料夾中的 `ls` 仍然失敗,開啟**系統設定 > 隱私與安全 > 檔案和資料夾**,為您的終端應用程式開啟該資料夾,然後重新開啟終端2893* 對於 macOS 上的 `EPERM`,使用 Cmd+Q 結束您的終端應用程式,重新開啟它,返回該資料夾,然後執行 `claude`。如果該資料夾中的 `ls` 仍然失敗,請開啟**系統設定 > 隱私與安全 > 檔案和資料夾**,為您的終端應用程式開啟該資料夾,然後重新開啟終端
2712 2894
2713<h3 id="temp-directory-refused-or-cannot-be-created">2895<h3 id="temp-directory-refused-or-cannot-be-created">
2714 暫時目錄被拒絕或無法建立2896 臨時目錄被拒絕或無法建立
2715</h3>2897</h3>
2716 2898
2717在 macOS 和 Linux 上,Claude Code 在啟動時建立一個私有暫時目錄 `claude-<uid>`,位於系統暫時目錄或 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 覆蓋下。當目錄無法建立,或該路徑的現有項目未通過安全檢查時,Claude Code 將失敗列印到 stderr 並以代碼 1 結束,而不是啟動工作階段:2899在 macOS 和 Linux 上,Claude Code 在啟動時建立一個私有臨時目錄 `claude-<uid>`,位於系統臨時目錄或 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 覆蓋下。當無法建立目錄,或該路徑上的現有項目無法通過安全檢查時,Claude Code 會將失敗列印到 stderr 並以代碼 1 結束而不是啟動工作階段:
2718 2900
2719```text wrap theme={null}2901```text wrap theme={null}
2720ENOSPC: no space left on device, mkdir '/tmp/claude-501'2902ENOSPC: no space left on device, mkdir '/tmp/claude-501'
2728 2910
2729**該怎麼做:**2911**該怎麼做:**
2730 2912
2731* 對於 `ENOSPC`,釋放保有暫時目錄的磁碟區上的磁碟空間2913* 對於 `ENOSPC`,釋放保存臨時目錄的磁碟區上的磁碟空間
2732* 對於 `Refusing to use it` 形式,移除命名的項目本身,而不是連結指向的內容,然後再次啟動 Claude Code;對於 `owned by uid` 形式,只有管理員或該使用者可以移除它2914* 對於 `Refusing to use it` 形式,移除命名的項目本身,而不是連結指向的內容,然後啟動 Claude Code;對於 `owned by uid` 形式,只有管理員或該使用者可以移除它
2733* 對於 `is not readable`,在命名的目錄上執行 `chmod 0700`,或移除它並重新啟動2915* 對於 `is not readable`,在命名的目錄上執行 `chmod 0700`,或移除它並重新啟動
2734* 在任何這些情況下,將 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設定為您控制的目錄並啟動 Claude Code,讓被拒絕的路徑保持不變2916* 在任何這些情況下,將 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設定為您控制的目錄並啟動 Claude Code,保留被拒絕的路徑不變
2735 2917
2736<h3 id="directory-couldnt-be-resolved-to-a-real-location">2918<h3 id="directory-couldnt-be-resolved-to-a-real-location">
2737 目錄無法解析為真實位置2919 目錄無法解析為真實位置
2739 2921
2740您為工作目錄的子目錄執行了 `/add-dir`,Claude Code 無法將目錄解析為其真實位置。2922您為工作目錄的子目錄執行了 `/add-dir`,Claude Code 無法將目錄解析為其真實位置。
2741 2923
2742您已經可以存取工作目錄的子目錄,所以 `/add-dir` 只載入其 skills、命令和代理。在載入它們之前,Claude Code 檢查目錄的真實位置(解析任何符號連結)是否在工作目錄內。當 Claude Code 無法解析該位置時,它不載入任何內容並顯示此訊息:2924您已經可以存取工作目錄的子目錄,所以 `/add-dir` 只會載入其技能、命令和代理。在載入它們之前,Claude Code 會檢查目錄的真實位置(解析任何符號連結)是否在工作目錄內。當 Claude Code 無法解析該位置時,它不會載入任何內容並顯示此訊息:
2743 2925
2744```text theme={null}2926```text theme={null}
2745packages/app couldn't be resolved to a real location, so its skills, commands, and agents weren't loaded. Check that it is a directory inside the working directory and try again.2927packages/app couldn't be resolved to a real location, so its skills, commands, and agents weren't loaded. Check that it is a directory inside the working directory and try again.
2748**該怎麼做:**2930**該怎麼做:**
2749 2931
2750* 檢查路徑是否命名工作目錄內的真實目錄,然後再次執行 `/add-dir`2932* 檢查路徑是否命名工作目錄內的真實目錄,然後再次執行 `/add-dir`
2751* 訊息不會變更您的檔案存取;它只報告目錄的 `.claude/` 內容未被載入2933* 訊息不會改變您的檔案存取;它只報告目錄的 `.claude/` 內容未被載入
2752 2934
2753在 v2.1.261 之前,當工作目錄在 `/net/<host>` 自動掛載上時,此訊息也會為每個 `/add-dir <subdirectory>` 出現,Claude Code 根據設計拒絕解析路徑;目錄很好,重試無法幫助。2935在 v2.1.261 之前,當工作目錄在 `/net/<host>` 自動掛載上時,此訊息也會為每個 `/add-dir <subdirectory>` 出現,Claude Code 根據設計拒絕解析路徑;目錄很好,重試無法幫助。
2754 2936
2756 啟動遠端控制時工作區未受信任2938 啟動遠端控制時工作區未受信任
2757</h3>2939</h3>
2758 2940
2759您在未信任的目錄中使用 `claude remote-control` 或其 `claude rc` 別名啟動[遠端控制](/docs/zh-TW/remote-control)伺服器模式。該命令本身不顯示工作區信任對話框,所以它以代碼 1 結束並命名修復:2941您在未信任的目錄中使用 `claude remote-control` 或其 `claude rc` 別名啟動[遠端控制](/docs/zh-TW/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
2765在您的主目錄中,訊息是不同的,因為工作區信任對話框永遠不會為主目錄儲存信任,所以在那裡接受它無法滿足此檢查。在 v2.1.214 之前,主目錄顯示上述訊息,其建議無法在那裡成功。2947兩個也以 `Error: Workspace not trusted.` 開頭的變體也會在終端中出現,終端太小而無法顯示信任目錄會開啟什麼,或沒有報告其大小的終端。放大視窗或切換到正常終端視窗,然後再次執行 `claude rc`。
2948
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-TW/remote-control#requirements)回答 `n` 或按 Enter,命令會列印一條 `Remote Control did not start` 訊息,命名目錄並以代碼 1 結束。再次執行 `claude rc` 以回答 `y`。
2956
2771**該怎麼做:**2957**該怎麼做:**
2772 2958
2773* 在目錄中執行 `claude`,接受[工作區信任對話框](/docs/zh-TW/permissions#project-allow-rules-and-workspace-trust),然後再次執行 `claude remote-control`2959* 首先從終端信任目錄:在那裡執行 `claude rc` 並回答 `y`,或執行 `claude` 並接受[工作區信任對話框](/docs/zh-TW/permissions#project-allow-rules-and-workspace-trust),然後再次執行您的原始命令
2774* 在您的主目錄中,變更到專案目錄並在那裡啟動遠端控制2960* 在您的主目錄中,變更為專案目錄並在那裡啟動遠端控制
2961
2962在 v2.1.284 之前,命令永遠不會詢問,即使在終端中也是如此。
2775 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>
2779 2967
2780您使用全域 `claude` 旗標在 `remote-control` 動詞之前啟動[遠端控制](/docs/zh-TW/remote-control),該旗標會限制或設定遠端控制啟動的工作階段,例如 `--settings`、`--setting-sources`、`--permission-mode`、`--disallowed-tools` 或 `--mcp-config`。放在動詞之前的旗標永遠不會到達這些工作階段。Claude Code 拒絕啟動,命名該旗標:2968您使用全域 `claude` 旗標在 `remote-control` 動詞之前啟動[遠端控制](/docs/zh-TW/remote-control),該旗標會限制或設定遠端控制啟動的工作階段,例如 `--settings`、`--setting-sources`、`--permission-mode`、`--disallowed-tools` 或 `--mcp-config`。放在動詞之前的旗標永遠不會到達這些工作階段。Claude Code 拒絕啟動,命名旗標:
2781 2969
2782```text theme={null}2970```text theme={null}
2783Error: `--settings` before `remote-control` is not carried over to the sessions Remote Control starts, so Remote Control refuses to start rather than drop it — remove it, and give Remote Control's own options after the verb (see `claude remote-control --help`).2971Error: `--settings` before `remote-control` is not carried over to the sessions Remote Control starts, so Remote Control refuses to start rather than drop it — remove it, and give Remote Control's own options after the verb (see `claude remote-control --help`).
2792* 從動詞之前移除旗標,並在其後傳遞[遠端控制自己的選項](/docs/zh-TW/remote-control#start-a-remote-control-session);`claude remote-control --help` 列出它們2980* 從動詞之前移除旗標,並在其後傳遞[遠端控制自己的選項](/docs/zh-TW/remote-control#start-a-remote-control-session);`claude remote-control --help` 列出它們
2793* 當被拒絕的旗標是 `--permission-mode` 時,執行 `claude remote-control --permission-mode <mode>` 以設定遠端控制啟動的工作階段的權限模式2981* 當被拒絕的旗標是 `--permission-mode` 時,執行 `claude remote-control --permission-mode <mode>` 以設定遠端控制啟動的工作階段的權限模式
2794 2982
2795在 v2.1.248 之前,當全域旗標首先出現時,`claude remote-control` 不接受自己的旗標,命令失敗並出現未知選項錯誤。2983在 v2.1.248 之前,當全域旗標首先出現時,`claude remote-control` 不接受其自己的旗標,命令失敗並出現未知選項錯誤。
2796 2984
2797<h3 id="claude-import-is-not-yet-available-in-this-build">2985<h3 id="claude-import-is-not-yet-available-in-this-build">
2798 claude import 在此組建中尚不可用2986 claude import 在此組建中尚不可用
2799</h3>2987</h3>
2800 2988
2801您執行了 [`claude import`](/docs/zh-TW/cli-reference#cli-commands),Claude Code 發現匯入流程已關閉,所以命令以代碼 1 結束而不是啟動匯入。在 v2.1.222 之前,關閉匯入流程的組建將 `import` 視為提示並啟動互動工作階段,而不是列印此訊息。2989您執行了 [`claude import`](/docs/zh-TW/cli-reference#cli-commands),Claude Code 發現匯入流程已關閉,所以命令以代碼 1 結束而不是啟動匯入。在 v2.1.222 之前,關閉匯入流程的組建會將 `import` 視為提示並啟動互動工作階段,而不是列印此訊息。
2802 2990
2803```text theme={null}2991```text theme={null}
2804`claude import` is not yet available in this build. Run `claude` and use /mcp or edit ~/.claude/settings.json directly.2992`claude import` is not yet available in this build. Run `claude` and use /mcp or edit ~/.claude/settings.json directly.
2805```2993```
2806 2994
2807Claude Code 透過從 Anthropic 擷取並在磁碟上快取的功能旗標開啟 `claude import`。此訊息意味著快取的值已關閉。原因通常是以下之一:2995Claude Code 通過它從 Anthropic 擷取並在磁碟上快取的功能旗標開啟 `claude import`。此訊息表示快取的值已關閉。原因通常是以下之一:
2808 2996
2809* 您自安裝以來尚未啟動工作階段,所以 Claude Code 尚未擷取旗標。第一個 `claude import` 即使功能對您可用,也可能列印此訊息。2997* 您自安裝以來尚未啟動工作階段,所以 Claude Code 尚未擷取旗標。第一個 `claude import` 即使該功能對您可用,也可能列印此訊息。
2810* 您透過 Amazon Bedrock、Google Cloud 的代理平台、Microsoft Foundry、AWS 上的 Claude Platform 或透過 [Claude 應用程式閘道](/docs/zh-TW/claude-apps-gateway#availability-and-limitations)使用 Claude Code。Claude Code 在這些工作階段中不擷取功能旗標,所以 `claude import` 保持不可用。2998* 您通過 Amazon Bedrock、Google Cloud 的 Agent Platform、Microsoft Foundry 或 AWS 上的 Claude Platform,或通過[Claude 應用程式閘道](/docs/zh-TW/claude-apps-gateway#availability-and-limitations)使用 Claude Code。Claude Code 在這些工作階段中不擷取功能旗標,所以 `claude import` 保持不可用。
2811* 您設定了 `DISABLE_TELEMETRY`、`DO_NOT_TRACK`、`DISABLE_GROWTHBOOK` 或 [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](/docs/zh-TW/env-vars),它們關閉功能旗標擷取,所以 `claude import` 保持不可用。2999* 您設定了 `DISABLE_TELEMETRY`、`DO_NOT_TRACK`、`DISABLE_GROWTHBOOK` 或 [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](/docs/zh-TW/env-vars),它們關閉功能旗標擷取,所以 `claude import` 保持不可用。
2812 3000
2813**該怎麼做:**3001**該怎麼做:**
2814 3002
2815* 在全新安裝上,啟動 `claude`,等待工作階段載入,結束,然後再次執行 `claude import`3003* 在新安裝上,啟動 `claude`,等待工作階段載入,結束,然後再次執行 `claude import`
2816* 功能旗標擷取保持關閉的地方,自己設定設定:使用 [`claude mcp add`](/docs/zh-TW/mcp#installing-mcp-servers) 新增 MCP 伺服器,並建立您想要帶過來的 [`CLAUDE.md` 檔案](/docs/zh-TW/memory#how-claude-md-files-load)、[skills 和命令](/docs/zh-TW/skills#where-skills-live)和[子代理](/docs/zh-TW/sub-agents#choose-the-subagent-scope)。訊息也命名 `~/.claude/settings.json`。在 `claude import` 帶來的設定中,該檔案只保有[權限模式](/docs/zh-TW/settings-reference#permission-settings);Claude Code 不從中讀取 MCP 伺服器。3004* 在功能旗標擷取保持關閉的地方,自己設定設定:使用 [`claude mcp add`](/docs/zh-TW/mcp#installing-mcp-servers) 新增 MCP 伺服器,並建立您想要帶過去的 [`CLAUDE.md` 檔案](/docs/zh-TW/memory#how-claude-md-files-load)、[技能和命令](/docs/zh-TW/skills#where-skills-live)以及[子代理](/docs/zh-TW/sub-agents#choose-the-subagent-scope)。訊息也命名 `~/.claude/settings.json`。在 `claude import` 帶過去的設定中,該檔案只保存[權限模式](/docs/zh-TW/settings-reference#permission-settings);Claude Code 不從它讀取 MCP 伺服器。
2817 3005
2818<h3 id="could-not-read-claude-code-config">3006<h3 id="could-not-read-claude-code-config">
2819 無法讀取 Claude Code 設定3007 無法讀取 Claude Code 設定
2820</h3>3008</h3>
2821 3009
2822您執行了 [`claude import`](/docs/zh-TW/cli-reference#cli-commands),而 Claude Code 無法解析 `~/.claude.json`,它儲存您的登入和每個專案狀態的檔案。子命令讀取該檔案以檢查可用性,但不顯示互動工作階段顯示的復原對話框,所以它以代碼 1 結束。在 v2.1.222 之前,具有不可讀設定檔的 `claude import` 啟動互動工作階段,其復原對話框處理該檔案。3010您在 Claude Code 無法解析 `~/.claude.json` 時執行了 [`claude import`](/docs/zh-TW/cli-reference#cli-commands),該檔案是它儲存您的登入和每個專案狀態的地方。子命令讀取該檔案以檢查可用性,但不顯示互動工作階段顯示的復原對話框,所以它以代碼 1 結束。在 v2.1.222 之前,具有不可讀設定檔的 `claude import` 啟動了互動工作階段,其復原對話框處理了該檔案。
2823 3011
2824```text theme={null}3012```text theme={null}
2825Could not read Claude Code config — run `claude` with no arguments to recover it.3013Could not read Claude Code config — run `claude` with no arguments to recover it.
2827 3015
2828**該怎麼做:**3016**該怎麼做:**
2829 3017
2830* 執行沒有引數的 `claude`。Claude Code 偵測無效檔案並提供重設它。然後再次執行 `claude import`。3018* 執行不帶引數的 `claude`。Claude Code 偵測無效檔案並提供重設它。然後再次執行 `claude import`。
2831* 若要保留您所做的手動編輯,請在編輯器中修復 `~/.claude.json` 中的 JSON 語法,然後重新執行 `claude import`3019* 若要保留您所做的手動編輯,請在編輯器中修復 `~/.claude.json` 中的 JSON 語法,然後重新執行 `claude import`
2832 3020
2833<h3 id="could-not-import-a-server-from-claude-desktop">3021<h3 id="could-not-import-a-server-from-claude-desktop">
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.
2841```3029```
2842 3030
2843伺服器名稱後的文字是原因。最常見的是名稱檢查:Claude Desktop 允許伺服器名稱中的字元,例如空格和句號,而 `claude mcp` 限制為字母、數字、連字號和底線。其他原因包括無法通過驗證的伺服器設定和被您的組織的 [MCP 政策](/docs/zh-TW/managed-mcp)阻止的伺服器。3031伺服器名稱後的文字是原因。最常見的是名稱檢查:Claude Desktop 允許伺服器名稱中的字元,例如空格和句號,而 `claude mcp` 限制為字母、數字、連字號和底線。其他原因包括無法通過驗證的伺服器設定和被您的組織[MCP 政策](/docs/zh-TW/managed-mcp)阻止的伺服器。
2844 3032
2845**該怎麼做:**3033**該怎麼做:**
2846 3034
2851 無法將 MCP 伺服器新增到受管範圍3039 無法將 MCP 伺服器新增到受管範圍
2852</h3>3040</h3>
2853 3041
2854您使用 `--scope managed` 執行了 `claude mcp add` 或 `claude mcp add-json`。該範圍保有您的組織透過 [`managedMcpServers`](/docs/zh-TW/settings-reference#managedmcpservers) 受管設定提供的伺服器。Claude Code 只從受管設定讀取它們,所以命令無法將伺服器寫入該範圍。3042您使用 `--scope managed` 執行了 `claude mcp add` 或 `claude mcp add-json`。該範圍保存您的組織通過 [`managedMcpServers`](/docs/zh-TW/settings-reference#managedmcpservers) 受管設定提供的伺服器。Claude Code 只從受管設定讀取它們,所以命令無法將伺服器寫入該範圍。
2855 3043
2856```text theme={null}3044```text theme={null}
2857Cannot add MCP server to scope: managed3045Cannot add MCP server to scope: managed
2859 3047
2860**該怎麼做:**3048**該怎麼做:**
2861 3049
2862* 將伺服器新增到您可以寫入的範圍:`local`、`user` 或 `project`。沒有 `--scope`,命令使用 `local`。請參閱 [MCP 安裝範圍](/docs/zh-TW/mcp#mcp-installation-scopes)3050* 將伺服器新增到您可以寫入的範圍:`local`、`user` 或 `project`。不使用 `--scope` 時,命令使用 `local`。請參閱 [MCP 安裝範圍](/docs/zh-TW/mcp#mcp-installation-scopes)
2863* 若要為您的組織中的每個使用者提供伺服器,請將其新增到您部署的受管設定中的 [`managedMcpServers`](/docs/zh-TW/settings-reference#managedmcpservers)3051* 若要為您的組織中的每個使用者提供伺服器,請將其新增到您部署的受管設定中的 [`managedMcpServers`](/docs/zh-TW/settings-reference#managedmcpservers)
2864 3052
2865<h3 id="cant-read-mcp-json">3053<h3 id="cant-read-mcp-json">
2866 無法讀取 .mcp.json3054 無法讀取 .mcp.json
2867</h3>3055</h3>
2868 3056
2869讀取專案的 [`.mcp.json`](/docs/zh-TW/mcp#project-scope) 的命令,例如 `claude mcp add` 或 `claude mcp add-json` 搭配 `--scope project`,或 `claude mcp remove`,發現您目前目錄中的檔案不是常規檔案或大於 2 MiB,所以它以此錯誤結束而不是讀取檔案。3057讀取專案 [`.mcp.json`](/docs/zh-TW/mcp#project-scope) 的命令,例如 `claude mcp add` 或 `claude mcp add-json` 搭配 `--scope project`,或 `claude mcp remove`,發現您目前目錄中的檔案不是常規檔案或大於 2 MiB,所以它以此錯誤結束而不是讀取檔案。
2870 3058
2871```text theme={null}3059```text theme={null}
2872Can't read .mcp.json: it isn't a regular file or is larger than 2097152 bytes. Fix or remove it, then run the command again.3060Can't read .mcp.json: it isn't a regular file or is larger than 2097152 bytes. Fix or remove it, then run the command again.
2873```3061```
2874 3062
2875在 v2.1.257 之前,`.mcp.json` 的 FIFO 讓命令無限期等待且沒有輸出,到 `/dev/zero` 等裝置檔案的符號連結會無限制地增加記憶體,直到程序被殺死。3063在 v2.1.257 之前,`.mcp.json` 上的 FIFO 會讓命令無限期等待而沒有輸出,到 `/dev/zero` 等裝置檔案的符號連結會增加記憶體直到程序被殺死。
2876 3064
2877**該怎麼做:**3065**該怎麼做:**
2878 3066
2879* 檢查您目前目錄中 `.mcp.json` 的內容。將其替換為 [project-scope 格式](/docs/zh-TW/mcp#project-scope)中的普通 JSON 檔案,或刪除它,然後執行命令。3067* 檢查您目前目錄中 `.mcp.json` 上的內容。將其替換為 [project-scope 格式](/docs/zh-TW/mcp#project-scope)中的普通 JSON 檔案,或刪除它,然後再次執行命令。
2880 3068
2881<h3 id="anthropic-hosted-and-doesnt-support-local-oauth">3069<h3 id="anthropic-hosted-and-doesnt-support-local-oauth">
2882 伺服器是 Anthropic 託管的,不支援本地 OAuth3070 伺服器是 Anthropic 託管的,不支援本地 OAuth
2883</h3>3071</h3>
2884 3072
2885您為 URL 指向透過第三方身份提供者進行身份驗證的 Anthropic 託管連接器主機的 MCP 伺服器啟動了登入。這些主機包括 `microsoft365.mcp.claude.com`、`gmail.mcp.claude.com` 和 `gcal.mcp.claude.com`。Claude Code 拒絕為這些主機從 `/mcp` 面板和 `claude mcp login` 啟動其本地 OAuth 流程,因為[它們的登入僅透過 claude.ai 運作](/docs/zh-TW/mcp#use-mcp-servers-from-claude-ai)。3073您為 MCP 伺服器啟動了登入,其 URL 指向通過第三方身份提供者進行身份驗證的 Anthropic 託管連接器主機。這些主機包括 `microsoft365.mcp.claude.com`、`gmail.mcp.claude.com` 和 `gcal.mcp.claude.com`。Claude Code 拒絕為這些主機從 `/mcp` 面板和 `claude mcp login` 啟動其本地 OAuth 流程,因為[它們的登入僅通過 claude.ai 工作](/docs/zh-TW/mcp#use-mcp-servers-from-claude-ai)。
2886 3074
2887```text theme={null}3075```text theme={null}
2888"gmail" is Anthropic-hosted and doesn't support local OAuth. Connect it via Settings → Connectors on claude.ai (requires `claude login`), then it'll be available here automatically.3076"gmail" is Anthropic-hosted and doesn't support local OAuth. Connect it via Settings → Connectors on claude.ai (requires `claude login`), then it'll be available here automatically.
2892 3080
2893**該怎麼做:**3081**該怎麼做:**
2894 3082
2895* 使用 `claude mcp remove <name>` 移除您的項目,以便它無法隱藏相同 URL 的 claude.ai 連接器3083* 使用 `claude mcp remove <name>` 移除您的項目,以便它無法隱藏相同 URL 上的 claude.ai 連接器
2896* 移除後,在 [claude.ai/customize/connectors](https://claude.ai/customize/connectors) 連接服務,同時登入您在 Claude Code 中使用的帳戶。連接後,如果您的活躍身份驗證方法是 claude.ai 訂閱登入,[連接器會自動出現在 Claude Code 中](/docs/zh-TW/mcp#use-mcp-servers-from-claude-ai)3084* 移除後,在 [claude.ai/customize/connectors](https://claude.ai/customize/connectors) 連接服務,同時登入您在 Claude Code 中使用的帳戶。連接後,如果您的活躍身份驗證方法是 claude.ai 訂閱登入,[連接器會自動出現在 Claude Code 中](/docs/zh-TW/mcp#use-mcp-servers-from-claude-ai)
2897 3085
2898<h3 id="server-rejected-the-authorization-header-minted-by-the-configured-headershelper">3086<h3 id="server-rejected-the-authorization-header-minted-by-the-configured-headershelper">
2899 伺服器拒絕了由設定的 headersHelper 鑄造的授權標頭3087 伺服器拒絕了由設定的 headersHelper 鑄造的授權標頭
2900</h3>3088</h3>
2901 3089
2902其 [`headersHelper`](/docs/zh-TW/mcp#use-dynamic-headers-for-custom-authentication) 提供 `Authorization` 標頭的 MCP 伺服器以 HTTP 401 或 403 回答連線,所以 Claude Code 報告連線失敗。因為 helper 提供 `Authorization` 標頭,Claude Code [不會回退到 OAuth](/docs/zh-TW/mcp#authenticate-with-remote-mcp-servers) 用於伺服器:3090其 [`headersHelper`](/docs/zh-TW/mcp#use-dynamic-headers-for-custom-authentication) 提供 `Authorization` 標頭的 MCP 伺服器以 HTTP 401 或 403 回答連線,所以 Claude Code 將連線報告為失敗。因為幫助程式提供 `Authorization` 標頭,Claude Code [不會回退到 OAuth](/docs/zh-TW/mcp#authenticate-with-remote-mcp-servers) 用於伺服器:
2903 3091
2904```text theme={null}3092```text theme={null}
2905Server rejected the Authorization header minted by the configured headersHelper (HTTP 401). Check that the helper command returns a valid credential for this MCP endpoint — OAuth fallback is disabled when the helper supplies Authorization.3093Server rejected the Authorization header minted by the configured headersHelper (HTTP 401). Check that the helper command returns a valid credential for this MCP endpoint — OAuth fallback is disabled when the helper supplies Authorization.
2906```3094```
2907 3095
2908Claude Code 在每次連線嘗試時重新執行 helper,所以在暫時拒絕後重試(例如令牌輪換競爭)可以使用新認證成功。3096Claude Code 在每次連線嘗試時重新執行幫助程式,所以在暫時拒絕(例如權杖輪換競賽)後重試可以使用新認證成功。
2909 3097
2910**該怎麼做:**3098**該怎麼做:**
2911 3099
2912* 按照 Claude Code 執行它的方式自己執行 `headersHelper` 命令:從 [Claude Code 執行它的目錄](/docs/zh-TW/mcp#where-the-helper-runs),使用 [Claude Code 為其設定的環境變數](/docs/zh-TW/mcp#use-dynamic-headers-for-custom-authentication),以及沒有 [Claude Code 為來自專案 `.mcp.json`、外掛程式或專案代理檔案的伺服器移除的認證變數](/docs/zh-TW/mcp#which-variables-a-helper-can-read)。檢查它列印的 `Authorization` 值伺服器的端點接受3100* 按照 Claude Code 執行它的方式自己執行 `headersHelper` 命令:從 [Claude Code 執行它的目錄](/docs/zh-TW/mcp#where-the-helper-runs),使用 [Claude Code 為它設定的環境變數](/docs/zh-TW/mcp#use-dynamic-headers-for-custom-authentication),以及沒有 [Claude Code 為來自專案 `.mcp.json`、外掛程式或專案代理檔案的伺服器移除的認證變數](/docs/zh-TW/mcp#which-variables-a-helper-can-read)。檢查它列印的 `Authorization` 值伺服器的端點接受
2913* 修復 helper 或其認證來源後,在 `/mcp` 中選擇伺服器並選擇**重新連線**3101* 修復幫助程式或其認證來源後,在 `/mcp` 中選擇伺服器並選擇**重新連線**
2914 3102
2915在 v2.1.248 之前,Claude Code 為其 helper 提供 `Authorization` 標頭的伺服器執行 OAuth 發現。該發現可能失敗並出現 `Incompatible auth server: does not support dynamic client registration` 而不是報告被拒絕的認證。3103在 v2.1.248 之前,Claude Code 為其幫助程式提供 `Authorization` 標頭的伺服器執行 OAuth 發現。該發現可能失敗並顯示 `Incompatible auth server: does not support dynamic client registration` 而不是報告被拒絕的認證。
2916 3104
2917<h3 id="mcp-permission-prompt-tool-not-found">3105<h3 id="mcp-permission-prompt-tool-not-found">
2918 找不到 MCP 權限提示工具3106 找不到 MCP 權限提示工具
2919</h3>3107</h3>
2920 3108
2921您傳遞給 [`--permission-prompt-tool`](/docs/zh-TW/cli-reference#cli-flags) 的工具在執行首次需要權限決定時不在連接的 MCP 工具中,要麼因為其伺服器從未連接,要麼因為沒有連接的伺服器公開該名稱的工具。Claude Code 仍然傳送您的提示:[非互動](/docs/zh-TW/headless)執行在第一個需要批准的工具呼叫時以此錯誤和結束代碼 1 結束,所以即使提出了請求,它也不產生答案。在第一個提示之前,Claude Code 等待最多由 [`MCP_TIMEOUT`](/docs/zh-TW/env-vars) 設定的每個伺服器連線逾時 30 秒,以便該伺服器連接。在 v2.1.206 之前,啟動不等待伺服器完成連接,所以啟動緩慢但健康的伺服器也產生此錯誤。3109您傳遞給 [`--permission-prompt-tool`](/docs/zh-TW/cli-reference#cli-flags) 的工具在執行首次需要權限決定時不在連接的 MCP 工具中,要麼因為其伺服器永遠沒有連接,要麼因為沒有連接的伺服器公開該名稱的工具。Claude Code 仍會傳送您的提示:[非互動](/docs/zh-TW/headless)執行在第一個工具呼叫時以此錯誤和結束代碼 1 結束,所以即使提出了請求,它也不會產生答案。在第一個提示之前,Claude Code 等待最多由 [`MCP_TIMEOUT`](/docs/zh-TW/env-vars) 設定的每個伺服器連線逾時 30 秒,以便該伺服器連接。在 v2.1.206 之前,啟動不會等待伺服器完成連接,所以啟動緩慢但健康的伺服器也會產生此錯誤。
2922 3110
2923```text theme={null}3111```text theme={null}
2924Error: MCP tool mcp__permissions__approve (passed via --permission-prompt-tool) not found. Available MCP tools: none3112Error: MCP tool mcp__permissions__approve (passed via --permission-prompt-tool) not found. Available MCP tools: none
2925```3113```
2926 3114
2927`Available MCP tools:` 後的清單命名等待結束時連接的 MCP 工具。3115`Available MCP tools:` 後的列表命名已連接的 MCP 工具。
2928 3116
2929**該怎麼做:**3117**該怎麼做:**
2930 3118
2931* 檢查伺服器啟動並保持連接:在相同目錄中執行 `claude mcp list` 並確認伺服器列為已連接3119* 檢查伺服器啟動並保持連接:在同一目錄中執行 `claude mcp list` 並確認伺服器列為已連接
2932* 確認工具名稱符合伺服器公開的 `mcp__<server>__<tool>` 名稱3120* 確認工具名稱與伺服器公開的 `mcp__<server>__<tool>` 名稱相符
2933* 如果伺服器需要超過 30 秒才能啟動,請提高 [`MCP_TIMEOUT`](/docs/zh-TW/env-vars)3121* 如果伺服器需要超過 30 秒才能啟動,請提高 [`MCP_TIMEOUT`](/docs/zh-TW/env-vars)
2934 3122
2935<h3 id="oauth-callback-port-is-already-in-use">3123<h3 id="oauth-callback-port-is-already-in-use">
2936 OAuth 回呼連接埠已在使用中3124 OAuth 回呼連接埠已在使用中
2937</h3>3125</h3>
2938 3126
2939當您使用 OAuth 登入遠端 MCP 伺服器時,Claude Code 啟動本地接聽器以接收登入回呼。如果該接聽器需要的連接埠被另一個程序佔用,登入失敗並出現此訊息。這主要發生在[固定回呼連接埠](/docs/zh-TW/mcp#use-a-fixed-oauth-callback-port)透過 [`MCP_OAUTH_CALLBACK_PORT`](/docs/zh-TW/env-vars) 變數或 `--callback-port` 設定時,因為沒有一個 Claude Code 會選擇可用的連接埠。3127當您使用 OAuth 登入遠端 MCP 伺服器時,Claude Code 啟動本地監聽器以接收登入回呼。如果該監聽器需要的連接埠被另一個程序持有,登入會失敗並顯示此訊息。這主要發生在通過 [`MCP_OAUTH_CALLBACK_PORT`](/docs/zh-TW/env-vars) 變數或 `--callback-port` 設定的[固定回呼連接埠](/docs/zh-TW/mcp#use-a-fixed-oauth-callback-port)上,因為沒有一個 Claude Code 會選擇可用的連接埠。
2940 3128
2941```text theme={null}3129```text theme={null}
2942OAuth callback port <port> is already in use — another process may be holding it. Run `lsof -ti:<port> -sTCP:LISTEN` to find it.3130OAuth callback port <port> is already in use — another process may be holding it. Run `lsof -ti:<port> -sTCP:LISTEN` to find it.
2946 3134
2947**該怎麼做:**3135**該怎麼做:**
2948 3136
2949* 執行訊息中的命令以找到佔用連接埠的程序,並停止它或等待它完成3137* 執行訊息中的命令以找到持有連接埠的程序,並停止它或等待它完成
2950* 如果另一個程式永久需要該連接埠,使用伺服器註冊不同的重定向 URI,並使用 `MCP_OAUTH_CALLBACK_PORT` 或 `--callback-port` 設定其連接埠,以您使用的為準3138* 如果另一個程式永久需要該連接埠,請向伺服器註冊不同的重新導向 URI,並使用 `MCP_OAUTH_CALLBACK_PORT` 或 `--callback-port` 設定其連接埠,以您使用的為準
2951* 然後再次啟動登入,例如在 `/mcp` 中選擇伺服器3139* 然後再次啟動登入,例如在 `/mcp` 中選擇伺服器
2952 3140
2953<h3 id="no-available-ports-for-oauth-redirect">3141<h3 id="no-available-ports-for-oauth-redirect">
2954 沒有可用的 OAuth 重定向連接埠3142 沒有可用的 OAuth 重新導向連接埠
2955</h3>3143</h3>
2956 3144
2957當您使用[OAuth](/docs/zh-TW/mcp#authenticate-with-remote-mcp-servers)登入遠端 MCP 伺服器時,Claude Code 啟動本地接聽器以接收登入回呼。當 Claude Code 無法為其繫結本地連接埠時,登入失敗並出現此訊息。機器上的某些內容阻止它在 `127.0.0.1` 上接聽,例如安全軟體或拒絕本地接聽器的沙箱政策。3145當您使用 [OAuth](/docs/zh-TW/mcp#authenticate-with-remote-mcp-servers) 登入遠端 MCP 伺服器時,Claude Code 啟動本地監聽器以接收登入回呼。當 Claude Code 無法為其繫結本地連接埠時,登入失敗並顯示此訊息。機器上的某些內容阻止它在 `127.0.0.1` 上監聽,例如安全軟體或拒絕本地監聽器的沙箱政策。
2958 3146
2959```text theme={null}3147```text theme={null}
2960No available ports for OAuth redirect3148No available ports for OAuth redirect
2961```3149```
2962 3150
2963在 v2.1.268 之前,Claude Code 不回退到作業系統指派的連接埠,所以當只有其自選連接埠無法繫結時,訊息也會出現。這可能發生在 Hyper-V 保留涵蓋 Claude Code 選擇的連接埠的連接埠範圍的 Windows 主機上。3151在 v2.1.268 之前,Claude Code 不會回退到作業系統指派的連接埠,所以訊息也會在只有其自我選擇的連接埠無法繫結時出現。這可能發生在 Hyper-V 保留涵蓋 Claude Code 選擇的連接埠的連接埠範圍的 Windows 主機上。
2964 3152
2965**該怎麼做:**3153**該怎麼做:**
2966 3154
2967* 檢查安全軟體或沙箱政策是否阻止程序在 `127.0.0.1` 上接聽,並允許 Claude Code 繫結本地連接埠3155* 檢查安全軟體或沙箱政策是否阻止程序在 `127.0.0.1` 上監聽,並允許 Claude Code 繫結本地連接埠
2968* 然後再次啟動登入,例如在 `/mcp` 中選擇伺服器3156* 然後再次啟動登入,例如在 `/mcp` 中選擇伺服器
2969 3157
2970<h3 id="security-review-fails-without-origin-head">3158<h3 id="security-review-fails-without-origin-head">
2971 /security-review 在沒有 origin/HEAD 的情況下失敗3159 /security-review 在沒有 origin/HEAD 的情況下失敗
2972</h3>3160</h3>
2973 3161
2974[`/security-review`](/docs/zh-TW/commands#all-commands) 透過針對 `origin/HEAD` 進行差異來建立其審查上下文,這是記錄您的 `origin` 遠端上哪個分支是預設分支的本地 ref。當該 ref 不存在時,收集差異的 git 命令失敗,審查在開始前停止。3162[`/security-review`](/docs/zh-TW/commands#all-commands) 通過針對 `origin/HEAD` 進行差異來建立其審查內容,該本地參考記錄您的 `origin` 遠端上哪個分支是預設的。當該參考不存在時,收集差異的 git 命令失敗,審查在啟動前停止。
2975 3163
2976```text theme={null}3164```text theme={null}
2977Error: Shell command failed for pattern "!`git diff --name-only origin/HEAD...`": [stderr]3165Error: Shell command failed for pattern "!`git diff --name-only origin/HEAD...`": [stderr]
2980'git <command> [<revision>...] -- [<file>...]'3168'git <command> [<revision>...] -- [<file>...]'
2981```3169```
2982 3170
2983訊息可能引用 `git log` 或不同的 `git diff`。Git 只在遠端公告預設分支且您的擷取 refspec 涵蓋它時建立 `origin/HEAD`,完整的遠端 `git clone` 帶有提交時會執行此操作。ref 在這些設定中遺失:3171訊息可能引用 `git log` 或不同的 `git diff`。Git 只在遠端公告預設分支且您的擷取 refspec 涵蓋它時建立 `origin/HEAD`,完整的遠端 `git clone` 帶有提交會執行此操作。該參考在這些設定中遺失:
2984 3172
2985* 單一分支或 CI 檢出,擷取太窄的 refspec3173* 單分支或 CI 檢出,擷取太窄的 refspec
2986* 伺服器端 HEAD 指向沒有人推送的分支的遠端3174* 伺服器端 HEAD 指向沒有人推送的分支的遠端
2987* 沒有 `origin` 遠端的儲存庫,或您從未擷取的儲存庫3175* 沒有 `origin` 遠端的儲存庫,或您從未擷取的儲存庫
2988 3176
2989Claude Code 為任何 [injects dynamic context](/docs/zh-TW/skills#when-an-injected-command-fails) 的 skill 顯示相同的錯誤,失敗的注入命令中止該 skill 的呼叫。兩個同級字串在命令執行之前就會觸發:3177Claude Code 為任何[注入動態內容](/docs/zh-TW/skills#when-an-injected-command-fails)的技能顯示相同的錯誤,失敗的注入命令會中止該技能的呼叫。兩個同級字串在命令執行之前就會觸發:
2990 3178
2991* `Shell command permission check failed for pattern "..."`: 命令的權限檢查不允許它。[Permission checks on injected commands](/docs/zh-TW/skills#permission-checks-on-injected-commands) 涵蓋在每個權限模式中哪些結果中止以及如何使用 `allowed-tools` 預先批准命令3179* `Shell command permission check failed for pattern "..."`:命令的權限檢查不允許它。[注入命令的權限檢查](/docs/zh-TW/skills#permission-checks-on-injected-commands)涵蓋每個權限模式中哪些結果中止以及如何使用 `allowed-tools` 預先核准命令
2992* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``: skill 的 frontmatter 在沒有它的機器上要求 bash。安裝 Git for Windows 或將 frontmatter 變更為 `shell: powershell`。請參閱[注入命令如何執行](/docs/zh-TW/skills#how-injected-commands-run)3180* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``:技能的 frontmatter 在沒有它的機器上要求 bash。安裝 Git for Windows 或將 frontmatter 變更為 `shell: powershell`。請參閱[注入命令如何執行](/docs/zh-TW/skills#how-injected-commands-run)
2993 3181
2994**該怎麼做:**3182**該怎麼做:**
2995 3183
2996* 透過命名您的遠端的預設分支建立 ref:`git remote set-head origin <default-branch>`。只要本地追蹤 ref `origin/<default-branch>` 存在,這就有效。如果它不存在,如在單一分支複製中,首先擷取分支:執行 `git remote set-branches --add origin <branch>`,然後 `git fetch origin`,然後重新執行 set-head 命令。重新執行 `/security-review`。3184* 通過命名您的遠端預設分支建立參考:`git remote set-head origin <default-branch>`。只要本地追蹤參考 `origin/<default-branch>` 存在,這就有效。如果不存在,如在單分支複製中,首先擷取分支:執行 `git remote set-branches --add origin <branch>`,然後 `git fetch origin`,然後重新執行 set-head 命令。重新執行 `/security-review`。
2997* 如果您寧願不命名分支,執行 `git fetch origin` 然後 `git remote set-head origin --auto`,它詢問遠端其預設分支是什麼。當遠端不公告預設分支時它失敗並出現 `error: Cannot determine remote HEAD`,因為它是空的或其 HEAD 指向沒有人推送的分支;改為明確命名分支。當您的複製不擷取該分支時它失敗並出現 `error: Not a valid ref`;首先如上所述擴寬 refspec。3185* 如果您寧願不命名分支,執行 `git fetch origin`,然後 `git remote set-head origin --auto`,它詢問遠端其預設分支是什麼。當遠端不公告預設分支時它失敗並顯示 `error: Cannot determine remote HEAD`,因為它是空的或其 HEAD 指向沒有人推送的分支;改為明確命名分支。當您的複製不擷取該分支時它失敗並顯示 `error: Not a valid ref`;首先如上所述擴大 refspec。
2998* 如果儲存庫沒有遠端,使用 `git remote add origin <url>` 新增一個並在建立 ref 之前擷取。如果遠端是空的,首先使用 `git push -u origin HEAD` 推送您的分支,並在 set-head 命令中命名該分支;`origin/HEAD` 然後指向您剛推送的分支,所以 `/security-review` 看到空差異,直到分支與它分歧。3186* 如果儲存庫沒有遠端,使用 `git remote add origin <url>` 新增一個並在建立參考之前擷取。如果遠端是空的,首先使用 `git push -u origin HEAD` 推送您的分支,並在 set-head 命令中命名該分支;`origin/HEAD` 然後指向您剛推送的分支,所以 `/security-review` 看到空差異直到分支與它分歧。
2999 3187
3000<h3 id="input-must-be-provided-when-using-print">3188<h3 id="input-must-be-provided-when-using-print">
3001 使用 --print 時必須提供輸入3189 使用 --print 時必須提供輸入
3002</h3>3190</h3>
3003 3191
3004裸 `claude` 需要 stdout 是終端才能啟動互動 UI。當 stdout 被重定向或主控台不是真實終端時,例如 PowerShell ISE 和某些 IDE 輸出窗格,`claude` 改為以[非互動](/docs/zh-TW/headless)模式執行。這與 `claude -p` 相同,它需要提示,所以訊息命名 `--print` 即使您沒有傳遞旗標。在任何地方傳遞沒有提示的 `-p`/`--print` 且 stdin 上沒有任何內容產生相同的錯誤。3192裸 `claude` 需要 stdout 是終端才能啟動互動 UI。當 stdout 被重新導向,或控制台不是真實終端時,例如 PowerShell ISE 和某些 IDE 輸出窗格,`claude` 改為以[非互動](/docs/zh-TW/headless)模式執行。這與 `claude -p` 相同,它需要提示,所以訊息命名 `--print` 即使您沒有傳遞旗標。在任何地方傳遞 `-p`/`--print` 而沒有提示且 stdin 上沒有任何管道會產生相同的錯誤。
3005 3193
3006```text theme={null}3194```text theme={null}
3007Error: Input must be provided either through stdin or as a prompt argument when using --print3195Error: Input must be provided either through stdin or as a prompt argument when using --print
3009 3197
3010**該怎麼做:**3198**該怎麼做:**
3011 3199
3012* 對於互動使用,在真實終端中執行 `claude`:Windows Terminal 或 PowerShell 主控台而不是 ISE,以及您的 IDE 的整合終端而不是輸出窗格3200* 對於互動使用,在真實終端中執行 `claude`:Windows Terminal 或 PowerShell 控制台而不是 ISE,以及您的 IDE 整合終端而不是輸出窗格
3013* 對於一次性使用,傳遞提示:`claude -p "your question"`,或使用 `echo "your question" | claude -p` 管道它3201* 對於一次性使用,傳遞提示:`claude -p "your question"`,或使用 `echo "your question" | claude -p` 管道它
3014 3202
3015<h3 id="input-contained-only-whitespace">3203<h3 id="input-contained-only-whitespace">
3019在[非互動模式](/docs/zh-TW/headless)中,Claude Code 拒絕完全由空格、製表符或換行符組成的提示,而不是傳送它,因為 API 拒絕沒有可見文字的訊息。您看到的訊息取決於空白提示來自何處:3207在[非互動模式](/docs/zh-TW/headless)中,Claude Code 拒絕完全由空格、製表符或換行符組成的提示,而不是傳送它,因為 API 拒絕沒有可見文字的訊息。您看到的訊息取決於空白提示來自何處:
3020 3208
3021* **`claude -p` 的提示引數或管道 stdin**:`claude` 以 `Error: Input contained only whitespace. Provide a prompt with text through stdin or as a prompt argument when using --print` 結束3209* **`claude -p` 的提示引數或管道 stdin**:`claude` 以 `Error: Input contained only whitespace. Provide a prompt with text through stdin or as a prompt argument when using --print` 結束
3022* **提交給執行中的 `--input-format stream-json` 或 [Agent SDK](/docs/zh-TW/agent-sdk/overview) 工作階段的訊息**:Claude Code 在不呼叫模型的情況下結束輪次,工作階段保持可用。拒絕作為資訊訊息和輪次的結果文字到達:`Blank prompt — the message was only whitespace, so nothing was sent to the model.`3210* **提交給執行中的 `--input-format stream-json` 或 [Agent SDK](/docs/zh-TW/agent-sdk/overview) 工作階段的訊息**:Claude Code 在不呼叫模型的情況下結束轉向,工作階段保持可用。拒絕作為資訊訊息和轉向的結果文字到達:`Blank prompt — the message was only whitespace, so nothing was sent to the model.`
3023 3211
3024在 v2.1.229 之前,Claude Code 將空白訊息傳送到 API,API 以 400 錯誤拒絕請求。3212在 v2.1.229 之前,Claude Code 將僅空白訊息傳送到 API,API 以 400 錯誤拒絕了請求。
3025 3213
3026**該怎麼做:**3214**該怎麼做:**
3027 3215
3028* 在提示中包含可見文字。如果指令碼從變數或檔案建立提示,請在呼叫 Claude Code 之前檢查來源是否不為空。3216* 在提示中包含可見文字。如果指令碼從變數或檔案建立提示,請在呼叫 Claude Code 之前檢查來源是否不為空。
3029 3217
3030<h3 id="stream-json-input-carried-over-256m-characters-with-no-newline">3218<h3 id="stream-json-input-carried-over-256m-characters-with-no-newline">
3031 stream-json 輸入在沒有換行符的情況下超過 256M 字元3219 stream-json 輸入在沒有換行符的情況下超過 256M 個字元
3032</h3>3220</h3>
3033 3221
3034您的程式在 stdin 上傳送了超過 268,435,456 個字元,沒有換行符到 `claude -p --input-format stream-json` 執行,所以 Claude Code 將此錯誤列印到 stderr 並以代碼 1 結束,而不是緩衝更多輸入。訊息將該預算陳述為 `256M`。在 v2.1.257 之前,Claude Code 無限制地緩衝此類輸入,增加記憶體,直到程序崩潰或被殺死。3222您的程式在沒有換行符的情況下在 stdin 上傳送了超過 268,435,456 個字元到 `claude -p --input-format stream-json` 執行,所以 Claude Code 將此錯誤列印到 stderr 並以代碼 1 結束而不是緩衝更多輸入。訊息將該預算陳述為 `256M`。在 v2.1.257 之前,Claude Code 無限制地緩衝此類輸入,增加記憶體直到程序崩潰或被殺死。
3035 3223
3036```text theme={null}3224```text theme={null}
3037Error: stream-json input carried over 256M characters with no newline. Each stream-json message must be a single newline-terminated JSON line: either the producer is not newline-terminating its messages, or one message exceeded this budget.3225Error: stream-json input carried over 256M characters with no newline. Each stream-json message must be a single newline-terminated JSON line: either the producer is not newline-terminating its messages, or one message exceeded this budget.
3038```3226```
3039 3227
3040沒有換行符的這麼長的輸入通常意味著製作者根本不是 stream-json 製作者,例如二進位檔案或意外管道的純日誌輸出。超過預算的單一訊息失敗相同的檢查。3228沒有換行符的此長度輸入通常表示生產者根本不是 stream-json 生產者,例如二進位檔案或意外管道的純日誌輸出。超過預算的單個訊息失敗相同的檢查。
3041 3229
3042**該怎麼做:**3230**該怎麼做:**
3043 3231
3048 未知命令3236 未知命令
3049</h3>3237</h3>
3050 3238
3051在互動終端工作階段中,您提交了一個 `/` 名稱,它不符合此工作階段中的任何命令,所以 Claude Code 報告該名稱而不是執行任何操作:3239在互動終端工作階段中,您提交了一個 `/` 名稱,該名稱與此工作階段中的任何命令都不符,所以 Claude Code 報告該名稱而不是執行任何操作:
3052 3240
3053```text theme={null}3241```text theme={null}
3054Unknown command: /hepl. Did you mean /help?3242Unknown command: /hepl. Did you mean /help?
3056 3244
3057Claude Code 建議此工作階段中菜單列出的最接近的命令名稱或別名。當沒有接近的時,訊息在名稱後結束。原因通常是以下之一:3245Claude Code 建議此工作階段中菜單列出的最接近的命令名稱或別名。當沒有接近的時,訊息在名稱後結束。原因通常是以下之一:
3058 3246
3059* 打字錯誤,例如 `/hepl` 代替 `/help`。[How the command menu matches what you type](/docs/zh-TW/commands#how-the-command-menu-matches-what-you-type) 涵蓋在提交前選擇接近的匹配3247* 打字錯誤,例如 `/hepl` 代替 `/help`。[命令菜單如何匹配您輸入的內容](/docs/zh-TW/commands#how-the-command-menu-matches-what-you-type)涵蓋在提交前選擇接近的匹配
3060* 存在但在此工作階段中不可用的命令,因為不符合要求,例如您的平台、計畫或身份驗證方法。[`/web-setup`](/docs/zh-TW/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command) 和 [`/schedule`](/docs/zh-TW/routines#schedule-returns-unknown-command) 的故障排除項目演練兩個常見情況。某些命令在您的組織政策停用它們時以自己的訊息回答,例如 [`Cloud sessions are disabled by your organization's policy`](#cloud-sessions-are-disabled-by-your-organizations-policy)3248* 存在但在此工作階段中不可用的命令,因為不符合要求,例如您的平台、計畫或身份驗證方法。[`/web-setup`](/docs/zh-TW/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command) 和 [`/schedule`](/docs/zh-TW/routines#schedule-returns-unknown-command) 的故障排除項目演練兩個常見情況。某些命令在您的組織政策停用它們時會回答自己的訊息,例如 [`Cloud sessions are disabled by your organization's policy`](#cloud-sessions-are-disabled-by-your-organizations-policy)
3061* 來自此工作階段中未安裝或未連接的[外掛程式](/docs/zh-TW/plugins)或 [MCP 伺服器](/docs/zh-TW/mcp#use-mcp-prompts-as-commands)的命令3249* 來自此工作階段中未安裝或未連接的[外掛程式](/docs/zh-TW/plugins/overview)或 [MCP 伺服器](/docs/zh-TW/mcp#use-mcp-prompts-as-commands)的命令
3062 3250
3063Claude Code 只在互動終端工作階段中以此方式回答不符合的 `/` 名稱。在每個其他工作階段中,它改為將提示傳送給 Claude 作為普通訊息,並帶有命令未執行的注意和 Claude 可以在工作階段中執行的命令清單。這些工作階段包括:3251Claude Code 只在互動終端工作階段中以這種方式回答不符合的 `/` 名稱。在每個其他工作階段中,它改為將提示作為普通訊息傳送給 Claude,並附註命令未執行以及 Claude 可以在工作階段中執行的命令列表。這些工作階段包括:
3064 3252
3065* `-p` 執行3253* `-p` 執行
3066* [Agent SDK](/docs/zh-TW/agent-sdk/overview) 應用程式3254* [Agent SDK](/docs/zh-TW/agent-sdk/overview) 應用程式
3067* [Desktop 應用程式](/docs/zh-TW/desktop)的代碼標籤3255* [Desktop 應用程式](/docs/zh-TW/desktop)的代碼標籤
3068* [VS Code 擴充功能](/docs/zh-TW/vs-code)的聊天面板3256* [VS Code 擴充功能](/docs/zh-TW/vs-code)的聊天面板
3069* [雲端工作階段](/docs/zh-TW/claude-code-on-the-web)和[例程](/docs/zh-TW/routines)3257* [雲端工作階段](/docs/zh-TW/claude-code-on-the-web)和[例行程序](/docs/zh-TW/routines)
3070 3258
3071對於無法在其中一個工作階段中執行的內建命令,Claude Code 仍然回答命令不可用,而不是將其傳送給 Claude。在 v2.1.274 之前,只有雲端工作階段和例程將不符合的名稱傳送給 Claude。在 v2.1.273 之前,它們也回答 `Unknown command`。3259對於無法在其中一個工作階段中執行的內建命令,Claude Code 仍會回答該命令不可用,而不是將其傳送給 Claude。在 v2.1.274 之前,只有雲端工作階段和例行程序將不符合的名稱傳送給 Claude。在 v2.1.273 之前,它們也回答 `Unknown command`。
3072 3260
3073Claude Code 不將每個以 `/` 開頭的提示視為命令。當 `/` 後的第一個單詞以標點符號開頭時,它將提示傳送給 Claude 作為普通訊息,例如開啟 Lean 文件註釋的 `/--`,或是路徑,例如 `/var/log/syslog`。3261Claude Code 不會將每個以 `/` 開頭的提示視為命令。當 `/` 後的第一個單詞以標點符號開頭時,它會將提示作為普通訊息傳送給 Claude,例如開啟 Lean 文件註釋的 `/--`,或是路徑,例如 `/var/log/syslog`。
3074 3262
3075在 v2.1.236 之前,如果您在命令菜單列出您輸入的名稱的接近匹配時按下 `Enter`,Claude Code 執行該匹配,所以 `/hepl` 等打字錯誤執行 `/help` 而不是產生此訊息。3263在 v2.1.236 之前,如果您在命令菜單列出您輸入的名稱的接近匹配時按 Enter,Claude Code 會執行該匹配,所以 `/hepl` 之類的打字錯誤會執行 `/help` 而不是產生此訊息。
3076 3264
3077**該怎麼做:**3265**該怎麼做:**
3078 3266
3079* 執行建議的名稱,或輸入 `/` 後跟名稱的一部分以查看此工作階段中可用的內容3267* 執行建議的名稱,或輸入 `/` 後跟名稱的一部分以查看此工作階段中可用的內容
3080* 如果 Claude Code 報告文件化命令為未知,請檢查[命令參考](/docs/zh-TW/commands)中其行以了解它命名的要求3268* 如果 Claude Code 將記錄的命令報告為未知,請檢查[命令參考](/docs/zh-TW/commands)中的其行以了解它命名的要求
3081 3269
3082<h3 id="diff-is-too-large-for-ultrareview">3270<h3 id="diff-is-too-large-for-ultrareview">
3083 差異對於 ultrareview 來說太大3271 差異對於 ultrareview 來說太大
3084</h3>3272</h3>
3085 3273
3086您的分支與基礎分支之間的差異,包括未提交和暫存的變更,超過 [ultrareview](/docs/zh-TW/ultrareview) 的大小限制,所以 `/code-review ultra` 和 `claude ultrareview` 子命令在雲端工作階段啟動前拒絕審查。被拒絕的審查不使用免費執行,不計費使用額度。訊息命名有效的限制、您的差異大小和貢獻最多變更行的檔案。在 v2.1.216 之前,訊息只顯示原始差異統計。3274您的分支與基礎分支之間的差異,包括未提交和暫存的變更,超過了 [ultrareview](/docs/zh-TW/ultrareview) 的大小限制,所以 `/code-review ultra` 和 `claude ultrareview` 子命令在雲端工作階段啟動之前拒絕審查。被拒絕的審查不使用免費執行,也不計費使用額度。訊息命名有效的限制、您的差異大小以及貢獻最多變更行的檔案。在 v2.1.216 之前,訊息只顯示原始差異統計。
3087 3275
3088```text theme={null}3276```text theme={null}
3089Diff is too large for ultrareview: 812 files, 96,410 lines changed (limits: 500 files, 8,000 lines). Largest files: package-lock.json (41,904 lines), dist/bundle.js (18,210 lines), src/generated/api.ts (9,876 lines). Pass a closer base branch (`/code-review ultra <branch>`) to narrow the scope, or split the change.3277Diff is too large for ultrareview: 812 files, 96,410 lines changed (limits: 500 files, 8,000 lines). Largest files: package-lock.json (41,904 lines), dist/bundle.js (18,210 lines), src/generated/api.ts (9,876 lines). Pass a closer base branch (`/code-review ultra <branch>`) to narrow the scope, or split the change.
3093 3281
3094**該怎麼做:**3282**該怎麼做:**
3095 3283
3096* 傳遞更接近您工作的基礎分支,例如 `/code-review ultra develop`,以便審查只涵蓋針對該分支的差異3284* 傳遞更接近您工作的基礎分支,例如 `/code-review ultra develop`,以便審查僅涵蓋針對該分支的差異
3097* 將變更分割成較小的分支,並審查每一個。訊息命名的檔案貢獻最多變更行,所以首先將這些移到自己的分支。3285* 將變更分成較小的分支並審查每一個。訊息命名的檔案貢獻最多變更行,所以首先開始將這些移到它們自己的分支。
3098 3286
3099<h3 id="could-not-find-merge-base-with-the-base-branch">3287<h3 id="could-not-find-merge-base-with-the-base-branch">
3100 找不到與基礎分支的合併基礎3288 無法找到與基礎分支的合併基礎
3101</h3>3289</h3>
3102 3290
3103`/code-review ultra` 和 `claude ultrareview` 子命令審查您的分支與基礎分支之間的差異,這需要兩者共享的提交。當 `git merge-base` 找不到時,Claude Code 在雲端工作階段啟動前拒絕審查。在 Claude Code 可以驗證完整的複製上,至少有一個分支,它改為回退到[審查每個追蹤檔案](/docs/zh-TW/ultrareview#diff-limits-and-fallbacks)而不是拒絕。您在基礎分支根本找不到時、Claude Code 無法驗證您的複製完整時,或在罕見的儲存庫中看到此拒絕,其中整個樹差異不可能,例如 SHA-256 物件格式。3291`/code-review ultra` 和 `claude ultrareview` 子命令審查您的分支與基礎分支之間的差異,這需要兩者共享的提交。當 `git merge-base` 找不到時,Claude Code 在雲端工作階段啟動之前拒絕審查。在 Claude Code 可以驗證完整的複製上,至少有一個分支,它改為[審查每個追蹤的檔案](/docs/zh-TW/ultrareview#diff-limits-and-fallbacks)而不是拒絕。當基礎分支根本找不到時,當 Claude Code 無法驗證您的複製是否完整時,或在罕見的儲存庫中(其中整個樹差異不可能),例如 SHA-256 物件格式,您會看到此拒絕。
3104 3292
3105```text theme={null}3293```text theme={null}
3106Could not find merge-base with main. Pass the base branch explicitly (e.g. `/code-review ultra develop`) or make sure you're in a git repo with a main branch.3294Could not find merge-base with main. Pass the base branch explicitly (e.g. `/code-review ultra develop`) or make sure you're in a git repo with a main branch.
3108 3296
3109第一句後的提示取決於 Claude Code 觀察到的內容:3297第一句後的提示取決於 Claude Code 觀察到的內容:
3110 3298
3111* **您沒有傳遞基礎分支**:Claude Code 與儲存庫的預設分支進行比較,並建議明確傳遞您的基礎,如上例所示3299* **您沒有傳遞基礎分支**:Claude Code 與儲存庫的預設分支進行了比較,並建議明確傳遞您的基礎,如上例所示
3112* **您傳遞的基礎分支已在您的複製中**:提示讀取 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``3300* **您傳遞的基礎分支已在您的複製中**:提示讀取 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``
3113* **您傳遞的基礎分支不在您的複製中**:Claude Code 在比較前從 origin 擷取它。提示讀取 ``<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`)``;當 Claude Code 無法判斷您的複製是否淺時,它改為建議 `git fetch --unshallow origin`。在 v2.1.221 之前,提示為每個擷取的基礎分支建議 `git fetch --unshallow origin`,在完整複製上該命令失敗並出現 `fatal: --unshallow on a complete repository does not make sense`。3301* **您傳遞的基礎分支不在您的複製中**:Claude Code 在比較前從 origin 擷取了它。提示讀取 ``<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`)``;當 Claude Code 無法判斷您的複製是否淺時,它改為建議 `git fetch --unshallow origin`。在 v2.1.221 之前,提示為每個擷取的基礎分支建議 `git fetch --unshallow origin`,在完整複製上該命令失敗並顯示 `fatal: --unshallow on a complete repository does not make sense`。
3114 3302
3115**該怎麼做:**3303**該怎麼做:**
3116 3304
3121 您的檢出沒有分支3309 您的檢出沒有分支
3122</h3>3310</h3>
3123 3311
3124檢出可以有提交但沒有分支:如果您執行 `git init` 後跟 `git fetch <url>` 和 `git checkout FETCH_HEAD`,您會得到一個分離的 HEAD,沒有 refs。Claude Code 將您的儲存庫打包為 git 套件以上傳以進行 [ultrareview](/docs/zh-TW/ultrareview),它無法打包沒有分支或其他 refs 的儲存庫,所以 `/code-review ultra` 和 `claude ultrareview` 子命令在雲端工作階段啟動前拒絕審查。3312檢出可以有提交但沒有分支:如果您執行 `git init` 後跟 `git fetch <url>` 和 `git checkout FETCH_HEAD`,您會得到一個分離的 HEAD 而沒有參考。Claude Code 將您的儲存庫打包為 git 套件以上傳它進行 [ultrareview](/docs/zh-TW/ultrareview),它無法打包沒有分支或其他參考的儲存庫,所以 `/code-review ultra` 和 `claude ultrareview` 子命令在雲端工作階段啟動之前拒絕審查。
3125 3313
3126```text theme={null}3314```text theme={null}
3127Your checkout has no branches (detached HEAD only), which cloud review can't bundle. Create one first — `git checkout -b <name>` — then rerun /code-review ultra.3315Your checkout has no branches (detached HEAD only), which cloud review can't bundle. Create one first — `git checkout -b <name>` — then rerun /code-review ultra.
3131 3319
3132**該怎麼做:**3320**該怎麼做:**
3133 3321
3134* 使用 `git checkout -b <name>` 在您目前的提交建立分支,然後重新執行審查3322* 使用 `git checkout -b <name>` 在您目前的提交上建立分支,然後重新執行審查
3135 3323
3136<h3 id="no-github-account-is-connected-to-your-claude-account">3324<h3 id="no-github-account-is-connected-to-your-claude-account">
3137 沒有 GitHub 帳戶連接到您的 Claude 帳戶3325 沒有 GitHub 帳戶連接到您的 Claude 帳戶
3138</h3>3326</h3>
3139 3327
3140您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,在建立雲端工作階段前,Claude Code 詢問伺服器[連接到您的 Claude 帳戶的 GitHub 帳戶](/docs/zh-TW/ultrareview#review-a-pull-request)是否可以到達 PR 的儲存庫。沒有帳戶連接,或連接已過期,所以雲端複製會失敗,Claude Code 拒絕啟動。Claude Code 不為被拒絕的啟動花費免費執行或計費使用額度。3328您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,在建立雲端工作階段之前 Claude Code 詢問伺服器[連接到您的 Claude 帳戶的 GitHub 帳戶](/docs/zh-TW/ultrareview#review-a-pull-request)是否可以到達 PR 的儲存庫。沒有帳戶連接,或連接已過期,所以雲端複製會失敗,Claude Code 拒絕啟動。Claude Code 不會為被拒絕的啟動花費免費執行或計費使用額度。
3141 3329
3142```text theme={null}3330```text theme={null}
3143Ultrareview clones <owner>/<repo> in the cloud with the GitHub account connected to your Claude account, and none is connected (or the connection expired). To fix: run /web-setup to reuse your GitHub CLI login, or connect an account at https://claude.ai/connect-github — then re-run /code-review ultra 1234 (allow a minute after connecting).3331Ultrareview clones <owner>/<repo> in the cloud with the GitHub account connected to your Claude account, and none is connected (or the connection expired). To fix: run /web-setup to reuse your GitHub CLI login, or connect an account at https://claude.ai/connect-github — then re-run /code-review ultra 1234 (allow a minute after connecting).
3150* 執行 `/web-setup` 以將您的 GitHub CLI 登入連接到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連接帳戶3338* 執行 `/web-setup` 以將您的 GitHub CLI 登入連接到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連接帳戶
3151* 連接後一分鐘重新執行審查3339* 連接後一分鐘重新執行審查
3152 3340
3153在 v2.1.248 之前,Claude Code 不在啟動前檢查此項。3341在 v2.1.248 之前,Claude Code 在啟動前不檢查此項。
3154 3342
3155<h3 id="your-connected-github-account-cant-see-the-repository">3343<h3 id="your-connected-github-account-cant-see-the-repository">
3156 您連接的 GitHub 帳戶看不到儲存庫3344 您連接的 GitHub 帳戶無法看到儲存庫
3157</h3>3345</h3>
3158 3346
3159您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,[連接到您的 Claude 帳戶的 GitHub 帳戶](/docs/zh-TW/ultrareview#review-a-pull-request)無法讀取 PR 的儲存庫,所以雲端複製會失敗,Claude Code 拒絕啟動。Claude Code 不為被拒絕的啟動花費免費執行或計費使用額度。3347您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,[連接到您的 Claude 帳戶的 GitHub 帳戶](/docs/zh-TW/ultrareview#review-a-pull-request)無法讀取 PR 的儲存庫,所以雲端複製會失敗,Claude Code 拒絕啟動。Claude Code 不會為被拒絕的啟動花費免費執行或計費使用額度。
3160 3348
3161```text theme={null}3349```text theme={null}
3162Your connected GitHub account can't see <owner>/<repo> — usually the Claude GitHub app isn't installed on <owner> or wasn't granted this repo (web-connected accounts need it for private repos), or a different GitHub account is connected. To fix: run /web-setup to reuse your GitHub CLI login, or install the app at https://github.com/apps/claude/installations/new — then re-run /code-review ultra 1234.3350Your connected GitHub account can't see <owner>/<repo> — usually the Claude GitHub app isn't installed on <owner> or wasn't granted this repo (web-connected accounts need it for private repos), or a different GitHub account is connected. To fix: run /web-setup to reuse your GitHub CLI login, or install the app at https://github.com/apps/claude/installations/new — then re-run /code-review ultra 1234.
3169* 如果您的本地 `gh` CLI 可以讀取儲存庫,執行 `/web-setup` 以將該登入連接到您的 Claude 帳戶3357* 如果您的本地 `gh` CLI 可以讀取儲存庫,執行 `/web-setup` 以將該登入連接到您的 Claude 帳戶
3170* 變更後重新執行審查3358* 變更後重新執行審查
3171 3359
3172在 v2.1.248 之前,Claude Code 不在啟動前檢查此項。3360在 v2.1.248 之前,Claude Code 在啟動前不檢查此項。
3173 3361
3174<h3 id="the-github-app-preflight-failed-transiently">3362<h3 id="the-github-app-preflight-failed-transiently">
3175 GitHub 應用程式預檢暫時失敗3363 GitHub 應用程式預檢暫時失敗
3176</h3>3364</h3>
3177 3365
3178您從本地儲存庫啟動了[雲端工作階段](/docs/zh-TW/claude-code-on-the-web),兩個步驟一起失敗。Claude Code 無法建立或上傳您的儲存庫套件。在上傳前,它檢查雲端服務是否可以從 GitHub 複製儲存庫,而不是明確的答案,該檢查以重試可以清除的錯誤結束,例如網路錯誤、逾時或暫時伺服器錯誤。完整訊息以停止套件的內容開頭,例如 `Could not upload repo bundle (<error>)`,並以預檢句子結尾:3366您從本地儲存庫啟動了[雲端工作階段](/docs/zh-TW/claude-code-on-the-web),兩個步驟一起失敗。Claude Code 無法建立或上傳您的儲存庫套件。在上傳之前,它檢查了雲端服務是否可以從 GitHub 複製儲存庫,而不是明確的答案,該檢查以重試可能清除的錯誤結束,例如網路錯誤、逾時或暫時伺服器錯誤。完整訊息以停止套件的內容開頭,例如 `Could not upload repo bundle (<error>)`,並以預檢句子結尾:
3179 3367
3180```text theme={null}3368```text theme={null}
3181Could not upload repo bundle (<error>). The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead3369Could not upload repo bundle (<error>). The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead
3186* 片刻後重新執行命令。當 GitHub 檢查通過時,Claude Code 可以從 GitHub 複製啟動工作階段,所以失敗的上傳不再阻止啟動3374* 片刻後重新執行命令。當 GitHub 檢查通過時,Claude Code 可以從 GitHub 複製啟動工作階段,所以失敗的上傳不再阻止啟動
3187* 如果重試持續失敗,訊息的開頭命名停止上傳的內容。當該原因是您可以修復的內容時,修復它以便工作階段可以改為從您的本地儲存庫啟動3375* 如果重試持續失敗,訊息的開頭命名停止上傳的內容。當該原因是您可以修復的內容時,修復它以便工作階段可以改為從您的本地儲存庫啟動
3188 3376
3189在 v2.1.251 之前,Claude Code 以 `Please set up GitHub on https://claude.ai/code` 結尾訊息,即使 GitHub 檢查只暫時失敗,設定建議無法清除暫時失敗。3377在 v2.1.251 之前,Claude Code 以 `Please set up GitHub on https://claude.ai/code` 結束訊息,即使 GitHub 檢查只暫時失敗,設定建議無法清除暫時失敗。
3190 3378
3191<h3 id="github-isnt-connected-to-your-claude-account">3379<h3 id="github-isnt-connected-to-your-claude-account">
3192 GitHub 未連接到您的 Claude 帳戶3380 GitHub 未連接到您的 Claude 帳戶
3198GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud. Run /web-setup to connect with your GitHub CLI login, or connect on the web at https://claude.ai/connect-github3386GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud. Run /web-setup to connect with your GitHub CLI login, or connect on the web at https://claude.ai/connect-github
3199```3387```
3200 3388
3201當您使用 [`/schedule`](/docs/zh-TW/routines) 建立例程時,相同的訊息作為命名儲存庫的設定注意出現;注意不阻止建立例程。3389當您使用 [`/schedule`](/docs/zh-TW/routines) 建立例行程序時,相同的訊息作為設定注意事項出現,命名儲存庫;注意事項不會阻止建立例行程序。
3202 3390
3203**該怎麼做:**3391**該怎麼做:**
3204 3392
3205* 執行 `/web-setup` 以使用您的 GitHub CLI 登入連接到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連接帳戶。請參閱 [GitHub 身份驗證選項](/docs/zh-TW/claude-code-on-the-web#github-authentication-options)以了解兩者的差異。3393* 執行 `/web-setup` 以將您的 GitHub CLI 登入連接到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連接帳戶。請參閱 [GitHub 身份驗證選項](/docs/zh-TW/claude-code-on-the-web#github-authentication-options)以了解兩者的差異。
3206* 連接後一分鐘重新執行命令3394* 連接後一分鐘重新執行命令
3207 3395
3208在 v2.1.268 之前,Claude Code 報告此為 Claude GitHub 應用程式檢查的暫時失敗,並建議重試或安裝應用程式;兩者都不連接 GitHub 帳戶。3396在 v2.1.268 之前,Claude Code 將此報告為 Claude GitHub 應用程式檢查的暫時失敗,並建議重試或安裝應用程式;兩者都不連接 GitHub 帳戶。
3209 3397
3210<h3 id="single-sign-on-authorization-needed">3398<h3 id="single-sign-on-authorization-needed">
3211 需要單一登入授權3399 需要單一登入授權
3212</h3>3400</h3>
3213 3401
3214您執行了 [`/install-github-app`](/docs/zh-TW/github-actions#quick-setup),並選擇了其組織強制執行 SAML 單一登入的儲存庫。在設定前,Claude Code 使用 GitHub CLI 檢查您對儲存庫的存取,GitHub 拒絕該檢查,因為您的 `gh` 令牌尚未針對組織授權。精靈顯示帶有授權步驟的警告:3402您執行了 [`/install-github-app`](/docs/zh-TW/github-actions#quick-setup) 並選擇了其組織強制執行 SAML 單一登入的儲存庫。在設定之前,Claude Code 使用 GitHub CLI 檢查您對儲存庫的存取,GitHub 拒絕了該檢查,因為您的 `gh` 權杖尚未針對組織授權。精靈顯示帶有授權步驟的警告:
3215 3403
3216```text theme={null}3404```text theme={null}
3217Single sign-on authorization needed3405Single sign-on authorization needed
3220 3408
3221**該怎麼做:**3409**該怎麼做:**
3222 3410
3223* 透過執行 `gh auth refresh -h github.com -s repo,workflow` 使用 `repo` 和 `workflow` 範圍重新授權您的 GitHub CLI 登入,並在 GitHub 提示單一登入時授權組織3411* 通過執行 `gh auth refresh -h github.com -s repo,workflow` 使用 `repo` 和 `workflow` 範圍重新授權您的 GitHub CLI 登入,並在 GitHub 提示單一登入時授權組織
3224* 如果您使用 `GH_TOKEN` 中的個人存取令牌進行身份驗證,開啟 [github.com/settings/tokens](https://github.com/settings/tokens),在令牌上選擇**設定 SSO**,並授權組織3412* 如果您使用 `GH_TOKEN` 中的個人存取權杖進行身份驗證,請開啟 [github.com/settings/tokens](https://github.com/settings/tokens),在權杖上選擇**設定 SSO**,並授權組織
3225* 再次執行 `/install-github-app`3413* 再次執行 `/install-github-app`
3226 3414
3227在 v2.1.273 之前,Claude Code 為此條件顯示 `Admin permissions required` 警告。3415在 v2.1.273 之前,Claude Code 為此條件顯示 `Admin permissions required` 警告。
3230 無法恢復對話3418 無法恢復對話
3231</h3>3419</h3>
3232 3420
3233Claude Code 無法讀取或處理您從 [`claude --resume` 選擇器](/docs/zh-TW/sessions#use-the-session-picker)選擇的工作階段的已儲存文字記錄,所以它結束程序而不是在部分載入狀態下繼續。訊息包括重試的命令:3421Claude Code 無法讀取或處理您從 [`claude --resume` 選擇器](/docs/zh-TW/sessions#use-the-session-picker)選擇的工作階段的已保存文字記錄,所以它結束程序而不是在部分載入狀態下繼續。訊息包括重試的命令:
3234 3422
3235```text theme={null}3423```text theme={null}
3236Failed to resume the conversation.3424Failed to resume the conversation.
3237Run claude --resume <session-id> to retry, or claude to start a new session.3425Run claude --resume <session-id> to retry, or claude to start a new session.
3238```3426```
3239 3427
3240Claude Code 在顯示訊息後以代碼 1 結束。執行中工作階段內的 `/resume` 選擇器報告對話中的 `Failed to resume conversation`,您目前的工作階段保持執行。在 v2.1.216 之前,來自 `claude --resume` 選擇器的失敗恢復在 `Resuming conversation…` 微調器上無限期停留,而不是顯示此訊息。3428Claude Code 在顯示訊息後以代碼 1 結束。在執行中的工作階段內的 `/resume` 選擇器報告對話中的 `Failed to resume conversation`,您目前的工作階段保持執行。在 v2.1.216 之前,來自 `claude --resume` 選擇器的失敗恢復在 `Resuming conversation…` 微調器上無限期停留,而不是顯示此訊息。
3241 3429
3242**該怎麼做:**3430**該怎麼做:**
3243 3431
3244* 執行 `claude --resume <session-id>`,使用訊息中的工作階段 ID 重試3432* 執行 `claude --resume <session-id>` 搭配訊息中的工作階段 ID 以重試
3245* 如果重試再次失敗,執行 `claude update` 並再次恢復。v2.1.275 之前的版本在已儲存的文字記錄包含它們無法讀取的項目時失敗恢復。3433* 如果每次重試都以相同方式失敗,執行 `claude update` 並再次恢復。v2.1.275 之前的版本在已保存的文字記錄包含它們無法讀取的項目時恢復失敗。
3246* 如果重試再次失敗,執行 `claude` 啟動新工作階段3434* 如果重試再次失敗,執行 `claude` 以啟動新工作階段
3247 3435
3248<h3 id="no-conversation-found-with-the-session-id">3436<h3 id="no-conversation-found-with-the-session-id">
3249 找不到具有工作階段 ID 的對話3437 找不到具有工作階段 ID 的對話
3250</h3>3438</h3>
3251 3439
3252您傳遞了工作階段 ID 給 `claude --resume <session-id>`,沒有已儲存的文字記錄符合它:3440您傳遞了工作階段 ID 給 `claude --resume <session-id>`,沒有已保存的文字記錄與其相符:
3253 3441
3254```text theme={null}3442```text theme={null}
3255No conversation found with session ID: <session-id>3443No conversation found with session ID: <session-id>
3256```3444```
3257 3445
3258Claude Code 在顯示訊息後以代碼 1 結束。Claude Code [首先搜尋目前專案,然後搜尋此機器上的每個其他專案](/docs/zh-TW/sessions#resume-a-session)以尋找 ID。在 v2.1.223 之前,查詢在目前專案目錄及其 git worktrees 停止,所以從工作階段最後工作的目錄恢復。3446Claude Code 在顯示訊息後以代碼 1 結束。Claude Code [首先搜尋目前專案,然後搜尋此機器上的每個其他專案](/docs/zh-TW/sessions#resume-a-session)以找到 ID。在 v2.1.223 之前,查詢停止在目前專案目錄及其 git worktrees,所以從工作階段最後工作的目錄恢復。
3259 3447
3260常見原因:3448常見原因:
3261 3449
3262* **打字錯誤的 ID**:對於非互動執行,ID 是 [`--output-format json` 輸出](/docs/zh-TW/headless#get-structured-output)的 `session_id` 欄位3450* **打字錯誤的 ID**:對於非互動執行,ID 是 [`--output-format json` 輸出](/docs/zh-TW/headless#get-structured-output)的 `session_id` 欄位
3263* **已刪除的文字記錄**:Claude Code 在[保留期](/docs/zh-TW/sessions#where-transcripts-are-stored)後移除文字記錄,預設 30 天,遵循[保留掃描規則](/docs/zh-TW/claude-directory#cleaned-up-automatically)3451* **已刪除的文字記錄**:Claude Code 在[保留期](/docs/zh-TW/sessions#where-transcripts-are-stored)後移除文字記錄,預設為 30 天,遵循[保留掃描規則](/docs/zh-TW/claude-directory#cleaned-up-automatically)
3264* **不同的機器**:Claude Code 在本地儲存文字記錄,所以在執行工作階段的機器上恢復工作階段3452* **不同的機器**:Claude Code 在本地儲存文字記錄,所以在執行工作階段的機器上恢復它
3265* **重複副本**:如果您在 `~/.claude/projects` 下複製了專案目錄,使兩個文字記錄帶有相同 ID,Claude Code 報告此訊息而不是任意恢復一個副本3453* **重複副本**:如果您在 `~/.claude/projects` 下複製了專案目錄,使兩個文字記錄帶有相同 ID,Claude Code 報告此訊息而不是任意恢復一個副本
3266 3454
3267**該怎麼做:**3455**該怎麼做:**
3268 3456
3269* 對於互動工作階段,使用 `claude --resume` 開啟[工作階段選擇器](/docs/zh-TW/sessions#use-the-session-picker),按 `Ctrl+A` 將其擴寬到此機器上的每個專案,然後選擇工作階段3457* 對於互動工作階段,使用 `claude --resume` 開啟[工作階段選擇器](/docs/zh-TW/sessions#use-the-session-picker),按 `Ctrl+A` 將其擴大到此機器上的每個專案,然後選擇工作階段
3270* 使用 `claude -p` 或 [Agent SDK](/docs/zh-TW/agent-sdk/overview) 建立的工作階段不會出現在選擇器中,所以重新檢查 ID 與您的原始執行列印的 `session_id`3458* 使用 `claude -p` 或 [Agent SDK](/docs/zh-TW/agent-sdk/overview) 建立的工作階段不會出現在選擇器中,所以根據您的原始執行列印的 `session_id` 重新檢查 ID
3459
3460<h3 id="windows-reported-an-error-ebadf">
3461 Windows 在 Claude Code 讀取此工作階段的文字記錄檔案時報告了錯誤 (EBADF)
3462</h3>
3463
3464您在 Windows 上恢復了工作階段,其已保存的[文字記錄檔案](/docs/zh-TW/sessions#where-transcripts-are-stored)正常開啟,讀取它然後失敗並顯示系統錯誤 EBADF。系統錯誤沒有說明讀取失敗的原因,所以訊息建議可能的原因和要嘗試的內容:
3465
3466```text theme={null}
3467Windows 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.
3468```
3469
3470訊息遵循命令自己的失敗行,例如 `Failed to resume session <session-id>`。`claude --resume` 或 [`claude -p`](/docs/zh-TW/headless) 命令在顯示它後以代碼 1 結束。在工作階段內的 `/resume` 後,您目前的工作階段保持執行。
3471
3472**該怎麼做:**
3473
3474* 從掃描或攔截檔案讀取的軟體(例如安全、加密或端點管理工具)中排除保存工作階段文字記錄的資料夾。文字記錄預設位於 `%USERPROFILE%\.claude\projects` 下,或位於 [`CLAUDE_CONFIG_DIR`](/docs/zh-TW/env-vars) 命名的目錄下
3475* 如果您無法新增排除項,請改為將 Claude Code 新增到該軟體的允許應用程式
3476* 再次恢復工作階段
3477
3478在 v2.1.282 之前,失敗沒有解釋:`claude --resume <session-id>` 在 `Failed to resume session <session-id>` 結束,`-p` 執行只列印系統錯誤文字,例如 `Failed to resume session: EBADF: bad file descriptor, read`。
3271 3479
3272<h3 id="cannot-switch-renderers-in-this-session">3480<h3 id="cannot-switch-renderers-in-this-session">
3273 無法在此工作階段中切換轉譯器3481 無法在此工作階段中切換轉譯器
3274</h3>3482</h3>
3275 3483
3276當您切換轉譯器時,Claude Code 重新啟動其程序。您在 Claude Code 拒絕重新啟動的工作階段中執行了 [`/tui`](/docs/zh-TW/fullscreen#enable-fullscreen-rendering),所以它不切換並保存任何內容。您看到的訊息告訴您原因:3484當您切換轉譯器時,Claude Code 重新啟動其程序。您在 Claude Code 拒絕重新啟動的工作階段中執行了 [`/tui`](/docs/zh-TW/fullscreen#enable-fullscreen-rendering),所以它不會切換並保存任何內容。您看到的訊息告訴您原因:
3277 3485
3278* `Cannot switch renderers while work is running in the background`:您有在背景執行的工作,重新啟動會放棄,例如背景 shell 或子代理。等待工作完成或使用 [`/tasks`](/docs/zh-TW/commands) 停止它,然後再次執行 `/tui fullscreen` 或 `/tui default`3486* `Cannot switch renderers while work is running in the background`:您有在背景執行的工作,重新啟動會放棄,例如背景 shell 或子代理。等待工作完成或使用 [`/tasks`](/docs/zh-TW/commands) 停止它,然後再次執行 `/tui fullscreen` 或 `/tui default`
3279* `Cannot switch renderers in this session`:工作階段有 Claude Code 無法傳遞給重新啟動程序的限制。在 v2.1.234 之前,Claude Code 無論如何重新啟動,重新啟動的工作階段執行時沒有它們3487* `Cannot switch renderers in this session`:工作階段有 Claude Code 無法傳遞給重新啟動的程序的限制。在 v2.1.234 之前,Claude Code 無論如何都會重新啟動,重新啟動的工作階段在沒有它們的情況下執行
3280 3488
3281在限制訊息中,括號中的部分命名 Claude Code 發現的限制:3489在限制訊息中,括號中的部分命名 Claude Code 發現的限制:
3282 3490
3287訊息可以在括號中顯示的每個原因:3495訊息可以在括號中顯示的每個原因:
3288 3496
3289* `launch flags: a custom system prompt, a tool allowlist, or restricted settings`:您使用 Claude Code 不傳遞回重新啟動程序的旗標啟動了工作階段。這些旗標包括 [`--system-prompt`](/docs/zh-TW/cli-reference#cli-flags)、`--system-prompt-file`、`--append-system-prompt-file`、[`--tools`](/docs/zh-TW/cli-reference#cli-flags) 允許清單、[`--setting-sources`](/docs/zh-TW/cli-reference#cli-flags) 和 [`--permission-prompt-tool`](/docs/zh-TW/cli-reference#cli-flags)3497* `launch flags: a custom system prompt, a tool allowlist, or restricted settings`:您使用 Claude Code 不傳遞回重新啟動程序的旗標啟動了工作階段。這些旗標包括 [`--system-prompt`](/docs/zh-TW/cli-reference#cli-flags)、`--system-prompt-file`、`--append-system-prompt-file`、[`--tools`](/docs/zh-TW/cli-reference#cli-flags) 允許清單、[`--setting-sources`](/docs/zh-TW/cli-reference#cli-flags) 和 [`--permission-prompt-tool`](/docs/zh-TW/cli-reference#cli-flags)
3290* `permission rules set for this session only`:來自 hook 或 SDK 呼叫者的[權限更新](/docs/zh-TW/hooks#permission-update-entries)新增了帶有 `session` 目的地的拒絕或詢問規則。工作階段範圍的允許規則不觸發拒絕。重新啟動會移除它們,Claude Code 改為再次提示3498* `permission rules set for this session only`:來自鉤子或 SDK 呼叫者的[權限更新](/docs/zh-TW/hooks#permission-update-entries)新增了具有 `session` 目的地的拒絕或詢問規則。工作階段範圍的允許規則不會觸發拒絕。重新啟動會丟棄它們,Claude Code 改為提示
3291* `ask-before-running rules with no command-line form`:來自 hook 或 SDK 呼叫者的權限更新新增了詢問規則以及 Claude Code 傳遞回 `--allowed-tools` 和 `--disallowed-tools` 的規則。詢問規則不存在旗標3499* `ask-before-running rules with no command-line form`:來自鉤子或 SDK 呼叫者的權限更新新增了詢問規則以及 Claude Code 作為 `--allowed-tools` 和 `--disallowed-tools` 傳遞回的規則。詢問規則不存在旗標
3292* `permission rules a command line cannot carry intact` 和 `added directories a command line cannot carry intact`:權限更新在工作階段中期新增了規則或目錄路徑。重新啟動程序的命令列無法將其文字作為相同值帶回3500* `permission rules a command line cannot carry intact` 和 `added directories a command line cannot carry intact`:權限更新在工作階段中期新增了規則或目錄路徑。重新啟動的程序的命令列無法將其文字作為相同值帶過去
3293 3501
3294**該怎麼做:**3502**該怎麼做:**
3295 3503
3296* 在沒有這些限制的工作階段中,執行 `/tui fullscreen` 或 `/tui default` 切換回。Claude Code 在那裡儲存 [`tui` 設定](/docs/zh-TW/settings-reference#tui)3504* 在沒有這些限制的工作階段中,執行 `/tui fullscreen`,或 `/tui default` 以切換回。Claude Code 在那裡保存 [`tui` 設定](/docs/zh-TW/settings-reference#tui)
3297 3505
3298<h3 id="couldnt-open-claude-desktop">3506<h3 id="couldnt-open-claude-desktop">
3299 無法開啟 Claude Desktop3507 無法開啟 Claude Desktop
3300</h3>3508</h3>
3301 3509
3302您執行了 [`/desktop`](/docs/zh-TW/desktop#coming-from-the-cli),或其別名 `/app`,系統命令 Claude Code 用來開啟 Claude Desktop 失敗。工作階段保持在終端。3510您執行了 [`/desktop`](/docs/zh-TW/desktop#coming-from-the-cli) 或其別名 `/app`,Claude Code 用來開啟 Claude Desktop 的系統命令失敗。工作階段保持在終端中。
3303 3511
3304```text theme={null}3512```text theme={null}
3305Error: Couldn't open Claude Desktop (`open` exited 1: LSOpenURLsWithRole() failed for the URL claude://resume?session=<session-id> with error -10814). Open Claude Desktop and run /desktop again.3513Error: Couldn't open Claude Desktop (`open` exited 1: LSOpenURLsWithRole() failed for the URL claude://resume?session=<session-id> with error -10814). Open Claude Desktop and run /desktop again.
3310* 自己開啟 Claude Desktop,然後再次執行 `/desktop`3518* 自己開啟 Claude Desktop,然後再次執行 `/desktop`
3311* 若要讀取該命令的完整錯誤輸出,使用 `/debug` 開啟偵錯日誌,再次執行 `/desktop`,並檢查偵錯日誌3519* 若要讀取該命令的完整錯誤輸出,使用 `/debug` 開啟偵錯日誌,再次執行 `/desktop`,並檢查偵錯日誌
3312 3520
3313在 v2.1.275 之前,訊息是 `Failed to open Claude Desktop. Please try opening it manually.` 並沒有說什麼失敗。3521在 v2.1.275 之前,訊息是 `Failed to open Claude Desktop. Please try opening it manually.`,沒有說明什麼失敗。
3314 3522
3315<h3 id="terminal-setup-left-your-zed-keymap-unchanged">3523<h3 id="terminal-setup-left-your-zed-keymap-unchanged">
3316 /terminal-setup 讓您的 Zed 快捷鍵保持不變3524 /terminal-setup 保持您的 Zed 快捷鍵不變
3317</h3>3525</h3>
3318 3526
3319您在 Zed 中執行了 [`/terminal-setup`](/docs/zh-TW/terminal-config#enter-multiline-prompts),Claude Code 無法完成對您的 Zed `keymap.json` 的更新,所以它讓檔案保持原樣。3527您在 Zed 中執行了 [`/terminal-setup`](/docs/zh-TW/terminal-config#enter-multiline-prompts),Claude Code 無法完成對您的 Zed `keymap.json` 的更新,所以它保持檔案不變。
3320 3528
3321每個訊息命名您的快捷鍵的路徑,並以您自己新增的快捷鍵區塊結尾:3529每個訊息命名您的快捷鍵的路徑,並以您自己新增的快捷鍵區塊結尾:
3322 3530
3331* `Couldn't read your Zed keymap, so it was left unchanged.`:Claude Code 無法讀取檔案,例如因為檔案權限3539* `Couldn't read your Zed keymap, so it was left unchanged.`:Claude Code 無法讀取檔案,例如因為檔案權限
3332* `Your Zed keymap isn't a readable list of keybindings, so it was left unchanged.`:檔案讀取良好,但不解析為快捷鍵區塊的陣列,即使允許 `//` 註釋和尾隨逗號3540* `Your Zed keymap isn't a readable list of keybindings, so it was left unchanged.`:檔案讀取良好,但不解析為快捷鍵區塊的陣列,即使允許 `//` 註釋和尾隨逗號
3333* `Couldn't back up your Zed keymap; not modifying it.`:Claude Code 無法將檔案複製到其旁邊的 `.bak` 備份,所以它沒有變更任何內容3541* `Couldn't back up your Zed keymap; not modifying it.`:Claude Code 無法將檔案複製到其旁邊的 `.bak` 備份,所以它沒有變更任何內容
3334* `Couldn't update your Zed keymap, so it was left unchanged.`:合併的結果未驗證為帶有快捷鍵的有效快捷鍵,所以 Claude Code 丟棄它而不是寫入。具有重複鍵的快捷鍵區塊可能導致此3542* `Couldn't update your Zed keymap, so it was left unchanged.`:合併的結果未驗證為帶有繫結的有效快捷鍵,所以 Claude Code 丟棄它而不是寫入。具有重複鍵的快捷鍵區塊可能導致此情況
3335 3543
3336**該怎麼做:**3544**該怎麼做:**
3337 3545
3338* 將訊息中的區塊複製到訊息命名的路徑中 `keymap.json` 中的頂級陣列3546* 將訊息中的區塊複製到您 `keymap.json` 中訊息命名的路徑中的頂級陣列
3339* 對於 `isn't a readable list of keybindings`,修復語法錯誤,或使檔案的頂級值成為陣列,然後再次執行 `/terminal-setup`3547* 對於 `isn't a readable list of keybindings`,修復語法錯誤,或使檔案的頂級值成為陣列,然後再次執行 `/terminal-setup`
3340 3548
3341在 v2.1.247 之前,`/terminal-setup` 無法解析使用 `//` 註釋或尾隨逗號的 Zed 快捷鍵,它用只有自己的快捷鍵替換整個檔案,同時報告快捷鍵已安裝。若要恢復較早版本替換的快捷鍵,請使用[輸入多行提示](/docs/zh-TW/terminal-config#enter-multiline-prompts)下描述的 `.bak` 備份檔案。3549在 v2.1.247 之前,`/terminal-setup` 無法解析使用 `//` 註釋或尾隨逗號的 Zed 快捷鍵,它用只有其自己的繫結替換整個檔案,同時報告繫結已安裝。若要恢復較早版本替換的快捷鍵,請使用[輸入多行提示](/docs/zh-TW/terminal-config#enter-multiline-prompts)下描述的 `.bak` 備份檔案。
3342 3550
3343<h3 id="skill-usage-reports-are-not-available-on-this-connection">3551<h3 id="skill-usage-reports-are-not-available-on-this-connection">
3344 此連線上無法使用 Skill 使用情況報告3552 此連線上不提供技能使用報告
3345</h3>3553</h3>
3346 3554
3347您在[遠端控制](/docs/zh-TW/remote-control)上執行了 [`/skill-doctor`](/docs/zh-TW/skills#find-unused-skills),從您的手機或瀏覽器。Claude Code 不透過遠端控制傳送 skill 使用情況報告,改為以此訊息回答:3555您在[遠端控制](/docs/zh-TW/remote-control)上、從您的手機或瀏覽器執行了 [`/skill-doctor`](/docs/zh-TW/skills#find-unused-skills)。Claude Code 不會通過遠端控制傳送技能使用報告,並改為回答此訊息:
3348 3556
3349```text theme={null}3557```text theme={null}
3350Skill usage reports are not available on this connection.3558Skill usage reports are not available on this connection.
3352 3560
3353**該怎麼做:**3561**該怎麼做:**
3354 3562
3355* 在工作階段執行的機器上的終端中執行 `/skill-doctor`,或在那裡執行 `claude -p "/skill-doctor"`3563* 在工作階段執行所在的機器上的終端中執行 `/skill-doctor`,或在那裡執行 `claude -p "/skill-doctor"`
3356 3564
3357<h3 id="custom-output-styles-cant-be-selected-over-remote-control">3565<h3 id="custom-output-styles-cant-be-selected-over-remote-control">
3358 無法在遠端控制上選擇自訂輸出樣式3566 無法通過遠端控制選擇自訂輸出樣式
3359</h3>3567</h3>
3360 3568
3361您從行動應用程式或網路透過[遠端控制](/docs/zh-TW/remote-control)執行了 [`/output-style`](/docs/zh-TW/output-styles#change-your-output-style),或命令在轉送到工作階段的訊息中到達。因為此類輪次可能不來自帳戶擁有者,Claude Code 只列出並選擇[內建樣式](/docs/zh-TW/output-styles#built-in-output-styles),並在命令列出樣式或不識別您給定的名稱時新增此注意。[自訂樣式](/docs/zh-TW/output-styles#create-a-custom-output-style)名稱獲得與不存在的名稱相同的回答:3569您從行動應用程式或網路通過[遠端控制](/docs/zh-TW/remote-control)執行了 [`/output-style`](/docs/zh-TW/output-styles#change-your-output-style),或命令在轉向中轉送到工作階段。因為此類轉向可能不來自帳戶擁有者,Claude Code 只在其上列出並選擇[內建樣式](/docs/zh-TW/output-styles#built-in-output-styles),並在命令列出樣式或不識別您給定的名稱時新增此注意。[自訂樣式](/docs/zh-TW/output-styles#create-a-custom-output-style)名稱得到與不存在的名稱相同的回覆:
3362 3570
3363```text theme={null}3571```text theme={null}
3364Custom output styles can't be selected over Remote Control or from a relayed message. Select one in the session itself, or pick a built-in style here.3572Custom output styles can't be selected over Remote Control or from a relayed message. Select one in the session itself, or pick a built-in style here.
3367**該怎麼做:**3575**該怎麼做:**
3368 3576
3369* 選擇內建樣式,例如 `/output-style concise`3577* 選擇內建樣式,例如 `/output-style concise`
3370* 若要使用自訂樣式,在專案的 `.claude/settings.local.json` 中設定 [`outputStyle`](/docs/zh-TW/settings-reference#outputstyle),或在工作階段自己的終端中執行 `/output-style <style>`(如果有的話)3578* 若要使用自訂樣式,在專案的 `.claude/settings.local.json` 中設定 [`outputStyle`](/docs/zh-TW/settings-reference#outputstyle),或在工作階段自己的終端中執行 `/output-style <style>`(如果它有的話)
3371 3579
3372<h3 id="output-styles-are-saved-to-local-settings-which-this-session-doesnt-load">3580<h3 id="output-styles-are-saved-to-local-settings-which-this-session-doesnt-load">
3373 輸出樣式已儲存到此工作階段不載入的本地設定3581 輸出樣式被保存到此工作階段不載入的本地設定
3374</h3>3582</h3>
3375 3583
3376您嘗試使用 `/output-style <style>` 或 `/config outputStyle=<style>` 在其設定來源排除 `local` 的工作階段中切換[輸出樣式](/docs/zh-TW/output-styles)。範例是[Agent SDK](/docs/zh-TW/agent-sdk/typescript) 工作階段,其 [`settingSources`](/docs/zh-TW/agent-sdk/typescript#options) 遺漏 `"local"` 和使用 [`--setting-sources`](/docs/zh-TW/cli-reference#cli-flags) 值遺漏 `local` 啟動的 CLI 工作階段。兩個命令都將樣式儲存到 `.claude/settings.local.json`,此類工作階段永遠不會讀回,所以 Claude Code 拒絕而不是寫入沒有效果的設定:3584您嘗試在其設定來源排除 `local` 的工作階段中使用 `/output-style <style>` 或 `/config outputStyle=<style>` 切換[輸出樣式](/docs/zh-TW/output-styles)。範例是 [Agent SDK](/docs/zh-TW/agent-sdk/typescript) 工作階段,其 [`settingSources`](/docs/zh-TW/agent-sdk/typescript#options) 保留 `"local"` 和使用 [`--setting-sources`](/docs/zh-TW/cli-reference#cli-flags) 值保留 `local` 啟動的 CLI 工作階段。兩個命令都將樣式保存到 `.claude/settings.local.json`,此類工作階段永遠不會讀取回,所以 Claude Code 拒絕而不是寫入沒有效果的設定:
3377 3585
3378```text theme={null}3586```text theme={null}
3379Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load, so the style can't be changed here.3587Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load, so the style can't be changed here.
3382**該怎麼做:**3590**該怎麼做:**
3383 3591
3384* 將 `local` 新增到工作階段的設定來源並再次切換3592* 將 `local` 新增到工作階段的設定來源並再次切換
3385* 在工作階段確實載入的設定檔中設定 [`outputStyle`](/docs/zh-TW/settings-reference#outputstyle) 鍵,例如專案中的 `.claude/settings.json` 或 `~/.claude/settings.json`。在 TypeScript SDK 中,改為在內聯 `settings` 物件內設定 `outputStyle`;請參閱[啟動輸出樣式](/docs/zh-TW/agent-sdk/modifying-system-prompts#activate-an-output-style)3593* 在工作階段確實載入的設定檔中設定 [`outputStyle`](/docs/zh-TW/settings-reference#outputstyle) 鍵,例如專案中的 `.claude/settings.json` 或 `~/.claude/settings.json`。在 TypeScript SDK 中,改為在內嵌 `settings` 物件內設定 `outputStyle`;請參閱[啟用輸出樣式](/docs/zh-TW/agent-sdk/modifying-system-prompts#activate-an-output-style)
3386 3594
3387<h2 id="plugin-errors">3595<h2 id="plugin-errors">
3388 Plugin 錯誤3596 Plugin 錯誤
3452* 將 marketplace 重新命名為不拼寫保留名稱的名稱,然後重新新增它3660* 將 marketplace 重新命名為不拼寫保留名稱的名稱,然後重新新增它
3453* 對於忽略的項目警告,執行它給出的 `claude plugin marketplace remove` 命令,或從 `~/.claude/plugins/known_marketplaces.json` 移除項目3661* 對於忽略的項目警告,執行它給出的 `claude plugin marketplace remove` 命令,或從 `~/.claude/plugins/known_marketplaces.json` 移除項目
3454 3662
3663<h3 id="claude-code-refuses-the-marketplace-name">
3664 Claude Code 拒絕 marketplace 名稱
3665</h3>
3666
3667已註冊的 marketplace 名稱 [冒充官方 Anthropic marketplace](/docs/zh-TW/plugins/marketplace-reference#reserved-names),根據該部分列出的規則。
3668
3669如果 marketplace 是在檢查阻止它之前以這樣的名稱註冊的,marketplace 及從中安裝的 plugin 會停止載入,因為 Claude Code 每次讀取 marketplace 的目錄時都會檢查名稱。當名稱模仿官方名稱時,`claude plugin list` 和 `/plugin` **錯誤** 標籤會報告每個受影響的 plugin,訊息開頭為:
3670
3671```text theme={null}
3672Claude Code refuses the marketplace name "anthropic-plugins-v2"
3673```
3674
3675對於模仿名稱,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`。
3676
3677在 v2.1.282 之前,`claude plugin list` 和 `/plugin` 報告模仿名稱的 plugin 也失敗載入,而沒有將 marketplace 名稱命名為原因。
3678
3679**該怎麼做:**
3680
3681* 執行 `claude plugin marketplace remove <name>`。這也會卸載從 marketplace 安裝的 plugin 並刪除其已儲存的資料
3682* 若要改為保留 marketplace,請等待其維護者重新命名它,然後執行 `claude plugin marketplace update <name>`
3683* 如果您發佈 marketplace,請在您的 `marketplace.json` 中重新命名它;使用者然後更新 marketplace 而不是移除它
3684
3455<h3 id="marketplace-is-already-added-from-a-different-source">3685<h3 id="marketplace-is-already-added-from-a-different-source">
3456 Marketplace 已從不同的來源新增3686 Marketplace 已從不同的來源新增
3457</h3>3687</h3>
3621* `Failed to load marketplace configuration`:檔案不是有效的 JSON,或無法讀取。空檔案也會以這種方式失敗。3851* `Failed to load marketplace configuration`:檔案不是有效的 JSON,或無法讀取。空檔案也會以這種方式失敗。
3622* `Marketplace configuration file is corrupted`:檔案是有效的 JSON,但其內容與登錄架構不符。3852* `Marketplace configuration file is corrupted`:檔案是有效的 JSON,但其內容與登錄架構不符。
3623 3853
3624遺失的檔案不是失敗:Claude Code 將其視為沒有marketplace 的登錄。3854遺失的檔案不是失敗:Claude Code 將其視為沒有 marketplace 的登錄。
3625 3855
3626使用空檔案時,`claude plugin install` 報告:3856使用空檔案時,`claude plugin install` 報告:
3627 3857
3654 3884
3655* 詢問您的 claude.ai 組織的管理員以變更 plugin 在 claude.ai 上的必需狀態3885* 詢問您的 claude.ai 組織的管理員以變更 plugin 在 claude.ai 上的必需狀態
3656 3886
3887<h3 id="plugin-was-not-uninstalled">
3888 Plugin 未被卸載
3889</h3>
3890
3891您執行了 [`claude plugin uninstall`](/docs/zh-TW/plugins/cli-reference#plugin-uninstall),或在 `/plugin` **已安裝** 標籤中選擇了 **卸載**,而卸載停止並顯示以 `"<plugin>" was not uninstalled:` 開頭的訊息。
3892
3893當 Claude Code 從 `enabledPlugins` 移除 plugin 的項目並讀回該範圍的設定檔案時,要麼 plugin 仍在該處被開啟,要麼可以開啟它的檔案無法被讀取或檢查。在設定項目可以將其重新開啟時刪除 plugin 的已儲存選項、機密和資料會遺失它們,因此卸載會停止:plugin 保持安裝,它儲存的任何內容都不會被刪除。
3894
3895```text theme={null}
3896✘ 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.
3897```
3898
3899訊息的中間部分命名了檔案和原因:
3900
3901* `it is still switched on in <file>, although the settings change reported no error`:設定寫入報告成功但項目在讀回檔案時仍在那裡
3902* `it is still switched on in <file>, and the settings change failed (<error>)`:檔案無法被儲存,原因在括號中
3903* `<file> is there and could not be read`:檔案存在但無法作為設定讀取,例如因為它不是有效的 JSON,所以它可能仍然啟用 plugin
3904* `<file> (not read: it is on a network path or is a link to one, or could not be checked)`:Claude Code 沒有讀取專案或本機設定檔案,因為檔案或保存它的 `.claude` 資料夾是指向網路位置的連結,或因為它無法檢查該路徑
3905
3906`claude plugin uninstall` 以退出代碼 1 結束,使用 `--json` 時結果帶有 `failureCode: "settings_still_on"`。`/plugin` 顯示相同的訊息。
3907
3908**該怎麼做:**
3909
3910* 遵循訊息的最後一句:修復或替換它命名的設定檔案,或自己從該檔案中的 `enabledPlugins` 移除 plugin 的項目,然後再次執行卸載
3911
3657<h2 id="tool-errors">3912<h2 id="tool-errors">
3658 工具錯誤3913 工具錯誤
3659</h2>3914</h2>
3661這些錯誤來自 Claude 的內建工具。Claude 會自動修正大多數工具錯誤。當需要您進行變更時,該錯誤的**應該怎麼做**清單會說明要變更的內容。3916這些錯誤來自 Claude 的內建工具。Claude 會自動修正大多數工具錯誤。當需要您進行變更時,該錯誤的**應該怎麼做**清單會說明要變更的內容。
3662 3917
3663<h3 id="agent-would-be-spawned-with-zero-tools">3918<h3 id="agent-would-be-spawned-with-zero-tools">
3664 Agent would be spawned with zero tools3919 Agent 會以零個工具生成
3665</h3>3920</h3>
3666 3921
3667子代理的 [`tools` 清單](/docs/zh-TW/sub-agents#supported-frontmatter-fields)中的每個項目都無法符合可用的工具,因此 Claude Code 拒絕啟動子代理:沒有工具,它就無法行動。該訊息會按照出錯的原因將您的項目分組:3922子代理的 [`tools` 清單](/docs/zh-TW/sub-agents#supported-frontmatter-fields)中的每個項目都無法匹配可用的工具,因此 Claude Code 拒絕啟動子代理:沒有工具,它無法採取行動。該訊息會按出錯原因將您的項目分組:
3668 3923
3669* **Unrecognized**:該項目不符合任何工具名稱,通常是打字錯誤,例如 `Grpe` 而非 `Grep`。3924* **無法識別**:該項目不符合任何工具名稱,通常是打字錯誤,例如 `Grpe` 而非 `Grep`。
3670* **Not available to subagents**:該項目命名了一個[子代理無法使用](/docs/zh-TW/sub-agents#available-tools)的真實工具。背景子代理保持較小的內建工具集,因此當子代理在背景中執行時(這是預設行為),只有前景子代理才能使用的項目會出現在此處。如果您列出 `Agent`,該訊息會改為在下一個群組下報告它。3925* **子代理無法使用**:該項目命名了一個[子代理無法使用](/docs/zh-TW/sub-agents#available-tools)的真實工具。背景子代理保持較小的內建工具集,因此當子代理在背景中執行時(這是預設值),只有前景子代理可以使用的項目會出現在此處。如果您列出 `Agent`,該訊息會改為在下一個群組下報告它。
3671* **Matched no tools in this session**:該項目有效,但目前工作階段中沒有工具符合它,例如沒有連接 GitHub MCP 伺服器的 `mcp__github__*`,或在[深度限制](/docs/zh-TW/sub-agents#let-subagents-spawn-their-own-subagents)處的子代理的 `Agent`。3926* **在此工作階段中未匹配任何工具**:該項目有效,但目前工作階段中沒有工具符合它,例如沒有連接 GitHub MCP 伺服器的 `mcp__github__*`,或子代理在[深度限制](/docs/zh-TW/sub-agents#let-subagents-spawn-their-own-subagents)處的 `Agent`。
3672 3927
3673省略 `tools` 欄位永遠不會觸發此拒絕。如果您將 `tools` 清單留空,或 `disallowedTools` 移除其中的每個項目,Claude Code 也會跳過拒絕並啟動沒有工具的子代理。3928省略 `tools` 欄位永遠不會觸發此拒絕。如果您將 `tools` 清單留空,或 `disallowedTools` 移除其中的每個項目,Claude Code 也會跳過拒絕並啟動沒有工具的子代理。
3674 3929
3675在 v2.1.208 之前,子代理啟動時沒有工具,可能會傳回空的或令人困惑的結果。3930在 v2.1.208 之前,子代理會以零個工具啟動,並可能返回空的或令人困惑的結果。
3676 3931
3677```text theme={null}3932```text theme={null}
3678Agent 'code-reviewer' would be spawned with zero tools — refusing. Its tools list resolved to nothing: unrecognized [Grpe]. Fix the agent's tools frontmatter or pass a different subagent_type.3933Agent 'code-reviewer' would be spawned with zero tools — refusing. Its tools list resolved to nothing: unrecognized [Grpe]. Fix the agent's tools frontmatter or pass a different subagent_type.
3682 3937
3683* 根據[子代理可用的工具](/docs/zh-TW/sub-agents#available-tools)修正錯誤命名的每個項目3938* 根據[子代理可用的工具](/docs/zh-TW/sub-agents#available-tools)修正錯誤命名的每個項目
3684* 移除工作階段沒有的工具項目,例如來自未連接伺服器的 MCP 工具3939* 移除工作階段沒有的工具項目,例如來自未連接伺服器的 MCP 工具
3685* 對於[背景子代理會捨棄](/docs/zh-TW/sub-agents#available-tools)的工具(例如 `CronCreate`),移除該項目。若要保留該工具,請[關閉 fork 模式](/docs/zh-TW/sub-agents#turn-fork-mode-on-or-off)並要求 Claude 在前景中執行子代理3940* 對於[背景子代理會捨棄](/docs/zh-TW/sub-agents#available-tools)的工具(例如 `CronCreate`),移除該項目。若要保留該工具,[關閉 fork 模式](/docs/zh-TW/sub-agents#turn-fork-mode-on-or-off)並要求 Claude 在前景中執行子代理
3686* 刪除 `tools` 欄位而不是列出工具,以給予子代理[子代理可用的每個工具](/docs/zh-TW/sub-agents#available-tools)3941* 刪除 `tools` 欄位而不是列出工具,以給予子代理[子代理可用的每個工具](/docs/zh-TW/sub-agents#available-tools)
3687* 對於只包含 `Agent` 的 `tools` 清單,提高[深度限制](/docs/zh-TW/sub-agents#let-subagents-spawn-their-own-subagents)或給予代理至少一個其他工具:Claude Code 在該限制處會拒絕提供 `Agent`,因此只有其他工具的清單會解析為沒有工具3942* 對於只包含 `Agent` 的 `tools` 清單,提高[深度限制](/docs/zh-TW/sub-agents#let-subagents-spawn-their-own-subagents)或給予代理至少一個其他工具:Claude Code 在該限制處會保留 `Agent`,因此只有其他工具的清單會解析為零個工具
3688 3943
3689<h3 id="file-is-covered-by-a-read-deny-rule">3944<h3 id="file-is-covered-by-a-read-deny-rule">
3690 File is covered by a Read deny rule3945 檔案受到 Read 拒絕規則的涵蓋
3691</h3>3946</h3>
3692 3947
3693Edit 或 Write 工具在由 [`Read` 拒絕規則](/docs/zh-TW/permissions#read-and-edit)符合的路徑上被呼叫,包括在該路徑建立新檔案。兩個工具都會變更 Claude 必須能夠讀回的內容,因此 Claude Code 在任何檔案存取之前拒絕該呼叫。NotebookEdit 不受 `Read` 拒絕規則涵蓋。在 v2.1.228 之前,該規則僅阻止 Edit 工具,在 v2.1.208 之前,只有 `Edit` 拒絕規則會阻止編輯。3948Edit 或 Write 工具在由 [`Read` 拒絕規則](/docs/zh-TW/permissions#read-and-edit)匹配的路徑上被呼叫,包括在該路徑建立新檔案。兩個工具都會變更 Claude 必須能夠讀回的內容,因此 Claude Code 在任何檔案存取之前拒絕該呼叫。NotebookEdit 不受 `Read` 拒絕規則涵蓋。在 v2.1.228 之前,該規則僅阻止 Edit 工具,在 v2.1.208 之前,只有 `Edit` 拒絕規則會阻止編輯。
3694 3949
3695```text theme={null}3950```text theme={null}
3696File is covered by a Read deny rule in your permission settings and cannot be edited.3951File is covered by a Read deny rule in your permission settings and cannot be edited.
3703* 如果 Claude 應該能夠變更檔案,請在 `/permissions` 或[設定](/docs/zh-TW/settings-reference#permission-settings)中移除或縮小 `Read` 拒絕規則3958* 如果 Claude 應該能夠變更檔案,請在 `/permissions` 或[設定](/docs/zh-TW/settings-reference#permission-settings)中移除或縮小 `Read` 拒絕規則
3704* 如果檔案必須保持未觸及,請保留該規則並為相同路徑新增 `Edit` 拒絕規則以同時阻止 NotebookEdit 工具3959* 如果檔案必須保持未觸及,請保留該規則並為相同路徑新增 `Edit` 拒絕規則以同時阻止 NotebookEdit 工具
3705 3960
3961<h3 id="path-cannot-contain-null-bytes">
3962 路徑不能包含空位元組
3963</h3>
3964
3965檔案工具呼叫的路徑或模式引數包含空位元組,檔案系統和搜尋工具無法接受。Read、Write、Edit、NotebookEdit、Glob 和 Grep 會檢查此項,訊息會命名工具和引數:
3966
3967```text theme={null}
3968Read file_path cannot contain null bytes (\0). Remove the null byte and try again.
3969```
3970
3971工具呼叫失敗,Claude 看到錯誤,回合繼續。
3972
3973**應該怎麼做:**
3974
3975* 您這邊無需做任何事:錯誤會作為工具的結果返回給 Claude,訊息本身會告訴 Claude 移除空位元組並重試
3976
3977在 v2.1.281 之前,Read、Write、Edit 或 NotebookEdit 路徑中的空位元組會以命名 `Path contains null bytes` 的錯誤結束整個回合,工具永遠不會執行。
3978
3706<h3 id="subagent-type-is-required">3979<h3 id="subagent-type-is-required">
3707 subagent\_type is required3980 subagent\_type 是必需的
3708</h3>3981</h3>
3709 3982
3710```text theme={null}3983```text theme={null}
3711subagent_type is required: the general-purpose agent is not available in this session. Available agents: ...3984subagent_type is required: the general-purpose agent is not available in this session. Available agents: ...
3712```3985```
3713 3986
3714Claude 呼叫了 [Agent 工具](/docs/zh-TW/tools-reference#agent-tool-behavior)但沒有 `subagent_type`,而此工作階段沒有[通用子代理](/docs/zh-TW/sub-agents#built-in-subagents)可作為備用。這在兩種設定中是這樣的情況:3987Claude 呼叫了 [Agent 工具](/docs/zh-TW/tools-reference#agent-tool-behavior)但沒有 `subagent_type`,此工作階段沒有[通用子代理](/docs/zh-TW/sub-agents#built-in-subagents)可作為備用。這在兩種設定中是這樣的情況:
3715 3988
3716* [`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1`](/docs/zh-TW/env-vars) 在非互動模式中設定,這會移除每個內建子代理3989* [`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1`](/docs/zh-TW/env-vars) 在非互動模式中設定,這會移除每個內建子代理
3717* 工作階段的主執行緒代理有一個 [`tools: Agent(...)` 允許清單](/docs/zh-TW/sub-agents#restrict-which-subagents-can-be-spawned),其中不包括 `general-purpose`3990* 工作階段的主執行緒代理有一個 [`tools: Agent(...)` 允許清單](/docs/zh-TW/sub-agents#restrict-which-subagents-can-be-spawned),其中不包括 `general-purpose`
3718 3991
3719**應該怎麼做:**3992**應該怎麼做:**
3720 3993
3721* 通常不需要做任何事:該訊息列出工作階段確實擁有的子代理,因此 Claude 可以使用其中一個重試3994* 通常無需做任何事:訊息會列出工作階段確實擁有的子代理,因此 Claude 可以使用其中一個重試
3722* 如果 Claude 持續失敗,請將 `general-purpose` 新增到 `tools: Agent(...)` 允許清單,或取消設定 `CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS`3995* 如果 Claude 持續失敗,請將 `general-purpose` 新增到 `tools: Agent(...)` 允許清單,或取消設定 `CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS`
3723 3996
3724在 v2.1.235 之前,相同的呼叫失敗並顯示 `Agent type 'general-purpose' not found`。3997在 v2.1.235 之前,相同的呼叫失敗並顯示 `Agent type 'general-purpose' not found`。
3725 3998
3726<h3 id="memory-index-is-over-its-read-limit">3999<h3 id="memory-index-is-over-its-read-limit">
3727 Memory index is over its read limit4000 記憶體索引超過其讀取限制
3728</h3>4001</h3>
3729 4002
3730Claude 寫入[自動記憶](/docs/zh-TW/memory#auto-memory)索引 `MEMORY.md` 並將其留在其中一個讀取限制之上:200 行或 25KB。寫入成功,但只有前 200 行或 25KB(以先到者為準)在工作階段開始時載入,因此超過限制的所有內容在每次讀取索引時都會被捨棄。在 v2.1.210 之前,超過限制的索引在下次載入時會被無聲地截斷,沒有寫入時間訊號。4003Claude 寫入[自動記憶體](/docs/zh-TW/memory#auto-memory)索引 `MEMORY.md` 並將其留在其讀取限制之一上方:200 行或 25KB。寫入成功,但只有前 200 行或 25KB(以先到者為準)在工作階段開始時載入,因此超過限制的所有內容在每次讀取索引時都會被捨棄。在 v2.1.210 之前,超限索引在下次載入時會被無聲地截斷,沒有寫入時間訊號。
3731 4004
3732```text theme={null}4005```text theme={null}
3733Error: this write left the memory index at MEMORY.md at 214 lines, over its 200-line read limit. The write succeeded, but everything past the limit is silently dropped each time the index is loaded — entries at the end are already invisible to readers. Rewrite it to under 140 lines now: keep one line per entry, move detail into topic files, and merge or drop stale entries.4006Error: this write left the memory index at MEMORY.md at 214 lines, over its 200-line read limit. The write succeeded, but everything past the limit is silently dropped each time the index is loaded — entries at the end are already invisible to readers. Rewrite it to under 140 lines now: keep one line per entry, move detail into topic files, and merge or drop stale entries.
3734```4007```
3735 4008
3736只有載入的內容才計入限制。YAML frontmatter 和區塊級 HTML 註解在索引載入前會被移除,因此它們被排除在測量之外。在 v2.1.211 之前,Claude Code 測量原始檔案,frontmatter 或註解可能會觸發此錯誤,即使載入的內容符合。4009只有載入的內容才計入限制。YAML frontmatter 和區塊級 HTML 註解在索引載入前會被移除,因此它們被排除在測量之外。在 v2.1.211 之前,Claude Code 測量原始檔案,frontmatter 或註解即使在載入的內容符合時也可能觸發此錯誤。
3737 4010
3738Claude Code 在寫入後將錯誤傳遞給 Claude,而不是在您的終端中列印為橫幅,因此您可能只在文字記錄中注意到它。4011Claude Code 在寫入後將錯誤傳遞給 Claude,而不是在您的終端中列印為橫幅,因此您可能只在文字記錄中注意到它。
3739 4012
3740當 Claude 的寫入使檔案接近限制但未超過時,Claude Code 會傳回更溫和的提醒以壓縮索引,而不是此錯誤。4013當 Claude 的寫入使檔案接近限制但未超過時,Claude Code 會返回更溫和的提醒以壓縮索引,而不是此錯誤。
3741 4014
3742**應該怎麼做:**4015**應該怎麼做:**
3743 4016
3744* 讓 Claude 重寫 `MEMORY.md`,或要求它:每個項目保留一行,將詳細資訊移到主題檔案中,並合併或捨棄過時的項目4017* 讓 Claude 重寫 `MEMORY.md`,或要求它:每個項目保留一行,將詳細資訊移到主題檔案中,並合併或捨棄過時的項目
3745* 若要自己修剪索引,請參閱[稽核和編輯您的記憶](/docs/zh-TW/memory#audit-and-edit-your-memory)4018* 若要自己修剪索引,請參閱[稽核和編輯您的記憶體](/docs/zh-TW/memory#audit-and-edit-your-memory)
3746 4019
3747<h3 id="pkill-pattern-matches-the-claude-code-process">4020<h3 id="pkill-pattern-matches-the-claude-code-process">
3748 pkill pattern matches the Claude Code process4021 pkill 模式符合 Claude Code 程序
3749</h3>4022</h3>
3750 4023
3751Bash 工具呼叫中的 `pkill` 命令使用了一個模式(通常使用 `-f`),該模式符合 Claude Code 程序本身,因此 Claude Code 拒絕該命令而不是讓它結束工作階段。Claude Code 在執行 `pkill` 之前使用 `pgrep` 測試該模式,並在其自己的程序 ID 在結果中時拒絕。該檢查僅在 Linux 上執行;在 macOS 上,`pkill` 不經修改地執行。在 v2.1.214 之前,該命令執行,符合的模式會在轉換中途殺死 Claude Code 工作階段。4024Bash 工具呼叫中的 `pkill` 命令使用了一個模式(通常帶有 `-f`),該模式符合 Claude Code 程序本身,因此 Claude Code 拒絕該命令而不是讓它結束工作階段。Claude Code 在執行 `pkill` 之前使用 `pgrep` 測試模式,並在結果中包含其自己的程序 ID 時拒絕。檢查僅在 Linux 上執行;在 macOS 上,`pkill` 不經修改地執行。在 v2.1.214 之前,命令執行,符合的模式在回合中途殺死了 Claude Code 工作階段。
3752 4025
3753```text theme={null}4026```text theme={null}
3754pkill: refusing to run — this pattern matches the Claude CLI process (PID 12345). Narrow the pattern, or target your own children with `pkill -P $$ ...`.4027pkill: refusing to run — this pattern matches the Claude CLI process (PID 12345). Narrow the pattern, or target your own children with `pkill -P $$ ...`.
3762* 若要停止由目前 shell 啟動的程序,請使用 `pkill -P $$` 搭配模式,這會將符合限制為 shell 自己的子程序4035* 若要停止由目前 shell 啟動的程序,請使用 `pkill -P $$` 搭配模式,這會將符合限制為 shell 自己的子程序
3763 4036
3764<h3 id="failed-to-write-to-a-teammate-inbox">4037<h3 id="failed-to-write-to-a-teammate-inbox">
3765 Failed to write to a teammate's inbox4038 無法寫入隊友的收件匣
3766</h3>4039</h3>
3767 4040
3768Claude Code 無法將訊息寫入 `~/.claude/teams/{team-name}/inboxes/` 下的隊友信箱檔案,因此收件人沒有收到任何內容。當 Claude Code 無法建立或更新檔案時寫入失敗,例如因為磁碟已滿、目錄不可寫,或另一個代理長時間持有收件箱鎖定。在 v2.1.224 之前,Claude Code 即使寫入失敗也會報告訊息已傳送。4041Claude Code 無法將訊息寫入 `~/.claude/teams/{team-name}/inboxes/` 下隊友的信箱檔案,因此收件者沒有收到任何內容。當 Claude Code 無法建立或更新檔案時寫入失敗,例如因為磁碟已滿、目錄不可寫,或另一個代理長時間持有收件匣鎖。在 v2.1.224 之前,Claude Code 即使寫入失敗也會報告訊息已傳送。
3769 4042
3770該錯誤出現在傳送代理的工具結果中,而不是作為您終端中的橫幅,其文字告訴 Claude 重試:4043錯誤出現在傳送代理的工具結果中,而不是作為您終端中的橫幅,其文字告訴 Claude 重試:
3771 4044
3772```text theme={null}4045```text theme={null}
3773Failed to write to researcher's inbox — nothing was sent. Try again, or message the lead.4046Failed to write to researcher's inbox — nothing was sent. Try again, or message the lead.
3775 4048
3776結構化[代理團隊](/docs/zh-TW/agent-teams)協議訊息以相同方式失敗,錯誤命名未傳遞的訊息:當 Claude Code 無法寫入計畫核准、計畫拒絕、關閉要求或關閉拒絕時,錯誤讀作 `Failed to write the <message> to <name>'s inbox — nothing was sent`。該清單中的 `plan approval` 是領導者核准隊友計畫的決定;隊友的計畫提交是單獨的 `plan approval request` 訊息。該訊息和另外兩個協議訊息帶有自己的訊息文字和後果:4049結構化[代理團隊](/docs/zh-TW/agent-teams)協議訊息以相同方式失敗,錯誤命名未傳遞的訊息:當 Claude Code 無法寫入計畫核准、計畫拒絕、關閉要求或關閉拒絕時,錯誤讀作 `Failed to write the <message> to <name>'s inbox — nothing was sent`。該清單中的 `plan approval` 是領導者核准隊友計畫的決定;隊友的計畫提交是單獨的 `plan approval request` 訊息。該訊息和另外兩個協議訊息帶有自己的訊息文字和後果:
3777 4050
3778* `Failed to write the plan approval request to the lead's inbox — plan not submitted; try again`:隊友的計畫從未到達領導者,隊友保持在計畫模式,直到重新提交成功4051* `Failed to write the plan approval request to the lead's inbox — plan not submitted; try again`:隊友的計畫永遠沒有到達領導者,隊友保持在計畫模式直到重新提交成功
3779* `The permission request could not be delivered to the team lead (mailbox write failed)`:隊友的權限要求從未到達領導者,因此沒有人核准工具呼叫4052* `The permission request could not be delivered to the team lead (mailbox write failed)`:隊友的權限要求永遠沒有到達領導者,因此沒有人核准工具呼叫
3780* `The confirmation could not be written to team-lead's inbox.`:關閉核准本身生效,隊友退出;只有對領導者的確認遺失4053* `The confirmation could not be written to team-lead's inbox.`:關閉核准本身生效,隊友退出;只有對領導者的確認遺失
3781 4054
3782當您自己訊息隊友時,在領導者工作階段中輸入 `@name` 後跟訊息,相同的失敗會顯示為通知 `Couldn't write to @name's inbox — message not sent. Try again.`,Claude Code 會將您的文字保留在提示框中,以便您可以再次傳送。4055當您自己訊息隊友時,在領導者工作階段中輸入 `@name` 後跟訊息,相同的失敗會顯示為通知 `Couldn't write to @name's inbox — message not sent. Try again.`,Claude Code 會將您的文字保留在提示框中,以便您可以再次傳送。
3783 4056
3784**應該怎麼做:**4057**應該怎麼做:**
3785 4058
3786* 要求傳送者重新傳送訊息;收件箱鎖定的爭用是暫時的,在重試時會清除4059* 要求傳送者重新傳送訊息;收件匣鎖的爭用是暫時的,在重試時會清除
3787* 檢查可用磁碟空間,並檢查 `~/.claude/teams` 及其下的檔案是否可由您的使用者寫入4060* 檢查可用磁碟空間,並檢查 `~/.claude/teams` 及其下的檔案是否可由您的使用者寫入
3788 4061
3789<h3 id="teammate-agent-definition-not-restored">4062<h3 id="teammate-agent-definition-not-restored">
3790 Teammate's agent definition was not restored4063 隊友的代理定義未被復原
3791</h3>4064</h3>
3792 4065
3793Claude 訊息了一個已停止的[代理團隊](/docs/zh-TW/agent-teams)隊友,Claude Code 將其恢復而沒有重新應用它生成的[子代理定義](/docs/zh-TW/agent-teams#use-subagent-definitions-for-teammates),因為其定義檔案來自沒有已儲存信任的資料夾。該通知在傳送代理的工具結果中的恢復報告之後:4066Claude 訊息了一個已停止的[代理團隊](/docs/zh-TW/agent-teams)隊友,Claude Code 將其恢復而沒有重新應用[子代理定義](/docs/zh-TW/agent-teams#use-subagent-definitions-for-teammates)它是從中生成的,因為其定義檔案來自沒有已儲存信任的資料夾。通知在傳送代理的工具結果中的恢復報告之後:
3794 4067
3795```text wrap theme={null}4068```text wrap theme={null}
3796Its agent definition was not restored: the folder its definition file came from is not trusted (source: projectSettings), so the teammate is running with the team-essential tools and no custom instructions. To restore it, the user needs to run Claude Code in that folder once and accept the trust dialog (the --debug log names the folder); do not change trust settings on the user's behalf.4069Its agent definition was not restored: the folder its definition file came from is not trusted (source: projectSettings), so the teammate is running with the team-essential tools and no custom instructions. To restore it, the user needs to run Claude Code in that folder once and accept the trust dialog (the --debug log names the folder); do not change trust settings on the user's behalf.
3797```4070```
3798 4071
3799該檢查適用於專案的 `.claude/agents/` 目錄或 `--add-dir` 目錄中的定義,接受父資料夾的信任對話不滿足它。4072檢查適用於專案的 `.claude/agents/` 目錄或 `--add-dir` 目錄中的定義,接受父資料夾的信任對話不滿足它。
3800 4073
3801**應該怎麼做:**4074**應該怎麼做:**
3802 4075
3804* 或在 `~/.claude.json` 中將 `hasTrustDialogAccepted` 項目設定為 `true`,使用偵錯日誌列印的確切 `projects["<path>"]` 鍵4077* 或在 `~/.claude.json` 中將 `hasTrustDialogAccepted` 項目設定為 `true`,使用偵錯日誌列印的確切 `projects["<path>"]` 鍵
3805 4078
3806<h3 id="message-too-large-for-cross-session-delivery">4079<h3 id="message-too-large-for-cross-session-delivery">
3807 Message too large for cross-session delivery4080 跨工作階段傳遞的訊息太大
3808</h3>4081</h3>
3809 4082
3810Claude 的[跨工作階段訊息](/docs/zh-TW/cross-session-messaging)到此機器上您的另一個工作階段太長而無法傳送。Claude Code 拒絕了它,接收工作階段沒有收到任何內容。拒絕出現在傳送工作階段的工具結果中,而不是作為您終端中的橫幅。它命名了兩個大小以及如何使訊息符合:4083Claude 的[跨工作階段訊息](/docs/zh-TW/cross-session-messaging)到此機器上您的另一個工作階段太長而無法傳送。Claude Code 拒絕了它,接收工作階段沒有收到任何內容。拒絕出現在傳送工作階段的工具結果中,而不是作為您終端中的橫幅。它命名兩個大小以及如何使訊息符合:
3811 4084
3812```text wrap theme={null}4085```text wrap theme={null}
3813Failed to send to api-worker: Message too large for cross-session delivery: the serialized message is 1,203,844 characters and the limit is 1,048,576. Shorten the message text — put bulk content in a file the recipient can read rather than in the message — or split it into smaller messages.4086Failed to send to api-worker: Message too large for cross-session delivery: the serialized message is 1,203,844 characters and the limit is 1,048,576. Shorten the message text — put bulk content in a file the recipient can read rather than in the message — or split it into smaller messages.
3814```4087```
3815 4088
3816重新傳送相同的文字以相同的方式失敗。4089重新傳送相同的文字以相同方式失敗。
3817 4090
3818**應該怎麼做:**4091**應該怎麼做:**
3819 4092
3820* 要求 Claude 總結訊息,或將大量內容放在收件人可以讀取的檔案中並傳送檔案的路徑4093* 要求 Claude 總結訊息,或將大量內容放在收件者可以讀取的檔案中
3821* 要求 Claude 將內容分割成幾個較短的訊息4094* 要求 Claude 將內容分割成幾個較短的訊息
3822 4095
3823在 v2.1.235 之前,Claude Code 報告超大訊息已傳送。接收工作階段未讀就捨棄了它。4096在 v2.1.235 之前,Claude Code 報告超大訊息已傳送。接收工作階段未讀地捨棄了它。
3824 4097
3825<h3 id="too-many-messages-to-this-session-just-now">4098<h3 id="too-many-messages-to-this-session-just-now">
3826 Too many messages to this session just now4099 此工作階段剛才收到太多訊息
3827</h3>4100</h3>
3828 4101
3829Claude 向此機器上您的一個工作階段傳送了快速的[跨工作階段訊息](/docs/zh-TW/cross-session-messaging)爆發,該爆發達到了該工作階段的收件箱接受的內容。Claude Code 拒絕了下一個傳送,接收工作階段沒有收到任何內容。拒絕出現在傳送工作階段的工具結果中,而不是作為您終端中的橫幅:4102Claude 向此機器上您的一個工作階段傳送了快速的[跨工作階段訊息](/docs/zh-TW/cross-session-messaging)爆發,爆發達到該工作階段的收件匣接受的內容。Claude Code 拒絕了下一個傳送,接收工作階段沒有收到任何內容。拒絕出現在傳送工作階段的工具結果中,而不是作為您終端中的橫幅:
3830 4103
3831```text wrap theme={null}4104```text wrap theme={null}
3832Failed to send to api-worker: Too many messages to this session just now: 30 were sent recently and more would be dropped by its rate limit, so this one was not sent. Batch what remains into one message, or wait a little before sending more.4105Failed to send to api-worker: Too many messages to this session just now: 30 were sent recently and more would be dropped by its rate limit, so this one was not sent. Batch what remains into one message, or wait a little before sending more.
3834 4107
3835**應該怎麼做:**4108**應該怎麼做:**
3836 4109
3837* 通常不需要做任何事:Claude 將剩餘內容批次處理為一個訊息,或在傳送更多內容之前等待4110* 通常無需做任何事:Claude 將剩餘內容批次處理為一個訊息,或在傳送更多內容之前等待
3838* 如果您自己提示了爆發,請要求 Claude 將剩餘內容合併為單一訊息4111* 如果您自己提示了爆發,要求 Claude 將剩餘內容合併為單一訊息
3839 4112
3840在 v2.1.236 之前,Claude Code 報告這些傳送已傳送。接收工作階段未讀就捨棄了它們。4113在 v2.1.236 之前,Claude Code 報告這些傳送已傳送。接收工作階段未讀地捨棄了它們。
4114
4115<h3 id="cross-session-message-dropped-at-the-inbox">
4116 跨工作階段訊息在收件者工作階段的收件匣被捨棄
4117</h3>
4118
4119Claude 傳送了[跨工作階段訊息](/docs/zh-TW/cross-session-messaging)到此機器上您的另一個工作階段,該工作階段的收件匣在 Claude 在該工作階段中讀取它之前捨棄了它。該行命名收件者的位址,當收件者提供原因時,在破折號後新增原因:
4120
4121```text wrap theme={null}
4122Cross-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.
4123```
4124
4125一行可以涵蓋多個捨棄的訊息。然後它以複數開始,例如 `Cross-session messages (12) were dropped`。若要找到位址屬於哪個工作階段,請將其與 `/status` 在每個工作階段中顯示的 [`Peer address` 列](/docs/zh-TW/cross-session-messaging#the-sessions-inbox-socket)進行比較。
4126
4127在破折號後,該行給出以下一個或多個原因:
4128
4129* `its queue of undelivered peer messages was full`:收件者已經持有來自其他工作階段的許多未傳遞訊息,達到其佇列允許的數量
4130* `you sent faster than that session accepts`:傳送工作階段的訊息到達速度比收件者從一個傳送者接受的速度快
4131* `it repeated your previous message`:訊息與傳送工作階段不久前傳送給此收件者的訊息相同
4132* `a relay loop between sessions was cut`:訊息繼續了工作階段相互訊息的鏈,該鏈已通過收件者太多次或變得太長
4133
4134**應該怎麼做:**
4135
4136* 假設收件者從未看到捨棄的訊息。Claude Code 告訴 Claude 相同的內容,並告訴它改為在稍後的一個訊息中包含仍然重要的任何內容,而不是立即重新傳送
4137* 如果您的工作階段相互傳送頻繁的更新,要求 Claude 傳送較少、較大的訊息,例如工作階段完成其工作時的一份報告
4138* 對於 `a relay loop between sessions was cut`,在其中一個工作階段中自己輸入下一個指令。Claude 為回應您自己的提示而傳送的訊息開始新的鏈
4139
4140在 v2.1.238 之前,當收件者的收件匣捨棄訊息時,傳送工作階段沒有收到報告。
3841 4141
3842<h3 id="refusing-to-send-a-cross-session-message">4142<h3 id="refusing-to-send-a-cross-session-message">
3843 Refusing to send a cross-session message4143 拒絕傳送跨工作階段訊息
3844</h3>4144</h3>
3845 4145
3846在 Claude Code 將[跨工作階段訊息](/docs/zh-TW/cross-session-messaging)寫入此機器上您的另一個工作階段之前,它會檢查目標工作階段的收件箱通訊端是否是訊息定址到的端點。當檢查失敗時,Claude Code 在傳送工作階段中拒絕傳送,目標工作階段沒有收到任何內容。對於 Claude 傳送的訊息,拒絕出現在傳送工作階段的工具結果中:4146在 Claude Code 將[跨工作階段訊息](/docs/zh-TW/cross-session-messaging)寫入此機器上您的另一個工作階段之前,它會檢查目標工作階段的收件匣通訊端是否是訊息定址到的端點。當檢查失敗時,Claude Code 拒絕傳送,目標工作階段收不到任何內容。對於 Claude 傳送的訊息,拒絕出現在傳送工作階段的工具結果中:
3847 4147
3848```text theme={null}4148```text theme={null}
3849Failed to send to api-worker: Refusing to send: reply target is a symlink4149Failed to send to api-worker: Refusing to send: reply target is a symlink
3853 4153
3854* `reply target is a symlink`:符號連結位於目標工作階段的通訊端路徑。Claude Code 不會透過它傳遞,因為連結可能會將訊息重新導向到目標工作階段未建立的端點。4154* `reply target is a symlink`:符號連結位於目標工作階段的通訊端路徑。Claude Code 不會透過它傳遞,因為連結可能會將訊息重新導向到目標工作階段未建立的端點。
3855* `cannot vet reply target`:Claude Code 根本無法檢查目標路徑,例如因為讀取失敗並出現權限錯誤。4155* `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 4156
3862**應該怎麼做:**4157**應該怎麼做:**
3863 4158
3864* 通常不需要做任何事:檢查會防止訊息到達定址到的工作階段以外的端點,沒有傳送任何內容4159* 通常無需做任何事:檢查會防止訊息到達定址到的工作階段以外的端點,沒有任何內容被傳送
3865* 要求 Claude 再次列出您的工作階段並重新傳送;由過時位址引起的拒絕在 Claude 傳送到目前的工作階段後會清除4160* 如果 `reply target is a symlink` 對一個工作階段重複,檢查在該工作階段的通訊端路徑(顯示在其 `/status` 下的 `Peer address`)建立連結的內容
3866* 如果 `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 4161
3872<h3 id="refusing-after-a-symlink-changed">4162<h3 id="refusing-after-a-symlink-changed">
3873 Refusing to read, write, or search a path4163 拒絕讀取、寫入或搜尋路徑
3874</h3>4164</h3>
3875 4165
3876Claude Code 檢查檔案路徑的[權限規則](/docs/zh-TW/permissions#read-and-edit),然後在工具開啟檔案或啟動搜尋時再次確認該解析。當它無法確認路徑仍然導向檢查核准的位置時,Claude Code 拒絕該操作而不是跟隨它。拒絕出現在工具結果中:4166Claude Code 檢查檔案路徑的[權限規則](/docs/zh-TW/permissions#read-and-edit),然後在工具開啟檔案或啟動搜尋時再次確認該解析。當它無法確認路徑仍然導向檢查核准的位置時,Claude Code 拒絕操作而不是跟隨它。拒絕出現在工具結果中:
3877 4167
3878```text wrap theme={null}4168```text wrap theme={null}
3879Refusing to read /path/to/file: its symlink resolution changed after permission was checked (a link on the way now leads somewhere the check did not see). If a link in the working directory is being rewritten concurrently, stop that and retry.4169Refusing to read /path/to/file: its symlink resolution changed after permission was checked (a link on the way now leads somewhere the check did not see). If a link in the working directory is being rewritten concurrently, stop that and retry.
3881 4171
3882每個拒絕命名其原因:4172每個拒絕命名其原因:
3883 4173
3884* `its symlink resolution changed after permission was checked`:路徑上的符號連結或 Grep 或 Glob 搜尋根目錄在權限檢查和操作之間被取代。在讀取拒絕中,括號中的短語命名哪個比較失敗。4174* `its symlink resolution changed after permission was checked`:路徑上的符號連結或 Grep 或 Glob 搜尋根在權限檢查和操作之間被取代。在讀取拒絕中,括號中的短語命名哪個比較失敗。
3885* `its parent-directory symlink resolution changed after permission was checked`:寫入路徑通過的目錄不再解析為核准的位置4175* `its parent-directory symlink resolution changed after permission was checked`:寫入路徑通過的目錄不再解析為核准的位置
3886* `it is a symbolic link. Write to the link's target path instead`:符號連結位於核准的寫入位置本身,例如 `CLAUDE.md` 是 `AGENTS.md` 的符號連結;訊息指導 Claude 到連結的目標4176* `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 無法跟隨路徑到磁碟上的最終位置,例如因為路徑上的符號連結形成迴圈
3887* `Refusing to write through symlink: <path>. Resolve the symlink and pass the real target path explicitly.`:相同的條件在另一個寫入器開啟檔案時被捕捉,例如寫入符號連結的 `.mcp.json`4177* `it is a symbolic link. Write to the link's target path instead`:符號連結位於核准的寫入位置本身,例如 `CLAUDE.md` 是 `AGENTS.md` 的符號連結;訊息將 Claude 導向連結的目標
3888* `Refusing to write into symlinked directory: <path>`:持有檔案的目錄本身是符號連結,例如專案的 `.claude/` 目錄連結到另一個位置4178* `Refusing to write through symlink: <path>. Resolve the symlink and pass the real target path explicitly.`:當另一個寫入器開啟檔案時捕獲的相同條件,例如寫入符號連結的 `.mcp.json`
4179* `Refusing to write into symlinked directory: <path>`:持有檔案的目錄本身是符號連結,例如專案的 `.claude/` 目錄連結到另一位置
3889* `a path one of its Read deny rules is written through changed while the search was being prepared. Retry.`:搜尋的 `Read` 拒絕規則命名通過符號連結的路徑,該連結在 Claude Code 準備搜尋時變更4180* `a path one of its Read deny rules is written through changed while the search was being prepared. Retry.`:搜尋的 `Read` 拒絕規則命名通過符號連結的路徑,該連結在 Claude Code 準備搜尋時變更
3890* `it could not be opened (EACCES) — it is unreadable, or is being replaced concurrently.`:搜尋根目錄存在但無法開啟;括號中的代碼是作業系統錯誤4181* `it could not be opened (EACCES) — it is unreadable, or is being replaced concurrently.`:搜尋根存在但無法開啟;括號中的代碼是作業系統錯誤
3891* `its permission check expired before it ran (too many concurrent file operations). Retry.`:Claude Code 在許多同時檔案操作下驅逐了核准記錄,然後工具使用它;重試執行新的權限檢查4182* `its permission check expired before it ran (too many concurrent file operations). Retry.`:Claude Code 在許多同時檔案操作下驅逐核准記錄,工具使用它之前;重試執行新鮮的權限檢查
3892* `ripgrep was found only by name on PATH, and a search outside the working directory cannot apply your Read deny rules in that configuration`:Claude Code 無法將 `rg` 二進位檔解析為絕對路徑,因此它拒絕在工作目錄外的搜尋,而不是執行您的拒絕規則不涵蓋的搜尋4183* `ripgrep was found only by name on PATH, and a search outside the working directory cannot apply your Read deny rules in that configuration`:Claude Code 無法將 `rg` 二進位檔解析為絕對路徑,因此它拒絕工作目錄外的搜尋,而不是執行您的拒絕規則不涵蓋的搜尋
3893 4184
3894**應該怎麼做:**4185**應該怎麼做:**
3895 4186
3896* 通常不需要做任何事:拒絕到達 Claude 作為工具結果,被拒絕的操作不執行4187* 通常無需做任何事:拒絕到達 Claude 作為工具結果,被拒絕的操作不執行
3897* 如果符號連結拒絕在一個路徑上重複,請找到持續重寫連結的內容,例如建置工具或檔案監視程式,或要求 Claude 使用檔案的已解析路徑而不是連結的路徑4188* 如果符號連結拒絕在一個路徑上重複,找到什麼持續重寫那裡的連結,例如建置工具或檔案監視程式,或要求 Claude 使用檔案的已解析路徑而不是連結的路徑
3898* 如果此拒絕在 Windows 上的 AppContainer 或受限權杖沙箱內執行 Claude Code 時出現在每個檔案上,請升級到 v2.1.265 或更新版本4189* 如果此拒絕在 Windows 上 Claude Code 在 AppContainer 或受限權杖沙箱內執行時出現,升級到 v2.1.265 或更新版本
3899* 如果讀取拒絕在 macOS 上出現在沒有任何內容重寫的檔案上,例如拖入提示的螢幕擷取畫面,請升級到 v2.1.273 或更新版本4190* 如果讀取拒絕在 macOS 上出現,針對沒有任何內容重寫的檔案,例如拖入提示的螢幕擷取畫面,升級到 v2.1.273 或更新版本
3900* 對於 ripgrep 拒絕,使用您的套件管理員安裝 ripgrep,以便 `rg` 在 `PATH` 上解析為絕對路徑,或將搜尋保留在工作目錄下4191* 對於 ripgrep 拒絕,使用您的套件管理員安裝 ripgrep,使 `rg` 解析為 `PATH` 上的絕對路徑,或將搜尋保留在工作目錄下
3901 4192
3902在 v2.1.251 之前,Claude Code 僅對檔案寫入重新檢查路徑的解析,因此在權限檢查後取代的連結可能會將讀取或搜尋重新導向到不同的位置,沒有訊息。在這些拒絕中,只有父目錄、透過符號連結和符號連結目錄寫入拒絕出現在較早的版本上。4193在 v2.1.251 之前,Claude Code 僅針對檔案寫入重新檢查路徑的解析,因此在權限檢查後取代的連結可能會將讀取或搜尋重新導向到不同位置而沒有訊息。其中,只有父目錄、透過符號連結和符號連結目錄寫入拒絕出現在較早的版本上。
4194
4195在 v2.1.280 之前,`where it leads on disk could not be determined` 拒絕沒有出現。
3903 4196
3904<h3 id="task-output-swap-refused">4197<h3 id="task-output-swap-refused">
3905 Task output swap refused4198 工作輸出交換被拒絕
3906</h3>4199</h3>
3907 4200
3908Claude Code 將每個 Bash 命令的輸出儲存到其暫存目錄下的檔案。每次它開啟其中一個檔案時,它都會檢查路徑是否仍然導向它建立的檔案,沒有符號連結、額外硬連結或移動的目錄重新導向它。此訊息表示該檢查失敗,因此 Claude Code 拒絕了該操作,而不是透過該路徑寫入或讀取輸出。該訊息出現在 Bash 工具結果中:4201Claude Code 將每個 Bash 命令的輸出儲存到其暫存目錄下的檔案。每次它開啟其中一個檔案時,它都會檢查路徑是否仍然導向它建立的檔案,沒有符號連結、額外硬連結或移動的目錄重新導向它。此訊息表示該檢查失敗,因此 Claude Code 拒絕操作而不是透過該路徑寫入或讀取輸出。訊息出現在 Bash 工具結果中:
3909 4202
3910```text wrap theme={null}4203```text wrap theme={null}
3911task output swap refused (tasks dir moved or linked): /private/tmp/claude-501/-Users-you-my-project/1f0e62dc-4b0a-4f5e-9c2d-8a7b6c5d4e3f/tasks/b7k2f9m3q.output. To recover: restart Claude Code with CLAUDE_CODE_TMPDIR set to a fresh directory; or, if /private/tmp/claude-501/-Users-you-my-project is a stray directory or a symbolic link that should not be there, remove that entry itself (not what it points to) and restart.4204task output swap refused (tasks dir moved or linked): /private/tmp/claude-501/-Users-you-my-project/1f0e62dc-4b0a-4f5e-9c2d-8a7b6c5d4e3f/tasks/b7k2f9m3q.output. To recover: restart Claude Code with CLAUDE_CODE_TMPDIR set to a fresh directory; or, if /private/tmp/claude-501/-Users-you-my-project is a stray directory or a symbolic link that should not be there, remove that entry itself (not what it points to) and restart.
3922**應該怎麼做:**4215**應該怎麼做:**
3923 4216
3924* 升級到 v2.1.260 或更新版本。較早的版本有時在沒有連結或移動目錄存在時顯示此訊息4217* 升級到 v2.1.260 或更新版本。較早的版本有時在沒有連結或移動目錄存在時顯示此訊息
3925* 使用設定為新目錄的 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 重新啟動 Claude Code4218* 使用 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設定為新鮮目錄重新啟動 Claude Code
3926* 或檢查 Claude Code 暫存目錄下的專案目錄,範例訊息中的 `/private/tmp/claude-501/-Users-you-my-project`。如果該路徑是符號連結,或不應該存在的目錄,請移除連結或目錄本身而不是連結的目標,然後重新啟動 Claude Code4219* 或檢查您的專案在 Claude Code 暫存目錄下的目錄,範例訊息中的 `/private/tmp/claude-501/-Users-you-my-project`。如果該路徑是符號連結,或不應該在那裡的目錄,移除連結或目錄本身而不是連結的目標,並重新啟動 Claude Code
3927* 如果拒絕重複,程序在工作階段執行時會取代、連結或移除 Claude Code 暫存目錄下的項目。將 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設定為沒有其他內容管理的目錄並重新啟動4220* 如果拒絕重複,程序在工作階段執行時替換、連結或移除 Claude Code 暫存目錄下的項目。將 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設定為沒有其他內容管理的目錄並重新啟動
4221
4222<h3 id="disk-quota-or-temp-filesystem-is-full">
4223 磁碟配額或暫存檔案系統已滿
4224</h3>
4225
4226Claude Code 將每個 Bash 和 PowerShell 命令的輸出儲存到其暫存目錄下的檔案。當命令以非零代碼退出且完全沒有輸出時,Claude Code 會檢查持有該檔案的檔案系統是否空間不足或 inode 不足,或您在其上的磁碟配額是否已用完。如果是這樣,診斷會出現在命令的結果中,代替空輸出:
4227
4228```text wrap theme={null}
4229Your 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.
4230```
4231
4232訊息命名什麼用完了:
4233
4234* `Your disk quota is full ... (EDQUOT)`:您在該檔案系統上的配額已用完。配額可以在檔案系統仍顯示可用空間時已滿
4235* `The filesystem with Claude Code's temp directory ..., or your disk quota on it, is full (ENOSPC)`:檔案系統或您在其上的配額沒有空間剩餘
4236* `Command output was lost: the temp filesystem at ... is full` 或 `... is out of inodes`:檔案系統幾乎沒有可用空間剩餘,或 inode 即將用完
4237
4238**應該怎麼做:**
4239
4240* 刪除您在持有 Claude Code 暫存目錄的檔案系統上不再需要的檔案。對於 `EDQUOT`,刪除計入您自己配額的檔案。對於 `out of inodes`,刪除許多檔案而不是幾個大檔案,因為每個檔案佔用一個 inode,無論其大小如何
4241* 或使用 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設定為有空間的檔案系統上的目錄重新啟動 Claude Code
4242* 然後讓 Claude 再次執行命令。它列印的輸出已遺失,未被截斷
3928 4243
3929<h3 id="the-source-file-is-not-valid-utf-8-text">4244<h3 id="the-source-file-is-not-valid-utf-8-text">
3930 The source file is not valid UTF-8 text4245 來源檔案不是有效的 UTF-8 文字
3931</h3>4246</h3>
3932 4247
3933Claude 嘗試從位元組不解碼為文字的檔案發佈[成品](/docs/zh-TW/artifacts),或其文字已包含替換字元 `U+FFFD`,因此 Claude Code 在上傳任何內容之前拒絕發佈。該訊息出現在成品工具結果中,並命名要修正的第一個位置:4248Claude 嘗試從其位元組不解碼為文字的檔案發佈[成品](/docs/zh-TW/artifacts),或其文字已包含替換字元 `U+FFFD`,因此 Claude Code 拒絕發佈,未上傳任何內容。訊息出現在成品工具結果中,並命名要修正的第一個位置:
3934 4249
3935```text wrap theme={null}4250```text wrap theme={null}
3936file_path: the source file is not valid UTF-8 text (first invalid byte at line 12, column 40). It may be saved in another encoding or contain binary data. Rewrite it as UTF-8, then publish again. Nothing was published.4251file_path: the source file is not valid UTF-8 text (first invalid byte at line 12, column 40). It may be saved in another encoding or contain binary data. Rewrite it as UTF-8, then publish again. Nothing was published.
3938file_path: the source file has the replacement character U+FFFD at line 12, column 40, usually left where an earlier edit or paste lost a character. Replace it with the intended text (in HTML, write an intended U+FFFD as �), then publish again. Nothing was published.4253file_path: the source file has the replacement character U+FFFD at line 12, column 40, usually left where an earlier edit or paste lost a character. Replace it with the intended text (in HTML, write an intended U+FFFD as �), then publish again. Nothing was published.
3939```4254```
3940 4255
3941Claude Code 將檔案解碼為 UTF-8,或當它以小端 UTF-16 位元組順序標記開頭時解碼為 UTF-16。當這樣的 UTF-16 檔案無法解碼時,第一個訊息命名 `UTF-16` 並仍然告訴您將檔案重寫為 UTF-8。當更多位置跟隨命名的位置時,訊息在位置之後新增計數,例如 `(+2 more)`。4256Claude Code 將檔案解碼為 UTF-8,或當它以小端 UTF-16 位元組順序標記開始時解碼為 UTF-16。當這樣的 UTF-16 檔案不解碼時,第一個訊息命名 `UTF-16` 並仍然告訴您將檔案重寫為 UTF-8。當更多位置跟隨命名的位置時,訊息在位置後新增計數,例如 `(+2 more)`。
3942 4257
3943**應該怎麼做:**4258**應該怎麼做:**
3944 4259
3945* 通常不需要做任何事:Claude 重寫檔案並再次發佈4260* 通常無需做任何事:Claude 重寫檔案並再次發佈
3946* 如果檔案是您寫入或匯出的,請再次將其儲存為 UTF-8,並將每個 `U+FFFD` 取代為較早的編輯、貼上或轉換遺失的字元4261* 如果檔案是您寫入或匯出的,再次將其儲存為 UTF-8,並將每個 `U+FFFD` 替換為較早的編輯、貼上或轉換遺失的字元
3947* 若要在頁面上顯示有意的 `U+FFFD`,請在 HTML 中將其寫為 `�` 而不是字面字元4262* 若要在頁面上顯示有意的 `U+FFFD`,請在 HTML 中將其寫為 `�` 而不是字面字元
3948 4263
3949在 v2.1.267 之前,Claude Code 上傳這樣的檔案而不檢查它,伺服器改為拒絕發佈。4264在 v2.1.267 之前,Claude Code 上傳這樣的檔案而不檢查它,伺服器改為拒絕發佈。
3950 4265
3951<h3 id="reading-a-local-file-from-outside-the-connected-folders">4266<h3 id="reading-a-local-file-from-outside-the-connected-folders">
3952 Reading a local file from outside the connected folders in a Cowork session4267 在 Cowork 工作階段中從連接的資料夾外讀取本機檔案
3953</h3>4268</h3>
3954 4269
3955在 Claude Desktop 應用程式中在您的機器上執行的 [Cowork](https://claude.com/docs/cowork/overview) 工作階段中,Claude 為[成品](/docs/zh-TW/artifacts)命名了本機檔案。Claude Code 無法確認檔案是工作階段連接資料夾內的純檔案:路徑位於這些資料夾外、通過符號連結或以可能命名不同檔案的方式拼寫。讀取這樣的檔案需要您的核准,在無法向您顯示核准卡的工作階段中,例如設定為跳過所有核准的工作階段,Claude Code 拒絕讀取。4270在 Claude Desktop 應用程式中在您的機器上執行的 [Cowork](https://claude.com/docs/cowork/overview) 工作階段中,Claude 命名了[成品](/docs/zh-TW/artifacts)的本機檔案。Claude Code 無法確認檔案是工作階段連接資料夾內的純檔案:路徑位於這些資料夾外、通過符號連結或以可能命名不同檔案的方式拼寫。讀取這樣的檔案需要您的核准,在無法向您顯示核准卡的工作階段中,例如設定為跳過所有核准的工作階段,Claude Code 拒絕讀取。
3956 4271
3957拒絕出現在成品工具結果中;當檔案根本無法檢查時,它改為命名該失敗:4272拒絕出現在成品工具結果中;當檔案根本無法檢查時,它改為命名該失敗:
3958 4273
3964 4279
3965**應該怎麼做:**4280**應該怎麼做:**
3966 4281
3967* 通常不需要做任何事:訊息告訴 Claude 改為使用連接資料夾內的純檔案4282* 通常無需做任何事:訊息告訴 Claude 改為使用連接資料夾內的純檔案
3968* 若要將該確切檔案放在成品中,請將其複製到工作階段的其中一個連接資料夾中作為常規檔案(不是符號連結),然後再次詢問4283* 若要將該確切檔案放在成品中,將其複製到工作階段的連接資料夾之一中作為常規檔案(不是符號連結),並再次詢問
3969 4284
3970<h3 id="webfetch-cannot-fetch-localhost">4285<h3 id="webfetch-cannot-fetch-localhost">
3971 WebFetch cannot fetch localhost4286 WebFetch 無法擷取 localhost
3972</h3>4287</h3>
3973 4288
3974Claude 呼叫了 [WebFetch](/docs/zh-TW/tools-reference#webfetch-tool-behavior),其 URL 的主機名沒有點,例如 `http://localhost:3000` 或裸內部網路名稱如 `http://wiki/`。WebFetch 在進行任何要求之前拒絕這些 URL:4289Claude 呼叫了 [WebFetch](/docs/zh-TW/tools-reference#webfetch-tool-behavior),其 URL 的主機名沒有點,例如 `http://localhost:3000` 或裸內部網路名稱如 `http://wiki/`。WebFetch 在進行任何要求之前拒絕這些 URL:
3979 4294
3980**應該怎麼做:**4295**應該怎麼做:**
3981 4296
3982* 通常不需要做任何事:訊息將 Claude 指向透過 Bash 工具的 `curl`,它可以到達本機和內部網路伺服器4297* 通常無需做任何事:訊息將 Claude 指向透過 Bash 工具的 `curl`,它可以到達本機和內部網路伺服器
3983 4298
3984在 v2.1.268 之前,WebFetch 使用通用 `Invalid URL` 錯誤報告這些 URL。4299在 v2.1.268 之前,WebFetch 報告這些 URL 時出現通用 `Invalid URL` 錯誤。
3985 4300
3986<h2 id="background-session-errors">4301<h2 id="background-session-errors">
3987 背景工作階段錯誤4302 背景工作階段錯誤
3993 在背景工作階段中拒絕的命令4308 在背景工作階段中拒絕的命令
3994</h3>4309</h3>
3995 4310
3996開啟互動式對話框的命令在沒有終端附加到背景工作階段時無法執行。`/install-github-app`、`/mcp` 設定清單和 MCP 伺服器選單中的驗證動作會回應一則訊息,工作階段會在[代理檢視](/docs/zh-TW/agent-view)中的 **Needs input** 下出現,以便您可以找到它、附加並再次執行命令。當終端附加時,這些命令正常運作。4311開啟互動式對話框的命令在沒有終端附加到背景工作階段時無法執行。`/install-github-app`、`/mcp` 設定清單和 MCP 伺服器選單中的驗證動作會回應一則訊息。對於 `/install-github-app` 和 `/mcp` 設定清單,工作階段也會在[代理檢視](/docs/zh-TW/agent-view)中的 **Needs input** 下出現,以便您可以找到它、附加並再次執行命令。當終端附加時,這些命令正常運作。
3997 4312
3998在 v2.1.216 之前,工作階段在其中一個拒絕後不會在 **Needs input** 下出現。在 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 而不是開啟瀏覽器。4313在 v2.1.216 之前,工作階段在 `/install-github-app` 或 `/mcp` 設定清單被拒絕後不會在 **Needs input** 下出現。在 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 4314
4000措辭會命名該命令。`/mcp` 設定清單報告:4315措辭會命名該命令。`/mcp` 設定清單報告:
4001 4316
4005 4320
4006**該怎麼做:**4321**該怎麼做:**
4007 4322
4008* 從代理檢視附加到工作階段,其中它列在 **Needs input** 下,並再次執行命令4323* 從代理檢視附加到工作階段並再次執行命令
4009* 或使用訊息命名的形式,例如 `/mcp reconnect <server>`、`/mcp enable` 或 `/mcp disable`,這些在不附加的情況下有效4324* 或使用訊息命名的形式,例如 `/mcp reconnect <server>`、`/mcp enable` 或 `/mcp disable`,這些在不附加的情況下有效
4010 4325
4011<h3 id="write-or-command-blocked-because-the-path-cannot-be-safely-resolved">4326<h3 id="write-or-command-blocked-because-the-path-cannot-be-safely-resolved">
4040**該怎麼做:**4355**該怎麼做:**
4041 4356
4042* 通常什麼都不做:Claude 使用訊息要求的本機拼寫重試4357* 通常什麼都不做:Claude 使用訊息要求的本機拼寫重試
4043* 如果檔案在網路共享上而不是用網路路徑拼寫的本機檔案,它在工作階段的本機工作區之外;改為從常規互動式工作階段編輯它
4044 4358
4045<h3 id="command-blocked-by-the-worktree-isolation-checks">4359<h3 id="command-blocked-by-the-worktree-isolation-checks">
4046 命令被 worktree 隔離檢查阻止4360 命令被 worktree 隔離檢查阻止
4275 4589
4276在某些帳戶上,訊息在 `daemon` 位置說 `background service`。4590在某些帳戶上,訊息在 `daemon` 位置說 `background service`。
4277 4591
4278在 npm 安裝上,在 `npm install -g @anthropic-ai/claude-code` 替換二進位檔案時出現的 `EUNKNOWN` 與[重新安裝期間的 `EACCES`](#eacces-when-starting-a-background-session) 有相同的原因,並在您在安裝完成後重試時清除。4592在 npm 安裝上,在 `npm install -g @anthropic-ai/claude-code` 替換二進位檔案時出現的 `EUNKNOWN` 與[重新安裝期間的 `EACCES`](#eacces-when-starting-a-background-session)有相同的原因,並在您在安裝完成後重試時清除。
4279 4593
4280Claude Code 透過 PowerShell 啟動背景服務,以便服務在關閉終端時存活,在安裝時使用 PowerShell 7,否則使用 Windows PowerShell 5.1。當兩個 PowerShell 都無法執行時,Claude Code 改為直接啟動服務,因此只阻止 PowerShell 的原則不會導致此錯誤。如果您在沒有 npm 安裝執行時看到它,原則會阻止 Claude Code 可執行檔本身。4594Claude Code 透過 PowerShell 啟動背景服務,以便服務在關閉終端時存活,在安裝時使用 PowerShell 7,否則使用 Windows PowerShell 5.1。當兩個 PowerShell 都無法執行時,Claude Code 改為直接啟動服務,因此只阻止 PowerShell 的原則不會導致此錯誤。
4281 4595
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。4596在 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 4597
4341 啟動背景工作階段時工作目錄不再存在4655 啟動背景工作階段時工作目錄不再存在
4342</h3>4656</h3>
4343 4657
4344您嘗試在不再存在的目錄中啟動[背景工作階段](/docs/zh-TW/agent-view)。當您從代理檢視分派或在您工作的目錄被刪除或移動後執行 `/background` 時,會發生這種情況。當您附加到或重新啟動其程序已退出且其目錄已消失的工作階段時,也會發生這種情況,因為新程序會在相同目錄中啟動。Claude Code 不啟動工作階段,訊息命名遺漏的目錄:4658您嘗試在不再存在的目錄中啟動[背景工作階段](/docs/zh-TW/agent-view)。Claude Code 不啟動工作階段,訊息命名遺漏的目錄:
4345 4659
4346```text theme={null}4660```text theme={null}
4347Couldn't start a background session (working directory no longer exists or is not accessible: /tmp/demo)4661Couldn't start a background session (working directory no longer exists or is not accessible: /tmp/demo)
4349 4663
4350在 v2.1.257 之前,工作階段似乎啟動,然後在代理檢視中顯示為失敗列,原因相同。4664在 v2.1.257 之前,工作階段似乎啟動,然後在代理檢視中顯示為失敗列,原因相同。
4351 4665
4666在 v2.1.281 之前,此訊息也在您啟動工作階段之前目錄已消失時出現。該案例報告[`could not be resolved on disk`](#workspace-not-trusted-when-dispatching-a-background-session)。
4667
4352**該怎麼做:**4668**該怎麼做:**
4353 4669
4354* 重新建立訊息命名的目錄,或從存在的目錄分派,然後再試一次4670* 重新建立訊息命名的目錄,或從存在的目錄分派,然後再試一次
4355 4671
4672<h3 id="workspace-not-trusted-when-dispatching-a-background-session">
4673 分派背景工作階段時工作區未信任
4674</h3>
4675
4676您在未[信任](/docs/zh-TW/permissions#project-allow-rules-and-workspace-trust)的目錄中啟動或重新啟動[背景工作階段](/docs/zh-TW/agent-view),工作區信任對話無法出現以詢問您。Claude Code 不啟動工作階段:
4677
4678```text theme={null}
4679Workspace not trusted. Run `claude` in /path/to/project once and accept the trust prompt, then retry.
4680```
4681
4682從工作階段自己的目錄中的終端,相同的命令改為顯示信任對話並在您接受後啟動工作階段。此訊息出現在沒有對話可以出現的地方,例如在指令碼中,或當您從不同於其自己的目錄重新啟動工作階段時。
4683
4684兩個變體命名不同的原因:
4685
4686* **`The home directory is trusted one session at a time`**:工作階段的目錄是您的主目錄。Claude Code 永遠不會儲存主目錄的信任,因此在較早的工作階段中在那裡接受對話不計算。
4687* **`<path> could not be resolved on disk`**:Claude Code 無法在磁碟上找到工作階段的目錄。
4688
4689**該怎麼做:**
4690
4691* 在訊息命名的目錄中執行 `claude` 並接受信任對話,然後再次執行命令
4692* 對於主目錄訊息,從您主目錄中的終端執行命令,以便對話可以出現,或改為從專案目錄啟動工作階段
4693* 對於 `could not be resolved on disk` 訊息,重新建立目錄,或從存在的目錄啟動新工作階段
4694
4356<h2 id="wrapper-and-ide-errors">4695<h2 id="wrapper-and-ide-errors">
4357 包裝程式和 IDE 錯誤4696 包裝程式和 IDE 錯誤
4358</h2>4697</h2>
4437 4776
4438* 識別哪些檔案被跳過,以便您可以使用下面的步驟處理每個檔案。訊息只提供計數;位於 `~/.claude/debug/<session-id>.txt` 的偵錯日誌會在還原執行時列出每個跳過的路徑,因此在下次還原之前使用 `/debug` 開啟偵錯日誌。在 macOS 或 Linux 上,您可以改為直接找到連結:`find . -type l` 用於符號連結,`find . -type f -links +1` 用於硬連結檔案。4777* 識別哪些檔案被跳過,以便您可以使用下面的步驟處理每個檔案。訊息只提供計數;位於 `~/.claude/debug/<session-id>.txt` 的偵錯日誌會在還原執行時列出每個跳過的路徑,因此在下次還原之前使用 `/debug` 開啟偵錯日誌。在 macOS 或 Linux 上,您可以改為直接找到連結:`find . -type l` 用於符號連結,`find . -type f -links +1` 用於硬連結檔案。
4439* 如果跳過的檔案是您有意建立的連結,例如由 dotfile 管理器管理的設定檔或由 pnpm 等工具硬連結的檔案,rewind 會保留其內容不變。若要復原工作階段對其所做的變更,請要求 Claude 反轉編輯或自行編輯檔案4778* 如果跳過的檔案是您有意建立的連結,例如由 dotfile 管理器管理的設定檔或由 pnpm 等工具硬連結的檔案,rewind 會保留其內容不變。若要復原工作階段對其所做的變更,請要求 Claude 反轉編輯或自行編輯檔案
4440* 如果您沒有建立連結,請在信任其內容之前檢查路徑:某些東西在檢查點之後替換了該檔案4779* 如果您沒有建立連結,請在信任其內容之前檢查路徑
4441 4780
4442<h3 id="no-files-were-restored">4781<h3 id="no-files-were-restored">
4443 No files were restored4782 No files were restored
4585* 縮短您的代理程式檔案的 `description` frontmatter,或要求 Claude 為您修剪它們。4924* 縮短您的代理程式檔案的 `description` frontmatter,或要求 Claude 為您修剪它們。
4586* 移除您不再使用的代理程式檔案。4925* 移除您不再使用的代理程式檔案。
4587 4926
4927<h3 id="a-skill-command-or-workflow-wasnt-loaded-because-its-name-is-reserved">
4928 技能、命令或工作流程未被載入,因為其名稱已保留
4929</h3>
4930
4931技能資料夾、frontmatter `name`、`.claude/commands/` 中的檔案或子資料夾,或[已儲存的工作流程](/docs/zh-TW/workflows#save-the-workflow-for-reuse)使用名稱 `anthropic-skills` 或以 `anthropic-skills:` 開頭的名稱。Claude Code [保留該名稱用於從 claude.ai 同步的技能](/docs/zh-TW/skills#names-reserved-for-synced-skills),不會載入該項目。
4932
4933Claude Code 在對話檢視中顯示此警告作為啟動通知,而不是在 stderr 上:
4934
4935```text theme={null}
4936未載入:重新命名 .claude/skills/anthropic-skills,然後重新啟動 — 其名稱使用 "anthropic-skills",這是為從您的 claude.ai 帳戶同步的技能保留的名稱
4937```
4938
4939通知命名它拒絕的第一個項目要變更的內容:要重新命名的資料夾或檔案、要編輯的 `name:` 行,或要重新命名的工作流程。當拒絕了多個項目時,通知以計數結尾,例如 `· 2 more`,[偵錯日誌](/docs/zh-TW/debug-your-config)命名每一個。
4940
4941**該怎麼做:**
4942
4943* 重新命名通知命名的項目,或編輯它指向的 `name:` 行,然後重新啟動工作階段。
4944
4945在 v2.1.282 之前,Claude Code 載入了具有這些名稱的技能和命令。
4946
4588<h3 id="workspace-has-not-been-trusted">4947<h3 id="workspace-has-not-been-trusted">
4589 工作區尚未受信任4948 工作區尚未受信任
4590</h3>4949</h3>
4631 遠端受管設定無法載入4990 遠端受管設定無法載入
4632</h3>4991</h3>
4633 4992
4634您的工作階段符合[伺服器受管設定](/docs/zh-TW/server-managed-settings)的資格,但 Claude Code 無法擷取它們,因此在互動工作階段中顯示此警告。括號中的原因命名失敗的內容,例如 `network error`、`request timed out` 或 `authentication rejected (401)`,行的其餘部分說明工作階段執行的策略:4993您的工作階段符合[伺服器受管設定](/docs/zh-TW/server-managed-settings)的資格,但 Claude Code 無法擷取它們或無法應用伺服器傳回的內容,因此在互動工作階段中顯示此警告。
4994
4995括號中的原因命名失敗的內容,例如 `network error`、`request timed out` 或 `authentication rejected (401)`。原因 `no setting in the server response could be applied as written` 表示伺服器已回應,但它傳回的設定都未通過[驗證](/docs/zh-TW/server-managed-settings#invalid-entries-in-delivered-settings)。在 v2.1.282 之前,此原因讀作 `server returned invalid settings`。
4996
4997行的其餘部分說明工作階段執行的策略:
4635 4998
4636* **從較早成功擷取快取的設定**:Claude Code 在該快取策略上執行工作階段,除了[隱藏的環境變數](/docs/zh-TW/server-managed-settings#fetch-and-caching-behavior),行讀取 `using cached policy`。4999* **從較早成功擷取快取的設定**:Claude Code 在該快取策略上執行工作階段,除了[隱藏的環境變數](/docs/zh-TW/server-managed-settings#fetch-and-caching-behavior),行讀取 `using cached policy`。
4637* **無快取**:Claude Code 在沒有伺服器受管設定的情況下執行工作階段,行讀取 `no remote policy applied`。5000* **無快取**:Claude Code 在沒有伺服器受管設定的情況下執行工作階段,行讀取 `no remote policy applied`。
4639**該怎麼做:**5002**該怎麼做:**
4640 5003
4641* 對訊息命名的原因採取行動:對於網路原因,檢查此機器是否可以到達 `api.anthropic.com`;對於驗證原因,使用 `/status` 檢查您的登入5004* 對訊息命名的原因採取行動:對於網路原因,檢查此機器是否可以到達 `api.anthropic.com`;對於驗證原因,使用 `/status` 檢查您的登入
5005* 對於 `no setting in the server response could be applied as written`,要求您的管理員更正伺服器上的設定
4642* 執行 `/status` 或 `claude doctor` 以取得完整診斷5006* 執行 `/status` 或 `claude doctor` 以取得完整診斷
4643 5007
4644在 v2.1.248 之前,Claude Code 僅在偵錯日誌中報告設定擷取失敗。5008在 v2.1.248 之前,Claude Code 僅在偵錯日誌中報告設定擷取失敗。
4658* 再次啟動 Claude Code 並批准對話以在您的組織設定下繼續。拒絕的對話不會被記住,因此在下次啟動時會再次出現。5022* 再次啟動 Claude Code 並批准對話以在您的組織設定下繼續。拒絕的對話不會被記住,因此在下次啟動時會再次出現。
4659* 如果您對對話列出的設定不確定,在批准前詢問維護您的組織受管設定的人5023* 如果您對對話列出的設定不確定,在批准前詢問維護您的組織受管設定的人
4660 5024
5025<h3 id="managed-settings-block-the-default-model">
5026 受管設定阻止預設模型
5027</h3>
5028
5029您的組織的[受管設定](/docs/zh-TW/managed-settings)阻止預設選項解析為的模型以及它可以降級到的每個模型。將在預設選項上啟動的工作階段在啟動時退出,而不是執行被阻止的模型。您看到的訊息取決於阻止它的設定。當 [`deniedModels`](/docs/zh-TW/model-config#block-specific-models-or-versions) 清單阻止它時,訊息讀作:
5030
5031```text theme={null}
5032Claude Code 無法啟動:您的組織的受管設定在 "deniedModels" 中阻止預設模型 (claude-opus-5-5),且它們允許的模型都無法用作預設模型。要求您的管理員更新 "deniedModels" 或 "availableModels"。
5033```
5034
5035當 `availableModels` 清單且 [`availableModelsMatch`](/docs/zh-TW/settings-reference#availablemodelsmatch) 設定為 `"exact"` 時省略它,訊息讀作:
5036
5037```text theme={null}
5038Claude Code 無法啟動:您的組織僅允許 "availableModels" 中列出的模型,且它們都無法用作預設模型 (claude-opus-5-5 未列出)。要求您的管理員更新 "availableModels"。
5039```
5040
5041**該怎麼做:**
5042
5043* 如果您管理設定,將您的使用者可以執行的模型新增到 `availableModels`,或縮小阻止每個後備的 `deniedModels` 項目。[阻止特定模型或版本](/docs/zh-TW/model-config#block-specific-models-or-versions)描述預設選項如何降級
5044* 如果您不管理它們,將訊息傳送給您的管理員。您自己的設定檔案無法擴大受管 `availableModels` 或 `deniedModels` 清單
5045
4661<h3 id="mcp-server-is-blocked-by-enterprise-managed-policy">5046<h3 id="mcp-server-is-blocked-by-enterprise-managed-policy">
4662 MCP 伺服器被企業受管策略阻止5047 MCP 伺服器被企業受管策略阻止
4663</h3>5048</h3>
4927 5312
4928* 配置的 [`--fallback-model`](/docs/zh-TW/cli-reference#cli-flags) 在可用性錯誤後接管該輪次,並在文字記錄中顯示通知5313* 配置的 [`--fallback-model`](/docs/zh-TW/cli-reference#cli-flags) 在可用性錯誤後接管該輪次,並在文字記錄中顯示通知
4929* Amazon Bedrock 或 Google Cloud 的 Agent Platform 啟動檢查發現您的預設模型不可用5314* Amazon Bedrock 或 Google Cloud 的 Agent Platform 啟動檢查發現您的預設模型不可用
4930* [自動模型備用](/docs/zh-TW/model-config#automatic-model-fallback)在 Fable 5.1、Fable 5、Opus 5.5 和 Opus 5 上將工作階段移至標記類別的備用模型(當該類別有備用模型時),並在文字記錄中顯示通知5315* [自動模型備用](/docs/zh-TW/model-config#automatic-model-fallback)在 Fable 5.1、Fable 5、Opus 5.5、Sonnet 5.5 和 Opus 5 上將工作階段移至標記類別的備用模型(當該類別有備用模型時),並在文字記錄中顯示通知
4931 5316
4932下面的模型選擇檢查可以捕捉第二和第三種情況;第一種情況顯示為文字記錄通知而非 `/model` 變更。[模型設定](/docs/zh-TW/model-config)說明每個備用何時適用。5317下面的模型選擇檢查可以捕捉第二和第三種情況;第一種情況顯示為文字記錄通知而非 `/model` 變更。[模型設定](/docs/zh-TW/model-config)說明每個備用何時適用。
4933 5318