46| `Agent terminated early due to an API error` | [伺服器錯誤](#agent-terminated-early-due-to-an-api-error) |46| `Agent terminated early due to an API error` | [伺服器錯誤](#agent-terminated-early-due-to-an-api-error) |
47| `You've hit your session limit` / `You've hit your weekly limit` / `You've hit your Opus limit` / `You've hit your Sonnet limit` | [用量上限](#youve-hit-your-session-limit) |47| `You've hit your session limit` / `You've hit your weekly limit` / `You've hit your Opus limit` / `You've hit your Sonnet limit` | [用量上限](#youve-hit-your-session-limit) |
48| `Usage credits required for 1M context` | [用量上限](#usage-credits-required-for-1m-context) |48| `Usage credits required for 1M context` | [用量上限](#usage-credits-required-for-1m-context) |
49| `the prompt to confirm went unanswered — nothing was sent` | [用量上限](#the-prompt-to-confirm-went-unanswered) |49| `the prompt to confirm went unanswered · nothing was sent`,自 v2.1.324 起 | [用量上限](#the-prompt-to-confirm-went-unanswered) |
50| `Claude stopped here · send a message to be asked again` | [用量上限](#the-prompt-to-confirm-went-unanswered) |
50| `Server is temporarily limiting requests` | [用量上限](#server-is-temporarily-limiting-requests) |51| `Server is temporarily limiting requests` | [用量上限](#server-is-temporarily-limiting-requests) |
51| `Request rejected (429)` | [用量上限](#request-rejected-429) |52| `Request rejected (429)` | [用量上限](#request-rejected-429) |
52| `Credit balance is too low` | [用量上限](#credit-balance-is-too-low) |53| `Credit balance is too low` | [用量上限](#credit-balance-is-too-low) |
84| `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) |85| `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) |
85| `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) |86| `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) |
86| `Couldn't verify your organization's policy for remote control` | [疑難排解 Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#couldnt-verify-your-organizations-policy-for-remote-control) |87| `Couldn't verify your organization's policy for remote control` | [疑難排解 Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#couldnt-verify-your-organizations-policy-for-remote-control) |
88| `Remote Control didn't finish connecting` | [啟動 Remote Control 工作階段](https://code.claude.com/docs/zh-TW/remote-control.md#start-a-remote-control-session) |
87| `Remote Control is disabled by your organization's policy` | [疑難排解 Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#remote-control-is-disabled-by-your-organizations-policy) |89| `Remote Control is disabled by your organization's policy` | [疑難排解 Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#remote-control-is-disabled-by-your-organizations-policy) |
88| `Remote Control was turned off by your organization's policy` | [疑難排解 Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#remote-control-was-turned-off-by-your-organizations-policy) |90| `Remote Control was turned off by your organization's policy` | [疑難排解 Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#remote-control-was-turned-off-by-your-organizations-policy) |
89| `Session failed: working folder not found:` | [Remote Control 疑難排解](https://code.claude.com/docs/zh-TW/remote-control.md#working-folder-not-found) |91| `Session failed: working folder not found:` | [Remote Control 疑難排解](https://code.claude.com/docs/zh-TW/remote-control.md#working-folder-not-found) |
90| `The program file this Remote Control started from is gone` | [Remote Control 疑難排解](https://code.claude.com/docs/zh-TW/remote-control.md#program-file-is-gone) |92| `The program file this Remote Control started from is gone` | [Remote Control 疑難排解](https://code.claude.com/docs/zh-TW/remote-control.md#program-file-is-gone) |
91| `Session failed: spawn error:`,後接 `ENOENT` 訊息 | [Remote Control 疑難排解](https://code.claude.com/docs/zh-TW/remote-control.md#program-file-is-gone) |93| `Session failed: spawn error:`,後接 `ENOENT` 訊息 | [Remote Control 疑難排解](https://code.claude.com/docs/zh-TW/remote-control.md#program-file-is-gone) |
94| `Remote Control disconnected:` 後接提及 `share link` 的原因 | [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#what-connected-devices-see) |
92| `OAuth token revoked` / `OAuth token has expired` | [身分驗證](#oauth-token-revoked-or-expired) |95| `OAuth token revoked` / `OAuth token has expired` | [身分驗證](#oauth-token-revoked-or-expired) |
93| `Failed to authenticate: OAuth token revoked` | [身分驗證](#oauth-token-revoked-or-expired) |96| `Failed to authenticate: OAuth token revoked` | [身分驗證](#oauth-token-revoked-or-expired) |
94| `Your account does not have access to Claude. Please login again or contact your administrator.` | [身分驗證](#oauth-token-revoked-or-expired) |97| `Your account does not have access to Claude. Please login again or contact your administrator.` | [身分驗證](#oauth-token-revoked-or-expired) |
141| `Unable to connect to API` | [網路](#unable-to-connect-to-api) |144| `Unable to connect to API` | [網路](#unable-to-connect-to-api) |
142| `Connection refused —` / `Can't reach the API server —` / `No internet route —` / `Couldn't connect through your proxy` / `Connection dropped`,各以括號中的錯誤代碼結尾 | [網路](#unable-to-connect-to-api) |145| `Connection refused —` / `Can't reach the API server —` / `No internet route —` / `Couldn't connect through your proxy` / `Connection dropped`,各以括號中的錯誤代碼結尾 | [網路](#unable-to-connect-to-api) |
143| 設定期間出現的 `Unable to connect to Anthropic services` | [網路](#unable-to-connect-to-anthropic-services) |146| 設定期間出現的 `Unable to connect to Anthropic services` | [網路](#unable-to-connect-to-anthropic-services) |
147| `Unable to fetch your privacy settings at this time` | [claude.ai 上的隱私設定](https://claude.ai/settings/data-privacy-controls) |
144| `Socket is closed` | [網路](#socket-is-closed) |148| `Socket is closed` | [網路](#socket-is-closed) |
145| `Waiting for API response · will retry in` | [自動重試](#automatic-retries),或如果持續發生,則為[網路](#unable-to-connect-to-api) |149| `Waiting for API response · will retry in` | [自動重試](#automatic-retries),或如果持續發生,則為[網路](#unable-to-connect-to-api) |
146| `API returned an empty or malformed response` | [網路](#api-returned-an-empty-or-malformed-response) |150| `API returned an empty or malformed response` | [網路](#api-returned-an-empty-or-malformed-response) |
147| `Streaming response ended before any complete data was received` | [網路](#streaming-response-ended-before-any-complete-data-was-received) |151| `Streaming response ended before any complete data was received` | [網路](#streaming-response-ended-before-any-complete-data-was-received) |
148| `Bedrock streaming response has content-type "..."; expected "application/vnd.amazon.eventstream"` | [網路](#bedrock-streaming-response-has-an-unexpected-content-type) |152| `Bedrock streaming response has content-type "..."; expected "application/vnd.amazon.eventstream"` | [網路](#bedrock-streaming-response-has-an-unexpected-content-type) |
153| `Claude Code used only the certificates that it could read in full from the NODE_EXTRA_CA_CERTS file` / `Claude Code ignored all of the NODE_EXTRA_CA_CERTS file: it holds no certificate that Claude Code can read` | [自訂 CA 憑證](https://code.claude.com/docs/zh-TW/network-config.md#custom-ca-certificates) |
149| `SSL certificate verification failed` | [網路](#ssl-certificate-errors) |154| `SSL certificate verification failed` | [網路](#ssl-certificate-errors) |
150| 登入或啟動期間出現的 `SSL certificate error (...)` | [網路](#ssl-certificate-errors) |155| 登入或啟動期間出現的 `SSL certificate error (...)` | [網路](#ssl-certificate-errors) |
151| `unable to get local issuer certificate` | [網路](#ssl-certificate-errors) |156| `unable to get local issuer certificate` | [網路](#ssl-certificate-errors) |
276| ``Couldn't run `<command>` for <name>. A file named HEAD or .git in this folder or one above it may not be yours``,來自注入動態上下文的 skill | [注入命令的權限檢查](https://code.claude.com/docs/zh-TW/skills.md#permission-checks-on-injected-commands) |281| ``Couldn't run `<command>` for <name>. A file named HEAD or .git in this folder or one above it may not be yours``,來自注入動態上下文的 skill | [注入命令的權限檢查](https://code.claude.com/docs/zh-TW/skills.md#permission-checks-on-injected-commands) |
277| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [命令列錯誤](#security-review-fails-without-origin-head) |282| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [命令列錯誤](#security-review-fails-without-origin-head) |
278| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [命令列錯誤](#no-shell-command-was-run) |283| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [命令列錯誤](#no-shell-command-was-run) |
284| `This skill, command or hook and the arguments filled into it add up to more than 4,000,000 characters` | [命令列錯誤](#skill-command-or-hook-over-the-4000000-character-limit) |
279| `Input must be provided either through stdin or as a prompt argument when using --print` | [命令列錯誤](#input-must-be-provided-when-using-print) |285| `Input must be provided either through stdin or as a prompt argument when using --print` | [命令列錯誤](#input-must-be-provided-when-using-print) |
280| `Claude Code can't read the keyboard here: stdin is not a terminal` | [命令列錯誤](#claude-code-cant-read-the-keyboard-here) |286| `Claude Code can't read the keyboard here: stdin is not a terminal` | [命令列錯誤](#claude-code-cant-read-the-keyboard-here) |
281| `Error: Input contained only whitespace` | [命令列錯誤](#input-contained-only-whitespace) |287| `Error: Input contained only whitespace` | [命令列錯誤](#input-contained-only-whitespace) |
289| `Your connected GitHub account can't see <owner>/<repo>` | [命令列錯誤](#your-connected-github-account-cant-see-the-repository) |295| `Your connected GitHub account can't see <owner>/<repo>` | [命令列錯誤](#your-connected-github-account-cant-see-the-repository) |
290| `The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead` | [命令列錯誤](#the-github-app-preflight-failed-transiently) |296| `The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead` | [命令列錯誤](#the-github-app-preflight-failed-transiently) |
291| 帶有 `the upload cannot follow that setting` 的 `Not uploading this working tree` | [命令列錯誤](#the-repository-upload-cant-follow-a-git-setting) |297| 帶有 `the upload cannot follow that setting` 的 `Not uploading this working tree` | [命令列錯誤](#the-repository-upload-cant-follow-a-git-setting) |
298| `Not uploading this working tree` 並附有其他原因 / `Git will not work in this checkout because its folder, or the .git in it, belongs to another user` | [不透過 GitHub 傳送本機儲存庫](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#send-local-repositories-without-github) |
292| `GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud` | [命令列錯誤](#github-isnt-connected-to-your-claude-account) |299| `GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud` | [命令列錯誤](#github-isnt-connected-to-your-claude-account) |
293| `Your GitHub organization has an IP allowlist that is blocking Claude` | [命令列錯誤](#a-github-organization-policy-is-blocking-claude) |300| `Your GitHub organization has an IP allowlist that is blocking Claude` | [命令列錯誤](#a-github-organization-policy-is-blocking-claude) |
294| `Your GitHub organization requires single sign-on` | [命令列錯誤](#a-github-organization-policy-is-blocking-claude) |301| `Your GitHub organization requires single sign-on` | [命令列錯誤](#a-github-organization-policy-is-blocking-claude) |
312| `/recap only runs when you ask for it yourself in this session` | [命令列錯誤](#recap-only-runs-when-you-ask-for-it-yourself) |319| `/recap only runs when you ask for it yourself in this session` | [命令列錯誤](#recap-only-runs-when-you-ask-for-it-yourself) |
313| `/feedback is disabled by your organization's policy`,或 `/bug` 或 `/share` 的相同訊息 | [命令列錯誤](#feedback-is-disabled-by-your-organizations-policy) |320| `/feedback is disabled by your organization's policy`,或 `/bug` 或 `/share` 的相同訊息 | [命令列錯誤](#feedback-is-disabled-by-your-organizations-policy) |
314| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [外掛錯誤](#plugin-eval-is-currently-in-early-access) |321| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [外掛錯誤](#plugin-eval-is-currently-in-early-access) |
322| `credential store on this machine holds a symbolic link inside it` | [授予工具](https://code.claude.com/docs/zh-TW/plugin-evals.md#grant-tools) |
315| `cannot be evaluated where sessions load it` | [使用 evals 測試外掛](https://code.claude.com/docs/zh-TW/plugin-evals.md#cannot-be-evaluated-where-sessions-load-it) |323| `cannot be evaluated where sessions load it` | [使用 evals 測試外掛](https://code.claude.com/docs/zh-TW/plugin-evals.md#cannot-be-evaluated-where-sessions-load-it) |
316| `Marketplace "<name>" is registered from an untrusted source` | [外掛錯誤](#marketplace-is-registered-from-an-untrusted-source) |324| `Marketplace "<name>" is registered from an untrusted source` | [外掛錯誤](#marketplace-is-registered-from-an-untrusted-source) |
317| `Claude Code refuses the marketplace name "<name>"` | [外掛錯誤](#claude-code-refuses-the-marketplace-name) |325| `Claude Code refuses the marketplace name "<name>"` | [外掛錯誤](#claude-code-refuses-the-marketplace-name) |
343| `Plugin "<plugin>" was not uninstalled: installed_plugins.json` | [外掛疑難排解](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md#installed-plugins-json-holds-a-record-this-version-cannot-read) |351| `Plugin "<plugin>" was not uninstalled: installed_plugins.json` | [外掛疑難排解](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md#installed-plugins-json-holds-a-record-this-version-cannot-read) |
344| `Plugin directory does not exist: <path>` | [外掛疑難排解](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md#plugin-directory-does-not-exist) |352| `Plugin directory does not exist: <path>` | [外掛疑難排解](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md#plugin-directory-does-not-exist) |
345| `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)` | [外掛錯誤](#skipping-connection-recent-failure-cached) |353| `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)` | [外掛錯誤](#skipping-connection-recent-failure-cached) |
354| `is not added on this machine, so your organization's marketplace policy keeps its plugins off` | [新增市集](https://code.claude.com/docs/zh-TW/plugins/install.md#add-a-marketplace) |
355| `A mod's http.fetch hook stopped this request` | [開啟或關閉 mod](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#turn-mods-on-or-off) |
346| `Error: No such tool available: <tool name>` | [工具錯誤](#no-such-tool-available) |356| `Error: No such tool available: <tool name>` | [工具錯誤](#no-such-tool-available) |
347| `MCP server "<name>" connection closed before the tool call was answered` | [工具錯誤](#connection-closed-before-the-tool-call-was-answered) |357| `MCP server "<name>" connection closed before the tool call was answered` | [工具錯誤](#connection-closed-before-the-tool-call-was-answered) |
348| `MCP server "<name>" is disabled — re-enable it via /mcp to use its tools` | [工具錯誤](#mcp-server-is-disabled) |358| `MCP server "<name>" is disabled — re-enable it via /mcp to use its tools` | [工具錯誤](#mcp-server-is-disabled) |
356| `cannot contain null bytes (\0)` | [工具錯誤](#path-cannot-contain-null-bytes) |366| `cannot contain null bytes (\0)` | [工具錯誤](#path-cannot-contain-null-bytes) |
357| `Path contains null bytes` | [工具錯誤](#path-cannot-contain-null-bytes) |367| `Path contains null bytes` | [工具錯誤](#path-cannot-contain-null-bytes) |
358| `command contains the invisible character U+FEFF (byte order mark) or U+180E (Mongolian vowel separator), and was not run` | [工具錯誤](#command-contains-an-invisible-character) |368| `command contains the invisible character U+FEFF (byte order mark) or U+180E (Mongolian vowel separator), and was not run` | [工具錯誤](#command-contains-an-invisible-character) |
359| `This call was not run. The command was approved before Claude Code restarted` | [工具錯誤](#command-approved-before-a-restart-was-not-run) |369| `This call was not run. Claude Code could not confirm that the shell is back in the directory`,自 v2.1.323 起 | [工具錯誤](#command-approved-before-a-restart-was-not-run) |
360| `File is too large to read as an image (the limit is 128MB)` | [工具錯誤](#file-is-too-large-to-read-as-an-image) |370| `File is too large to read as an image (the limit is 128MB)` | [工具錯誤](#file-is-too-large-to-read-as-an-image) |
361| `Cannot read this as an image: <path> is a pipe or a device` | [工具錯誤](#file-is-too-large-to-read-as-an-image) |371| `Cannot read this as an image: <path> is a pipe or a device` | [工具錯誤](#file-is-too-large-to-read-as-an-image) |
362| `subagent_type is required: the general-purpose agent is not available in this session` | [工具錯誤](#subagent-type-is-required) |372| `subagent_type is required: the general-purpose agent is not available in this session` | [工具錯誤](#subagent-type-is-required) |
445| `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` | [全螢幕轉譯](https://code.claude.com/docs/zh-TW/fullscreen.md#fullscreen-renderer-didnt-finish-starting) |455| `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` | [全螢幕轉譯](https://code.claude.com/docs/zh-TW/fullscreen.md#fullscreen-renderer-didnt-finish-starting) |
446| `Claude Code exited after an unrecoverable interface error (...)` | [設定警告](#exited-after-an-unrecoverable-interface-error) |456| `Claude Code exited after an unrecoverable interface error (...)` | [設定警告](#exited-after-an-unrecoverable-interface-error) |
447| `Agent descriptions are over the 15.0k-token limit` | [設定警告](#agent-descriptions-are-over-the-15000-token-limit) |457| `Agent descriptions are over the 15.0k-token limit` | [設定警告](#agent-descriptions-are-over-the-15000-token-limit) |
458| `declares type "claudeai-proxy", which only claude.ai connectors use` | 從您的 MCP 設定中移除該項目。請參閱[使用來自 claude.ai 的 MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md#use-mcp-servers-from-claude-ai)。 |
448| `hook needs quotes around a path with a space` | [設定警告](#hook-needs-quotes-around-a-path-with-a-space) |459| `hook needs quotes around a path with a space` | [設定警告](#hook-needs-quotes-around-a-path-with-a-space) |
449| `Instruction file not loaded` | [設定警告](#instruction-file-not-loaded) |460| `Instruction file not loaded` | [設定警告](#instruction-file-not-loaded) |
450| `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) |461| `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) |
486| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" reads as <N> tokens, so Claude Code treats it as the 100k minimum` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` 的值與警告](https://code.claude.com/docs/zh-TW/model-config#claude_code_auto_compact_window-values) |497| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" reads as <N> tokens, so Claude Code treats it as the 100k minimum` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` 的值與警告](https://code.claude.com/docs/zh-TW/model-config#claude_code_auto_compact_window-values) |
487| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" is too large, so Claude Code treats it as the 1M maximum` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` 的值與警告](https://code.claude.com/docs/zh-TW/model-config#claude_code_auto_compact_window-values) |498| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" is too large, so Claude Code treats it as the 1M maximum` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` 的值與警告](https://code.claude.com/docs/zh-TW/model-config#claude_code_auto_compact_window-values) |
488| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" isn't a usable size, so Claude Code ignores it` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` 的值與警告](https://code.claude.com/docs/zh-TW/model-config#claude_code_auto_compact_window-values) |499| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" isn't a usable size, so Claude Code ignores it` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` 的值與警告](https://code.claude.com/docs/zh-TW/model-config#claude_code_auto_compact_window-values) |
489| `Model "<model>" isn't recognized · context assumed to be 200k tokens` | [修正閘道或自訂模型 ID 的上下文視窗](https://code.claude.com/docs/zh-TW/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id) |500| `Model "<model>" isn't recognized · context assumed to be <N> tokens` / `Claude Code doesn't recognize the model "<model>", so it assumes a context window of <N> tokens` | [修正閘道或自訂模型 ID 的視窗](https://code.claude.com/docs/zh-TW/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id) |
490| `Claude Code doesn't recognize the model "<model>", so it assumes a context window of 200k tokens` | [修正閘道或自訂模型 ID 的上下文視窗](https://code.claude.com/docs/zh-TW/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id) |
491| `Model "<model>" isn't recognized · did you mean "<suggestion>"?` / `Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"?` | [修正拼錯的模型名稱](https://code.claude.com/docs/zh-TW/model-config.md#fix-a-mistyped-model-name) |501| `Model "<model>" isn't recognized · did you mean "<suggestion>"?` / `Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"?` | [修正拼錯的模型名稱](https://code.claude.com/docs/zh-TW/model-config.md#fix-a-mistyped-model-name) |
492| `[claude-code:unrecognized_model]` | [設定警告](#unrecognized-model-id-on-a-request) |502| `[claude-code:unrecognized_model]` | [設定警告](#unrecognized-model-id-on-a-request) |
493| `is ignored — managed settings set allowManagedReadPathsOnly` / `is ignored — managed settings set allowManagedDomainsOnly` | [設定警告](#sandbox-allow-entries-are-ignored-under-a-managed-lock) |503| `is ignored — managed settings set allowManagedReadPathsOnly` / `is ignored — managed settings set allowManagedDomainsOnly` | [設定警告](#sandbox-allow-entries-are-ignored-under-a-managed-lock) |
934當 [Fable 用量點數同意提示](https://code.claude.com/docs/zh-TW/model-config.md#fable-and-usage-credits)在無人回應的情況下關閉時,Claude Code 會以以下其中一條訊息結束回合:944當 [Fable 用量點數同意提示](https://code.claude.com/docs/zh-TW/model-config.md#fable-and-usage-credits)在無人回應的情況下關閉時,Claude Code 會以以下其中一條訊息結束回合:
935 945
936```text theme={null}946```text theme={null}
937Fable limit reached · continuing on Fable 5.1 uses usage credits, and the prompt to confirm went unanswered — nothing was sent · answer it where this session is running, or /model to change947Fable limit reached · continuing on Fable 5.1 uses usage credits, and the prompt to confirm went unanswered · nothing was sent · answer it where this session is running, or /model to change
938Fable 5.1 now uses usage credits · the prompt to confirm went unanswered — nothing was sent · answer it where this session is running, or /model to change948Fable 5.1 now uses usage credits · the prompt to confirm went unanswered · nothing was sent · answer it where this session is running, or /model to change
939```949```
940 950
941訊息會命名工作階段的 Fable 模型,因此在 Fable 5.2 上它們會讀作 `continuing on Fable 5.2` 和 `Fable 5.2 now uses usage credits`。在 v2.1.257 之前,第一條訊息以 `Fable 5 limit reached` 開頭。951訊息會命名工作階段的 Fable 模型,因此在 Fable 5.2 上它們會讀作 `continuing on Fable 5.2` 和 `Fable 5.2 now uses usage credits`。連接 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 時,每條訊息可能改以 `Claude stopped here · send a message to be asked again, or switch models` 結尾。在 v2.1.257 之前,第一條訊息以 `Fable 5 limit reached` 開頭。
942 952
943這發生在 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 工作階段、[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md)、[agent team](https://code.claude.com/docs/zh-TW/agent-teams.md) 隊友工作階段,以及另一個應用程式透過 Agent SDK 託管的工作階段中。如需 Claude Code 何時關閉提示,請參閱 [Fable 和用量點數](https://code.claude.com/docs/zh-TW/model-config.md#fable-and-usage-credits)。953這發生在 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 工作階段、[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md)、[agent team](https://code.claude.com/docs/zh-TW/agent-teams.md) 隊友工作階段,以及另一個應用程式透過 Agent SDK 託管的工作階段中。如需 Claude Code 何時關閉提示,請參閱 [Fable 和用量點數](https://code.claude.com/docs/zh-TW/model-config.md#fable-and-usage-credits)。
944 954
945**該怎麼做:**955**該怎麼做:**
946 956
947* 在工作階段執行所在的終端機或託管它的應用程式中,發送另一個提示詞,當同意提示重新出現時回答它。對於背景工作階段,請先從 [agents 檢視](https://code.claude.com/docs/zh-TW/agent-view.md)附加到它。從 Remote Control 用戶端重新發送會再次顯示此訊息,因為用戶端無法顯示提示。957* 在工作階段執行所在的終端機或託管它的應用程式中,發送另一個提示詞,當同意提示重新出現時回答它。對於背景工作階段,請先從 [agents 檢視](https://code.claude.com/docs/zh-TW/agent-view.md)附加到它。如果訊息顯示 `Claude stopped here`,您也可以從已連接的裝置回覆,並在那裡回答同意提示。
948* 執行 `/model` 以切換到不計費用量點數的模型958* 執行 `/model` 以切換到不計費用量點數的模型
949* 若要給自己更多時間,請將 [`dialogExpiry`](https://code.claude.com/docs/zh-TW/settings-reference#dialogexpiry) 設定為更長的值或 `"never"`959* 若要給自己更多時間,請將 [`dialogExpiry`](https://code.claude.com/docs/zh-TW/settings-reference#dialogexpiry) 設定為更長的值或 `"never"`
950 960
1921**處理方式:**1931**處理方式:**
1922 1932
1923* 如果提示表示憑證由此環境管理,則啟動 Claude Code 的應用程式擁有該憑證,此處的其他步驟並不適用:請重試,或聯絡您的管理員1933* 如果提示表示憑證由此環境管理,則啟動 Claude Code 的應用程式擁有該憑證,此處的其他步驟並不適用:請重試,或聯絡您的管理員
1934* 若您設定了 `CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD`,請改為依照 [Claude Models on Google Cloud (Anthropic managed)](https://code.claude.com/docs/zh-TW/claude-models-on-google-cloud-anthropic-managed.md#google-cloud-credentials-expired-or-invalid) 的步驟進行
1924* 如果您以應用程式預設憑證進行身分驗證,請執行訊息所指的 [`gcpAuthRefresh`](https://code.claude.com/docs/zh-TW/google-vertex-ai#advanced-credential-configuration) 命令,或 `gcloud auth application-default login`,完成登入後重試1935* 如果您以應用程式預設憑證進行身分驗證,請執行訊息所指的 [`gcpAuthRefresh`](https://code.claude.com/docs/zh-TW/google-vertex-ai#advanced-credential-configuration) 命令,或 `gcloud auth application-default login`,完成登入後重試
1925* 如果您在設定了 `CLAUDE_CODE_SKIP_VERTEX_AUTH` 的情況下透過 [LLM 閘道](https://code.claude.com/docs/zh-TW/llm-gateway)進行路由,請重新整理 `ANTHROPIC_AUTH_TOKEN` 或 `ANTHROPIC_CUSTOM_HEADERS` 中的閘道 token,然後重試1936* 如果您在設定了 `CLAUDE_CODE_SKIP_VERTEX_AUTH` 的情況下透過 [LLM 閘道](https://code.claude.com/docs/zh-TW/llm-gateway)進行路由,請重新整理 `ANTHROPIC_AUTH_TOKEN` 或 `ANTHROPIC_CUSTOM_HEADERS` 中的閘道 token,然後重試
1926* 如果您以服務帳戶金鑰檔案進行身分驗證,請確認 `GOOGLE_APPLICATION_CREDENTIALS` 指向有效的金鑰。請參閱[設定 GCP 憑證](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#3-configure-gcp-credentials)1937* 如果您以服務帳戶金鑰檔案進行身分驗證,請確認 `GOOGLE_APPLICATION_CREDENTIALS` 指向有效的金鑰。請參閱[設定 GCP 憑證](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#3-configure-gcp-credentials)
1941**處理方式:**1952**處理方式:**
1942 1953
1943* 如果提示指出憑證由此環境管理,表示啟動 Claude Code 的應用程式擁有該憑證,此處的其他步驟不適用:請重試,或聯絡您的管理員1954* 如果提示指出憑證由此環境管理,表示啟動 Claude Code 的應用程式擁有該憑證,此處的其他步驟不適用:請重試,或聯絡您的管理員
1955* 若您設定了 `CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD`,請改為依照 [Claude Models on Google Cloud (Anthropic managed)](https://code.claude.com/docs/zh-TW/claude-models-on-google-cloud-anthropic-managed.md#google-cloud-authentication-failed) 的步驟進行
1944* 確認 [IAM 設定](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#iam-configuration)中的角色已授予您用來進行身分驗證的身分1956* 確認 [IAM 設定](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#iam-configuration)中的角色已授予您用來進行身分驗證的身分
1945* 確認模型已在您的專案中啟用。請參閱[請求模型存取權](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#2-request-model-access)1957* 確認模型已在您的專案中啟用。請參閱[請求模型存取權](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#2-request-model-access)
1946 1958
2500* 使用 `/mcp disable <name>` 禁用您未使用的 MCP 伺服器,以從上下文中移除其工具定義2512* 使用 `/mcp disable <name>` 禁用您未使用的 MCP 伺服器,以從上下文中移除其工具定義
2501* 修剪大型 `CLAUDE.md` 記憶檔案,或將指示移至[路徑範圍規則](https://code.claude.com/docs/zh-TW/memory.md#path-specific-rules),這些規則僅在相關時載入2513* 修剪大型 `CLAUDE.md` 記憶檔案,或將指示移至[路徑範圍規則](https://code.claude.com/docs/zh-TW/memory.md#path-specific-rules),這些規則僅在相關時載入
2502* 自動壓縮預設為開啟,通常可防止此錯誤。如果您在 `/config` 中或使用 [`DISABLE_AUTO_COMPACT`](https://code.claude.com/docs/zh-TW/env-vars) 關閉了它,請將其重新開啟。如果您保持關閉,請在視窗填滿之前自己執行 `/compact`。2514* 自動壓縮預設為開啟,通常可防止此錯誤。如果您在 `/config` 中或使用 [`DISABLE_AUTO_COMPACT`](https://code.claude.com/docs/zh-TW/env-vars) 關閉了它,請將其重新開啟。如果您保持關閉,請在視窗填滿之前自己執行 `/compact`。
2503* 如果在可接受更多 token 的模型上,錯誤出現在接近 200K token 時,原因之一是 Claude Code 無法辨識該模型 ID。Claude Code 會為這類 ID 假設 200K 的視窗,因此若要在超過該點後繼續工作,請[提供模型實際的上下文視窗](https://code.claude.com/docs/zh-TW/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id)。2515* 如果 Claude Code 警告無法辨識您的模型 ID,該警告可能會指出它所假設的視窗大小。當模型的實際視窗不同時,請[提供 Claude Code 實際的視窗大小](https://code.claude.com/docs/zh-TW/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id)。
2504 * 如果您使用自訂的 [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/zh-TW/env-vars),且錯誤以 `Prompt is too long · automatic compaction failed` 開頭,請[設定模型的上下文視窗](https://code.claude.com/docs/zh-TW/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id)或[更新](https://code.claude.com/docs/zh-TW/setup.md#update-claude-code)至 v2.1.299 或更新版本。在 v2.1.299 之前,Claude Code 會在接近假設的 200K 視窗時以該訊息結束回合,而不是傳送請求。2516 * 如果您使用自訂的 [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/zh-TW/env-vars),且錯誤以 `Prompt is too long · automatic compaction failed` 開頭,請[設定模型的上下文視窗](https://code.claude.com/docs/zh-TW/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id),或[更新](https://code.claude.com/docs/zh-TW/setup.md#update-claude-code)至 v2.1.299 或更新版本。在 v2.1.299 之前,Claude Code 會在接近所假設的 200K 視窗時以該訊息結束回合,而不送出請求。
2505* 如果錯誤是在您於 Claude 壓縮對話期間停止它之後立即出現,您的對話並未變更,且仍大到需要壓縮。請執行 `/compact` 並再次送出您的訊息。若要避免此錯誤再次發生,請將 Claude Code [更新](https://code.claude.com/docs/zh-TW/setup.md#update-claude-code)至 v2.1.304 或更新版本。在 v2.1.304 之前,在那個時間點停止可能會使該回合以此錯誤結束。2517* 如果錯誤是在您於 Claude 壓縮對話期間停止它之後立即出現,您的對話並未變更,且仍大到需要壓縮。請執行 `/compact` 並再次送出您的訊息。若要避免此錯誤再次發生,請將 Claude Code [更新](https://code.claude.com/docs/zh-TW/setup.md#update-claude-code)至 v2.1.304 或更新版本。在 v2.1.304 之前,在那個時間點停止可能會使該回合以此錯誤結束。
2506* 在 v2.1.305 上,若有許多 MCP 工具且直接連線至 Anthropic API,此錯誤可能會掩蓋來自 API 的無關 400 或 422 錯誤。請將 [Claude Code 更新](https://code.claude.com/docs/zh-TW/setup.md#update-claude-code)至 v2.1.306 或更新版本,以查看原始錯誤。2518* 在 v2.1.305 上,若有許多 MCP 工具且直接連線至 Anthropic API,此錯誤可能會掩蓋來自 API 的無關 400 或 422 錯誤。請將 [Claude Code 更新](https://code.claude.com/docs/zh-TW/setup.md#update-claude-code)至 v2.1.306 或更新版本,以查看原始錯誤。
2507 2519
3192 3204
3193## 命令列錯誤3205## 命令列錯誤
3194 3206
3195這些錯誤來自 `claude` 命令列及其子命令、您在輸入提示處提交的命令名稱,以及像 `/security-review` 這類會在其提示詞執行前先執行 shell 命令以收集脈絡的命令。它們也可能來自會重新啟動 CLI 的 `/tui`。3207這些錯誤來自 `claude` 命令列及其子命令、您在提示詞輸入處送出的命令名稱,以及像 `/security-review` 這類在其提示詞執行前先執行 shell 命令來收集脈絡的命令。它們也來自會重新啟動 CLI 的 `/tui`。
3196 3208
3197### `--bg` 與 `--print` 衝突3209### `--bg` 與 `--print` 之間的衝突
3198 3210
3199此訊息需要 Claude Code v2.1.198 或更新版本。您在同一次 `claude` 呼叫中將 `--bg` 與 `-p` 或 `--print` 合併使用。`--bg` 會啟動一個[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#from-your-shell),您之後可以使用 `claude agents` 附加到該工作階段;而 `--print` 則以[非互動方式](https://code.claude.com/docs/zh-TW/headless.md)執行,永遠不會啟動 `claude agents` 所附加的互動式工作階段。在 v2.1.198 之前,此組合會默默建立一個永遠無法附加的背景工作。3211此訊息需要 Claude Code v2.1.198 或更新版本。您在同一次 `claude` 呼叫中將 `--bg` 與 `-p` 或 `--print` 併用。`--bg` 會啟動一個[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#from-your-shell),您稍後可用 `claude agents` 附加到該工作階段;而 `--print` 以[非互動方式](https://code.claude.com/docs/zh-TW/headless.md)執行,永遠不會啟動 `claude agents` 所附加的互動式工作階段。在 v2.1.198 之前,這種組合會默默建立一個永遠無法附加的背景工作。
3200 3212
3201```text theme={null}3213```text theme={null}
3202--bg and --print conflict: --print never starts the interactive session that `claude agents` attaches to, so the job would be unattachable. The prompt is the positional — drop --print: `claude --bg '<task>'`.3214--bg and --print conflict: --print never starts the interactive session that `claude agents` attaches to, so the job would be unattachable. The prompt is the positional — drop --print: `claude --bg '<task>'`.
3204 3216
3205**處理方式:**3217**處理方式:**
3206 3218
3207* 移除 `-p` 或 `--print`。`--bg` 會將提示詞作為其位置引數,因此 `claude --bg "<task>"` 就是完整的命令。請參閱[從 shell 分派新的 agent](https://code.claude.com/docs/zh-TW/agent-view.md#from-your-shell)。3219* 移除 `-p` 或 `--print`。`--bg` 會將提示詞當作其位置引數,因此 `claude --bg "<task>"` 就是完整的命令。請參閱[從 shell 派發新的 agent](https://code.claude.com/docs/zh-TW/agent-view.md#from-your-shell)。
3208* 若要以非互動方式執行提示詞並列印結果,而不是建立背景工作階段,請移除 `--bg` 並執行 `claude -p "<task>"`3220* 若要以非互動方式執行提示詞並印出結果,而不是建立背景工作階段,請移除 `--bg` 並執行 `claude -p "<task>"`
3209 3221
3210### Couldn't tell whether `--bg` is a flag or text3222### Couldn't tell whether `--bg` is a flag or text
3211 3223
3212您執行 `claude` 時,將 `--bg` 或 `--background` 放在 Claude Code 無法判斷您是要將其作為背景旗標還是文字的位置。該命令沒有啟動任何東西,僅列印這一行,並以退出碼 1 結束:3224您執行 `claude` 時,`--bg` 或 `--background` 所在的位置讓 Claude Code 無法判斷您是想將其作為背景旗標還是文字。該命令沒有啟動任何東西,印出下列這行後以退出碼 1 結束:
3213 3225
3214```text theme={null}3226```text theme={null}
3215Couldn't tell whether --bg is a flag or text here, so nothing was started. To start a background session put it first: claude --bg <prompt>3227Couldn't tell whether --bg is a flag or text here, so nothing was started. To start a background session put it first: claude --bg <prompt>
3221 3233
3222* 若要啟動[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#from-your-shell),請在 shell 中將旗標放在最前面再次執行命令:`claude --bg --name nightly-audit "<task>"`3234* 若要啟動[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#from-your-shell),請在 shell 中將旗標放在最前面再次執行命令:`claude --bg --name nightly-audit "<task>"`
3223 3235
3224### 系統提示詞旗標與其檔案形式衝突3236### 系統提示詞旗標與其檔案形式之間的衝突
3225 3237
3226您在同一次 `claude` 呼叫中同時傳入了 [`--append-subagent-system-prompt`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 與 `--append-subagent-system-prompt-file`,因此 `claude` 會以退出碼 1 結束,而不會啟動工作階段:3238您在同一次 `claude` 呼叫中同時傳入了 [`--append-subagent-system-prompt`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 與 `--append-subagent-system-prompt-file`,因此 `claude` 會以退出碼 1 結束,而不會啟動工作階段:
3227 3239
3229Error: Cannot use both --append-subagent-system-prompt and --append-subagent-system-prompt-file. Please use only one.3241Error: Cannot use both --append-subagent-system-prompt and --append-subagent-system-prompt-file. Please use only one.
3230```3242```
3231 3243
3232在 v2.1.283 之前,當您將 `--system-prompt` 與 `--system-prompt-file` 一起傳入,或將 `--append-system-prompt` 與 `--append-system-prompt-file` 一起傳入時,`claude` 也會以相同方式結束,因為這些成對的旗標會相互衝突,而不是[合併使用](https://code.claude.com/docs/zh-TW/cli-reference.md#system-prompt-flags)。在這些版本中,訊息會指出您合併使用的那一對旗標。3244在 v2.1.283 之前,當您將 `--system-prompt` 與 `--system-prompt-file` 併用,或將 `--append-system-prompt` 與 `--append-system-prompt-file` 併用時,`claude` 也會以同樣方式結束,因為這些組合會相互衝突,而不是[合併使用](https://code.claude.com/docs/zh-TW/cli-reference.md#system-prompt-flags)。在這些版本中,訊息會列出您併用的那一組旗標。
3233 3245
3234**處理方式:**3246**處理方式:**
3235 3247
3236* 保留旗標的其中一種形式,並移除另一種。若要將固定的提示詞檔案與每次執行的文字結合,請在啟動前將文字合併到檔案中,而不是同時傳入兩個旗標3248* 保留旗標的其中一種形式並移除另一種。若要將固定的提示詞檔案與每次執行的文字結合,請在啟動前將文字合併到檔案中,而不要同時傳入兩個旗標
3237 3249
3238### 無效的 `--agents` 設定3250### 無效的 `--agents` 設定
3239 3251
3240您傳給 `--agents` 的值無效,因此 `claude` 會以退出碼 1 結束,而不會啟動工作階段。當您傳入 `--safe-mode` 或設定 [`CLAUDE_CODE_SAFE_MODE`](https://code.claude.com/docs/zh-TW/env-vars#variables) 時,Claude Code 會完全忽略 `--agents`。搭配 `--resume` 或 `--continue` 時,內嵌的 JSON 值不會被檢查,工作階段會照常啟動;從檔案讀取的值則會在每次啟動時檢查。在 v2.1.242 之前,Claude Code 仍會照樣啟動工作階段。3252您傳給 `--agents` 的值無效,因此 `claude` 會以退出碼 1 結束,而不會啟動工作階段。當您傳入 `--safe-mode` 或設定 [`CLAUDE_CODE_SAFE_MODE`](https://code.claude.com/docs/zh-TW/env-vars#variables) 時,Claude Code 會完全忽略 `--agents`。搭配 `--resume` 或 `--continue` 時,行內 JSON 值不會被檢查,工作階段會照常啟動;從檔案讀取的值則在每次啟動時都會被檢查。在 v2.1.242 之前,Claude Code 仍會照常啟動工作階段。
3241 3253
3242```text theme={null}3254```text theme={null}
3243Error: Invalid --agents configuration:3255Error: Invalid --agents configuration:
3244<what failed>3256<what failed>
3245```3257```
3246 3258
3247第一行之後的內容取決於該值失敗的方式。Claude Code 會依序執行以下檢查,並在第一個失敗的檢查處停止。如果您的值有兩類問題,您要在修正第一類之後才會看到第二類:3259第一行之後的內容取決於該值失敗的方式。Claude Code 會依序執行下列檢查,並在第一個失敗的檢查處停止。如果您的值有兩種問題,您必須先修正第一個,才會看到第二個:
3248 3260
32491. 當值以 `{` 開頭但無法解析為 JSON,或 `--agents` 檔案的內容無法解析時,Claude Code 會列印一行 `invalid JSON:`,其中包含 JSON 剖析器本身的訊息32611. 當值以 `{` 開頭但無法解析為 JSON,或 `--agents` 檔案的內容無法解析時,Claude Code 會印出一行 `invalid JSON:`,內含 JSON 剖析器本身的訊息
32502. 當值可以解析,但某個 agent 定義不符合 [CLI 定義的 subagent](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope) 的 schema 時,Claude Code 會針對每個問題列印一行32622. 當值可以解析,但某個 agent 定義不符合 [CLI 定義之 subagent](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope) 的 schema 時,Claude Code 會針對每個問題印出一行
32513. 當 agent 名稱以 `-` 開頭時,Claude Code 會列印 `<name>: agent names must not start with '-'`32633. 當 agent 名稱以 `-` 開頭時,Claude Code 會印出 `<name>: agent names must not start with '-'`
3252 3264
3253當問題行超過 20 行時,Claude Code 會列印前 20 行,並將其餘部分替換為 `…and N more`。3265當問題行超過 20 行時,Claude Code 會印出前 20 行,並將其餘部分替換為 `…and N more`。
3254 3266
3255搭配 `--print` 時,`--agents` 也接受以[JSON 檔案的路徑](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope)取代內嵌物件。在 v2.1.281 之前,`--agents` 只接受內嵌 JSON,並將檔案路徑視為無效的 JSON。檔案形式有其自己的拒絕訊息,會取代此訊息列印出來,包括以下幾種:3267搭配 `--print` 時,`--agents` 也接受以 [JSON 檔案的路徑](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope)取代行內物件。在 v2.1.281 之前,`--agents` 只接受行內 JSON,並將檔案路徑視為無效的 JSON。檔案形式有其自己的拒絕訊息,會取代此訊息印出,包括下列這些:
3256 3268
3257* **`Error: --agents takes a JSON object, or a file path only with --print (-p)`**:Claude Code 在互動式工作階段中將該值讀取為檔案路徑。請以內嵌 JSON 傳入定義,或加上 `-p` 以從檔案讀取。3269* **`Error: --agents takes a JSON object, or a file path only with --print (-p)`**:Claude Code 在互動式工作階段中將該值讀取為檔案路徑。請以行內 JSON 傳入定義,或加上 `-p` 以從檔案讀取。
3258* **`Error: --agents file not found: <path>`**:該路徑上沒有檔案。不以 `{` 開頭且不是有效 JSON 的值會被讀取為路徑,因此被 shell 弄亂的內嵌 JSON 也可能以此方式失敗。請檢查路徑或引號,然後再次執行命令。3270* **`Error: --agents file not found: <path>`**:該路徑不存在任何檔案。不以 `{` 開頭且不是有效 JSON 的值會被當作路徑讀取,因此被您的 shell 弄亂的行內 JSON 也可能以這種方式失敗。請檢查路徑或引號後再次執行命令。
3259 3271
3260**處理方式:**3272**處理方式:**
3261 3273
3262* 修正訊息列出的每個問題,然後再次執行命令。請參閱 [CLI 定義的 subagent 所接受的欄位](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope)。3274* 修正訊息中列出的每個問題,然後再次執行命令。請參閱 [CLI 定義之 subagent 可使用的欄位](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope)。
3263 3275
3264### 無法從 `--restricted` 工作階段建立雲端工作階段3276### Cloud sessions cannot be created from a `--restricted` session
3265 3277
3266當您以 [`--restricted`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 啟動工作階段時,Claude Code 會拒絕從中建立[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#from-terminal-to-cloud),因為新的工作階段會在受限程序之外執行,而且不會強制執行受限模式。Claude Code 會在用戶端、聯絡伺服器之前就拒絕,因此不會建立任何雲端工作階段:3278當您以 [`--restricted`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 啟動工作階段時,Claude Code 會拒絕從中建立[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#from-terminal-to-cloud),因為新的工作階段會在受限程序之外執行,且不會強制執行受限模式。Claude Code 會在用戶端、聯繫伺服器之前就拒絕,因此不會建立任何雲端工作階段:
3267 3279
3268```text theme={null}3280```text theme={null}
3269Cloud sessions cannot be created from a --restricted session: they would not enforce it.3281Cloud sessions cannot be created from a --restricted session: they would not enforce it.
3271 3283
3272**處理方式:**3284**處理方式:**
3273 3285
3274* 在受限工作階段中於本機執行該任務3286* 在受限工作階段中於本機執行該工作
3275* 如果您能控制工作階段的啟動方式,請啟動一個不帶 `--restricted` 的新 `claude` 工作階段,並從那裡建立雲端工作階段3287* 如果您能控制工作階段的啟動方式,請在不使用 `--restricted` 的情況下啟動新的 `claude` 工作階段,並從那裡建立雲端工作階段
3276 3288
3277在 v2.1.248 之前,Claude Code 沒有 `--restricted` 旗標;較早的版本會以未知選項錯誤拒絕該旗標本身。3289在 v2.1.248 之前,Claude Code 沒有 `--restricted` 旗標;較早的版本會以未知選項錯誤拒絕該旗標本身。
3278 3290
3279### 雲端工作階段已被您組織的政策停用3291### Cloud sessions are disabled by your organization's policy
3280 3292
3281您組織的 `allow_remote_sessions` 政策已關閉,因此無法使用[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)以及使用它們的命令:3293您組織的 `allow_remote_sessions` 政策已關閉,因此無法使用[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)以及使用它們的命令:
3282 3294
3284Cloud sessions are disabled by your organization's policy. Contact your organization admin to enable them.3296Cloud sessions are disabled by your organization's policy. Contact your organization admin to enable them.
3285```3297```
3286 3298
3287此訊息會在您[從終端機建立雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#from-terminal-to-cloud)時出現,也會在您提交需要雲端工作階段的命令(例如 `/teleport`、`/remote-env` 或 `/web-setup`)時出現。在 v2.1.268 之前,提交這些命令之一會改為傳回 [`Unknown command`](#unknown-command)。3299當您[從終端機建立雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#from-terminal-to-cloud)時,以及當您送出需要雲端工作階段的命令(例如 `/teleport`、`/remote-env` 或 `/web-setup`)時,會出現此訊息。在 v2.1.268 之前,送出這些命令之一會改為傳回 [`Unknown command`](#unknown-command)。
3288 3300
3289如果訊息改為指出此工作階段正在使用的某個憑證,並以 `Cloud sessions use your claude.ai login.` 結尾,請參閱 [Cloud sessions use your claude.ai login](#cloud-sessions-use-your-claude-ai-login)。如果 Claude Code 完全無法載入您組織的政策,您會看到[另一則訊息](#couldnt-verify-your-organizations-policy-for-cloud-sessions)。3301如果訊息改為列出此工作階段正在使用的憑證,並以 `Cloud sessions use your claude.ai login.` 結尾,請參閱 [Cloud sessions use your claude.ai login](#cloud-sessions-use-your-claude-ai-login)。如果 Claude Code 完全無法載入您組織的政策,您會看到[另一則訊息](#couldnt-verify-your-organizations-policy-for-cloud-sessions)。
3290 3302
3291**處理方式:**3303**處理方式:**
3292 3304
3294 3306
3295### Cloud sessions use your claude.ai login3307### Cloud sessions use your claude.ai login
3296 3308
3297當[政策拒絕訊息](#cloud-sessions-are-disabled-by-your-organizations-policy)指出此工作階段正在使用的某個憑證並以這句話結尾時,表示 Claude Code 檢查的是核發該憑證之組織的雲端工作階段政策。該組織可能與您的 claude.ai 登入所屬的組織不同:3309當[政策拒絕訊息](#cloud-sessions-are-disabled-by-your-organizations-policy)列出此工作階段正在使用的憑證並以這句話結尾時,表示 Claude Code 檢查的是核發該憑證之組織的雲端工作階段政策。該組織可能與您的 claude.ai 登入所屬的組織不同:
3298 3310
3299```text theme={null}3311```text theme={null}
3300Cloud sessions are disabled by your organization's policy. This session is using ANTHROPIC_API_KEY, so Claude Code checked the policy for the organization that key belongs to. Cloud sessions use your claude.ai login.3312Cloud sessions are disabled by your organization's policy. This session is using ANTHROPIC_API_KEY, so Claude Code checked the policy for the organization that key belongs to. Cloud sessions use your claude.ai login.
3301```3313```
3302 3314
3303最後一句話表示雲端工作階段是在您的 claude.ai 登入上執行,而不是在該憑證上執行。當您從 shell 啟動、恢復雲端工作階段或傳送訊息給雲端工作階段時(例如使用 `--cloud` 或 `--teleport`),就會出現此形式。在 v2.1.296 之前,Claude Code 在這種情況下也會輸出要求您聯絡組織管理員的形式。3315最後一句話的意思是,雲端工作階段是以您的 claude.ai 登入執行,而不是以該憑證執行。當您從 shell 啟動、恢復雲端工作階段或向其傳送訊息(例如使用 `--cloud` 或 `--teleport`)時,會出現這種形式。在 v2.1.296 之前,Claude Code 在這種情況下也會印出要您聯絡組織管理員的形式。
3304 3316
3305### Couldn't verify your organization's policy for cloud sessions3317### Couldn't verify your organization's policy for cloud sessions
3306 3318
3307這些訊息表示 Claude Code 無法載入您組織的政策,而它會在建立、恢復[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)或傳送訊息給雲端工作階段之前檢查該政策。當政策請求尚未完成時,訊息為:3319這些訊息表示 Claude Code 無法載入您組織的政策;在建立、恢復[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)或向其傳送訊息之前,Claude Code 會先檢查此政策。當政策請求尚未完成時,訊息為:
3308 3320
3309```text theme={null}3321```text theme={null}
3310Couldn't verify your organization's policy for cloud sessions. Check your network connection and try again.3322Couldn't verify your organization's policy for cloud sessions. Check your network connection and try again.
3311```3323```
3312 3324
3313在工作階段中,需要雲端工作階段的命令(例如 `/teleport` 或 `/web-setup`)也會顯示此訊息。即使在您的 shell 會輸出 `Cloud sessions aren't available:` 形式的情況下也是如此,且其第二句為 `Check your network connection, then restart Claude Code and try again.`3325在工作階段內,需要雲端工作階段的命令(例如 `/teleport` 或 `/web-setup`)也會顯示此訊息。即使在您的 shell 會印出 `Cloud sessions aren't available:` 形式的情況下也是如此,且其第二句為 `Check your network connection, then restart Claude Code and try again.`
3314 3326
3315一旦政策請求失敗,訊息就會說明失敗的原因。這適用於您使用 `--cloud` 或 `--teleport` 等旗標從 shell 啟動、恢復雲端工作階段或傳送訊息給雲端工作階段的情況。在無法連到 API 時,訊息為:3327一旦政策請求失敗,訊息會說明失敗的原因。這適用於您使用 `--cloud` 或 `--teleport` 等旗標從 shell 啟動、恢復雲端工作階段或向其傳送訊息的情況。沒有通往 API 的路徑時,訊息如下:
3316 3328
3317```text theme={null}3329```text theme={null}
3318Cloud sessions aren't available: couldn't reach api.anthropic.com to load your organization's policy. Check your network or proxy.3330Cloud sessions aren't available: couldn't reach api.anthropic.com to load your organization's policy. Check your network or proxy.
3319```3331```
3320 3332
3321其他失敗會使用相同的開頭並附上各自的原因,例如代理伺服器以 HTTP 403 拒絕請求、伺服器錯誤,或 API 不接受的憑證。當 API 不接受此工作階段用來取代您 claude.ai 登入的憑證(例如 `ANTHROPIC_API_KEY` 環境變數)時,訊息也可能指出該憑證並要求您取消設定它:3333其他失敗情況使用相同的開頭,並附上各自的原因,例如代理伺服器以 HTTP 403 拒絕請求、伺服器錯誤,或 API 不接受的憑證。當 API 不接受此工作階段用來取代您 claude.ai 登入的憑證(例如 `ANTHROPIC_API_KEY` 環境變數)時,訊息也可能列出該憑證並要您取消設定它:
3322 3334
3323```text theme={null}3335```text theme={null}
3324Cloud sessions aren't available: api.anthropic.com didn't accept this session's credentials when Claude Code asked for your organization's policy. Cloud sessions use your claude.ai login. ANTHROPIC_API_KEY is set, so this session is using API-key auth — unset it (or run in a shell without it) to use cloud sessions.3336Cloud sessions aren't available: api.anthropic.com didn't accept this session's credentials when Claude Code asked for your organization's policy. Cloud sessions use your claude.ai login. ANTHROPIC_API_KEY is set, so this session is using API-key auth — unset it (or run in a shell without it) to use cloud sessions.
3325```3337```
3326 3338
3327在 v2.1.296 之前,這些失敗也會輸出 `Couldn't verify` 訊息。3339在 v2.1.296 之前,這些失敗也會印出 `Couldn't verify` 訊息。
3328 3340
3329**處理方式:**3341**處理方式:**
3330 3342
3331* 對於 `Couldn't verify` 訊息,請檢查網路連線後再試一次。若在工作階段中,請先重新啟動 Claude Code3343* 對於 `Couldn't verify` 訊息,請檢查您的網路連線後再試一次。若在工作階段內,請先重新啟動 Claude Code
3332* 對於 `Cloud sessions aren't available:` 訊息,請依其原因採取對應措施,例如檢查代理伺服器或取消設定訊息指出的憑證,然後再次執行命令3344* 對於 `Cloud sessions aren't available:` 訊息,請依其原因採取對應動作,例如檢查代理伺服器或取消設定其列出的憑證,然後再次執行命令
3333 3345
3334### 由於資料夾取代了受追蹤的檔案,未暫存任何內容3346### 因資料夾取代了受追蹤的檔案而未儲藏任何內容
3335 3347
3336此訊息表示您的檢出目錄中,現在有一個資料夾位於原本由 git 追蹤的檔案或連結所在的位置。當您將[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#from-cloud-to-terminal)拉取到終端機(例如使用 `claude --teleport` 或 `/teleport`)並選擇暫存(stash)選項之後,就會出現此訊息。暫存這種狀態可能會刪除資料夾內的檔案,因此 Claude Code 會拒絕暫存,並讓您的檢出目錄與索引保持不變:3348此訊息表示您的 checkout 中有一個資料夾現在位於原本是受 git 追蹤之檔案或連結的位置。當您將[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#from-cloud-to-terminal)拉到終端機(例如使用 `claude --teleport` 或 `/teleport`)時選擇了 stash 選項後,就會出現此訊息。對這種狀態執行 stash 可能會刪除資料夾內的檔案,因此 Claude Code 拒絕執行 stash,並保持您的 checkout 與索引不變:
3337 3349
3338```text wrap theme={null}3350```text wrap theme={null}
3339Error: Nothing was stashed: "f" is now a folder in place of a tracked file or link, and stashing could delete what's in it for good. Commit the change or move the folder somewhere else, then try again.3351Error: Nothing was stashed: "f" is now a folder in place of a tracked file or link, and stashing could delete what's in it for good. Commit the change or move the folder somewhere else, then try again.
3341 3353
3342**處理方式:**3354**處理方式:**
3343 3355
3344* 依照訊息所述,提交變更或將資料夾移到其他位置,然後再次執行 teleport3356* 依訊息所述,提交該變更或將資料夾移到其他地方,然後再次執行 teleport
3345 3357
3346### `--json-schema` 的值不是有效的 JSON Schema3358### `--json-schema` 的值不是有效的 JSON Schema
3347 3359
3348您在[非互動模式](https://code.claude.com/docs/zh-TW/headless.md#get-structured-output)中傳給 [`--json-schema`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 的 schema 未能通過 JSON Schema 編譯,因此 `claude` 會以退出碼 1 結束,而不會執行提示詞。在 v2.1.205 之前,無效的 schema 會產生非結構化輸出且不報錯,而且任何使用 `format` 關鍵字的 schema 都會被視為無效。3360您在[非互動模式](https://code.claude.com/docs/zh-TW/headless.md#get-structured-output)中傳給 [`--json-schema`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 的 schema 未能通過 JSON Schema 編譯,因此 `claude` 會以退出碼 1 結束,而不會執行提示詞。在 v2.1.205 之前,無效的 schema 會產生非結構化輸出且不會出現錯誤,而任何使用 `format` 關鍵字的 schema 都會被視為無效。
3349 3361
3350```text theme={null}3362```text theme={null}
3351Error: --json-schema is not a valid JSON Schema: data/type must be equal to one of the allowed values3363Error: --json-schema is not a valid JSON Schema: data/type must be equal to one of the allowed values
3352```3364```
3353 3365
3354第二個冒號之後的文字是驗證器的診斷訊息,會指出失敗的關鍵字或位置。使用 `format` 關鍵字的 schema(例如 `"format": "email"`)是有效的:Claude Code 將 `format` 視為註解接受,而不會強制執行它。3366第二個冒號之後的文字是驗證器的診斷訊息,會列出失敗的關鍵字或位置。使用 `format` 關鍵字的 schema(例如 `"format": "email"`)是有效的:Claude Code 將 `format` 視為註記接受,但不會強制執行。
3355 3367
3356Claude Code 在 schema 編譯之前會執行兩項檢查:對於無法解析的 JSON 值,會以 `Error: --json-schema is not valid JSON` 拒絕;對於有效但不是物件的 JSON,會以 `Error: --json-schema must be a JSON object` 拒絕。3368Claude Code 會在 schema 編譯之前執行兩項檢查:對於無法解析為 JSON 的值,會以 `Error: --json-schema is not valid JSON` 拒絕;對於不是物件的有效 JSON,會以 `Error: --json-schema must be a JSON object` 拒絕。
3357 3369
3358**處理方式:**3370**處理方式:**
3359 3371
3360* 修正診斷訊息指出的 schema 部分,然後重新執行命令3372* 修正診斷訊息所指出的 schema 部分,然後重新執行命令
3361* 請參閱[取得結構化輸出](https://code.claude.com/docs/zh-TW/headless.md#get-structured-output),了解可運作的 schema 與命令3373* 請參閱[取得結構化輸出](https://code.claude.com/docs/zh-TW/headless.md#get-structured-output)以取得可運作的 schema 與命令
3362 3374
3363### 設定檔超過 2MiB 上限3375### Settings file exceeds the 2MiB limit
3364 3376
3365您傳給 [`--settings`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 的檔案大於 2 MiB,因此 `claude` 會在啟動時以退出碼 1 結束,而不會載入它。在 v2.1.214 之前,Claude Code 讀取該檔案時不做大小檢查,數 GB 的檔案或像 `/dev/zero` 這樣的裝置檔案會使記憶體無限制地增長。3377您傳給 [`--settings`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 的檔案大於 2 MiB,因此 `claude` 會在啟動時以退出碼 1 結束,而不會載入它。在 v2.1.214 之前,Claude Code 讀取該檔案時不會檢查大小,多達數 GB 的檔案或 `/dev/zero` 之類的裝置檔案會使記憶體用量無限制地增長。
3366 3378
3367```text theme={null}3379```text theme={null}
3368Error: Settings file exceeds the 2MiB limit: /path/to/settings.json3380Error: Settings file exceeds the 2MiB limit: /path/to/settings.json
3369```3381```
3370 3382
3371Claude Code 也會以相同方式拒絕不是一般檔案的 `--settings` 路徑:裝置、FIFO 或 socket 會回報 `Error: Cannot use settings file (Not a regular file (device, FIFO, or socket))`,後面接著路徑;而目錄則會回報 `EISDIR` 原因。3383對於不是一般檔案的 `--settings` 路徑,Claude Code 也會以同樣方式拒絕:裝置、FIFO 或 socket 會回報 `Error: Cannot use settings file (Not a regular file (device, FIFO, or socket))` 並接著列出路徑,而目錄則會回報 `EISDIR` 原因。
3372 3384
3373**處理方式:**3385**處理方式:**
3374 3386
3376 3388
3377### Configuration error in \~/.claude.json3389### Configuration error in \~/.claude.json
3378 3390
3379Claude Code 無法解析 `~/.claude.json`,也就是保存您的帳戶資訊、MCP 伺服器與各專案狀態的檔案。[非互動式](https://code.claude.com/docs/zh-TW/headless.md)啟動(例如 `claude -p`)會以退出碼 1 結束。3391Claude Code 無法解析 `~/.claude.json`,這個檔案存放您的帳戶詳細資料、MCP 伺服器以及各專案的狀態。像 `claude -p` 這類[非互動](https://code.claude.com/docs/zh-TW/headless.md)啟動會以退出碼 1 結束。
3380 3392
3381當 Claude Code 找到[備份](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically)時,輸出會指名該備份,並輸出一行將其複製回來的 `cp` 命令:3393當 Claude Code 找到[備份](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically)時,輸出會列出該備份,並印出一行將其複製回去的 `cp` 命令:
3382 3394
3383```text wrap theme={null}3395```text wrap theme={null}
3384Claude configuration file at /home/user/.claude.json is corrupted: <JSON parser's message>3396Claude configuration file at /home/user/.claude.json is corrupted: <JSON parser's message>
3391 3403
3392**處理方式:**3404**處理方式:**
3393 3405
3394* **輸出中有 `cp` 行**:在終端機中執行該行。在 Windows 上,請在 PowerShell 中執行。3406* **輸出中有 `cp` 這一行**:在終端機中執行該行。在 Windows 上,請在 PowerShell 中執行。
3395* **輸出中沒有 `cp` 行,或執行後錯誤再次出現**:若 `~/.claude.json` 仍保有您的設定,請修正其 JSON。若無法修正,若 [`~/.claude/backups/`](https://code.claude.com/docs/zh-TW/claude-directory#cleaned-up-automatically) 中有其他 `.claude.json.backup.<timestamp>` 檔案,請將其複製過去覆寫該檔案,或將該檔案重新命名。若 `~/.claude.json` 不存在,Claude Code 會以預設設定啟動,且不會保有該檔案原本的任何內容。3407* **輸出中沒有 `cp` 這一行,或執行後錯誤再次出現**:如果 `~/.claude.json` 仍保有您的設定,請修正其 JSON。如果無法修正,若 [`~/.claude/backups/`](https://code.claude.com/docs/zh-TW/claude-directory#cleaned-up-automatically) 中有其他 `.claude.json.backup.<timestamp>` 檔案,請將其複製覆蓋過去,否則請將其重新命名。當 `~/.claude.json` 不存在時,Claude Code 會以預設設定啟動,且不包含該檔案原本存放的任何內容。
3396* **`~/.claude.json` 已不再保有您的設定**:在 [`~/.claude/backups/`](https://code.claude.com/docs/zh-TW/claude-directory#cleaned-up-automatically) 或您的家目錄中找出仍保有設定的 `.claude.json.corrupted.<timestamp>` 檔案。修正其 JSON,然後將其複製過去覆寫 `~/.claude.json`。若找不到或無法修正,請以保有您設定的 `.claude.json.backup.<timestamp>` 檔案嘗試相同步驟。若都沒有,請將 `~/.claude.json` 重新命名,並以 [`claude mcp add`](https://code.claude.com/docs/zh-TW/mcp#installing-mcp-servers) 重新加入您的 MCP 伺服器。3408* **`~/.claude.json` 已不再保有您的設定**:在 [`~/.claude/backups/`](https://code.claude.com/docs/zh-TW/claude-directory#cleaned-up-automatically) 或您的家目錄中,找出仍保有設定的 `.claude.json.corrupted.<timestamp>` 檔案。修正其 JSON,然後將其複製覆蓋 `~/.claude.json`。如果找不到或無法修正,請以保有您設定的 `.claude.json.backup.<timestamp>` 檔案嘗試相同步驟。如果沒有任何檔案保有您的設定,請將 `~/.claude.json` 重新命名,並使用 [`claude mcp add`](https://code.claude.com/docs/zh-TW/mcp#installing-mcp-servers) 重新新增您的 MCP 伺服器。
3397 3409
3398### Claude configuration file was empty and no backup holds anything3410### Claude configuration file was empty and no backup holds anything
3399 3411
3400啟動時出現此訊息,表示其所指名的檔案是空白的,且該檔案的所有 [`.backup` 副本](https://code.claude.com/docs/zh-TW/claude-directory#cleaned-up-automatically)都沒有任何內容。Claude Code 已針對該檔案保存的內容使用預設值啟動。您的 `settings.json` 檔案與 `.mcp.json` 是獨立的檔案。3412啟動時出現此訊息,表示它所列出的檔案是空白的,且該檔案的 [`.backup` 副本](https://code.claude.com/docs/zh-TW/claude-directory#cleaned-up-automatically)中沒有任何內容。Claude Code 對該檔案存放的內容以預設值啟動。您的 `settings.json` 檔案與 `.mcp.json` 是獨立的檔案。
3401 3413
3402```text wrap theme={null}3414```text wrap theme={null}
3403Claude configuration file at /home/user/.claude.json was empty and no backup holds anything: starting with defaults.3415Claude configuration file at /home/user/.claude.json was empty and no backup holds anything: starting with defaults.
3405 3417
3406**處理方式:**3418**處理方式:**
3407 3419
3408* 重新設定您原本在該檔案中設定的內容。例如,從終端機使用 `claude mcp add` 新增您 `user` 與 `local` 範圍的 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md#mcp-installation-scopes)。3420* 重新設定您原本在該檔案中設定的內容。例如,在終端機中使用 `claude mcp add` 新增您 `user` 與 `local` 範圍的 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md#mcp-installation-scopes)。
3409* 如果 Claude Code 要求您重新登入,請重新登入3421* 如果 Claude Code 要求,請重新登入
3410 3422
3411在 v2.1.318 之前,Claude Code 會將沒有備份的空白檔案回報為[已損壞](#configuration-error-in-claude-json)。3423在 v2.1.318 之前,Claude Code 會將沒有備份的空白檔案回報為[已損毀](#configuration-error-in-claude-json)。
3412 3424
3413### 目前的目錄已不存在3425### The current directory no longer exists
3414 3426
3415您從一個在 shell 進入後被刪除或移動的目錄啟動了 `claude`,例如被另一個 shell 移除的 worktree 或暫存目錄。Claude Code 無法讀取其工作目錄,因此在啟動工作階段之前就會以退出碼 1 結束,互動模式與[非互動](https://code.claude.com/docs/zh-TW/headless.md)模式皆然。在 v2.1.239 之前,Claude Code 會當機,並在 stderr 上輸出壓縮過的 bundle 原始碼與原始的 `ENOENT ... uv_cwd` 堆疊,而不是此訊息。3427您從一個在 shell 進入後已被刪除或移動的目錄啟動 `claude`,例如被另一個 shell 移除的 worktree 或暫存目錄。Claude Code 無法讀取其工作目錄,因此無論是互動模式或[非互動](https://code.claude.com/docs/zh-TW/headless.md)模式,都會在啟動工作階段前以退出碼 1 結束。在 v2.1.239 之前,Claude Code 會當機,並在 stderr 上印出經過壓縮的 bundle 原始碼與原始的 `ENOENT ... uv_cwd` 堆疊,而不是此訊息。
3416 3428
3417```text theme={null}3429```text theme={null}
3418The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory.3430The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory.
3421 3433
3422兩種形式的原因與修正方式相同。3434兩種形式的原因與修正方式相同。
3423 3435
3424當 Claude Code 因其他原因(例如權限變更)無法讀取工作目錄時,訊息會改為指出錯誤代碼:`Can't read the current directory (EACCES). Start Claude Code from a different directory.`3436當 Claude Code 因其他原因(例如權限變更)無法讀取工作目錄時,訊息會改為列出錯誤代碼:`Can't read the current directory (EACCES). Start Claude Code from a different directory.`
3425 3437
3426在 macOS 上,若 `~/Desktop`、`~/Documents`、`~/Downloads` 或 iCloud Drive 中的目錄出現 `EPERM`,通常表示 macOS 正在阻擋您的終端機應用程式存取該資料夾。讀取該資料夾的其他命令也會以相同方式失敗:在那裡執行 `ls` 會回報 `Operation not permitted`,即使使用 `sudo` 也一樣。3438在 macOS 上,對於位於 `~/Desktop`、`~/Documents`、`~/Downloads` 或 iCloud Drive 中的目錄出現 `EPERM`,通常表示 macOS 正在封鎖您的終端機應用程式存取該資料夾。讀取該資料夾的其他命令也會以同樣方式失敗:在該處執行 `ls` 會回報 `Operation not permitted`,即使使用 `sudo` 也一樣。
3427 3439
3428**處理方式:**3440**處理方式:**
3429 3441
3430* 切換到存在的目錄,例如您的家目錄或專案目錄,然後再次執行 `claude`3442* 切換到存在的目錄,例如您的家目錄或專案目錄,然後再次執行 `claude`
3431* 如果該目錄已在相同路徑重新建立,您的 shell 仍持有已刪除的那一個。請執行 `cd "$PWD"`,或離開後重新進入該目錄,然後再次執行 `claude`3443* 如果該目錄已在相同路徑重新建立,您的 shell 仍持有已刪除的那個目錄。請執行 `cd "$PWD"` 或離開後重新進入該目錄,然後再次執行 `claude`
3432* 對於 macOS 上的 `EPERM`,請以 Cmd+Q 結束您的終端機應用程式,再次開啟它,回到該資料夾,然後執行 `claude`。如果在該資料夾中執行 `ls` 仍然失敗,請開啟 **系統設定 > 隱私權與安全性 > 檔案與檔案夾**,為您的終端機應用程式開啟該資料夾,然後重新開啟終端機3444* 對於 macOS 上的 `EPERM`,請以 Cmd+Q 結束您的終端機應用程式,再重新開啟,回到該資料夾並執行 `claude`。如果在該資料夾中 `ls` 仍然失敗,請開啟 **System Settings > Privacy & Security > Files and Folders**,為您的終端機應用程式開啟該資料夾的存取權,然後重新開啟終端機
3433 3445
3434### 暫存目錄被拒絕使用或無法建立3446### 暫存目錄遭拒絕或無法建立
3435 3447
3436在 macOS 與 Linux 上,Claude Code 會在啟動時建立一個私人暫存目錄 `claude-<uid>`,位於系統暫存目錄或 [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/zh-TW/env-vars) 覆寫值之下。當該目錄無法建立,或該路徑上已存在的項目未通過安全檢查時,Claude Code 會將失敗原因列印到 stderr,並以退出碼 1 結束,而不會啟動工作階段:3448在 macOS 與 Linux 上,Claude Code 會在啟動時建立一個私人暫存目錄 `claude-<uid>`,位於系統暫存目錄或 [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/zh-TW/env-vars) 覆寫所指定的位置下。當該目錄無法建立,或該路徑上既有的項目未通過安全檢查時,Claude Code 會將失敗原因印到 stderr,並以退出碼 1 結束,而不會啟動工作階段:
3437 3449
3438```text wrap theme={null}3450```text wrap theme={null}
3439Claude Code's temporary directory /tmp/claude-501 could not be created: the volume holding /tmp is full (ENOSPC). Free space on that volume, or set CLAUDE_CODE_TMPDIR to a directory on another one, then try again.3451Claude Code's temporary directory /tmp/claude-501 could not be created: the volume holding /tmp is full (ENOSPC). Free space on that volume, or set CLAUDE_CODE_TMPDIR to a directory on another one, then try again.
3447 3459
3448**處理方式:**3460**處理方式:**
3449 3461
3450* 對於 `could not be created` 後接 `is full (ENOSPC)` 的情況,請釋放訊息所指出磁碟區上的磁碟空間。當訊息改為 `your disk quota on the volume holding /tmp is used up (EDQUOT)` 時,請刪除您在該磁碟區上不再需要的自有檔案3462* 對於 `could not be created` 後接 `is full (ENOSPC)` 的情況,請釋放訊息所列磁碟區上的磁碟空間。如果訊息改為 `your disk quota on the volume holding /tmp is used up (EDQUOT)`,請刪除您在該磁碟區上不再需要的檔案
3451* 對於 `Refusing to use it` 形式,請移除所指名的項目本身(而不是連結所指向的目標),然後再次啟動 Claude Code;對於 `owned by uid` 形式,只有管理員或該使用者能夠移除它3463* 對於 `Refusing to use it` 的各種形式,請移除所列出的項目本身,而不是連結所指向的目標,然後再次啟動 Claude Code;對於 `owned by uid` 形式,只有管理員或該使用者可以移除它
3452* 對於 `is not readable`,請對所指名的目錄執行 `chmod 0700`,或移除它後再次啟動3464* 對於 `is not readable`,請對所列出的目錄執行 `chmod 0700`,或將其移除後重新啟動
3453* 在上述任何情況下,您都可以將 [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/zh-TW/env-vars) 設為您能控制的目錄,然後再次啟動 Claude Code,而不去動被拒絕的路徑3465* 在上述任何情況下,您都可以將 [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/zh-TW/env-vars) 設定為您能控制的目錄,然後再次啟動 Claude Code,不去動被拒絕的路徑
3454 3466
3455在 v2.1.309 之前,當磁碟區已滿或您的配額已用完時,Claude Code 只會印出作業系統的錯誤文字。例如 `ENOSPC: no space left on device, mkdir '/tmp/claude-501'`,處理步驟相同。3467在 v2.1.309 之前,當磁碟區已滿或您的配額已用完時,Claude Code 只會印出作業系統的錯誤文字。例如 `ENOSPC: no space left on device, mkdir '/tmp/claude-501'`,適用相同的處理步驟。
3456 3468
3457### Claude Code 因磁碟已滿而無法儲存3469### Claude Code 因磁碟已滿而無法儲存
3458 3470
3459在 [`claude -p`](https://code.claude.com/docs/zh-TW/headless) 執行後,stderr 上出現這一行表示磁碟已滿或您的磁碟配額已用盡,因此 Claude Code 無法儲存該次執行的所有內容:3471在 [`claude -p`](https://code.claude.com/docs/zh-TW/headless) 執行後於 stderr 出現這一行,表示磁碟已滿或您的磁碟配額已用完,因此 Claude Code 無法儲存該次執行的所有內容:
3460 3472
3461```text wrap theme={null}3473```text wrap theme={null}
3462Error: Claude Code could not save all of this session's transcript under /Users/you/.claude because the disk is full (ENOSPC). If you resume this session, part of the conversation may be missing. Free up space on that disk before the next run.3474Error: Claude Code could not save all of this session's transcript under /Users/you/.claude because the disk is full (ENOSPC). If you resume this session, part of the conversation may be missing. Free up space on that disk before the next run.
3463```3475```
3464 3476
3465使用文字或 `json` 輸出時,該次執行會以退出碼 1 結束,而答案已經印出。使用 `stream-json` 輸出時,該次執行會維持其一般的退出碼,答案仍會送達。3477使用文字或 `json` 輸出時,該次執行會以退出碼 1 結束,且答案已經印出。使用 `stream-json` 輸出時,該次執行會保持其一般的退出碼,答案仍會送達。
3466 3478
3467**處理方式:**3479**處理方式:**
3468 3480
3469* **`the disk is full (ENOSPC)`**:在下次執行前,釋放包含訊息中路徑之磁碟上的空間3481* **`the disk is full (ENOSPC)`**:在下次執行之前,釋放存放訊息中路徑之磁碟上的空間
3470* **`your disk quota is used up (EDQUOT)`**:在下次執行前,釋放空間或要求更大的配額3482* **`your disk quota is used up (EDQUOT)`**:在下次執行之前,釋放空間或申請更大的配額
3471 3483
3472### 目錄無法解析為實際位置3484### Directory couldn't be resolved to a real location
3473 3485
3474您對工作目錄的子目錄執行了 `/add-dir`,而 Claude Code 無法將該目錄解析為其實際位置。3486您對工作目錄的某個子目錄執行了 `/add-dir`,而 Claude Code 無法將該目錄解析為其實際位置。
3475 3487
3476您本來就擁有工作目錄之子目錄的檔案存取權,因此 `/add-dir` 只會載入其 skill、命令與 agent。在載入之前,Claude Code 會檢查該目錄的實際位置(解析所有符號連結後)是否位於工作目錄內。當 Claude Code 無法解析該位置時,它不會載入任何內容,並顯示此訊息:3488您對工作目錄的子目錄本來就有檔案存取權,因此 `/add-dir` 只會載入其 skill、命令與 agent。在載入之前,Claude Code 會檢查該目錄的實際位置(已解析所有符號連結)是否位於工作目錄內。當 Claude Code 無法解析該位置時,它不會載入任何內容,並顯示此訊息:
3477 3489
3478```text theme={null}3490```text theme={null}
3479packages/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.3491packages/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.
3481 3493
3482**處理方式:**3494**處理方式:**
3483 3495
3484* 確認該路徑指向工作目錄內的一個實際目錄,然後再次執行 `/add-dir`3496* 確認該路徑指向工作目錄內的實際目錄,然後再次執行 `/add-dir`
3485* 此訊息不會變更您的檔案存取權;它只是回報該目錄的 `.claude/` 內容未被載入3497* 此訊息不會改變您的檔案存取權;它只是回報該目錄的 `.claude/` 內容未被載入
3486 3498
3487在 v2.1.261 之前,當工作目錄位於 `/net/<host>` 自動掛載點時,每次執行 `/add-dir <subdirectory>` 也都會出現此訊息,因為 Claude Code 在設計上不會解析該處的路徑;該目錄本身沒有問題,重試也無濟於事。3499在 v2.1.261 之前,當工作目錄位於 `/net/<host>` 自動掛載點上時(Claude Code 依設計不會解析這類路徑),每次執行 `/add-dir <subdirectory>` 都會出現此訊息;該目錄本身沒有問題,重試也無濟於事。
3488 3500
3489### 啟動 Remote Control 時工作區未受信任3501### 啟動 Remote Control 時出現 Workspace not trusted
3490 3502
3491> [!NOTE]3503> [!NOTE]
3492>3504>
3493> 如果 `claude ultrareview` 印出了 `Error: Workspace not trusted`,請改為參閱[執行 claude ultrareview 時出現 Workspace not trusted](#workspace-not-trusted-when-running-claude-ultrareview)。3505> 如果 `claude ultrareview` 印出了 `Error: Workspace not trusted`,請改為參閱[執行 claude ultrareview 時出現 Workspace not trusted](#workspace-not-trusted-when-running-claude-ultrareview)。
3494 3506
3495您在尚未信任的目錄中,以 `claude remote-control` 或其別名 `claude rc` 啟動了 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 伺服器模式,而該命令無法詢問您是否信任該目錄。例如,該命令的標準輸入或標準輸出不是終端機,因為其中之一被重新導向或透過管線傳送。該命令會以退出碼 1 結束:3507您在尚未信任的目錄中,以 `claude remote-control` 或其別名 `claude rc` 啟動 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 伺服器模式,而該命令無法詢問您是否信任該目錄。例如,該命令的標準輸入或標準輸出不是終端機,因為其中之一被重新導向或透過管線傳送。該命令會以退出碼 1 結束:
3496 3508
3497```text theme={null}3509```text theme={null}
3498Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog.3510Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog.
3499```3511```
3500 3512
3501另有兩種同樣以 `Error: Workspace not trusted.` 開頭的變體,會出現在太小而無法顯示信任該目錄會啟用哪些功能的終端機中,或未回報其大小的終端機中。請放大視窗或切換到一般終端機視窗,然後再次執行 `claude rc`。3513在太小而無法顯示信任該目錄會啟用哪些功能的終端機中,或在未回報其大小的終端機中,會出現另外兩種同樣以 `Error: Workspace not trusted.` 開頭的變體。請放大視窗或切換到一般的終端機視窗,然後再次執行 `claude rc`。
3502 3514
3503在您的家目錄中,訊息會有所不同,因為工作區信任對話框永遠不會儲存對家目錄的信任,所以在那裡接受信任無法滿足此檢查。在 v2.1.214 之前,家目錄會顯示上述訊息,但其建議在那裡無法奏效。3515在您的家目錄中,訊息會有所不同,因為工作區信任對話框永遠不會儲存家目錄的信任設定,因此在那裡接受信任無法滿足此項檢查。在 v2.1.214 之前,家目錄會顯示上述訊息,而其建議在那裡無法成功。
3504 3516
3505```text theme={null}3517```text theme={null}
3506Error: 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).3518Error: 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).
3507```3519```
3508 3520
3509如果您在 [`Trust <directory>?` 問題](https://code.claude.com/docs/zh-TW/remote-control#requirements)回答 `n` 或按下 Enter,該命令會列印一則指出該目錄的 `Remote Control did not start` 訊息,並以退出碼 1 結束。請再次執行 `claude rc` 並回答 `y`。3521如果您在 [`Trust <directory>?` 問題](https://code.claude.com/docs/zh-TW/remote-control#requirements)中回答 `n` 或按下 Enter,該命令會印出一則列出該目錄的 `Remote Control did not start` 訊息,並以退出碼 1 結束。請再次執行 `claude rc` 並回答 `y`。
3510 3522
3511**處理方式:**3523**處理方式:**
3512 3524
3513* 先從終端機信任該目錄:在該處執行 `claude rc` 並回答 `y`,或在該處執行 `claude` 並接受[工作區信任對話框](https://code.claude.com/docs/zh-TW/permissions.md#project-allow-rules-and-workspace-trust),然後再次執行您原本的命令3525* 先從終端機信任該目錄:在該處執行 `claude rc` 並回答 `y`,或在該處執行 `claude` 並接受[工作區信任對話框](https://code.claude.com/docs/zh-TW/permissions.md#project-allow-rules-and-workspace-trust),然後再次執行您原本的命令
3514* 在您的家目錄中,請切換到專案目錄,並在那裡啟動 Remote Control3526* 在您的家目錄中,請切換到專案目錄並在那裡啟動 Remote Control
3515 3527
3516在 v2.1.284 之前,即使在終端機中,該命令也從不詢問。3528在 v2.1.284 之前,即使在終端機中,該命令也從不詢問。
3517 3529
3527 3539
3528**處理方式:**3540**處理方式:**
3529 3541
3530* 在指令碼或 CI 工作中,附加 `--trust-workspace` 以僅在該次執行中信任該資料夾:`claude ultrareview --trust-workspace`。請僅對您信任的程式碼附加此旗標,因為 git 與 Claude Code 之後可能會執行該資料夾的 git 設定與專案設定中所指定的程式。對於您不信任其程式碼的 pull request,請[從您信任的分支執行審查](https://code.claude.com/docs/zh-TW/ultrareview.md#trust-the-folder-before-the-review-runs)。3542* 在指令碼或 CI 工作中,附加 `--trust-workspace` 以在該次執行中信任該資料夾:`claude ultrareview --trust-workspace`。請只對您信任的程式碼附加此旗標,因為 git 與 Claude Code 之後可能會執行該資料夾的 git 設定與專案設定中指定的程式。對於您不信任其程式碼的 pull request,請[從您信任的分支執行審查](https://code.claude.com/docs/zh-TW/ultrareview.md#trust-the-folder-before-the-review-runs)。
3531* 在您自己的電腦上,於該資料夾中執行 `claude` 並接受[工作區信任對話框](https://code.claude.com/docs/zh-TW/permissions.md#project-allow-rules-and-workspace-trust),然後再次執行原本的命令3543* 在您自己的電腦上,於該資料夾中執行 `claude` 並接受[工作區信任對話框](https://code.claude.com/docs/zh-TW/permissions.md#project-allow-rules-and-workspace-trust),然後再次執行您原本的命令
3532 3544
3533`claude ultrareview` 的下列每則訊息都表示沒有啟動任何審查,且退出碼為 1:3545`claude ultrareview` 的下列每則訊息都表示沒有啟動任何審查,且退出碼為 1:
3534 3546
3535* **`Error: Workspace not trusted. This terminal ...`**:終端機未回報列數與欄數,或無法容納信任問題及其警告。請放大終端機或使用會回報其大小的終端機,然後再次執行 `claude ultrareview`。在家目錄以外,您也可以在該資料夾中執行一次 `claude` 並接受信任對話框,之後在那裡的執行就不會再詢問。3547* **`Error: Workspace not trusted. This terminal ...`**:終端機未回報其列數與欄數,或無法容納信任問題及其警告。請放大終端機或使用會回報其大小的終端機,然後再次執行 `claude ultrareview`。在家目錄以外的位置,您也可以在該資料夾中執行一次 `claude` 並接受信任對話框,之後在那裡執行就不會再詢問。
3536* **`Error: Workspace not trusted. <folder> is your home directory`**:由於對家目錄的信任永遠不會被儲存,先在那裡執行 `claude` 並沒有幫助。請改從專案目錄執行 `claude ultrareview`(事先在那裡執行一次 `claude` 以接受信任對話框),或附加 `--trust-workspace`。3548* **`Error: Workspace not trusted. <folder> is your home directory`**:由於家目錄的信任設定永遠不會被儲存,先在該處執行 `claude` 無濟於事。請改從專案目錄執行 `claude ultrareview`(先在那裡執行一次 `claude` 以接受信任對話框),或附加 `--trust-workspace`。
3537* **`No answer in time.` 後接 `Error: Workspace not trusted`**:`Trust <folder>? [y/N]` 問題在 5 分鐘內未獲回答。請再次執行 `claude ultrareview` 並回答它。3549* **`No answer in time.` 後接 `Error: Workspace not trusted`**:`Trust <folder>? [y/N]` 問題在 5 分鐘內未獲回答。請再次執行 `claude ultrareview` 並回答問題。
3538* **`Ultrareview did not start: <folder> is not trusted`**:您在 `Trust <folder>? [y/N]` 問題中拒絕了,例如回答 `n` 或按下 Enter。若要啟動審查,請再次執行 `claude ultrareview` 並回答 `y`。3550* **`Ultrareview did not start: <folder> is not trusted`**:您在 `Trust <folder>? [y/N]` 問題中拒絕了,例如回答 `n` 或按下 Enter。若要開始審查,請再次執行 `claude ultrareview` 並回答 `y`。
3539* **``Ultrareview did not start: `--trust-workspace` takes no value``**:`--trust-workspace` 後面接了旗標以外的內容,例如 PR 編號或 `false`。如果您不信任該資料夾,請省略此旗標。若要在此次執行中信任它,請將 PR 編號或基礎分支放在旗標之前:`claude ultrareview 1234 --trust-workspace`。3551* **``Ultrareview did not start: `--trust-workspace` takes no value``**:`--trust-workspace` 後面接著旗標以外的內容,例如 PR 編號或 `false`。如果您不信任該資料夾,請省略此旗標。若要在此次執行中信任它,請將 PR 編號或基底分支放在旗標之前:`claude ultrareview 1234 --trust-workspace`。
3540 3552
3541在 v2.1.309 之前,`claude ultrareview` 不接受 `--trust-workspace`。3553在 v2.1.309 之前,`claude ultrareview` 不接受 `--trust-workspace`。
3542 3554
3543### Remote Control 因問題未獲回答而未啟動3555### Remote Control 因問題未獲回答而未啟動
3544 3556
3545此訊息表示 [`claude remote-control`](https://code.claude.com/docs/zh-TW/remote-control) 詢問了訊息中引述的首次執行問題,但沒有得到回答:3557此訊息表示 [`claude remote-control`](https://code.claude.com/docs/zh-TW/remote-control) 提出了訊息中所引用的首次執行問題,但沒有得到回答:
3546 3558
3547```text theme={null}3559```text theme={null}
3548Remote Control did not start: "Enable Remote Control?" got no answer. Run `claude remote-control` at a terminal and answer y once; it won't ask again.3560Remote Control did not start: "Enable Remote Control?" got no answer. Run `claude remote-control` at a terminal and answer y once; it won't ask again.
3551 3563
3552**處理方式:**3564**處理方式:**
3553 3565
3554* **`Enable Remote Control?`**:在腳本或服務中,標準輸入會在任何人能回答之前結束。請以您的腳本或服務執行時所用的使用者身分,在終端機中執行一次 `claude remote-control` 並回答 `y`。3566* **`Enable Remote Control?`**:在指令碼或服務中,標準輸入會在任何人能回答之前就結束。請以您的指令碼或服務執行時所用的使用者身分,在終端機中執行一次 `claude remote-control` 並回答 `y`。
3555* **`Choose [1/2] (default: 1):`**:再次執行 `claude remote-control` 並[選擇產生模式](https://code.claude.com/docs/zh-TW/remote-control.md#set-the-default-spawn-mode-for-a-project),或傳入 [`--spawn=same-dir` 或 `--spawn=worktree`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) 以跳過此問題3567* **`Choose [1/2] (default: 1):`**:再次執行 `claude remote-control` 並[選擇產生模式](https://code.claude.com/docs/zh-TW/remote-control.md#set-the-default-spawn-mode-for-a-project),或傳入 [`--spawn=same-dir` 或 `--spawn=worktree`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) 以略過此問題
3556 3568
3557### 不會傳遞到 Remote Control 所啟動的工作階段3569### Not carried over to the sessions Remote Control starts
3558 3570
3559您在 `remote-control` 動詞之前加上了全域 `claude` 旗標來啟動 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md),而該旗標會限制或設定 Remote Control 所啟動的工作階段,例如 `--settings`、`--setting-sources`、`--permission-mode`、`--disallowed-tools` 或 `--mcp-config`。放在動詞之前的旗標永遠不會傳到這些工作階段。Claude Code 會改為拒絕啟動,並指出該旗標:3571您在 `remote-control` 動詞之前加上了某個全域 `claude` 旗標來啟動 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md),而該旗標會限制或設定 Remote Control 所啟動的工作階段,例如 `--settings`、`--setting-sources`、`--permission-mode`、`--disallowed-tools` 或 `--mcp-config`。放在動詞之前的旗標永遠不會傳遞到這些工作階段。Claude Code 會改為拒絕啟動,並列出該旗標:
3560 3572
3561```text theme={null}3573```text theme={null}
3562Error: `--settings` before `remote-control` is not carried over to the sessions Remote Control starts, so Remote Control refuses to start rather than drop it — remove it, and give Remote Control's own options after the verb (see `claude remote-control --help`). Pass settings with `claude remote-control --settings <file>`.3574Error: `--settings` before `remote-control` is not carried over to the sessions Remote Control starts, so Remote Control refuses to start rather than drop it — remove it, and give Remote Control's own options after the verb (see `claude remote-control --help`). Pass settings with `claude remote-control --settings <file>`.
3563```3575```
3564 3576
3565對於捨棄後無害的全域旗標,例如 `--verbose`、`--model`,或由包裝程式注入的 `--session-id` 或 `--plugin-dir`,Claude Code 不會拒絕:它會忽略這些旗標,Remote Control 會照常啟動。3577對於可以無害地捨棄的全域旗標,例如 `--verbose`、`--model`,或由包裝程式注入的 `--session-id` 或 `--plugin-dir`,Claude Code 不會拒絕:它會忽略這些旗標,Remote Control 會照常啟動。
3566 3578
3567對於尚未被認定為無害的全域旗標,Claude Code 也會拒絕啟動,因此在較新版本中新增的旗標可能會出現在此訊息中,直到之後的版本將其標記為無害為止。3579對於 Claude Code 尚未認定為無害的全域旗標,它也會拒絕啟動,因此在較新版本中新增的旗標可能會出現在此訊息中,直到後續版本將其標記為無害為止。
3568 3580
3569**處理方式:**3581**處理方式:**
3570 3582
3571* 將該旗標從動詞之前移除,並在動詞之後傳入 [Remote Control 自身的選項](https://code.claude.com/docs/zh-TW/remote-control.md#start-a-remote-control-session);`claude remote-control --help` 會列出這些選項3583* 將該旗標從動詞之前移除,並在動詞之後傳入 [Remote Control 本身的選項](https://code.claude.com/docs/zh-TW/remote-control.md#start-a-remote-control-session);`claude remote-control --help` 會列出這些選項
3572* 當被拒絕的旗標是 `--permission-mode` 時,請執行 `claude remote-control --permission-mode <mode>`,為 Remote Control 所啟動的工作階段設定權限模式3584* 當被拒絕的旗標是 `--permission-mode` 時,請執行 `claude remote-control --permission-mode <mode>`,為 Remote Control 所啟動的工作階段設定權限模式
3573 3585
3574在 v2.1.248 之前,當全域旗標在前時,`claude remote-control` 不接受其自身的旗標,該命令會以 `unknown option` 錯誤失敗。3586在 v2.1.248 之前,當全域旗標在前時,`claude remote-control` 不接受其本身的旗標,且該命令會以 `unknown option` 錯誤失敗。
3575 3587
3576### Remote Control 因 `--settings` 檔案而未啟動3588### Remote Control 因 `--settings` 檔案而未啟動
3577 3589
3583 3595
3584**處理方式:**3596**處理方式:**
3585 3597
3586* 修正訊息所指出的問題,然後重新執行您的 `claude remote-control` 命令3598* 修正訊息所指出的問題,然後再次執行您的 `claude remote-control` 命令
3587 3599
3588### The settings file has changed since Remote Control started3600### The settings file has changed since Remote Control started
3589 3601
3595 3607
3596**處理方式:**3608**處理方式:**
3597 3609
3598* 若要使用該檔案的目前內容,請停止 `claude remote-control` 並重新執行相同的命令。若要找回它原本服務的工作階段,請參閱[停止伺服器後繼續工作階段](https://code.claude.com/docs/zh-TW/remote-control.md#resume-sessions-after-stopping-the-server)。3610* 若要使用該檔案的目前內容,請停止 `claude remote-control` 並再次執行相同的命令。若要找回它原本服務的工作階段,請參閱[停止伺服器後恢復工作階段](https://code.claude.com/docs/zh-TW/remote-control.md#resume-sessions-after-stopping-the-server)。
3599* 若要保留 Remote Control 啟動時所使用的設定,請將檔案內容還原為原本的樣子,若 `claude remote-control` 已結束,再重新執行命令3611* 若要保留 Remote Control 啟動時所用的設定,請將檔案內容還原為原本的樣子;如果 `claude remote-control` 已經結束,請再次執行該命令
3600 3612
3601### `--sandbox` or `--no-sandbox` is not supported by claude remote-control3613### `--sandbox` or `--no-sandbox` is not supported by claude remote-control
3602 3614
3603此錯誤表示啟動您 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 伺服器的命令在 `remote-control` 之後傳入了 `--sandbox` 或 `--no-sandbox`,而 `claude remote-control` 兩者皆不接受。伺服器會以退出碼 1 結束,而不會啟動:3615此錯誤表示啟動您 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 伺服器的命令在 `remote-control` 之後傳入了 `--sandbox` 或 `--no-sandbox`,而 `claude remote-control` 兩個旗標都不接受。伺服器會以退出碼 1 結束,而不會啟動:
3604 3616
3605```text theme={null}3617```text theme={null}
3606Error: --sandbox is not supported by claude remote-control. The flag had no effect and was removed. To sandbox sessions, set sandbox.enabled to true in settings.3618Error: --sandbox is not supported by claude remote-control. The flag had no effect and was removed. To sandbox sessions, set sandbox.enabled to true in settings.
3609 3621
3610**處理方式:**3622**處理方式:**
3611 3623
3612* 從命令中移除該旗標(包括在替您啟動伺服器的指令碼或服務定義中),然後再次執行3624* 從命令中移除該旗標,包括在為您啟動伺服器的指令碼或服務定義中,然後再次執行
3613* 若要對伺服器所啟動的工作階段使用沙箱,請在[設定檔](https://code.claude.com/docs/zh-TW/settings.md#where-settings-live)中將 [`sandbox.enabled`](https://code.claude.com/docs/zh-TW/settings-reference#sandbox-enabled) 設為 `true`,以開啟[沙箱機制](https://code.claude.com/docs/zh-TW/sandboxing.md)3625* 若要將伺服器所啟動的工作階段放入沙箱,請在[設定檔](https://code.claude.com/docs/zh-TW/settings.md#where-settings-live)中將 [`sandbox.enabled`](https://code.claude.com/docs/zh-TW/settings-reference#sandbox-enabled) 設為 `true` 以開啟[沙箱機制](https://code.claude.com/docs/zh-TW/sandboxing.md)
3614 3626
3615這兩個旗標已在 v2.1.300 中從 `claude remote-control` 移除,因此為較早版本撰寫的命令可能仍帶有其中之一。3627這兩個旗標已在 v2.1.300 中從 `claude remote-control` 移除,因此為較早版本撰寫的命令可能仍帶有其中之一。
3616 3628
3617### 此建置中尚無法使用 claude import3629### claude import is not yet available in this build
3618 3630
3619您執行了 [`claude import`](https://code.claude.com/docs/zh-TW/cli-reference#cli-commands),而 Claude Code 發現匯入流程已關閉,因此該命令會以退出碼 1 結束,而不會開始匯入。在 v2.1.222 之前,匯入流程關閉的建置會將 `import` 視為提示詞,並啟動互動式工作階段,而不是列印此訊息。3631您執行了 [`claude import`](https://code.claude.com/docs/zh-TW/cli-reference#cli-commands),而 Claude Code 發現匯入流程已關閉,因此該命令會以退出碼 1 結束,而不會開始匯入。在 v2.1.222 之前,匯入流程關閉的建置會將 `import` 當作提示詞,並啟動互動式工作階段,而不是印出此訊息。
3620 3632
3621```text theme={null}3633```text theme={null}
3622`claude import` is not yet available in this build. Run `claude` and use /mcp or edit ~/.claude/settings.json directly.3634`claude import` is not yet available in this build. Run `claude` and use /mcp or edit ~/.claude/settings.json directly.
3623```3635```
3624 3636
3625Claude Code 透過從 Anthropic 擷取並快取在磁碟上的功能旗標來開啟 `claude import`。此訊息表示快取的值為關閉。原因通常是以下其中之一:3637Claude Code 透過一個從 Anthropic 擷取並快取在磁碟上的功能旗標來開啟 `claude import`。此訊息表示快取的值為關閉。原因通常是下列其中之一:
3626 3638
3627* 您在安裝後尚未啟動過工作階段,因此 Claude Code 尚未擷取該旗標。即使您可以使用此功能,第一次執行 `claude import` 時也可能列印此訊息。3639* 您在安裝後尚未啟動過工作階段,因此 Claude Code 尚未擷取該旗標。即使該功能對您可用,第一次執行 `claude import` 也可能印出此訊息。
3628* 您透過 Amazon Bedrock、Google Cloud 的 Agent Platform、Microsoft Foundry 或 Claude Platform on AWS 使用 Claude Code,或透過 [Claude apps 閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway#availability-and-limitations)使用。Claude Code 在這些工作階段中不會擷取功能旗標,因此 `claude import` 會一直無法使用。3640* 您透過 Amazon Bedrock、Google Cloud 的 Agent Platform、Microsoft Foundry 或 Claude Platform on AWS,或透過 [Claude apps 閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway#availability-and-limitations)使用 Claude Code。Claude Code 在這些工作階段中不會擷取功能旗標,因此 `claude import` 會保持無法使用。
3629* 您設定了 `DISABLE_TELEMETRY`、`DO_NOT_TRACK`、[`CLAUDE_CODE_DISABLE_FEATURE_FLAGS`](https://code.claude.com/docs/zh-TW/env-vars#variables)、`DISABLE_GROWTHBOOK` 或 [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/zh-TW/env-vars),這些會關閉功能旗標擷取,因此 `claude import` 會維持無法使用。3641* 您設定了 `DISABLE_TELEMETRY`、`DO_NOT_TRACK`、[`CLAUDE_CODE_DISABLE_FEATURE_FLAGS`](https://code.claude.com/docs/zh-TW/env-vars#variables)、`DISABLE_GROWTHBOOK` 或 [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/zh-TW/env-vars),這些會關閉功能旗標擷取,因此 `claude import` 會保持無法使用。
3630 3642
3631**處理方式:**3643**處理方式:**
3632 3644
3633* 在全新安裝中,啟動 `claude`,等待工作階段載入後結束,然後再次執行 `claude import`3645* 在全新安裝上,啟動 `claude`,等待工作階段載入後結束,再次執行 `claude import`
3634* 在功能旗標擷取持續關閉的環境中,請自行完成設定:使用 [`claude mcp add`](https://code.claude.com/docs/zh-TW/mcp#installing-mcp-servers) 新增 MCP 伺服器,並建立您想沿用的 [`CLAUDE.md` 檔案](https://code.claude.com/docs/zh-TW/memory#how-claude-md-files-load)、[skill 與命令](https://code.claude.com/docs/zh-TW/skills.md#where-skills-live),以及 [subagent](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope)。訊息中也提到了 `~/.claude/settings.json`。在 `claude import` 所沿用的設定中,該檔案只保存[權限模式](https://code.claude.com/docs/zh-TW/settings-reference.md#permission-settings);Claude Code 不會從中讀取 MCP 伺服器。3646* 在功能旗標擷取保持關閉的情況下,請自行完成設定:使用 [`claude mcp add`](https://code.claude.com/docs/zh-TW/mcp#installing-mcp-servers) 新增 MCP 伺服器,並建立您想轉移的 [`CLAUDE.md` 檔案](https://code.claude.com/docs/zh-TW/memory#how-claude-md-files-load)、[skill 與命令](https://code.claude.com/docs/zh-TW/skills.md#where-skills-live)以及 [subagent](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-the-subagent-scope)。訊息中也提到了 `~/.claude/settings.json`。在 `claude import` 會轉移的設定中,該檔案只存放[權限模式](https://code.claude.com/docs/zh-TW/settings-reference.md#permission-settings);Claude Code 不會從中讀取 MCP 伺服器。
3635 3647
3636### 無法讀取 Claude Code 設定3648### Could not read Claude Code config
3637 3649
3638您在 Claude Code 無法剖析 `~/.claude.json`(它儲存您帳戶詳細資料與各專案狀態的檔案)時執行了 [`claude import`](https://code.claude.com/docs/zh-TW/cli-reference#cli-commands)。該子命令會讀取此檔案以檢查可用性,但不會顯示互動式工作階段所顯示的復原對話框,因此會以退出碼 1 結束。在 v2.1.222 之前,設定檔無法讀取時執行 `claude import` 會啟動互動式工作階段,並由其復原對話框處理該檔案。3650您在 Claude Code 無法解析 `~/.claude.json`(存放您帳戶詳細資料與各專案狀態的檔案)時執行了 [`claude import`](https://code.claude.com/docs/zh-TW/cli-reference#cli-commands)。該子命令會讀取此檔案以檢查可用性,但不會顯示互動式工作階段所顯示的復原對話框,因此會以退出碼 1 結束。在 v2.1.222 之前,在設定檔無法讀取時執行 `claude import` 會啟動互動式工作階段,並由其復原對話框處理該檔案。
3639 3651
3640```text theme={null}3652```text theme={null}
3641Could not read Claude Code config — run `claude` with no arguments to recover it.3653Could not read Claude Code config — run `claude` with no arguments to recover it.
3643 3655
3644**處理方式:**3656**處理方式:**
3645 3657
3646* 不帶引數執行 `claude`。Claude Code 會偵測到無效的檔案並提供重設選項。然後再次執行 `claude import`。3658* 不帶任何引數執行 `claude`。Claude Code 會偵測到無效的檔案並提議將其重設。然後再次執行 `claude import`。
3647* 若要保留您手動做過的編輯,請改為在編輯器中修正 `~/.claude.json` 的 JSON 語法,然後重新執行 `claude import`3659* 若要保留您手動進行的編輯,請改在編輯器中修正 `~/.claude.json` 的 JSON 語法,然後重新執行 `claude import`
3648 3660
3649### 無法從 Claude Desktop 匯入伺服器3661### 無法從 Claude Desktop 匯入伺服器
3650 3662
3651Claude Code 無法新增您在 `claude mcp add-from-claude-desktop` 中選取的其中一個伺服器。該命令仍會匯入其他選取的伺服器,並針對每個無法新增的伺服器列印一行。在 v2.1.205 之前,第一個失敗的伺服器會中止匯入。3663Claude Code 無法新增您在 `claude mcp add-from-claude-desktop` 中選取的其中一個伺服器。該命令仍會匯入其他選取的伺服器,並針對每個無法新增的伺服器印出一行。在 v2.1.205 之前,第一個失敗的伺服器會中止匯入。
3652 3664
3653```text theme={null}3665```text theme={null}
3654Could not import my server: Invalid name my server. Names can only contain letters, numbers, hyphens, and underscores.3666Could not import my server: Invalid name my server. Names can only contain letters, numbers, hyphens, and underscores.
3655```3667```
3656 3668
3657伺服器名稱之後的文字是原因。最常見的是名稱檢查:Claude Desktop 允許伺服器名稱中包含空格與句點等字元,而 `claude mcp` 將其限制為字母、數字、連字號與底線。其他原因包括伺服器設定未通過驗證,以及伺服器被您組織的 [MCP 政策](https://code.claude.com/docs/zh-TW/managed-mcp.md)封鎖。3669伺服器名稱之後的文字是原因。最常見的是名稱檢查:Claude Desktop 允許伺服器名稱中包含空格與句點等字元,而 `claude mcp` 則限制只能使用字母、數字、連字號與底線。其他原因包括伺服器設定未通過驗證,以及伺服器被您組織的 [MCP 政策](https://code.claude.com/docs/zh-TW/managed-mcp.md)封鎖。
3658 3670
3659**處理方式:**3671**處理方式:**
3660 3672
3661* 在 `claude_desktop_config.json` 中將該伺服器重新命名為只使用字母、數字、連字號與底線,然後再次執行 `claude mcp add-from-claude-desktop`3673* 在 `claude_desktop_config.json` 中將伺服器重新命名為只使用字母、數字、連字號與底線,然後再次執行 `claude mcp add-from-claude-desktop`
3662* 使用 `claude mcp add` 或 `claude mcp add-json` 以有效的名稱直接新增該伺服器。請參閱[從 Claude Desktop 匯入 MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md#import-mcp-servers-from-claude-desktop)。3674* 使用 `claude mcp add` 或 `claude mcp add-json` 以有效名稱直接新增該伺服器。請參閱[從 Claude Desktop 匯入 MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md#import-mcp-servers-from-claude-desktop)。
3663 3675
3664### 無法將 MCP 伺服器新增到受管範圍3676### 無法將 MCP 伺服器新增至 managed 範圍
3665 3677
3666您以 `--scope managed` 執行了 `claude mcp add` 或 `claude mcp add-json`。該範圍保存的是您的組織透過 [`managedMcpServers`](https://code.claude.com/docs/zh-TW/settings-reference#managedmcpservers) 受管設定提供的伺服器。Claude Code 只從受管設定讀取它們,因此該命令無法將伺服器寫入該範圍。3678您以 `--scope managed` 執行了 `claude mcp add` 或 `claude mcp add-json`。該範圍存放您組織透過 [`managedMcpServers`](https://code.claude.com/docs/zh-TW/settings-reference#managedmcpservers) 受管設定提供的伺服器。Claude Code 只會從受管設定讀取這些伺服器,因此該命令無法將伺服器寫入該範圍。
3667 3679
3668```text theme={null}3680```text theme={null}
3669Cannot add MCP server to scope: managed3681Cannot add MCP server to scope: managed
3671 3683
3672**處理方式:**3684**處理方式:**
3673 3685
3674* 將伺服器新增到您可寫入的範圍:`local`、`user` 或 `project`。若不指定 `--scope`,該命令會使用 `local`。請參閱 [MCP 安裝範圍](https://code.claude.com/docs/zh-TW/mcp.md#mcp-installation-scopes)3686* 將伺服器新增至您可以寫入的範圍:`local`、`user` 或 `project`。未指定 `--scope` 時,命令會使用 `local`。請參閱 [MCP 安裝範圍](https://code.claude.com/docs/zh-TW/mcp.md#mcp-installation-scopes)
3675* 若要將伺服器提供給組織中的每位使用者,請將其新增到您部署的受管設定中的 [`managedMcpServers`](https://code.claude.com/docs/zh-TW/settings-reference#managedmcpservers)3687* 若要將伺服器提供給組織中的每位使用者,請將其新增至您所部署之受管設定中的 [`managedMcpServers`](https://code.claude.com/docs/zh-TW/settings-reference#managedmcpservers)
3676 3688
3677### 受管設定只允許外掛伺服器時無法新增 MCP 伺服器3689### 受管設定只允許外掛伺服器時無法新增 MCP 伺服器
3678 3690
3679您在組織的受管設定將 [`strictPluginOnlyCustomization`](https://code.claude.com/docs/zh-TW/settings-reference#strictpluginonlycustomization) 設為 `true` 或設為包含 `mcp` 的清單時,執行了 `claude mcp add` 或 `claude mcp add-json`。在該設定下,Claude Code 不會從 `~/.claude.json` 或 `.mcp.json` 載入 MCP 伺服器,因此該命令會以退出碼 1 結束,而不是儲存一個永遠不會載入的伺服器:3691您在組織的受管設定將 [`strictPluginOnlyCustomization`](https://code.claude.com/docs/zh-TW/settings-reference#strictpluginonlycustomization) 設為 `true` 或設為包含 `mcp` 的清單時,執行了 `claude mcp add` 或 `claude mcp add-json`。在此設定下,Claude Code 不會從 `~/.claude.json` 或 `.mcp.json` 載入 MCP 伺服器,因此該命令會以退出碼 1 結束,而不會儲存一個永遠不會載入的伺服器:
3680 3692
3681```text theme={null}3693```text theme={null}
3682Cannot add MCP server: your organization's managed settings allow only MCP servers that plugins provide. Install a plugin that provides this server, or ask your administrator to make it available.3694Cannot add MCP server: your organization's managed settings allow only MCP servers that plugins provide. Install a plugin that provides this server, or ask your administrator to make it available.
3683```3695```
3684 3696
3685`claude mcp add-from-claude-desktop` 會將您選取的每個伺服器回報為未匯入,並以此訊息作為原因。[`/import`](https://code.claude.com/docs/zh-TW/commands#all-commands) 會針對它嘗試新增的每個 MCP 伺服器回報此訊息,但仍會匯入它找到的其他項目。3697`claude mcp add-from-claude-desktop` 會將您選取的每個伺服器回報為未匯入,並以此訊息作為原因。[`/import`](https://code.claude.com/docs/zh-TW/commands#all-commands) 會針對其嘗試新增的每個 MCP 伺服器回報此訊息,並仍會匯入它找到的其他項目。
3686 3698
3687在 v2.1.284 之前,這些命令會儲存伺服器並回報成功,但該伺服器永遠不會載入。3699在 v2.1.284 之前,這些命令會儲存該伺服器並回報成功,但該伺服器從未載入。
3688 3700
3689**處理方式:**3701**處理方式:**
3690 3702
3691* 安裝提供該伺服器的[外掛](https://code.claude.com/docs/zh-TW/plugins/install.md)3703* 安裝提供該伺服器的[外掛](https://code.claude.com/docs/zh-TW/plugins/install.md)
3692* 請您的管理員在[外掛](https://code.claude.com/docs/zh-TW/plugins/org.md)中發布該伺服器,或者若它是遠端 HTTP 或 SSE 伺服器,則透過 [`managedMcpServers`](https://code.claude.com/docs/zh-TW/settings-reference#managedmcpservers) 提供3704* 請您的管理員以[外掛](https://code.claude.com/docs/zh-TW/plugins/org.md)發佈該伺服器,或者如果它是遠端 HTTP 或 SSE 伺服器,則透過 [`managedMcpServers`](https://code.claude.com/docs/zh-TW/settings-reference#managedmcpservers) 提供
3693 3705
3694### 無法讀取 .mcp.json3706### Can't read .mcp.json
3695 3707
3696讀取專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-scope) 的命令(例如搭配 `--scope project` 的 `claude mcp add` 或 `claude mcp add-json`,或 `claude mcp remove`)發現目前目錄中的該檔案不是一般檔案,或大於 2 MiB,因此會以此錯誤結束,而不會讀取該檔案。3708讀取專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-scope) 的命令(例如搭配 `--scope project` 的 `claude mcp add` 或 `claude mcp add-json`,或是 `claude mcp remove`)發現您目前目錄中的該檔案不是一般檔案或大於 2 MiB,因此會以此錯誤結束,而不會讀取該檔案。
3697 3709
3698```text theme={null}3710```text theme={null}
3699Can'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.3711Can'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.
3700```3712```
3701 3713
3702在 v2.1.257 之前,位於 `.mcp.json` 的 FIFO 會讓命令無限期等待且沒有任何輸出,而指向 `/dev/zero` 等裝置檔案的符號連結則會讓記憶體持續增長,直到程序被終止。3714在 v2.1.257 之前,位於 `.mcp.json` 的 FIFO 會讓命令無止盡地等待且沒有任何輸出,而指向 `/dev/zero` 之類裝置檔案的符號連結會使記憶體用量持續增長,直到程序被終止為止。
3703 3715
3704**處理方式:**3716**處理方式:**
3705 3717
3706* 檢查目前目錄中 `.mcp.json` 是什麼。將其替換為[專案範圍格式](https://code.claude.com/docs/zh-TW/mcp.md#project-scope)的一般 JSON 檔案,或將其刪除,然後再次執行命令。3718* 檢查您目前目錄中 `.mcp.json` 位置上的內容。將其替換為符合[專案範圍格式](https://code.claude.com/docs/zh-TW/mcp.md#project-scope)的一般 JSON 檔案,或將其刪除,然後再次執行命令。
3707 3719
3708### MCP 伺服器未被儲存或移除3720### MCP 伺服器未被儲存或移除
3709 3721
3710此錯誤表示 `claude mcp add` 或 `claude mcp remove` 等命令未能將您的變更寫入 `~/.claude.json`。可能是其他 Claude Code 程序一直鎖定著該檔案,或者該檔案是唯讀的或受到沙箱保護。3722此錯誤表示 `claude mcp add` 或 `claude mcp remove` 之類的命令未能將您的變更寫入 `~/.claude.json`。可能是其他 Claude Code 程序持續鎖定該檔案,或該檔案為唯讀或受到沙箱保護。
3711 3723
3712```text theme={null}3724```text theme={null}
3713MCP server "example" was not saved to /home/user/.claude.json. If other Claude Code processes use that file, they may have kept it locked: add the server again, with CLAUDE_CODE_CONFIG_LOCK_WAIT_MS=60000 set to wait up to a minute. If that file is read-only or protected by a sandbox, make it writable or run the command outside the sandbox first.3725MCP server "example" was not saved to /home/user/.claude.json. If other Claude Code processes use that file, they may have kept it locked: add the server again, with CLAUDE_CODE_CONFIG_LOCK_WAIT_MS=60000 set to wait up to a minute. If that file is read-only or protected by a sandbox, make it writable or run the command outside the sandbox first.
3714```3726```
3715 3727
3716在移除之後,訊息會以 `was not removed from` 取代 `was not saved to`,並以 `remove the server again` 取代 `add the server again`。對於 `local` 範圍的伺服器,路徑之後會接著該項目所屬的專案目錄,形式為 `(local scope for /path/to/project)`。3728移除之後,訊息會以 `was not removed from` 取代 `was not saved to`,並以 `remove the server again` 取代 `add the server again`。對於 `local` 範圍的伺服器,路徑之後會接著該項目所屬的專案目錄,形式為 `(local scope for /path/to/project)`。
3717 3729
3718**處理方式:**3730**處理方式:**
3719 3731
3720* **有其他 Claude Code 程序正在執行**:命令會等待檔案鎖定約 10 到 20 秒,然後在未寫入的情況下放棄。請將 [`CLAUDE_CODE_CONFIG_LOCK_WAIT_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables) 設定為較長的等待時間(以毫秒為單位,例如 `60000`),然後重新執行相同的命令。3732* **有其他 Claude Code 程序正在執行**:命令會等待約 10 到 20 秒以取得檔案的鎖定,然後放棄而不寫入。請將 [`CLAUDE_CODE_CONFIG_LOCK_WAIT_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables) 設為較長的等待時間(以毫秒為單位,例如 `60000`),再次執行相同的命令。
3721* **檔案是唯讀的或受沙箱保護**:讓訊息所指出的檔案可寫入,然後重新執行相同的新增或移除命令,或在沙箱之外執行該命令。3733* **檔案為唯讀或受沙箱保護**:讓訊息所列的檔案變為可寫入,然後再次執行相同的新增或移除命令,或在沙箱之外執行該命令。
3722 3734
3723在 v2.1.283 之前,即使變更未寫入檔案,`claude mcp add`、`claude mcp add-json` 與 `claude mcp remove` 也會回報成功。在 v2.1.318 之前,訊息未提及鎖定,且 Claude Code 不會讀取 [`CLAUDE_CODE_CONFIG_LOCK_WAIT_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables)。3735在 v2.1.283 之前,即使變更未寫入檔案,`claude mcp add`、`claude mcp add-json` 與 `claude mcp remove` 仍會回報成功。在 v2.1.318 之前,訊息不會提及鎖定,且 Claude Code 不會讀取 [`CLAUDE_CODE_CONFIG_LOCK_WAIT_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables)。
3724 3736
3725### MCP 伺服器可能未被儲存或移除3737### MCP 伺服器可能未被儲存或移除
3726 3738
3727您針對 `user` 或 `local` [範圍](https://code.claude.com/docs/zh-TW/mcp.md#mcp-installation-scopes)中的伺服器執行了 `claude mcp add`、`claude mcp add-json` 或 `claude mcp remove`,而 Claude Code 無法讀回 `~/.claude.json` 來確認變更。變更可能已寫入磁碟,也可能沒有。`to confirm the change` 之後的括號內容會說明原因。3739您對 `user` 或 `local` [範圍](https://code.claude.com/docs/zh-TW/mcp.md#mcp-installation-scopes)中的伺服器執行了 `claude mcp add`、`claude mcp add-json` 或 `claude mcp remove`,而 Claude Code 無法讀回 `~/.claude.json` 以確認變更。變更可能已寫入磁碟,也可能沒有。`to confirm the change` 之後的括號內會說明原因。
3728 3740
3729```text theme={null}3741```text theme={null}
3730MCP server "example" may not have been saved: /home/user/.claude.json could not be read to confirm the change (EACCES: permission denied, open '/home/user/.claude.json'). Run `claude mcp get example` to check, then add the server again if it is missing.3742MCP server "example" may not have been saved: /home/user/.claude.json could not be read to confirm the change (EACCES: permission denied, open '/home/user/.claude.json'). Run `claude mcp get example` to check, then add the server again if it is missing.
3731```3743```
3732 3744
3733在移除之後,訊息會是 `may not have been removed`,並以 `then remove the server again if it is still listed` 結尾。如果原因是 `the file was not found`,該伺服器可能仍處於已設定狀態。3745移除之後,訊息會顯示 `may not have been removed`,並以 `then remove the server again if it is still listed` 結尾。如果原因是 `the file was not found`,該伺服器可能仍在設定中。
3734 3746
3735在 v2.1.283 之前,即使無法確認變更,這些命令也會回報成功。3747在 v2.1.283 之前,即使變更無法確認,這些命令仍會回報成功。
3736 3748
3737**處理方式:**3749**處理方式:**
3738 3750
3739* 執行 `claude mcp get <name>` 以檢查變更是否已寫入磁碟。對於 `local` 範圍的伺服器,請從該伺服器所屬的專案目錄執行,因為 local 範圍是以專案為單位。3751* 執行 `claude mcp get <name>` 以檢查變更是否已寫入磁碟。對於 `local` 範圍的伺服器,由於 local 範圍是依專案區分的,請從該伺服器所屬的專案目錄執行。
3740* 如果在新增後伺服器不存在,或在移除後仍被列出,請再次執行相同的新增或移除命令。3752* 如果新增後伺服器不存在,或移除後仍被列出,請再次執行相同的新增或移除命令。
3741 3753
3742### 伺服器由 Anthropic 託管,不支援本機 OAuth3754### Server is Anthropic-hosted and doesn't support local OAuth
3743 3755
3744您為某個 MCP 伺服器啟動了登入,而其 URL 指向透過第三方身分識別提供者進行身分驗證、由 Anthropic 託管的連接器主機。這些主機包括 `microsoft365.mcp.claude.com`、`gmail.mcp.claude.com` 與 `gcal.mcp.claude.com`。Claude Code 會拒絕從 `/mcp` 面板與 `claude mcp login` 為這些主機啟動本機 OAuth 流程,因為[它們的登入只能透過 claude.ai 進行](https://code.claude.com/docs/zh-TW/mcp.md#use-mcp-servers-from-claude-ai)。3756您為某個 MCP 伺服器開始登入,而其 URL 指向透過第三方身分提供者進行身分驗證的 Anthropic 託管連接器主機。這些主機包括 `microsoft365.mcp.claude.com`、`gmail.mcp.claude.com` 與 `gcal.mcp.claude.com`。無論是從 `/mcp` 面板或 `claude mcp login`,Claude Code 都會拒絕為這些主機啟動其本機 OAuth 流程,因為[它們的登入只能透過 claude.ai 進行](https://code.claude.com/docs/zh-TW/mcp.md#use-mcp-servers-from-claude-ai)。
3745 3757
3746```text theme={null}3758```text theme={null}
3747"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.3759"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.
3749 3761
3750**處理方式:**3762**處理方式:**
3751 3763
3752* 使用 `claude mcp remove <name>` 移除您的項目,以免它遮蔽相同 URL 的 claude.ai 連接器3764* 使用 `claude mcp remove <name>` 移除您的項目,使其不會遮蔽相同 URL 的 claude.ai 連接器
3753* 移除後,在登入您於 Claude Code 中使用的帳戶的情況下,於 [claude.ai/customize/connectors](https://claude.ai/customize/connectors) 連接該服務。連接後,如果您目前使用的身分驗證方式是 claude.ai 訂閱登入,[該連接器會自動出現在 Claude Code 中](https://code.claude.com/docs/zh-TW/mcp.md#use-mcp-servers-from-claude-ai)3765* 移除後,在登入您於 Claude Code 中使用之帳戶的情況下,於 [claude.ai/customize/connectors](https://claude.ai/customize/connectors) 連接該服務。連接完成後,如果您目前的身分驗證方式是 claude.ai 訂閱登入,[該連接器會自動出現在 Claude Code 中](https://code.claude.com/docs/zh-TW/mcp.md#use-mcp-servers-from-claude-ai)
3754 3766
3755### 伺服器拒絕了設定的 headersHelper 所產生的 Authorization 標頭3767### Server rejected the Authorization header minted by the configured headersHelper
3756 3768
3757某個由 [`headersHelper`](https://code.claude.com/docs/zh-TW/mcp#use-dynamic-headers-for-custom-authentication) 提供 `Authorization` 標頭的 MCP 伺服器以 HTTP 401 或 403 回應連線,因此 Claude Code 將該連線回報為失敗。由於 helper 提供了 `Authorization` 標頭,Claude Code [不會改用 OAuth](https://code.claude.com/docs/zh-TW/mcp.md#authenticate-with-remote-mcp-servers) 連線該伺服器:3769某個 MCP 伺服器的 [`headersHelper`](https://code.claude.com/docs/zh-TW/mcp#use-dynamic-headers-for-custom-authentication) 提供 `Authorization` 標頭,而該伺服器以 HTTP 401 或 403 回應連線,因此 Claude Code 將連線回報為失敗。由於 helper 提供了 `Authorization` 標頭,Claude Code 對該伺服器[不會改用 OAuth](https://code.claude.com/docs/zh-TW/mcp.md#authenticate-with-remote-mcp-servers):
3758 3770
3759```text theme={null}3771```text theme={null}
3760Server 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.3772Server 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.
3761```3773```
3762 3774
3763Claude Code 在每次嘗試連線時都會重新執行 helper,因此在暫時性拒絕(例如權杖輪替競爭)之後重試,可能會以新的憑證成功。3775Claude Code 會在每次連線嘗試時重新執行 helper,因此在暫時性拒絕(例如權杖輪替的競態條件)之後重試,可能會以新的憑證成功。
3764 3776
3765**處理方式:**3777**處理方式:**
3766 3778
3767* 以 Claude Code 執行它的方式自行執行 `headersHelper` 命令:從 [Claude Code 執行它的目錄](https://code.claude.com/docs/zh-TW/mcp.md#where-the-helper-runs)執行,帶上 [Claude Code 為它設定的環境變數](https://code.claude.com/docs/zh-TW/mcp.md#use-dynamic-headers-for-custom-authentication),並且對於來自專案 `.mcp.json`、外掛或專案 agent 檔案的伺服器,不帶 [Claude Code 移除的憑證變數](https://code.claude.com/docs/zh-TW/mcp.md#which-variables-a-helper-can-read)。確認它輸出的 `Authorization` 值能被該伺服器的端點接受3779* 以 Claude Code 執行 `headersHelper` 命令的方式自行執行它:從 [Claude Code 執行它的目錄](https://code.claude.com/docs/zh-TW/mcp.md#where-the-helper-runs)執行,帶上 [Claude Code 為其設定的環境變數](https://code.claude.com/docs/zh-TW/mcp.md#use-dynamic-headers-for-custom-authentication),並且對於來自專案 `.mcp.json`、外掛或專案 agent 檔案的伺服器,不帶 [Claude Code 會移除的憑證變數](https://code.claude.com/docs/zh-TW/mcp.md#which-variables-a-helper-can-read)。確認它印出的 `Authorization` 值能被伺服器的端點接受
3768* 修正 helper 或其憑證來源後,在 `/mcp` 中選取該伺服器並選擇 **Reconnect**3780* 修正 helper 或其憑證來源之後,在 `/mcp` 中選取該伺服器並選擇 **Reconnect**
3769 3781
3770在 v2.1.248 之前,對於 helper 提供 `Authorization` 標頭的伺服器,Claude Code 仍會執行 OAuth 探索。該探索可能會以 `Incompatible auth server: does not support dynamic client registration` 失敗,而不是回報被拒絕的憑證。3782在 v2.1.248 之前,對於 helper 提供 `Authorization` 標頭的伺服器,Claude Code 仍會執行 OAuth 探索。該探索可能會以 `Incompatible auth server: does not support dynamic client registration` 失敗,而不是回報被拒絕的憑證。
3771 3783
3772### MCP 伺服器拒絕了 elicitation 功能3784### MCP 伺服器拒絕了 elicitation 能力
3773 3785
3774以 Java MCP SDK 0.11.0 至 0.17.0 建置的 MCP 伺服器拒絕了連線。這些 SDK 版本無法剖析 Claude Code 在交握中宣告的 `form` 與 `url` [elicitation 模式](https://code.claude.com/docs/zh-TW/mcp.md#elicitation-modes-claude-code-declares)。訊息如下:3786一個以 Java MCP SDK 0.11.0 至 0.17.0 建置的 MCP 伺服器拒絕了連線。這些 SDK 版本無法解析 Claude Code 在其交握中宣告的 `form` 與 `url` [elicitation 模式](https://code.claude.com/docs/zh-TW/mcp.md#elicitation-modes-claude-code-declares)。訊息如下:
3775 3787
3776```text theme={null}3788```text theme={null}
3777This server (Java MCP SDK 0.17.0 or older) rejected Claude Code's elicitation capability. Set "bareElicitationCapability": true for it, or upgrade to Java MCP SDK 0.17.1+ (Spring AI 1.0.7+ or 1.1.6+).3789This server (Java MCP SDK 0.17.0 or older) rejected Claude Code's elicitation capability. Set "bareElicitationCapability": true for it, or upgrade to Java MCP SDK 0.17.1+ (Spring AI 1.0.7+ or 1.1.6+).
3779 3791
3780**處理方式:**3792**處理方式:**
3781 3793
3782* 將伺服器升級至 Java MCP SDK 0.17.1 或更新版本,或升級至訊息所指名的其中一個 Spring AI 版本3794* 將伺服器升級至 Java MCP SDK 0.17.1 或更新版本,或升級至訊息所列的其中一個 Spring AI 版本
3783* 或者,在您的 MCP 設定中將 `"bareElicitationCapability": true` 新增到該伺服器的項目,然後重新啟動 Claude Code。此欄位適用於 stdio、`sse`、`http` 和 `ws` 項目,且需要 Claude Code v2.1.281 或更新版本3795* 或在您 MCP 設定中該伺服器的項目加上 `"bareElicitationCapability": true`,然後重新啟動 Claude Code。此欄位可用於 stdio、`sse`、`http` 與 `ws` 項目,且需要 Claude Code v2.1.281 或更新版本
3784 3796
3785以下 `.mcp.json` 項目為一個 HTTP 伺服器設定此欄位:3797下列 `.mcp.json` 項目為一個 HTTP 伺服器設定此欄位:
3786 3798
3787```json theme={null}3799```json theme={null}
3788{3800{
3796}3808}
3797```3809```
3798 3810
3799重新啟動後,`/mcp` 會將該伺服器顯示為已連線。Claude Code 只會對該伺服器宣告 form 模式,因此在升級伺服器後請移除此欄位。3811重新啟動後,`/mcp` 會顯示該伺服器已連線。Claude Code 只對該伺服器宣告 form 模式,因此在您升級該伺服器後,請移除此欄位。
3800 3812
3801伺服器也可能以其本身的錯誤文字失敗,例如包含 `Unrecognized field "form"` 的錯誤。適用相同的修正方式。3813伺服器也可能以其自身的錯誤文字失敗,例如包含 `Unrecognized field "form"` 的訊息。相同的修正方式同樣適用。
3802 3814
3803### 找不到 MCP 權限提示工具3815### 找不到 MCP 權限提示工具
3804 3816
3805您傳給 [`--permission-prompt-tool`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 的工具在執行首次需要權限決定時,不在已連線的 MCP 工具之中,原因可能是其伺服器從未連線,或沒有任何已連線的伺服器提供該名稱的工具。Claude Code 仍會傳送您的提示詞:[非互動](https://code.claude.com/docs/zh-TW/headless.md)執行會在第一次工具呼叫時以此錯誤與退出碼 1 結束,因此即使已發出請求,也不會產生任何回答。在第一次提示之前,Claude Code 會等待該伺服器連線,最長等待由 [`MCP_TIMEOUT`](https://code.claude.com/docs/zh-TW/env-vars) 設定的每個伺服器 30 秒連線逾時。在 v2.1.206 之前,啟動時不會等待伺服器完成連線,因此啟動緩慢但正常的伺服器也會產生此錯誤。3817您傳給 [`--permission-prompt-tool`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 的工具在該次執行首次需要權限決定時,並不在已連線的 MCP 工具之中,原因可能是其伺服器從未連線,或沒有任何已連線的伺服器提供該名稱的工具。Claude Code 仍會送出您的提示詞:[非互動](https://code.claude.com/docs/zh-TW/headless.md)執行會在第一次工具呼叫時以此錯誤及退出碼 1 結束,因此即使已送出請求,也不會產生任何答案。在第一個提示詞之前,Claude Code 會等待該伺服器連線,最長等待時間為由 [`MCP_TIMEOUT`](https://code.claude.com/docs/zh-TW/env-vars) 設定的每個伺服器連線逾時 30 秒。在 v2.1.206 之前,啟動時不會等待伺服器完成連線,因此啟動較慢但運作正常的伺服器也會產生此錯誤。
3806 3818
3807```text theme={null}3819```text theme={null}
3808Error: MCP tool mcp__permissions__approve (passed via --permission-prompt-tool) not found. Available MCP tools: none3820Error: MCP tool mcp__permissions__approve (passed via --permission-prompt-tool) not found. Available MCP tools: none
3809```3821```
3810 3822
3811`Available MCP tools:` 之後的清單列出已連線的 MCP 工具。3823`Available MCP tools:` 之後的清單列出了已連線的 MCP 工具。
3812 3824
3813**處理方式:**3825**處理方式:**
3814 3826
3815* 確認伺服器能啟動並保持連線:在相同目錄中執行 `claude mcp list`,並確認該伺服器被列為已連線3827* 確認伺服器能啟動並保持連線:在相同目錄中執行 `claude mcp list`,確認該伺服器列為已連線
3816* 確認工具名稱與伺服器所提供的 `mcp__<server>__<tool>` 名稱相符3828* 確認工具名稱與伺服器所提供的 `mcp__<server>__<tool>` 名稱相符
3817* 如果伺服器需要超過 30 秒才能啟動,請調高 [`MCP_TIMEOUT`](https://code.claude.com/docs/zh-TW/env-vars)3829* 如果伺服器需要超過 30 秒才能啟動,請提高 [`MCP_TIMEOUT`](https://code.claude.com/docs/zh-TW/env-vars)
3818 3830
3819### OAuth 回呼連接埠已被使用3831### OAuth callback port is already in use
3820 3832
3821當您以 OAuth 登入遠端 MCP 伺服器時,Claude Code 會啟動本機監聽器來接收登入回呼。如果該監聽器所需的連接埠被其他程序佔用,登入就會以此訊息失敗。這大多發生在透過 [`MCP_OAUTH_CALLBACK_PORT`](https://code.claude.com/docs/zh-TW/env-vars) 變數或 `--callback-port` 設定了[固定回呼連接埠](https://code.claude.com/docs/zh-TW/mcp.md#use-a-fixed-oauth-callback-port)時,因為若未設定,Claude Code 會挑選一個可用的連接埠。3833當您以 OAuth 登入遠端 MCP 伺服器時,Claude Code 會啟動一個本機監聽器來接收登入回呼。如果該監聽器所需的連接埠被其他程序佔用,登入會以此訊息失敗。這種情況大多發生在透過 [`MCP_OAUTH_CALLBACK_PORT`](https://code.claude.com/docs/zh-TW/env-vars) 變數或 `--callback-port` 設定了[固定回呼連接埠](https://code.claude.com/docs/zh-TW/mcp.md#use-a-fixed-oauth-callback-port)時,因為若未設定,Claude Code 會挑選可用的連接埠。
3822 3834
3823```text theme={null}3835```text theme={null}
3824OAuth callback port <port> is already in use — another process may be holding it. Run `lsof -ti:<port> -sTCP:LISTEN` to find it.3836OAuth callback port <port> is already in use — another process may be holding it. Run `lsof -ti:<port> -sTCP:LISTEN` to find it.
3825```3837```
3826 3838
3827在 Windows 上,建議的命令改為 `netstat -ano | findstr :<port>`。3839在 Windows 上,建議的命令則是 `netstat -ano | findstr :<port>`。
3828 3840
3829**處理方式:**3841**處理方式:**
3830 3842
3831* 執行訊息中的命令以找出佔用該連接埠的程序,然後停止它或等待它結束3843* 執行訊息中的命令以找出佔用該連接埠的程序,並停止它或等待其結束
3832* 如果另一個程式需要永久使用該連接埠,請向伺服器註冊不同的重新導向 URI,並以 `MCP_OAUTH_CALLBACK_PORT` 或 `--callback-port`(視您使用哪一個而定)設定其連接埠3844* 如果另一個程式需要永久使用該連接埠,請向伺服器註冊不同的重新導向 URI,並使用 `MCP_OAUTH_CALLBACK_PORT` 或 `--callback-port`(以您使用的為準)設定其連接埠
3833* 然後再次開始登入,例如在 `/mcp` 中選取該伺服器3845* 然後重新開始登入,例如在 `/mcp` 中選取該伺服器
3834 3846
3835### 沒有可用於 OAuth 重新導向的連接埠3847### No available ports for OAuth redirect
3836 3848
3837當您以 [OAuth](https://code.claude.com/docs/zh-TW/mcp.md#authenticate-with-remote-mcp-servers) 登入遠端 MCP 伺服器時,Claude Code 會啟動本機監聽器來接收登入回呼。當 Claude Code 無法為其繫結本機連接埠時,登入就會以此訊息失敗。機器上有某些東西阻止它在 `127.0.0.1` 上監聽,例如安全性軟體或拒絕本機監聽器的沙箱政策。3849當您以 [OAuth](https://code.claude.com/docs/zh-TW/mcp.md#authenticate-with-remote-mcp-servers) 登入遠端 MCP 伺服器時,Claude Code 會啟動一個本機監聽器來接收登入回呼。當 Claude Code 無法為其繫結本機連接埠時,登入會以此訊息失敗。電腦上有某些東西阻止它在 `127.0.0.1` 上監聽,例如安全性軟體或拒絕本機監聽器的沙箱政策。
3838 3850
3839```text theme={null}3851```text theme={null}
3840No available ports for OAuth redirect3852No available ports for OAuth redirect
3841```3853```
3842 3854
3843在 v2.1.268 之前,Claude Code 不會改用作業系統指派的連接埠,因此當只有它自行挑選的連接埠無法繫結時,也會出現此訊息。這可能發生在 Hyper-V 保留的連接埠範圍涵蓋 Claude Code 挑選範圍的 Windows 主機上。3855在 v2.1.268 之前,Claude Code 不會改用作業系統指派的連接埠,因此當只是它自行挑選的連接埠無法繫結時,也會出現此訊息。這可能發生在 Hyper-V 保留了涵蓋 Claude Code 挑選範圍之連接埠區段的 Windows 主機上。
3844 3856
3845**處理方式:**3857**處理方式:**
3846 3858
3847* 檢查是否有安全性軟體或沙箱政策阻止程序在 `127.0.0.1` 上監聽,並允許 Claude Code 繫結本機連接埠3859* 檢查是否有安全性軟體或沙箱政策阻止程序在 `127.0.0.1` 上監聽,並允許 Claude Code 繫結本機連接埠
3848* 然後再次開始登入,例如在 `/mcp` 中選取該伺服器3860* 然後重新開始登入,例如在 `/mcp` 中選取該伺服器
3849 3861
3850### 沒有 origin/HEAD 時 /security-review 失敗3862### 缺少 origin/HEAD 時 /security-review 失敗
3851 3863
3852[`/security-review`](https://code.claude.com/docs/zh-TW/commands#all-commands) 會將您的分支與 `origin/HEAD`(記錄您 `origin` 遠端上哪個分支為預設分支的本機 ref)進行差異比對,以建立其審查上下文。當該 ref 不存在時,收集差異的 git 命令會失敗,審查會在開始前就停止。3864[`/security-review`](https://code.claude.com/docs/zh-TW/commands#all-commands) 會將您的分支與 `origin/HEAD` 進行差異比對來建立其審查脈絡;`origin/HEAD` 是記錄您 `origin` 遠端上哪個分支為預設分支的本機 ref。當該 ref 不存在時,收集差異的 git 命令會失敗,審查會在開始前就停止。
3853 3865
3854```text theme={null}3866```text theme={null}
3855Error: Shell command failed for pattern "!`git diff --name-only origin/HEAD...`": [stderr]3867Error: Shell command failed for pattern "!`git diff --name-only origin/HEAD...`": [stderr]
3858'git <command> [<revision>...] -- [<file>...]'3870'git <command> [<revision>...] -- [<file>...]'
3859```3871```
3860 3872
3861訊息可能會改為引用 `git log` 或其他 `git diff`。只有當遠端公告了預設分支,且您的 fetch refspec 涵蓋它時,Git 才會建立 `origin/HEAD`;對含有提交的遠端執行完整的 `git clone` 就會如此。在以下設定中,該參照會不存在:3873訊息引用的也可能是 `git log` 或其他 `git diff` 命令。只有當遠端公告了預設分支且您的 fetch refspec 涵蓋該分支時,Git 才會建立 `origin/HEAD`;對含有提交的遠端執行完整的 `git clone` 就會如此。在下列設定中,該 ref 會不存在:
3862 3874
3863* 單一分支或 CI 的 checkout,其擷取的 refspec 範圍過窄3875* 單一分支或 CI 的 checkout,其擷取的 refspec 範圍太窄
3864* 伺服器端 HEAD 指向無人推送過之分支的遠端3876* 伺服器端 HEAD 指向一個從未有人推送之分支的遠端
3865* 沒有 `origin` 遠端的儲存庫,或您從未擷取過的遠端3877* 沒有 `origin` 遠端的儲存庫,或您從未擷取過的遠端
3866 3878
3867對於任何[注入動態上下文](https://code.claude.com/docs/zh-TW/skills.md#when-an-injected-command-fails)的 skill,Claude Code 都會顯示相同的錯誤,而注入的命令失敗會中止該 skill 的呼叫。3879對於任何[注入動態脈絡](https://code.claude.com/docs/zh-TW/skills.md#when-an-injected-command-fails)的 skill,Claude Code 都會顯示相同的錯誤,而失敗的注入命令會中止該 skill 的呼叫。
3868 3880
3869以下同類字串會在命令執行之前就觸發:3881相關的訊息會在命令執行之前就出現:
3870 3882
3871* `Shell command permission check failed for pattern "..."`:命令的權限檢查未允許它。請參閱[注入命令的權限檢查](https://code.claude.com/docs/zh-TW/skills.md#permission-checks-on-injected-commands),了解在各權限模式下哪些結果會中止,以及 `allowed-tools` 何時會預先核准命令3883* `Shell command permission check failed for pattern "..."`:命令的權限檢查不允許執行它。請參閱[注入命令的權限檢查](https://code.claude.com/docs/zh-TW/skills.md#permission-checks-on-injected-commands),了解在各權限模式下哪些結果會中止,以及 `allowed-tools` 何時會預先核准命令
3872* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``:該 skill 的 frontmatter 要求 bash,但電腦上沒有 bash。請安裝 Git for Windows,或將 frontmatter 改為 `shell: powershell`。請參閱[注入命令的執行方式](https://code.claude.com/docs/zh-TW/skills.md#how-injected-commands-run)3884* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``:skill 的 frontmatter 要求在沒有 bash 的電腦上使用 bash。請安裝 Git for Windows,或將 frontmatter 改為 `shell: powershell`。請參閱[注入命令的執行方式](https://code.claude.com/docs/zh-TW/skills.md#how-injected-commands-run)
3873 3885
3874**處理方式:**3886**處理方式:**
3875 3887
3876* 指定遠端的預設分支來建立該參照:`git remote set-head origin <default-branch>`。只要本機追蹤參照 `origin/<default-branch>` 存在,這就能運作。如果它不存在(例如在單一分支複製中),請先擷取該分支:執行 `git remote set-branches --add origin <branch>`,接著執行 `git fetch origin`,然後重新執行 set-head 命令。再重新執行 `/security-review`。3888* 指定遠端的預設分支以建立該 ref:`git remote set-head origin <default-branch>`。只要本機追蹤 ref `origin/<default-branch>` 存在,這就能運作。如果它不存在(例如在單一分支的 clone 中),請先擷取該分支:執行 `git remote set-branches --add origin <branch>`,然後執行 `git fetch origin`,再重新執行 set-head 命令。接著重新執行 `/security-review`。
3877* 如果您不想指定分支名稱,請執行 `git fetch origin`,然後執行 `git remote set-head origin --auto`,它會詢問遠端哪個分支是預設分支。當遠端沒有公告預設分支(因為它是空的,或其 HEAD 指向無人推送的分支)時,它會以 `error: Cannot determine remote HEAD` 失敗;此時請明確指定分支。當您的複製不擷取該分支時,它會以 `error: Not a valid ref` 失敗;請先如上所述擴大 refspec。3889* 如果您不想指定分支,請執行 `git fetch origin`,然後執行 `git remote set-head origin --auto`,它會詢問遠端哪個分支是其預設分支。當遠端未公告預設分支(因為它是空的,或其 HEAD 指向一個從未有人推送的分支)時,它會以 `error: Cannot determine remote HEAD` 失敗;此時請改為明確指定分支。當您的 clone 不會擷取該分支時,它會以 `error: Not a valid ref` 失敗;請先依上述方式擴大 refspec。
3878* 如果儲存庫沒有遠端,請使用 `git remote add origin <url>` 新增一個,並在建立參照前先擷取。如果遠端是空的,請先使用 `git push -u origin HEAD` 推送您的分支,並在 set-head 命令中指定該分支;之後 `origin/HEAD` 會指向您剛推送的分支,因此在您的分支與其分歧之前,`/security-review` 看到的差異都會是空的。3890* 如果儲存庫沒有遠端,請使用 `git remote add origin <url>` 新增一個,並在建立 ref 之前先擷取。如果遠端是空的,請先使用 `git push -u origin HEAD` 推送您的分支,並在 set-head 命令中指定該分支;`origin/HEAD` 之後會指向您剛推送的分支,因此在您的分支與其分歧之前,`/security-review` 會看到空的差異。
3879 3891
3880### No shell command in a skill or command was run3892### skill 或命令中的 shell 命令未被執行
3881 3893
3882`No shell command in <name> was run` 表示該 skill 或命令檔案中的某個 `` !`<command>` `` [動態上下文命令](https://code.claude.com/docs/zh-TW/skills.md#inject-dynamic-context)包含 Bash 或 PowerShell 工具會拒絕的字元:3894`No shell command in <name> was run` 表示該 skill 或命令檔案中的某個 `` !`<command>` `` [動態脈絡命令](https://code.claude.com/docs/zh-TW/skills.md#inject-dynamic-context)包含 Bash 或 PowerShell 工具會拒絕的字元:
3883 3895
3884* **任一工具**:除 tab 或換行以外的原始控制字元3896* **兩種工具皆然**:除了 tab 或換行以外的原始控制字元
3885* **PowerShell 工具**:另外還有 U+FEFF 或 U+180E3897* **PowerShell 工具**:另外還有 U+FEFF 或 U+180E
3886 3898
3887訊息會以被拒絕的命令結尾,並將每個被拒絕的字元顯示為 `�`,如以下 Bash 工具的範例:3899訊息會以被拒絕的命令結尾,並將每個被拒絕的字元顯示為 `�`,如下列 Bash 工具的範例:
3888 3900
3889```text theme={null}3901```text theme={null}
3890No shell command in /my-skill was run, because the Bash tool does not accept one of them: command contains control characters that would be hidden in the approval dialog. Unprintable characters are shown as � below: remove them from the skill or command file, or from the arguments or options substituted into it.3902No shell command in /my-skill was run, because the Bash tool does not accept one of them: command contains control characters that would be hidden in the approval dialog. Unprintable characters are shown as � below: remove them from the skill or command file, or from the arguments or options substituted into it.
3895 3907
3896* 在訊息結尾引用的命令中找出每個 `�`。從 [skill 或命令檔案](https://code.claude.com/docs/zh-TW/skills.md#where-skills-live)中,或從代入該檔案的引數或[選項](https://code.claude.com/docs/zh-TW/plugins/manifest-reference.md#user-configuration)中,移除它所代表的字元。3908* 在訊息結尾引用的命令中找出每個 `�`。從 [skill 或命令檔案](https://code.claude.com/docs/zh-TW/skills.md#where-skills-live)中,或從代入該檔案的引數或[選項](https://code.claude.com/docs/zh-TW/plugins/manifest-reference.md#user-configuration)中,移除它所代表的字元。
3897 3909
3898### 使用 `--print` 時必須提供輸入3910### skill、命令或 hook 超過 4,000,000 字元的限制
3899 3911
3900單獨執行 `claude` 需要 stdout 是終端機,才能啟動互動式 UI。當 stdout 被重新導向,或主控台不是真正的終端機(例如 PowerShell ISE 與某些 IDE 輸出窗格)時,`claude` 會改以[非互動方式](https://code.claude.com/docs/zh-TW/headless.md)執行。這與 `claude -p` 是相同的模式,而該模式需要提示詞,因此即使您沒有傳入該旗標,訊息也會提到 `--print`。在任何地方傳入 `-p`/`--print` 卻沒有提示詞、stdin 也沒有透過管線傳入任何內容,都會產生相同的錯誤。3912包含 `more than 4,000,000 characters` 的訊息表示某個 skill、命令或 [prompt 或 agent hook](https://code.claude.com/docs/zh-TW/hooks.md#prompt-and-agent-hook-fields) 未執行。如果您將長文字貼上作為引數,請將其存成檔案,並執行 `/clear`(因為該文字會留在對話中),然後傳入其路徑。在 [Code Mode](https://code.claude.com/docs/zh-TW/code-mode.md#tool-call-refused-by-a-hook) 之外,超過限制的 `PreToolUse` prompt 或 agent hook 不會阻擋該呼叫。請改用沒有此限制的 [command hook](https://code.claude.com/docs/zh-TW/hooks.md#command-hook-fields)。
3913
3914### Input must be provided when using `--print`
3915
3916單純的 `claude` 需要 stdout 是終端機才能啟動互動式 UI。當 stdout 被重新導向,或主控台不是真正的終端機(例如 PowerShell ISE 與部分 IDE 輸出窗格)時,`claude` 會改為以[非互動方式](https://code.claude.com/docs/zh-TW/headless.md)執行。這與 `claude -p` 是相同的模式,而該模式需要提示詞,因此即使您沒有傳入該旗標,訊息仍會提到 `--print`。在任何地方傳入 `-p`/`--print` 卻沒有提示詞,且 stdin 也沒有透過管線傳入任何內容,都會產生相同的錯誤。
3901 3917
3902```text theme={null}3918```text theme={null}
3903Error: Input must be provided either through stdin or as a prompt argument when using --print3919Error: Input must be provided either through stdin or as a prompt argument when using --print
3905 3921
3906**處理方式:**3922**處理方式:**
3907 3923
3908* 若要互動使用,請在真正的終端機中執行 `claude`:使用 Windows Terminal 或 PowerShell 主控台而非 ISE,並使用 IDE 的整合式終端機而非輸出窗格3924* 若要互動式使用,請在真正的終端機中執行 `claude`:使用 Windows Terminal 或 PowerShell 主控台而非 ISE,並使用 IDE 的整合式終端機而非輸出窗格
3909* 若要單次使用,請傳入提示詞:`claude -p "your question"`,或以 `echo "your question" | claude -p` 透過管線傳入3925* 若要單次使用,請傳入提示詞:`claude -p "your question"`,或以 `echo "your question" | claude -p` 透過管線傳入
3910 3926
3911### Claude Code 無法在此讀取鍵盤3927### Claude Code can't read the keyboard here
3912 3928
3913您在不帶 [`-p`](https://code.claude.com/docs/zh-TW/headless) 的情況下執行了 `claude`,這會啟動[互動式工作階段](https://code.claude.com/docs/zh-TW/interactive-mode.md),但其標準輸入不是終端機。有東西透過管線傳送或重新導向了它,或是啟動 `claude` 的程式提供了它自己的輸入串流。3929您在未加上 [`-p`](https://code.claude.com/docs/zh-TW/headless) 的情況下執行了 `claude`,這會啟動[互動式工作階段](https://code.claude.com/docs/zh-TW/interactive-mode.md),但其標準輸入不是終端機。可能是某些內容透過管線傳入或重新導向了標準輸入,或是啟動 `claude` 的程式提供了自己的輸入串流。
3914 3930
3915互動式工作階段需要從終端機讀取您的按鍵,而沒有終端機時 Claude Code 的行為取決於您的平台:3931互動式工作階段需要終端機來讀取您的按鍵輸入,而 Claude Code 在沒有終端機時的行為取決於您的平台:
3916 3932
3917* **Windows**:Claude Code 會將訊息列印到 stderr 並以退出碼 1 結束,而不會啟動介面3933* **Windows**:Claude Code 會將訊息輸出到 stderr 並以代碼 1 結束,而不會啟動介面
3918* **macOS 與 Linux**:Claude Code 會從 `/dev/tty` 讀取您的按鍵並啟動工作階段,並以任何透過管線傳入的文字作為您的第一個提示詞。當 `/dev/tty` 無法開啟時,您會看到此訊息,其第一行會以 `/dev/tty` 取代 Windows 的措辭。3934* **macOS 與 Linux**:Claude Code 會從 `/dev/tty` 讀取您的按鍵輸入並啟動工作階段,並將任何透過管線傳入的文字作為您的第一個提示詞。只有在無法開啟 `/dev/tty` 時才會看到此訊息,且其第一行會以 `/dev/tty` 取代 Windows 版的措辭。
3919 3935
3920在 Windows 上,訊息內容如下:3936在 Windows 上,訊息內容如下:
3921 3937
3927 3943
3928**處理方式:**3944**處理方式:**
3929 3945
3930* 若要互動工作,請直接在終端機中執行 `claude`,不要透過管線傳送或重新導向其輸入3946* 若要以互動方式工作,請直接在終端機中執行 `claude`,不要透過管線傳入或重新導向其輸入
3931* 若要在沒有互動式介面的情況下取得回覆(例如從指令碼),請加上 `-p`,並以引數或透過 stdin 提供提示詞,例如 `claude -p "your question"` 或 `echo "your question" | claude -p`。這也適用於 `--continue` 與 `--resume <session-id>`。3947* 若要在不使用互動式介面的情況下取得回覆(例如從指令碼中),請加上 `-p`,並以引數或透過 stdin 提供提示詞,例如 `claude -p "your question"` 或 `echo "your question" | claude -p`。這同樣適用於 `--continue` 與 `--resume <session-id>`。
3932 3948
3933在 v2.1.287 之前,Claude Code 會啟動介面而不是列印此訊息,然後要嘛畫面上什麼都不顯示,要嘛以包含 `Raw mode is not supported` 的錯誤失敗。3949在 v2.1.287 之前,Claude Code 會啟動介面而不是輸出此訊息,接著要麼畫面上什麼都不顯示,要麼以包含 `Raw mode is not supported` 的錯誤失敗。
3934 3950
3935如果您是在執行 `claude install` 時看到 `Raw mode is not supported`,請參閱[安裝期間出現 `Raw mode is not supported`](https://code.claude.com/docs/zh-TW/troubleshoot-install#raw-mode-is-not-supported-during-install)。3951如果您是在 `claude install` 期間看到 `Raw mode is not supported`,請參閱[安裝期間出現 `Raw mode is not supported`](https://code.claude.com/docs/zh-TW/troubleshoot-install#raw-mode-is-not-supported-during-install)。
3936 3952
3937### 輸入只包含空白字元3953### Input contained only whitespace
3938 3954
3939在[非互動模式](https://code.claude.com/docs/zh-TW/headless.md)中,Claude Code 會拒絕完全由空格、定位字元或換行組成的提示詞,而不會傳送它,因為 API 會拒絕沒有可見文字的訊息。您看到哪則訊息取決於空白提示詞的來源:3955在[非互動模式](https://code.claude.com/docs/zh-TW/headless.md)中,Claude Code 會拒絕完全由空格、定位字元或換行組成的提示詞,而不會將其送出,因為 API 會拒絕沒有可見文字的訊息。您看到的訊息取決於空白提示詞的來源:
3940 3956
3941* **`claude -p` 的提示詞引數或透過管線傳入的 stdin**:`claude` 會以 `Error: Input contained only whitespace. Provide a prompt with text through stdin or as a prompt argument when using --print` 結束3957* **`claude -p` 的提示詞引數或透過管線傳入的 stdin**:`claude` 會以 `Error: Input contained only whitespace. Provide a prompt with text through stdin or as a prompt argument when using --print` 結束
3942* **提交到執行中的 `--input-format stream-json` 或 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 工作階段的訊息**:Claude Code 會在不呼叫模型的情況下結束該回合,工作階段仍可繼續使用。拒絕會以資訊訊息以及該回合的結果文字送達:`Blank prompt — the message was only whitespace, so nothing was sent to the model.`3958* **提交到執行中的 `--input-format stream-json` 或 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 工作階段的訊息**:Claude Code 會在不呼叫模型的情況下結束該回合,且工作階段仍可繼續使用。拒絕會以資訊訊息以及該回合的結果文字形式傳回:`Blank prompt — the message was only whitespace, so nothing was sent to the model.`
3943 3959
3944在 v2.1.229 之前,Claude Code 會將只含空白的訊息傳送給 API,而 API 會以 400 錯誤拒絕該請求。3960在 v2.1.229 之前,Claude Code 會將僅含空白的訊息傳送給 API,而 API 會以 400 錯誤拒絕該請求。
3945 3961
3946**處理方式:**3962**處理方式:**
3947 3963
3948* 在提示詞中加入可見的文字。如果指令碼是從變數或檔案建立提示詞,請在呼叫 Claude Code 之前確認來源不是空的。3964* 在提示詞中包含可見文字。如果指令碼是從變數或檔案建構提示詞,請在呼叫 Claude Code 之前確認來源不是空的。
3949 3965
3950### stream-json 輸入超過 256M 個字元且沒有換行3966### stream-json input carried over 256M characters with no newline
3951 3967
3952您的程式在 stdin 上向 `claude -p --input-format stream-json` 執行傳送了超過 268,435,456 個字元且沒有換行,因此 Claude Code 會將此錯誤列印到 stderr 並以退出碼 1 結束,而不會繼續緩衝更多輸入。訊息中將此上限表示為 `256M`。在 v2.1.257 之前,Claude Code 會無限制地緩衝此類輸入,使記憶體持續增長,直到程序當機或被終止。3968您的程式在沒有換行的情況下,透過 stdin 向 `claude -p --input-format stream-json` 執行傳送了超過 268,435,456 個字元,因此 Claude Code 會將此錯誤輸出到 stderr 並以代碼 1 結束,而不會繼續緩衝更多輸入。訊息中以 `256M` 表示此上限。在 v2.1.257 之前,Claude Code 會無限制地緩衝此類輸入,使記憶體持續增長,直到程序當機或被終止。
3953 3969
3954```text theme={null}3970```text theme={null}
3955Error: 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.3971Error: 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.
3956```3972```
3957 3973
3958這麼長卻沒有換行的輸入,通常表示產生者根本不是 stream-json 產生者,例如意外透過管線傳入的二進位檔案或純文字日誌輸出。單一訊息超過此上限也會未通過相同的檢查。3974如此長且沒有換行的輸入,通常表示產生者根本不是 stream-json 產生者,例如不小心透過管線傳入的二進位檔案或純文字日誌輸出。單一訊息超過上限也會在同一項檢查中失敗。
3959 3975
3960**處理方式:**3976**處理方式:**
3961 3977
3962* 檢查透過管線傳入 stdin 的內容。使用 [`--input-format stream-json`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 時,每則訊息都必須是以換行結尾的一行 JSON3978* 檢查透過管線傳入 stdin 的內容。使用 [`--input-format stream-json`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 時,每則訊息都必須是一行以換行結尾的 JSON
3963* 若要改為傳送純文字,請移除 `--input-format stream-json`;`claude -p` 預設會從 stdin 讀取純文字提示詞3979* 若要改為傳送純文字,請移除 `--input-format stream-json`;`claude -p` 預設會從 stdin 讀取純文字提示詞
3964 3980
3965### 未知的命令3981### Unknown command
3966 3982
3967在互動式終端機工作階段中,您提交了一個與此工作階段中任何命令都不相符的 `/` 名稱,因此 Claude Code 會回報該名稱,而不會執行任何動作:3983在互動式終端機工作階段中,您提交了一個與此工作階段中任何命令都不相符的 `/` 名稱,因此 Claude Code 會回報該名稱,而不會執行任何動作:
3968 3984
3970Unknown command: /hepl. Did you mean /help?3986Unknown command: /hepl. Did you mean /help?
3971```3987```
3972 3988
3973Claude Code 會建議選單在此工作階段中列出的最接近的命令名稱或別名。當沒有相近的名稱時,訊息會在名稱之後結束。原因通常是以下其中之一:3989Claude Code 會建議此工作階段中選單所列出、最接近的命令名稱或別名。若沒有相近的名稱,訊息會在名稱之後結束。原因通常是下列其中之一:
3974 3990
3975* 打字錯誤,例如將 `/help` 打成 `/hepl`。[命令選單如何比對您輸入的內容](https://code.claude.com/docs/zh-TW/commands.md#how-the-command-menu-matches-what-you-type)說明了如何在提交前挑選相近的符合項目3991* 打字錯誤,例如將 `/help` 打成 `/hepl`。[命令選單如何比對您輸入的內容](https://code.claude.com/docs/zh-TW/commands.md#how-the-command-menu-matches-what-you-type)說明了如何在提交前選擇相近的符合項目
3976* 命令存在,但由於未滿足某項要求(例如您的平台、方案或身分驗證方式),在此工作階段中無法使用。請參閱 [`/web-setup`](https://code.claude.com/docs/zh-TW/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command)、[`/schedule`](https://code.claude.com/docs/zh-TW/routines#schedule-returns-unknown-command) 或 [`/auto-mode-setup`](https://code.claude.com/docs/zh-TW/auto-mode-config#auto-mode-setup-returns-unknown-command) 的相關項目。某些命令在您組織的政策停用它們時,會以自己的訊息回應,例如 [`Cloud sessions are disabled by your organization's policy`](#cloud-sessions-are-disabled-by-your-organizations-policy)3992* 命令存在,但因為未符合某項需求(例如您的平台、方案或身分驗證方式)而無法在此工作階段中使用。請參閱 [`/web-setup`](https://code.claude.com/docs/zh-TW/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command)、[`/schedule`](https://code.claude.com/docs/zh-TW/routines#schedule-returns-unknown-command) 或 [`/auto-mode-setup`](https://code.claude.com/docs/zh-TW/auto-mode-config#auto-mode-setup-returns-unknown-command) 的對應項目。某些命令在您組織的政策停用它們時,會以自己的訊息回應,例如 [`Cloud sessions are disabled by your organization's policy`](#cloud-sessions-are-disabled-by-your-organizations-policy)
3977* 來自[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)或 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md#use-mcp-prompts-as-commands)的命令,但該外掛或伺服器在此工作階段中未安裝或未連線3993* 來自[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)或 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md#use-mcp-prompts-as-commands)的命令,但該外掛或伺服器未在此工作階段中安裝或連線
3978 3994
3979只有在互動式終端機工作階段中,Claude Code 才會以這種方式回應不相符的 `/` 名稱。在其他所有工作階段中,它會改將提示詞作為一般訊息傳送給 Claude,並附上一則說明該命令未執行的備註,以及 Claude 在該工作階段中可執行的命令清單。這些工作階段包括:3995Claude Code 只會在互動式終端機工作階段中以這種方式回應不相符的 `/` 名稱。在所有其他工作階段中,它會改為將提示詞作為一般訊息傳送給 Claude,並附上說明命令未執行的註記,以及 Claude 可在該工作階段中執行的命令清單。這些工作階段包括:
3980 3996
3981* `-p` 執行3997* `-p` 執行
3982* [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 應用程式3998* [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 應用程式
3984* [VS Code 擴充功能](https://code.claude.com/docs/zh-TW/vs-code.md)的聊天面板4000* [VS Code 擴充功能](https://code.claude.com/docs/zh-TW/vs-code.md)的聊天面板
3985* [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)與[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)4001* [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)與[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)
3986 4002
3987對於無法在這些工作階段之一中執行的內建命令,Claude Code 仍會回應該命令無法使用,而不是將其傳送給 Claude。在 v2.1.274 之前,只有雲端工作階段與雲端排程任務會將不相符的名稱傳送給 Claude。在 v2.1.273 之前,它們也會回應 `Unknown command`。4003對於無法在上述工作階段中執行的內建命令,Claude Code 仍會回應該命令無法使用,而不會將其傳送給 Claude。在 v2.1.274 之前,只有雲端工作階段與雲端排程任務會將不相符的名稱傳送給 Claude。在 v2.1.273 之前,它們同樣會回應 `Unknown command`。
3988 4004
3989Claude Code 不會將每個以 `/` 開頭的提示詞都視為命令。當 `/` 之後的第一個字以標點符號開頭(例如開啟 Lean 文件註解的 `/--`),或是像 `/var/log/syslog` 這樣的路徑時,它會將提示詞作為一般訊息傳送給 Claude。4005Claude Code 不會將每個以 `/` 開頭的提示詞都視為命令。當 `/` 之後的第一個字以標點符號開頭(例如開啟 Lean 文件註解的 `/--`),或是一個路徑(例如 `/var/log/syslog`)時,它會將提示詞作為一般訊息傳送給 Claude。
3990 4006
3991在 v2.1.236 之前,如果您在命令選單列出與您輸入的名稱相近的符合項目時按下 `Enter`,Claude Code 會執行該符合項目,因此像 `/hepl` 這樣的打字錯誤會執行 `/help`,而不是產生此訊息。4007在 v2.1.236 之前,如果您在命令選單列出與您輸入名稱相近的符合項目時按下 `Enter`,Claude Code 會執行該符合項目,因此像 `/hepl` 這樣的打字錯誤會執行 `/help`,而不會產生此訊息。
3992 4008
3993**處理方式:**4009**處理方式:**
3994 4010
3995* 執行建議的名稱,或輸入 `/` 加上名稱的一部分,以查看此工作階段中可用的命令4011* 執行建議的名稱,或輸入 `/` 再加上名稱的一部分,以查看此工作階段中可用的命令
3996* 如果 Claude Code 將文件中記載的命令回報為未知,請查看[命令參考](https://code.claude.com/docs/zh-TW/commands.md)中該命令的列,了解它所指出的需求4012* 如果 Claude Code 將文件中記載的命令回報為未知,請在[命令參考](https://code.claude.com/docs/zh-TW/commands.md)中查看該命令所在列所列出的需求
3997 4013
3998### 差異對 ultrareview 而言過大4014### Diff is too large for ultrareview
3999 4015
4000您的分支與基底分支之間的差異(包括未提交與已暫存的變更)超過了 [ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md) 的大小上限,因此 `/code-review ultra` 與 `claude ultrareview` 子命令會在雲端工作階段啟動前拒絕該審查。被拒絕的審查不會使用免費執行次數,也不會收取用量點數。訊息會指出生效的上限、您的差異大小,以及貢獻最多變更行數的檔案。在 v2.1.216 之前,訊息只顯示原始的差異統計資料。4016您的分支與基礎分支之間的差異(包含未提交與已暫存的變更)超過了 [ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md) 的大小限制,因此 `/code-review ultra` 與 `claude ultrareview` 子命令會在雲端工作階段啟動之前拒絕審查。被拒絕的審查不會用掉免費次數,也不會計費用量點數。訊息會列出目前生效的限制、您的差異大小,以及貢獻最多變更行數的檔案。在 v2.1.216 之前,訊息只會顯示原始的差異統計資料。
4001 4017
4002```text theme={null}4018```text theme={null}
4003Diff 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.4019Diff 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.
4004```4020```
4005 4021
4006審查 pull request 時也適用相同的上限;該形式的訊息以 `PR #<N> is too large for ultrareview` 開頭,並指出該 PR 的檔案數與行數。4022審查 pull request 時適用相同的限制;該形式的訊息以 `PR #<N> is too large for ultrareview` 開頭,並列出該 PR 的檔案數與行數。
4007 4023
4008**處理方式:**4024**處理方式:**
4009 4025
4010* 傳入更接近您工作的基底分支,例如 `/code-review ultra develop`,讓審查只涵蓋與該分支之間的差異4026* 傳入更接近您工作內容的基礎分支,例如 `/code-review ultra develop`,讓審查只涵蓋與該分支之間的差異
4011* 將變更拆分為較小的分支並逐一審查。訊息所指名的檔案貢獻了最多的變更行數,因此請先將它們移到各自的分支。4027* 將變更拆分成較小的分支並分別審查。訊息所列出的檔案貢獻了最多的變更行數,因此請先將這些檔案移到各自的分支。
4012 4028
4013### 找不到與基底分支的 merge-base4029### Could not find merge-base with the base branch
4014 4030
4015`/code-review ultra` 與 `claude ultrareview` 子命令會審查您的分支與基底分支之間的差異,這需要兩者共同擁有的提交。當 `git merge-base` 找不到任何共同提交時,Claude Code 會在雲端工作階段啟動前拒絕該審查。在 Claude Code 能驗證為完整、且至少有一個分支的複製上,它會改為[審查每個被追蹤的檔案](https://code.claude.com/docs/zh-TW/ultrareview.md#diff-limits-and-fallbacks),而不是拒絕。當完全找不到基底分支、Claude Code 無法驗證您的複製是否完整,或在無法進行整棵樹差異比對的少數儲存庫中(例如 SHA-256 物件格式),您會看到此拒絕訊息。4031`/code-review ultra` 與 `claude ultrareview` 子命令會審查您的分支與基礎分支之間的差異,這需要兩者共有的一個提交。當 `git merge-base` 找不到共有提交時,Claude Code 會在雲端工作階段啟動之前拒絕審查。在 Claude Code 能確認為完整、且至少有一個分支的 clone 上,它會改為[審查每個受追蹤的檔案](https://code.claude.com/docs/zh-TW/ultrareview.md#diff-limits-and-fallbacks),而不是拒絕。您會在以下情況看到此拒絕:完全找不到基礎分支、Claude Code 無法確認您的 clone 是否完整,或是在極少數無法進行整個樹狀結構差異比對的儲存庫中,例如使用 SHA-256 物件格式的儲存庫。
4016 4032
4017```text theme={null}4033```text theme={null}
4018Could 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.4034Could 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.
4020 4036
4021第一句之後的提示取決於 Claude Code 觀察到的情況:4037第一句之後的提示取決於 Claude Code 觀察到的情況:
4022 4038
4023* **您沒有傳入基底分支**:Claude Code 與儲存庫的預設分支進行比較,並建議您明確傳入基底分支,如上例所示4039* **您未傳入基礎分支**:Claude Code 會與儲存庫的預設分支比較,並建議您明確傳入基礎分支,如上方範例所示
4024* **您傳入的基底分支已存在於您的複製中**:提示內容為 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``4040* **您傳入的基礎分支原本就在您的 clone 中**:提示內容為 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``
4025* **您傳入的基礎分支不在您的 clone 中**: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 無法判斷您的 clone 是否為淺層 clone 時,則會改為建議 `git fetch --unshallow origin`。在 v2.1.221 之前,提示會對每個擷取的基礎分支都建議 `git fetch --unshallow origin`,而在完整的 clone 上,該命令會以 `fatal: --unshallow on a complete repository does not make sense` 失敗。4041* **您傳入的基礎分支不在您的 clone 中**: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 無法判斷您的 clone 是否為淺層 clone 時,則會改為建議 `git fetch --unshallow origin`。在 v2.1.221 之前,對於每個擷取的基礎分支,提示都會建議 `git fetch --unshallow origin`,而在完整的 clone 上,該命令會以 `fatal: --unshallow on a complete repository does not make sense` 失敗。
4026 4042
4027**處理方式:**4043**處理方式:**
4028 4044
4029* 如果另一個分支才是您真正的基底,請明確傳入它:`/code-review ultra <branch>`4045* 如果另一個分支才是您真正的基礎分支,請明確傳入:`/code-review ultra <branch>`
4030* 如果您的複製可能沒有完整歷史,請執行 `git fetch --unshallow origin` 並重新執行審查4046* 如果您的 clone 可能沒有完整的歷史記錄,請執行 `git fetch --unshallow origin` 並重新執行審查
4031 4047
4032### 您的 checkout 沒有任何分支4048### Your checkout has no branches
4033 4049
4034checkout 可能有提交卻沒有分支:如果您執行 `git init`,接著執行 `git fetch <url>` 與 `git checkout FETCH_HEAD`,就會得到一個沒有任何參照的分離 HEAD。Claude Code 會將您的儲存庫打包為 git bundle 以上傳進行 [ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md),而它無法打包沒有分支或其他參照的儲存庫,因此 `/code-review ultra` 與 `claude ultrareview` 子命令會在雲端工作階段啟動前拒絕該審查。4050checkout 可能有提交卻沒有分支:如果您執行 `git init`,接著執行 `git fetch <url>` 與 `git checkout FETCH_HEAD`,就會得到一個沒有任何 ref 的 detached HEAD。Claude Code 會將您的儲存庫打包成 git bundle 以上傳進行 [ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md),而它無法打包沒有分支或其他 ref 的儲存庫,因此 `/code-review ultra` 與 `claude ultrareview` 子命令會在雲端工作階段啟動之前拒絕審查。
4035 4051
4036```text theme={null}4052```text theme={null}
4037Your 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.4053Your 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.
4038```4054```
4039 4055
4040在 v2.1.221 之前,Claude Code 會嘗試審查此 checkout 中每個被追蹤的檔案,而上傳會失敗。4056在 v2.1.221 之前,Claude Code 會嘗試審查此 checkout 中每個受追蹤的檔案,而上傳會失敗。
4041 4057
4042**處理方式:**4058**處理方式:**
4043 4059
4044* 使用 `git checkout -b <name>` 在目前的提交上建立分支,然後重新執行審查4060* 使用 `git checkout -b <name>` 在目前的提交上建立分支,然後重新執行審查
4045 4061
4046### 沒有 GitHub 帳戶連結到您的 Claude 帳戶4062### No GitHub account is connected to your Claude account
4047 4063
4048您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,而在建立雲端工作階段之前,Claude Code 會詢問伺服器[連結到您 Claude 帳戶的 GitHub 帳戶](https://code.claude.com/docs/zh-TW/ultrareview.md#review-a-pull-request)是否能存取該 PR 的儲存庫。由於沒有連結任何帳戶,或連結已過期,雲端複製將會失敗,因此 Claude Code 會拒絕啟動。對於被拒絕的啟動,Claude Code 不會耗用免費執行次數,也不會收取用量點數。4064您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,而在建立雲端工作階段之前,Claude Code 會詢問伺服器[連結到您 Claude 帳戶的 GitHub 帳戶](https://code.claude.com/docs/zh-TW/ultrareview.md#review-a-pull-request)是否能存取該 PR 的儲存庫。由於沒有連結任何帳戶,或連結已過期,雲端 clone 將會失敗,因此 Claude Code 拒絕啟動。被拒絕的啟動不會用掉免費次數,也不會計費用量點數。
4049 4065
4050```text theme={null}4066```text theme={null}
4051Ultrareview 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).4067Ultrareview 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).
4052```4068```
4053 4069
4054當 [`/web-setup`](https://code.claude.com/docs/zh-TW/web-quickstart#connect-from-your-terminal) 在您的工作階段中無法使用時,訊息只會提到 claude.ai 連結。4070當 [`/web-setup`](https://code.claude.com/docs/zh-TW/web-quickstart#connect-from-your-terminal) 在您的工作階段中無法使用時,訊息只會列出 claude.ai 連結。
4055 4071
4056**處理方式:**4072**處理方式:**
4057 4073
4058* 執行 `/web-setup` 將您的 GitHub CLI 登入連結到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連結帳戶4074* 執行 `/web-setup` 將您的 GitHub CLI 登入連結到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連結帳戶
4059* 連結後約一分鐘再重新執行審查4075* 連結後等待一分鐘再重新執行審查
4060 4076
4061在 v2.1.248 之前,Claude Code 不會在啟動前檢查此項目。4077在 v2.1.248 之前,Claude Code 不會在啟動前進行此檢查。
4062 4078
4063### 您連結的 GitHub 帳戶無法看到該儲存庫4079### Your connected GitHub account can't see the repository
4064 4080
4065您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,而[連結到您 Claude 帳戶的 GitHub 帳戶](https://code.claude.com/docs/zh-TW/ultrareview.md#review-a-pull-request)無法讀取該 PR 的儲存庫,因此雲端複製將會失敗,Claude Code 會拒絕啟動。對於被拒絕的啟動,Claude Code 不會耗用免費執行次數,也不會收取用量點數。4081您執行了 `/code-review ultra <PR#>` 或 `claude ultrareview <PR#>`,而[連結到您 Claude 帳戶的 GitHub 帳戶](https://code.claude.com/docs/zh-TW/ultrareview.md#review-a-pull-request)無法讀取該 PR 的儲存庫,因此雲端 clone 將會失敗,Claude Code 拒絕啟動。被拒絕的啟動不會用掉免費次數,也不會計費用量點數。
4066 4082
4067```text theme={null}4083```text theme={null}
4068Your 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.4084Your 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.
4069```4085```
4070 4086
4071當 [`/web-setup`](https://code.claude.com/docs/zh-TW/web-quickstart#connect-from-your-terminal) 在您的工作階段中無法使用時,訊息只會提到安裝應用程式。4087當 [`/web-setup`](https://code.claude.com/docs/zh-TW/web-quickstart#connect-from-your-terminal) 在您的工作階段中無法使用時,訊息只會列出應用程式安裝方式。
4072 4088
4073**處理方式:**4089**處理方式:**
4074 4090
4075* 如果您本機的 `gh` CLI 能夠讀取該儲存庫,請執行 `/web-setup` 將該登入連結到您的 Claude 帳戶4091* 如果您本機的 `gh` CLI 可以讀取該儲存庫,請執行 `/web-setup` 將該登入連結到您的 Claude 帳戶
4076* 完成變更後重新執行審查4092* 完成變更後重新執行審查
4077 4093
4078在 v2.1.248 之前,Claude Code 不會在啟動前檢查此項目。4094在 v2.1.248 之前,Claude Code 不會在啟動前進行此檢查。
4079 4095
4080### GitHub App 預檢暫時性失敗4096### The GitHub App preflight failed transiently
4081 4097
4082您從本機儲存庫啟動了[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md),而有兩個步驟同時失敗。Claude Code 無法建置或上傳您儲存庫的 bundle。在上傳之前,它檢查了雲端服務是否能從 GitHub 複製該儲存庫,而該檢查並未得到明確的答案,而是以重試可能排除的錯誤結束,例如網路錯誤、逾時或暫時性的伺服器錯誤。完整訊息會以阻止 bundle 的原因開頭,例如 `Could not upload repo bundle (<error>)`,並以預檢的句子結尾:4098您從本機儲存庫啟動了[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md),而有兩個步驟同時失敗。Claude Code 無法建置或上傳您儲存庫的 bundle。在上傳之前,它會檢查雲端服務是否能從 GitHub clone 該儲存庫,而該檢查沒有得到明確的答案,而是以重試可能解決的錯誤結束,例如網路錯誤、逾時或暫時性的伺服器錯誤。完整訊息以造成 bundle 失敗的原因開頭,例如 `Could not upload repo bundle (<error>)`,並以預檢句子結尾:
4083 4099
4084```text theme={null}4100```text theme={null}
4085Could not upload repo bundle (<error>). The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead4101Could not upload repo bundle (<error>). The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead
4087 4103
4088**處理方式:**4104**處理方式:**
4089 4105
4090* 稍後重新執行命令。當 GitHub 檢查通過時,Claude Code 可以從 GitHub 複製啟動工作階段,因此失敗的上傳不再阻擋啟動4106* 稍候片刻後重新執行命令。當 GitHub 檢查通過時,Claude Code 可以從 GitHub clone 啟動工作階段,因此失敗的上傳就不再阻擋啟動
4091* 如果重試持續失敗,訊息開頭會指出阻止上傳的原因。當該原因是您可以修正的問題時,請加以修正,讓工作階段能改從您的本機儲存庫啟動4107* 如果重試持續失敗,訊息開頭會列出造成上傳失敗的原因。若該原因是您可以修正的,請加以修正,讓工作階段可以改從您的本機儲存庫啟動
4092 4108
4093在 v2.1.251 之前,即使 GitHub 檢查只是暫時性失敗,Claude Code 也會以 `Please set up GitHub on https://claude.ai/code` 結束訊息,而設定建議無法排除暫時性失敗。4109在 v2.1.251 之前,即使 GitHub 檢查只是暫時性失敗,Claude Code 也會以 `Please set up GitHub on https://claude.ai/code` 作為訊息結尾,而設定建議無法解決暫時性失敗。
4094 4110
4095### 儲存庫上傳無法遵循某項 git 設定4111### The repository upload can't follow a git setting
4096 4112
4097您啟動了[上傳本機儲存庫的雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#send-local-repositories-without-github),或對某個分支進行 [ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md),而上傳無法遵循決定哪些屬性規則適用於您檔案的某項 git 設定。如果上傳照常進行並漏掉某條規則,那麼 git 在儲存前會轉換的檔案(例如由 clean 過濾器加密的檔案)可能會以磁碟上的原樣傳到雲端。Claude Code 會改為拒絕上傳,不會上傳任何內容:4113您啟動了[會上傳本機儲存庫的雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#send-local-repositories-without-github),或是對某個分支進行 [ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md),而上傳無法遵循用於決定哪些屬性規則套用到您檔案的某個 git 設定。如果上傳繼續進行而遺漏了某條規則,則 git 在儲存前會轉換的檔案(例如由 clean 篩選器加密的檔案)可能會以磁碟上的原樣傳到雲端。因此 Claude Code 會拒絕上傳,且不會上傳任何內容:
4098 4114
4099```text theme={null}4115```text theme={null}
4100Not uploading this working tree: core.ignoreCase (which decides whether .gitattributes patterns match file names regardless of letter case) is set in <file>, and the upload cannot follow that setting, so a file git would change before storing it (to encrypt it, for example) could be uploaded as it is on disk. Move the core.ignoreCase line into this repository’s .git/config or directly into your ~/.gitconfig, then retry.4116Not uploading this working tree: core.ignoreCase (which decides whether .gitattributes patterns match file names regardless of letter case) is set in <file>, and the upload cannot follow that setting, so a file git would change before storing it (to encrypt it, for example) could be uploaded as it is on disk. Move the core.ignoreCase line into this repository’s .git/config or directly into your ~/.gitconfig, then retry.
4101```4117```
4102 4118
4103訊息會指出該設定及其設定位置,並以針對您所遇情況的修正方式結尾。`core.attributesFile` 與 `attr.tree` 也會出現相同的拒絕訊息,各自附有其修正方式。4119訊息會列出該設定及其設定位置,並以針對您遇到情況的修正方式作為結尾。`core.attributesFile` 與 `attr.tree` 也會出現相同的拒絕,各自附有其修正方式。
4104 4120
4105訊息可能會指出您的 git 設定透過 `include` 或 `includeIf` 指示引入的設定檔,即使該指示的條件並不適用於此儲存庫。4121訊息可能會列出您的 git 設定透過 `include` 或 `includeIf` 指示詞引入的設定檔,即使該指示詞的條件並不適用於此儲存庫。
4106 4122
4107**處理方式:**4123**處理方式:**
4108 4124
4109* 套用訊息最後一句中的修正方式4125* 套用訊息最後一句中的修正方式
4110 4126
4111### GitHub 未連結到您的 Claude 帳戶4127### GitHub isn't connected to your Claude account
4112 4128
4113您從本機儲存庫啟動了[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md),例如使用 `/autofix-pr`。沒有 GitHub 帳戶連結到您的 Claude 帳戶,或連結已過期,因此 Claude Code 會拒絕啟動:4129您從本機儲存庫啟動了[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md),例如使用 `/autofix-pr`。由於沒有 GitHub 帳戶連結到您的 Claude 帳戶,或連結已過期,因此 Claude Code 拒絕啟動:
4114 4130
4115```text theme={null}4131```text theme={null}
4116GitHub 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-github4132GitHub 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
4117```4133```
4118 4134
4119當您使用 [`/schedule`](https://code.claude.com/docs/zh-TW/routines) 建立雲端排程任務時,相同的訊息會以列出儲存庫的設定提示形式出現;該提示不會阻擋任務的建立。4135當您使用 [`/schedule`](https://code.claude.com/docs/zh-TW/routines) 建立雲端排程任務時,相同的訊息會以列出該儲存庫的設定註記形式出現;該註記不會阻擋任務的建立。
4120 4136
4121**處理方式:**4137**處理方式:**
4122 4138
4123* 執行 `/web-setup` 將您的 GitHub CLI 登入連結到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連結帳戶。關於兩者的差異,請參閱 [GitHub 身分驗證選項](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#github-authentication-options)。4139* 執行 `/web-setup` 將您的 GitHub CLI 登入連結到您的 Claude 帳戶,或在 [claude.ai/connect-github](https://claude.ai/connect-github) 連結帳戶。關於兩者的差異,請參閱 [GitHub 身分驗證選項](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#github-authentication-options)。
4124* 連結後約一分鐘再重新執行命令4140* 連結後等待一分鐘再重新執行命令
4125 4141
4126在 v2.1.268 之前,Claude Code 會將此情況回報為 Claude GitHub App 檢查的暫時性失敗,並建議重試或安裝該應用程式;但這兩者都無法連結 GitHub 帳戶。4142在 v2.1.268 之前,Claude Code 會將此情況回報為 Claude GitHub App 檢查的暫時性失敗,並建議重試或安裝該應用程式;但這兩者都不會連結 GitHub 帳戶。
4127 4143
4128### GitHub 組織政策正在封鎖 Claude4144### A GitHub organization policy is blocking Claude
4129 4145
4130您在 Claude Code 提示字元執行了會啟動雲端工作階段的命令,例如 [`/autofix-pr`](https://code.claude.com/docs/zh-TW/claude-code-on-the-web#auto-fix-pull-requests)。在建立工作階段之前,Claude Code 會在 GitHub 上檢查 Claude 對儲存庫的存取權,而 GitHub 拒絕了,因為您的 GitHub 組織有一項封鎖 Claude 的政策。Claude Code 會在此停止,並顯示一則指出該政策的訊息。4146您在 Claude Code 提示字元執行了會啟動雲端工作階段的命令,例如 [`/autofix-pr`](https://code.claude.com/docs/zh-TW/claude-code-on-the-web#auto-fix-pull-requests)。在建立工作階段之前,Claude Code 會檢查 Claude 在 GitHub 上對該儲存庫的存取權,而 GitHub 因為您的 GitHub 組織有封鎖 Claude 的政策而拒絕。Claude Code 會在此停止,並顯示列出該政策的訊息。
4131 4147
4132當封鎖存取的是 IP 允許清單時,訊息內容為:4148當封鎖存取的是 IP 允許清單時,訊息內容如下:
4133 4149
4134```text theme={null}4150```text theme={null}
4135Your GitHub organization has an IP allowlist that is blocking Claude. Add Claude's IP ranges to your GitHub allowlist.4151Your GitHub organization has an IP allowlist that is blocking Claude. Add Claude's IP ranges to your GitHub allowlist.
4136```4152```
4137 4153
4138當封鎖存取的是單一登入時,訊息內容為:4154當封鎖的是單一登入時,訊息內容如下:
4139 4155
4140```text theme={null}4156```text theme={null}
4141Your GitHub organization requires single sign-on. Disconnect and reconnect GitHub on the Connectors page in Claude on the web, click Authorize next to your organization when GitHub asks, then try again.4157Your GitHub organization requires single sign-on. Disconnect and reconnect GitHub on the Connectors page in Claude on the web, click Authorize next to your organization when GitHub asks, then try again.
4142```4158```
4143 4159
4144當封鎖存取的是 Microsoft Entra ID 條件式存取政策時,訊息內容為:4160當封鎖的是 Microsoft Entra ID 條件式存取政策時,訊息內容如下:
4145 4161
4146```text theme={null}4162```text theme={null}
4147Your GitHub organization's identity provider (Microsoft Entra ID) has a Conditional Access policy that is blocking Claude. Ask your GitHub Enterprise or Entra ID admin to allow Claude in that policy.4163Your GitHub organization's identity provider (Microsoft Entra ID) has a Conditional Access policy that is blocking Claude. Ask your GitHub Enterprise or Entra ID admin to allow Claude in that policy.
4149 4165
4150**處理方式:**4166**處理方式:**
4151 4167
4152* **IP 允許清單**:請 GitHub 組織或企業的擁有者允許 Anthropic 的對外 IP 位址。請參閱 [GitHub 允許清單與防火牆](https://code.claude.com/docs/zh-TW/network-config.md#github-allow-lists-and-firewalls),了解相關位址以及需要變更的 GitHub 設定。4168* **IP 允許清單**:請您的 GitHub 組織或企業的擁有者允許 Anthropic 的對外 IP 位址。關於這些位址以及需要變更的 GitHub 設定,請參閱 [GitHub 允許清單與防火牆](https://code.claude.com/docs/zh-TW/network-config.md#github-allow-lists-and-firewalls)。
4153* **單一登入**:在 [claude.ai/customize/connectors](https://claude.ai/customize/connectors) 中中斷 GitHub 的連接,然後再次連接。當 GitHub 詢問時,按一下組織旁的 **Authorize**,讓新連線獲得該組織單一登入的授權。4169* **單一登入**:在 [claude.ai/customize/connectors](https://claude.ai/customize/connectors) 中斷 GitHub 連結,然後重新連結。當 GitHub 詢問時,請點選您組織旁的 **Authorize**,讓新的連結獲得其單一登入的授權。
4154* **條件式存取政策**:請您的 GitHub Enterprise 或 Microsoft Entra ID 管理員在該政策中允許 Claude4170* **條件式存取政策**:請您的 GitHub Enterprise 或 Microsoft Entra ID 管理員在該政策中允許 Claude
4155* 完成變更後,再次執行該命令4171* 完成變更後,再次執行命令
4156 4172
4157### 需要單一登入授權4173### Single sign-on authorization needed
4158 4174
4159您執行了 [`/install-github-app`](https://code.claude.com/docs/zh-TW/github-actions#quick-setup),並選擇了一個其組織強制使用 SAML 單一登入的儲存庫。在設定之前,Claude Code 會使用 GitHub CLI 檢查您對該儲存庫的存取權,而 GitHub 拒絕了該檢查,因為您的 `gh` token 尚未獲得該組織的授權。精靈會顯示警告以及授權步驟:4175您執行了 [`/install-github-app`](https://code.claude.com/docs/zh-TW/github-actions#quick-setup),並選擇了一個其組織強制執行 SAML 單一登入的儲存庫。在設定之前,Claude Code 會使用 GitHub CLI 檢查您對該儲存庫的存取權,而 GitHub 拒絕了該檢查,因為您的 `gh` token 尚未獲得該組織的授權。精靈會顯示警告以及授權步驟:
4160 4176
4161```text theme={null}4177```text theme={null}
4162Single sign-on authorization needed4178Single sign-on authorization needed
4165 4181
4166**處理方式:**4182**處理方式:**
4167 4183
4168* 執行 `gh auth refresh -h github.com -s repo,workflow`,以 `repo` 和 `workflow` 範圍重新授權您的 GitHub CLI 登入,並在 GitHub 提示單一登入時授權該組織4184* 執行 `gh auth refresh -h github.com -s repo,workflow`,以 `repo` 與 `workflow` 範圍重新授權您的 GitHub CLI 登入,並在 GitHub 提示單一登入時授權該組織
4169* 如果您使用 `GH_TOKEN` 中的個人存取 token 進行驗證,請開啟 [github.com/settings/tokens](https://github.com/settings/tokens),在該 token 上選擇 **Configure SSO**,並授權該組織4185* 如果您使用 `GH_TOKEN` 中的個人存取 token 進行身分驗證,請開啟 [github.com/settings/tokens](https://github.com/settings/tokens),在該 token 上選擇 **Configure SSO**,並授權該組織
4170* 再次執行 `/install-github-app`4186* 再次執行 `/install-github-app`
4171 4187
4172在 v2.1.273 之前,Claude Code 在此情況下會改為顯示 `Admin permissions required` 警告。4188在 v2.1.273 之前,Claude Code 會針對此情況顯示 `Admin permissions required` 警告。
4173 4189
4174### 無法繼續對話4190### Failed to resume the conversation
4175 4191
4176Claude Code 無法讀取或處理您從 [`claude --resume` 選擇器](https://code.claude.com/docs/zh-TW/sessions#use-the-session-picker)中選取之工作階段的已儲存逐字稿,因此它會結束程序,而不是在部分載入的狀態下繼續。訊息中包含重試用的命令:4192Claude Code 無法讀取或處理您從 [`claude --resume` 選擇器](https://code.claude.com/docs/zh-TW/sessions#use-the-session-picker)中選取之工作階段的已儲存逐字稿,因此它會結束程序,而不會在部分載入的狀態下繼續。訊息中包含重試的命令:
4177 4193
4178```text theme={null}4194```text theme={null}
4179Failed to resume the conversation.4195Failed to resume the conversation.
4180Run claude --resume <session-id> to retry, or claude to start a new session.4196Run claude --resume <session-id> to retry, or claude to start a new session.
4181```4197```
4182 4198
4183Claude Code 在顯示訊息後會以代碼 1 結束。在執行中的工作階段內使用 `/resume` 選擇器時,則會在對話中回報 `Failed to resume conversation`,而您目前的工作階段會繼續執行。在 v2.1.216 之前,從 `claude --resume` 選擇器繼續失敗時,會無限期停留在 `Resuming conversation…` 載入動畫上,而不會顯示此訊息。4199Claude Code 在顯示訊息後會以代碼 1 結束。執行中工作階段內的 `/resume` 選擇器則會在對話中回報 `Failed to resume conversation`,且您目前的工作階段會繼續執行。在 v2.1.216 之前,從 `claude --resume` 選擇器恢復失敗時,會無限期停留在 `Resuming conversation…` 載入動畫,而不會顯示此訊息。
4184 4200
4185**處理方式:**4201**處理方式:**
4186 4202
4187* 使用訊息中的工作階段 ID 執行 `claude --resume <session-id>` 以重試4203* 使用訊息中的工作階段 ID 執行 `claude --resume <session-id>` 以重試
4188* 在 v2.1.285 之前的版本上,如果重試以相同方式失敗,請執行 `claude update` 後再次繼續。當已儲存的逐字稿包含這些版本無法讀取的項目時,這些版本會讓繼續操作失敗。4204* 在 v2.1.285 之前的版本上,如果重試以相同方式失敗,請執行 `claude update` 後再次恢復。當已儲存的逐字稿包含這些版本無法讀取的項目時,這些版本會讓恢復失敗。
4189* 如果重試再次失敗,請執行 `claude` 以開始新的工作階段4205* 如果重試再次失敗,請執行 `claude` 以啟動新的工作階段
4190 4206
4191### 找不到具有該工作階段 ID 的對話4207### No conversation found with the session ID
4192 4208
4193您將工作階段 ID 傳給 `claude --resume <session-id>`,但沒有任何已儲存的逐字稿與之相符:4209您將工作階段 ID 傳給了 `claude --resume <session-id>`,但沒有任何已儲存的逐字稿與之相符:
4194 4210
4195```text theme={null}4211```text theme={null}
4196No conversation found with session ID: <session-id>4212No conversation found with session ID: <session-id>
4197```4213```
4198 4214
4199Claude Code 顯示訊息後會以代碼 1 結束。Claude Code 會[先搜尋目前的專案,再搜尋這台機器上的所有其他專案](https://code.claude.com/docs/zh-TW/sessions.md#where-the-session-picker-looks)來尋找該 ID。在 v2.1.223 之前,查找只會涵蓋目前的專案目錄及其 git worktree,因此請從該工作階段最後工作的目錄進行恢復。4215Claude Code 在顯示訊息後會以代碼 1 結束。Claude Code 會[先搜尋目前的專案,再搜尋此電腦上的所有其他專案](https://code.claude.com/docs/zh-TW/sessions.md#where-the-session-picker-looks)來尋找該 ID。在 v2.1.223 之前,查詢只會涵蓋目前的專案目錄及其 git worktree,因此請從該工作階段最後工作的目錄恢復。
4200 4216
4201常見原因:4217常見原因:
4202 4218
4203* **ID 輸入錯誤**:對於非互動式執行,ID 是 [`--output-format json` 輸出](https://code.claude.com/docs/zh-TW/headless#get-structured-output)中的 `session_id` 欄位4219* **ID 輸入錯誤**:對於非互動式執行,ID 是 [`--output-format json` 輸出](https://code.claude.com/docs/zh-TW/headless#get-structured-output)中的 `session_id` 欄位
4204* **逐字稿已刪除**:Claude Code 會依照[保留清理規則](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically),在[保留期限](https://code.claude.com/docs/zh-TW/sessions.md#where-transcripts-are-stored)(預設為 30 天)後移除逐字稿4220* **逐字稿已刪除**:Claude Code 會依照[保留清理規則](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically),在[保留期間](https://code.claude.com/docs/zh-TW/sessions.md#where-transcripts-are-stored)(預設為 30 天)過後移除逐字稿
4205* **不同的機器**:Claude Code 將逐字稿儲存在本機,因此請在執行該工作階段的機器上繼續4221* **不同的電腦**:Claude Code 將逐字稿儲存在本機,因此請在執行該工作階段的電腦上恢復它
4206* **重複的副本**:如果您複製了 `~/.claude/projects` 下的專案目錄,導致兩份逐字稿帶有相同的 ID,Claude Code 會回報此訊息,而不會任意繼續其中一份副本4222* **重複的副本**:如果您複製了 `~/.claude/projects` 下的專案目錄,使兩份逐字稿帶有相同的 ID,Claude Code 會回報此訊息,而不會任意恢復其中一份
4207 4223
4208**處理方式:**4224**處理方式:**
4209 4225
4210* 對於互動式工作階段,請使用 `claude --resume` 開啟[工作階段選擇器](https://code.claude.com/docs/zh-TW/sessions.md#use-the-session-picker),並按 `Ctrl+A` 將範圍擴大到這台機器上的所有專案,然後選取該工作階段4226* 對於互動式工作階段,請使用 `claude --resume` 開啟[工作階段選擇器](https://code.claude.com/docs/zh-TW/sessions.md#use-the-session-picker),並按下 `Ctrl+A` 將範圍擴大到此電腦上的所有專案,然後選取該工作階段
4211* 使用 `claude -p` 或 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 建立的工作階段不會出現在選擇器中,因此請對照原始執行所輸出的 `session_id` 再次檢查 ID4227* 使用 `claude -p` 或 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 建立的工作階段不會出現在選擇器中,因此請將 ID 與您原始執行所輸出的 `session_id` 重新比對
4212 4228
4213### Claude Code 讀取此工作階段的逐字稿檔案時,Windows 回報錯誤(EBADF)4229### Windows reported an error (EBADF) when Claude Code read this session's transcript file
4214 4230
4215您在 Windows 上繼續一個工作階段,其已儲存的[逐字稿檔案](https://code.claude.com/docs/zh-TW/sessions.md#where-transcripts-are-stored)正常開啟,但接著讀取時發生系統錯誤 EBADF。此系統錯誤並未說明讀取失敗的原因,因此訊息會提出可能的原因以及可以嘗試的做法:4231您在 Windows 上恢復了一個工作階段,其已儲存的[逐字稿檔案](https://code.claude.com/docs/zh-TW/sessions.md#where-transcripts-are-stored)正常開啟,但接著讀取時以系統錯誤 EBADF 失敗。系統錯誤並未說明讀取失敗的原因,因此訊息會建議可能的原因以及可嘗試的做法:
4216 4232
4217```text theme={null}4233```text theme={null}
4218Windows 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.4234Windows 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.
4219```4235```
4220 4236
4221此訊息會接在命令本身的失敗行之後,例如 `Failed to resume session <session-id>`。`claude --resume` 或 [`claude -p`](https://code.claude.com/docs/zh-TW/headless) 命令在顯示此訊息後會以代碼 1 結束。在工作階段內使用 `/resume` 後,您目前的工作階段會繼續執行。4237此訊息會接在命令本身的失敗行之後,例如 `Failed to resume session <session-id>`。`claude --resume` 或 [`claude -p`](https://code.claude.com/docs/zh-TW/headless) 命令在顯示訊息後會以代碼 1 結束。在工作階段內使用 `/resume` 後,您目前的工作階段會繼續執行。
4222 4238
4223**處理方式:**4239**處理方式:**
4224 4240
4225* 將存放工作階段逐字稿的資料夾從會掃描或攔截檔案讀取的軟體(例如安全性、加密或端點管理工具)中排除。逐字稿預設位於 `%USERPROFILE%\.claude\projects` 下,或位於 [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/zh-TW/env-vars) 所指定的目錄下4241* 將存放您工作階段逐字稿的資料夾排除在會掃描或攔截檔案讀取的軟體之外,例如安全性、加密或端點管理工具。逐字稿預設位於 `%USERPROFILE%\.claude\projects` 下,或位於 [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/zh-TW/env-vars) 所指定的目錄下
4226* 如果無法新增排除項目,請改為將 Claude Code 加入該軟體的允許應用程式4242* 如果無法新增排除項目,請改為將 Claude Code 加入該軟體的允許應用程式
4227* 再次繼續該工作階段4243* 再次恢復工作階段
4228 4244
4229在 v2.1.282 之前,此失敗不附帶任何說明:`claude --resume <session-id>` 會停在 `Failed to resume session <session-id>`,而 `-p` 執行只會輸出系統錯誤文字,例如 `Failed to resume session: EBADF: bad file descriptor, read`。4245在 v2.1.282 之前,此失敗不會附帶任何說明:`claude --resume <session-id>` 會在 `Failed to resume session <session-id>` 結束,而 `-p` 執行只會輸出系統錯誤文字,例如 `Failed to resume session: EBADF: bad file descriptor, read`。
4230 4246
4231### 無法在此工作階段中切換渲染器4247### Cannot switch renderers in this session
4232 4248
4233切換渲染器時,Claude Code 會重新啟動其程序。您在一個 Claude Code 拒絕重新啟動的工作階段中執行了 [`/tui`](https://code.claude.com/docs/zh-TW/fullscreen#enable-fullscreen-rendering),因此它不會切換,也不會儲存任何內容。您看到的訊息會指出原因:4249切換轉譯器時,Claude Code 會重新啟動其程序。您在 Claude Code 拒絕重新啟動的工作階段中執行了 [`/tui`](https://code.claude.com/docs/zh-TW/fullscreen#enable-fullscreen-rendering),因此它不會切換,也不會儲存任何內容。您看到的訊息會告訴您原因:
4234 4250
4235* `Cannot switch renderers while work is running in the background`:您有正在背景執行、重新啟動會將其捨棄的工作,例如背景 shell 或 subagent。請等待工作完成,或使用 [`/tasks`](https://code.claude.com/docs/zh-TW/commands) 將其停止,然後再次執行 `/tui fullscreen` 或 `/tui default`4251* `Cannot switch renderers while work is running in the background`:您有正在背景執行、重新啟動會將其中斷的工作,例如背景 shell 或 subagent。請等待工作完成,或使用 [`/tasks`](https://code.claude.com/docs/zh-TW/commands) 停止它,然後再次執行 `/tui fullscreen` 或 `/tui default`
4236* `Cannot switch renderers in this session`:該工作階段有 Claude Code 無法傳遞給重新啟動後程序的限制。在 v2.1.234 之前,Claude Code 仍會重新啟動,而重新啟動後的工作階段會在沒有這些限制的情況下執行4252* `Cannot switch renderers in this session`:工作階段具有 Claude Code 無法傳遞給重新啟動後程序的限制。在 v2.1.234 之前,Claude Code 仍會重新啟動,而重新啟動後的工作階段會在沒有這些限制的情況下執行
4237 4253
4238在限制訊息中,括號內的部分會指出 Claude Code 找到的限制:4254在限制訊息中,括號內的部分會列出 Claude Code 找到的限制:
4239 4255
4240```text theme={null}4256```text theme={null}
4241Cannot switch renderers in this session — it has restrictions a restart can't carry over (permission rules set for this session only). Nothing was changed. Running /tui fullscreen in a session started without them switches every later session too.4257Cannot switch renderers in this session — it has restrictions a restart can't carry over (permission rules set for this session only). Nothing was changed. Running /tui fullscreen in a session started without them switches every later session too.
4242```4258```
4243 4259
4244訊息括號內可能顯示的各項原因:4260訊息括號內可能顯示的各個原因:
4245 4261
4246* `launch flags: a custom system prompt, a tool allowlist, or restricted settings`:您使用了 Claude Code 不會傳回給重新啟動後程序的旗標來啟動工作階段。這些旗標包括 [`--system-prompt`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags)、`--system-prompt-file`、`--append-system-prompt-file`、[`--tools`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 允許清單、[`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 以及 [`--permission-prompt-tool`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags)4262* `launch flags: a custom system prompt, a tool allowlist, or restricted settings`:您使用了 Claude Code 不會傳回給重新啟動後程序的旗標啟動工作階段。這些旗標包括 [`--system-prompt`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags)、`--system-prompt-file`、`--append-system-prompt-file`、[`--tools`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 允許清單、[`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags),以及 [`--permission-prompt-tool`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags)
4247* `permission rules set for this session only`:來自 hook 或 SDK 呼叫端的[權限更新](https://code.claude.com/docs/zh-TW/hooks.md#permission-update-entries)以 `session` 目的地新增了拒絕或詢問規則。限於工作階段範圍的允許規則不會觸發拒絕。重新啟動會捨棄這些規則,而 Claude Code 會改為再次提示4263* `permission rules set for this session only`:來自 hook 或 SDK 呼叫端的[權限更新](https://code.claude.com/docs/zh-TW/hooks.md#permission-update-entries)新增了目的地為 `session` 的 deny 或 ask 規則。工作階段範圍的 allow 規則不會觸發拒絕。重新啟動會捨棄這些規則,而 Claude Code 會改為再次提示
4248* `ask-before-running rules with no command-line form`:來自 hook 或 SDK 呼叫端的權限更新,在 Claude Code 以 `--allowed-tools` 和 `--disallowed-tools` 傳回的規則之外新增了詢問規則。詢問規則沒有對應的旗標4264* `ask-before-running rules with no command-line form`:來自 hook 或 SDK 呼叫端的權限更新,在 Claude Code 以 `--allowed-tools` 與 `--disallowed-tools` 傳回的規則之外新增了 ask 規則。ask 規則沒有對應的旗標
4249* `permission rules a command line cannot carry intact` 和 `added directories a command line cannot carry intact`:權限更新在工作階段中途新增了規則或目錄路徑。重新啟動後程序的命令列無法以相同的值攜帶其文字4265* `permission rules a command line cannot carry intact` 與 `added directories a command line cannot carry intact`:權限更新在工作階段中途新增了規則或目錄路徑。重新啟動後程序的命令列無法將其文字以相同的值傳遞
4250 4266
4251**處理方式:**4267**處理方式:**
4252 4268
4253* 在未帶有這些限制而啟動的工作階段中,執行 `/tui fullscreen`,或執行 `/tui default` 切換回來。Claude Code 會在該處儲存 [`tui` 設定](https://code.claude.com/docs/zh-TW/settings-reference#tui)4269* 在未套用這些限制而啟動的工作階段中,執行 `/tui fullscreen`,或執行 `/tui default` 以切換回來。Claude Code 會在該處儲存 [`tui` 設定](https://code.claude.com/docs/zh-TW/settings-reference#tui)
4254 4270
4255### Can't restart while work is running or Remote Control is connected4271### Can't restart while work is running or Remote Control is connected
4256 4272
4258 4274
4259### Claude Code couldn't restart4275### Claude Code couldn't restart
4260 4276
4261當此訊息表示您的對話已儲存時,代表對話已寫入磁碟,您可以從中斷處繼續。Claude Code 當時正在自行重新啟動,例如在您執行 [`/tui`](https://code.claude.com/docs/zh-TW/fullscreen#enable-fullscreen-rendering) 後切換至或切換出全螢幕渲染,但無法啟動新程序,因此以狀態 1 結束:4277當此訊息表示您的對話已儲存時,該對話位於磁碟上,您可以從中斷處繼續。Claude Code 原本正在重新啟動自身,例如在您執行 [`/tui`](https://code.claude.com/docs/zh-TW/fullscreen#enable-fullscreen-rendering) 後切換至或切換出全螢幕轉譯,但無法啟動新的程序,因此以狀態 1 結束:
4262 4278
4263```text theme={null}4279```text theme={null}
4264Claude Code couldn't restart. Your conversation is saved. Start Claude Code again and run /resume to pick it up.4280Claude Code couldn't restart. Your conversation is saved. Start Claude Code again and run /resume to pick it up.
4265```4281```
4266 4282
4267當重新啟動時沒有可重新開啟的對話,例如因為 `/tui` 是您在新工作階段中的第一個輸入,訊息內容為 `Claude Code couldn't restart. Start Claude Code again.`4283當重新啟動沒有可重新開啟的對話時,例如因為 `/tui` 是您在新工作階段中的第一個輸入,訊息內容為 `Claude Code couldn't restart. Start Claude Code again.`
4268 4284
4269**處理方式:**4285**處理方式:**
4270 4286
4271* 在您的 shell 中再次執行 `claude`。如果訊息表示您的對話已儲存,請在新工作階段中執行 [`/resume`](https://code.claude.com/docs/zh-TW/sessions#resume-a-session) 並選取該對話。如果對話不在清單中,請[擴大工作階段選擇器的範圍](https://code.claude.com/docs/zh-TW/sessions.md#where-the-session-picker-looks)4287* 在您的 shell 中再次執行 `claude`。如果訊息表示您的對話已儲存,請在新的工作階段中執行 [`/resume`](https://code.claude.com/docs/zh-TW/sessions#resume-a-session) 並選取該對話。如果它不在清單中,請[擴大工作階段選擇器的範圍](https://code.claude.com/docs/zh-TW/sessions.md#where-the-session-picker-looks)
4272* 若重新啟動持續失敗,請在 shell 中使用 [`claude --debug-file claude-debug.log`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 啟動 Claude Code。若從該工作階段重新啟動失敗,您啟動所在目錄中的 `claude-debug.log` 會記錄一行包含作業系統錯誤的 `Failed to relaunch:`。在您[回報問題](#report-an-error)時請附上該行4288* 如果重新啟動持續失敗,請從您的 shell 以 [`claude --debug-file claude-debug.log`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 啟動 Claude Code。如果從該工作階段重新啟動失敗,您啟動時所在目錄中的 `claude-debug.log` 會記錄一行 `Failed to relaunch:`,其中包含作業系統的錯誤。在您[回報問題](#report-an-error)時請附上該行
4273 4289
4274### 無法開啟 Claude Desktop4290### Couldn't open Claude Desktop
4275 4291
4276您在工作階段中執行了 [`/desktop`](https://code.claude.com/docs/zh-TW/desktop#coming-from-the-cli) 或其別名 `/app`,或在 shell 中執行了 [`claude --desktop`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags),而 Claude Code 用來開啟 Claude Desktop 的系統命令失敗了。執行 `/desktop` 後,工作階段會留在終端機中;`claude --desktop` 會輸出不含 `Error:` 前綴的訊息,並以狀態 1 結束。4292您在工作階段中執行了 [`/desktop`](https://code.claude.com/docs/zh-TW/desktop#coming-from-the-cli) 或其別名 `/app`,或在您的 shell 中執行了 [`claude --desktop`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags),而 Claude Code 用來開啟 Claude Desktop 的系統命令失敗了。執行 `/desktop` 後,工作階段會留在終端機中;`claude --desktop` 則會輸出不含 `Error:` 前綴的訊息,並以狀態 1 結束。
4277 4293
4278括號內的文字會指出失敗的命令,以及其結束狀態和錯誤輸出的第一行(若有產生)。在 macOS 上該命令為 `open`,如此範例所示;在 Windows 上則為 `rundll32`:4294括號內的文字會列出失敗的命令,以及其產生的結束狀態與錯誤輸出的第一行(若有)。在 macOS 上,該命令為 `open`,如本範例所示;在 Windows 上則為 `rundll32`:
4279 4295
4280```text theme={null}4296```text theme={null}
4281Error: 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 try again.4297Error: 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 try again.
4284**處理方式:**4300**處理方式:**
4285 4301
4286* 自行開啟 Claude Desktop,然後再次執行 `/desktop` 或 `claude --desktop`4302* 自行開啟 Claude Desktop,然後再次執行 `/desktop` 或 `claude --desktop`
4287* 若要閱讀失敗命令的完整錯誤輸出,請使用 `/debug` 開啟偵錯日誌並再次執行 `/desktop`,或執行 `claude --desktop --debug-file <path>`,然後查看偵錯日誌4303* 若要閱讀失敗命令的完整錯誤輸出,請使用 `/debug` 開啟除錯日誌並再次執行 `/desktop`,或執行 `claude --desktop --debug-file <path>`,然後查看除錯日誌
4288 4304
4289在 v2.1.285 之前,訊息的結尾為 `Open Claude Desktop and run /desktop again.`。在 v2.1.275 之前,訊息為 `Failed to open Claude Desktop. Please try opening it manually.`,且未說明失敗的內容。4305在 v2.1.285 之前,訊息以 `Open Claude Desktop and run /desktop again.` 結尾。在 v2.1.275 之前,訊息為 `Failed to open Claude Desktop. Please try opening it manually.`,且未說明失敗的內容。
4290 4306
4291### /terminal-setup 未變更您的 Zed 按鍵對應4307### /terminal-setup left your Zed keymap unchanged
4292 4308
4293您在 Zed 中執行了 [`/terminal-setup`](https://code.claude.com/docs/zh-TW/terminal-config#enter-multiline-prompts),而 Claude Code 無法完成對您 Zed `keymap.json` 的更新,因此維持該檔案原狀。4309您在 Zed 中執行了 [`/terminal-setup`](https://code.claude.com/docs/zh-TW/terminal-config#enter-multiline-prompts),而 Claude Code 無法完成對您 Zed `keymap.json` 的更新,因此保留了該檔案原狀。
4294 4310
4295每則訊息都會指出您按鍵對應檔的路徑,並在結尾附上供您自行新增的快捷鍵區塊:4311每則訊息都會列出您 keymap 的路徑,並以您需自行新增的快捷鍵區塊作為結尾:
4296 4312
4297```text theme={null}4313```text theme={null}
4298Couldn't update your Zed keymap, so it was left unchanged.4314Couldn't update your Zed keymap, so it was left unchanged.
4300{ "context": "Terminal", "bindings": { "shift-enter": ["terminal::SendText", "\u001b\r"] } }4316{ "context": "Terminal", "bindings": { "shift-enter": ["terminal::SendText", "\u001b\r"] } }
4301```4317```
4302 4318
4303訊息的第一行會指出原因:4319訊息的第一行會列出原因:
4304 4320
4305* `Couldn't read your Zed keymap, so it was left unchanged.`:Claude Code 無法讀取該檔案,例如因為檔案權限4321* `Couldn't read your Zed keymap, so it was left unchanged.`:Claude Code 無法讀取該檔案,例如因為檔案權限
4306* `Your Zed keymap isn't a readable list of keybindings, so it was left unchanged.`:檔案可以正常讀取,但即使允許 `//` 註解和結尾逗號,仍無法解析為快捷鍵區塊的陣列4322* `Your Zed keymap isn't a readable list of keybindings, so it was left unchanged.`:檔案可以正常讀取,但即使允許 `//` 註解與結尾逗號,仍無法剖析為快捷鍵區塊的陣列
4307* `Couldn't back up your Zed keymap; not modifying it.`:Claude Code 無法將檔案複製為其旁邊的 `.bak` 備份,因此未做任何變更4323* `Couldn't back up your Zed keymap; not modifying it.`:Claude Code 無法將檔案複製為其旁邊的 `.bak` 備份,因此沒有做任何變更
4308* `Couldn't update your Zed keymap, so it was left unchanged.`:合併後的結果無法驗證為帶有該快捷鍵的有效按鍵對應,因此 Claude Code 將其捨棄而未寫入。帶有重複鍵的快捷鍵區塊可能導致此情況4324* `Couldn't update your Zed keymap, so it was left unchanged.`:合併後的結果未能驗證為帶有該快捷鍵的有效 keymap,因此 Claude Code 將其捨棄而不寫入。含有重複鍵的快捷鍵區塊可能會造成此情況
4309 4325
4310**處理方式:**4326**處理方式:**
4311 4327
4312* 將訊息中的區塊複製到訊息所指路徑上 `keymap.json` 的頂層陣列中4328* 將訊息中的區塊複製到訊息所列路徑之 `keymap.json` 中的最上層陣列
4313* 對於 `isn't a readable list of keybindings`,請修正語法錯誤,或讓檔案的頂層值成為陣列,然後再次執行 `/terminal-setup`4329* 對於 `isn't a readable list of keybindings`,請修正語法錯誤,或將檔案的最上層值改為陣列,然後再次執行 `/terminal-setup`
4314 4330
4315在 v2.1.247 之前,`/terminal-setup` 無法解析使用 `//` 註解或結尾逗號的 Zed 按鍵對應,並會以僅包含其自身快捷鍵的內容取代整個檔案,同時回報快捷鍵已安裝。若要還原被較早版本取代的按鍵對應,請使用[輸入多行提示詞](https://code.claude.com/docs/zh-TW/terminal-config.md#enter-multiline-prompts)中所述的 `.bak` 備份檔案。4331在 v2.1.247 之前,`/terminal-setup` 無法剖析使用 `//` 註解或結尾逗號的 Zed keymap,並會以僅包含其自身快捷鍵的內容取代整個檔案,同時回報快捷鍵已安裝。若要還原先前版本所取代的 keymap,請使用 [Enter multiline prompts](https://code.claude.com/docs/zh-TW/terminal-config.md#enter-multiline-prompts) 中所述的 `.bak` 備份檔案。
4316 4332
4317### 此連線無法使用 skill 使用情況報告4333### Skill usage reports are not available on this connection
4318 4334
4319您透過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md),從手機或瀏覽器執行了 [`/skill-doctor`](https://code.claude.com/docs/zh-TW/skills#find-unused-skills)。Claude Code 不會透過 Remote Control 傳送 skill 使用情況報告,而是改為回覆此訊息:4335您透過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 從手機或瀏覽器執行了 [`/skill-doctor`](https://code.claude.com/docs/zh-TW/skills#find-unused-skills)。Claude Code 不會透過 Remote Control 傳送 skill 使用報告,而會以此訊息回覆:
4320 4336
4321```text theme={null}4337```text theme={null}
4322Skill usage reports are not available on this connection.4338Skill usage reports are not available on this connection.
4324 4340
4325**處理方式:**4341**處理方式:**
4326 4342
4327* 在執行該工作階段之機器的終端機中執行 `/skill-doctor`,或在該處執行 `claude -p "/skill-doctor"`4343* 在執行工作階段之電腦的終端機中執行 `/skill-doctor`,或在該處執行 `claude -p "/skill-doctor"`
4328 4344
4329### 無法透過 Remote Control 選擇自訂輸出風格4345### Custom output styles can't be selected over Remote Control
4330 4346
4331您透過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 從行動應用程式或網頁執行了 [`/output-style`](https://code.claude.com/docs/zh-TW/output-styles#change-your-output-style),或者該命令是在轉送至工作階段的訊息中送達。由於這樣的回合可能並非來自帳戶擁有者,Claude Code 在其中只會列出並選擇[內建風格](https://code.claude.com/docs/zh-TW/output-styles.md#built-in-output-styles),並在命令列出風格或無法辨識您提供的名稱時加上此通知。[自訂風格](https://code.claude.com/docs/zh-TW/output-styles.md#create-a-custom-output-style)名稱會得到與不存在之名稱相同的回覆:4347您透過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 從行動應用程式或網頁執行了 [`/output-style`](https://code.claude.com/docs/zh-TW/output-styles#change-your-output-style),或該命令是在轉送到工作階段的訊息中送達的。由於這樣的回合可能並非來自帳戶擁有者,Claude Code 在其中只會列出與選取[內建風格](https://code.claude.com/docs/zh-TW/output-styles.md#built-in-output-styles),並在命令列出風格或無法辨識您提供的名稱時加上此通知。[自訂風格](https://code.claude.com/docs/zh-TW/output-styles.md#create-a-custom-output-style)名稱會得到與不存在之名稱相同的回覆:
4332 4348
4333```text theme={null}4349```text theme={null}
4334Custom 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.4350Custom 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.
4337**處理方式:**4353**處理方式:**
4338 4354
4339* 選擇內建風格,例如 `/output-style concise`4355* 選擇內建風格,例如 `/output-style concise`
4340* 若要使用自訂風格,請在專案的 `.claude/settings.local.json` 中設定 [`outputStyle`](https://code.claude.com/docs/zh-TW/settings-reference#outputstyle),或在工作階段本身的終端機(若有)執行 `/output-style <style>`4356* 若要使用自訂風格,請在專案的 `.claude/settings.local.json` 中設定 [`outputStyle`](https://code.claude.com/docs/zh-TW/settings-reference#outputstyle),或在工作階段本身的終端機(若有)中執行 `/output-style <style>`
4341 4357
4342### 輸出風格會儲存到此工作階段不會載入的本機設定4358### Output styles are saved to local settings which this session doesn't load
4343 4359
4344您在設定來源排除 `local` 的工作階段中,嘗試以 `/output-style <style>` 或 `/config outputStyle=<style>` 切換[輸出風格](https://code.claude.com/docs/zh-TW/output-styles.md)。例如 [`settingSources`](https://code.claude.com/docs/zh-TW/agent-sdk/typescript#options) 未包含 `"local"` 的 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/typescript.md) 工作階段,以及以未包含 `local` 的 [`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 值啟動的 CLI 工作階段。這兩個命令都會將風格儲存到 `.claude/settings.local.json`,而這類工作階段永遠不會讀回該檔案,因此 Claude Code 會拒絕,而不是寫入一個不會生效的設定:4360您在設定來源排除 `local` 的工作階段中,嘗試以 `/output-style <style>` 或 `/config outputStyle=<style>` 切換[輸出風格](https://code.claude.com/docs/zh-TW/output-styles.md)。例如 [`settingSources`](https://code.claude.com/docs/zh-TW/agent-sdk/typescript#options) 省略了 `"local"` 的 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/typescript.md) 工作階段,以及使用省略了 `local` 的 [`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 值啟動的 CLI 工作階段。這兩個命令都會將風格儲存到 `.claude/settings.local.json`,而這類工作階段永遠不會讀回該檔案,因此 Claude Code 會拒絕,而不會寫入不會產生效果的設定:
4345 4361
4346```text theme={null}4362```text theme={null}
4347Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load, so the style can't be changed here.4363Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load, so the style can't be changed here.
4352* 將 `local` 加入工作階段的設定來源,然後再次切換4368* 將 `local` 加入工作階段的設定來源,然後再次切換
4353* 在工作階段會載入的設定檔中設定 [`outputStyle`](https://code.claude.com/docs/zh-TW/settings-reference#outputstyle) 鍵,例如專案中的 `.claude/settings.json` 或 `~/.claude/settings.json`。在 TypeScript SDK 中,請改為在內嵌的 `settings` 物件中設定 `outputStyle`;請參閱[啟用輸出風格](https://code.claude.com/docs/zh-TW/agent-sdk/modifying-system-prompts.md#activate-an-output-style)4369* 在工作階段會載入的設定檔中設定 [`outputStyle`](https://code.claude.com/docs/zh-TW/settings-reference#outputstyle) 鍵,例如專案中的 `.claude/settings.json` 或 `~/.claude/settings.json`。在 TypeScript SDK 中,請改為在內嵌的 `settings` 物件中設定 `outputStyle`;請參閱[啟用輸出風格](https://code.claude.com/docs/zh-TW/agent-sdk/modifying-system-prompts.md#activate-an-output-style)
4354 4370
4355### /recap 只在您親自要求時執行4371### /recap only runs when you ask for it yourself
4356 4372
4357[`/recap`](https://code.claude.com/docs/zh-TW/interactive-mode#session-recap) 請求並非來自您自己的輸入。它出現在從 Slack、Teams 或[專案](https://code.claude.com/docs/zh-TW/claude-projects.md)討論串轉傳至工作階段的訊息中,或出現在[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)或其他程式傳送的提示詞中。4373[`/recap`](https://code.claude.com/docs/zh-TW/interactive-mode#session-recap) 請求並非來自您自己的輸入。它是在從 Slack、Teams 或[專案](https://code.claude.com/docs/zh-TW/claude-projects.md)討論串轉送到工作階段的訊息中送達的,或是在[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)或其他程式所傳送的提示詞中送達的。
4358 4374
4359即使轉送的訊息是您自己撰寫的,也會收到此通知。Claude Code 無法判斷轉送或自動化的訊息是否來自執行該工作階段之帳戶的本人,因此會以此通知回覆,而不是提供摘要:4375即使轉送的訊息是您自己撰寫的,也會收到此通知。Claude Code 無法判斷轉送或自動化的訊息是否來自執行該工作階段之帳戶的本人,因此會以此通知回應,而不是提供摘要:
4360 4376
4361```text theme={null}4377```text theme={null}
4362/recap only runs when you ask for it yourself in this session: from the terminal, the Claude app or claude.ai/code, or over Remote Control. A message relayed from Slack, Teams or a project thread, or sent by a routine or another program, can't request it.4378/recap only runs when you ask for it yourself in this session: from the terminal, the Claude app or claude.ai/code, or over Remote Control. A message relayed from Slack, Teams or a project thread, or sent by a routine or another program, can't request it.
4363```4379```
4364 4380
4365您傳給 `claude -p` 的 `/recap`,或您自己的 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 應用程式傳送給其所啟動之工作階段的 `/recap`,都算是您自己的輸入。4381您傳給 `claude -p` 的 `/recap`,或您自己的 [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) 應用程式傳送給其所啟動之工作階段的 `/recap`,都視為您自己的輸入。
4366 4382
4367**處理方式:**4383**處理方式:**
4368 4384
4369* 親自開啟該工作階段並在其中執行 `/recap`:在其終端機中、在 [Desktop 應用程式](https://code.claude.com/docs/zh-TW/desktop.md)或[行動應用程式](https://code.claude.com/docs/zh-TW/mobile.md)中、在 [claude.ai/code](https://claude.ai/code),或透過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md)4385* 自行開啟工作階段並在其中執行 `/recap`:在其終端機中、在 [Desktop 應用程式](https://code.claude.com/docs/zh-TW/desktop.md)或[行動應用程式](https://code.claude.com/docs/zh-TW/mobile.md)中、在 [claude.ai/code](https://claude.ai/code),或透過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md)
4370* 如果是雲端排程任務或其他程式傳送的,請從該提示詞中移除 `/recap`4386* 如果是雲端排程任務或其他程式傳送的,請從該提示詞中移除 `/recap`
4371 4387
4372### /feedback is disabled by your organization's policy4388### /feedback is disabled by your organization's policy
4373 4389
4374此訊息表示產品意見回饋已關閉,因此您輸入的命令不會開啟意見回饋對話框。組織的政策與先前的拒絕都會產生此訊息:4390此訊息表示產品意見回饋已關閉,因此您輸入的命令不會開啟意見回饋對話框。組織的政策與先前的拒絕都會產生此訊息:
4375 4391
4376* **組織政策**:您組織的政策不允許從 Claude Code 提交產品意見回饋。`/feedback`、`/bug` 與 `/share` 都會以此訊息回應。4392* **組織政策**:您組織的政策不允許從 Claude Code 提供產品意見回饋。`/feedback`、`/bug` 與 `/share` 都會以此訊息回應。
4377* **先前的拒絕**:意見回饋服務拒絕了您傳送的報告,例如顯示 [`Couldn't send feedback: Feedback has not been enabled for your organization.`](#couldnt-send-feedback)。之後 `/feedback` 與 `/bug` 可能會以此訊息回應。此狀態在這台機器上會從該次拒絕起持續七天。這適用於所有方案,包括 Pro 與 Max。4393* **先前的拒絕**:意見回饋服務拒絕了您傳送的報告,例如以 [`Couldn't send feedback: Feedback has not been enabled for your organization.`](#couldnt-send-feedback) 拒絕。此後 `/feedback` 與 `/bug` 可能會以此訊息回應。在此電腦上,該狀態會從該次拒絕起持續七天。這適用於所有方案,包括 Pro 與 Max。
4378 4394
4379訊息會列出您在 Claude Code 提示字元輸入的命令:4395訊息會列出您在 Claude Code 提示字元輸入的命令:
4380 4396
4386 4402
4387**處理方式:**4403**處理方式:**
4388 4404
4389* 若要回報錯誤,請在 [github.com/anthropics/claude-code/issues](https://github.com/anthropics/claude-code/issues) 建立 issue。任何人都可以閱讀該處的 issue,因此請勿包含程式碼、逐字稿及任何其他機密內容。4405* 若要回報錯誤,請在 [github.com/anthropics/claude-code/issues](https://github.com/anthropics/claude-code/issues) 開啟 issue。任何人都可以閱讀該處的 issue,因此請勿包含程式碼、逐字稿以及任何其他機密內容。
4390* 在先前遭到拒絕後,請等待七天過去,然後再次傳送報告,以確認服務是否仍會拒絕4406* 在先前的拒絕之後,請等待七天過去,然後再次傳送報告,以確認服務是否仍會拒絕
4391 4407
4392在 v2.1.319 之前,先前的拒絕不會產生此訊息。4408在 v2.1.319 之前,先前的拒絕不會產生此訊息。
4393 4409
4394在 v2.1.302 之前,完整訊息為 `/feedback is disabled by your organization's policy. Contact your organization admin to enable it.`4410在 v2.1.302 之前,完整訊息內容為 `/feedback is disabled by your organization's policy. Contact your organization admin to enable it.`
4395 4411
4396## Plugin 錯誤4412## Plugin 錯誤
4397 4413
4948* **對於 Claude 撰寫的命令**:您無需修正任何內容。訊息會告知 Claude 如何改寫該命令。4964* **對於 Claude 撰寫的命令**:您無需修正任何內容。訊息會告知 Claude 如何改寫該命令。
4949* **對於 skill 或命令檔案**:訊息會接在 `No shell command in <name> was run` 之後。請參閱 [在何處找到該字元並將其移除](#no-shell-command-was-run)。4965* **對於 skill 或命令檔案**:訊息會接在 `No shell command in <name> was run` 之後。請參閱 [在何處找到該字元並將其移除](#no-shell-command-was-run)。
4950 4966
4951### Command approved before Claude Code restarted was not run4967### Approved command was not run after Claude Code restarted
4952 4968
4953您核准的 shell 命令未執行,Claude 會收到此訊息作為該命令的結果:4969您核准的 shell 命令未執行,Claude 會收到此訊息作為該命令的結果:
4954 4970
4955```text wrap theme={null}4971```text wrap theme={null}
4956This call was not run. The command was approved before Claude Code restarted, and Claude Code could not confirm that the shell is back in the directory where it was approved. That directory may be gone or replaced, lie outside the directory where the session started, or be one that Claude Code needs approval to enter or is not allowed to examine. The shell's directory is <directory>. If the command still makes sense, cd to the directory it was meant for and make the call again; it may need approval again.4972This call was not run. Claude Code could not confirm that the shell is back in the directory where it was approved. That directory may be gone or replaced, lie outside the directory where the session started, or be one that Claude Code needs approval to enter or is not allowed to examine. The shell's directory is <directory>. If the command still makes sense, cd to the directory it was meant for and make the call again; it may need approval again.
4957```4973```
4958 4974
4959訊息的第三句也可能改為 `It does not keep track of that directory across a restart in a session that has been in a worktree.`4975訊息的第三句也可能改為 `It does not keep track of that directory across a restart in a session that has been in a worktree.`
5556 5572
5557### Worktree 有未推送到任何地方的提交5573### Worktree 有未推送到任何地方的提交
5558 5574
5559您嘗試刪除[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#what-deleting-a-session-removes),其 worktree 包含 Claude Code 無法確認已在其他地方儲存的提交。Claude Code 保留 worktree 和工作階段列,而不是在您未察覺的情況下銷毀提交。`claude rm` 命名分支和未推送的提交,並說明如何進行:5575您嘗試刪除[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#what-deleting-a-session-removes),其 worktree 包含 Claude Code 無法確認已在其他地方儲存的提交。`claude rm` 會說明如何進行:
5560 5576
5561```text theme={null}5577```text theme={null}
5562kept 7c5dcf5d — its worktree is still at “/home/you/project/.claude/worktrees/fix-login”5578kept 7c5dcf5d — its worktree is still at “/home/you/project/.claude/worktrees/fix-login”
5566 5582
5567當 Claude Code 無法總結提交時,詳細行改為顯示 `The worktree has unpushed commits`。在 [agent 檢視](https://code.claude.com/docs/zh-TW/agent-view.md)中,工作階段的列顯示 `not removed`,原因相同。5583當 Claude Code 無法總結提交時,詳細行改為顯示 `The worktree has unpushed commits`。在 [agent 檢視](https://code.claude.com/docs/zh-TW/agent-view.md)中,工作階段的列顯示 `not removed`,原因相同。
5568 5584
5569遠端上的提交不會阻止刪除。您的 `origin` 遠端預設分支的本機副本上的提交也不會,只要該分支在您的主簽出(即儲存庫目錄本身而不是 worktree)中簽出。
5570
5571**該怎麼做:**5585**該怎麼做:**
5572 5586
5573* 要保留提交,推送 worktree 的分支,或將其合併到在主簽出中簽出的預設分支,然後再次刪除工作階段5587* 要保留提交,請推送它們。一旦推送將它們放到遠端追蹤分支(例如 `origin/claude/fix-login`)上,請再次嘗試刪除工作階段。
5574* 要捨棄提交,執行訊息列印的 `claude rm <id> --discard-unpushed` 命令,或在 agent 檢視中的工作階段列上再次按 `Ctrl+X` 兩次。這會移除工作階段和 worktree 以及其分支、未推送的提交和任何未提交的變更。如果刪除再次被拒絕,請依照新的訊息操作。5588* 如果訊息提供捨棄提交的選項,請先確認您不需要該 worktree、這些提交或任何未提交的變更。然後執行訊息提供的步驟:在 agent 檢視中的工作階段列上按 `Ctrl+X` 兩次,或執行 `claude rm` 列印的 `claude rm <id> --discard-unpushed <commit>@<worktree-id>` 命令。如果 Claude Code 再次拒絕,請依照新的訊息操作。
5575* 當訊息說 worktree 也由另一個已完成的工作階段記錄時,再次刪除不會捨棄它:推送提交,然後再次刪除工作階段5589* 當訊息說 worktree 也由另一個已完成的工作階段記錄時,再次刪除不會捨棄它:推送提交,然後再次嘗試刪除工作階段
5576 5590
5577在 v2.1.268 之前,`claude rm` 將提交摘要放在 `kept` 行本身上。當 `claude rm` 無法總結提交時,`kept` 行會以 `worktree has commits that are not pushed anywhere` 代替摘要。5591在 v2.1.268 之前,`claude rm` 將提交摘要放在 `kept` 行本身上。當 `claude rm` 無法總結提交時,`kept` 行會以 `worktree has commits that are not pushed anywhere` 代替摘要。
5578 5592
5579在 v2.1.260 之前,訊息未命名分支或提交,也沒有捨棄的途徑。您仍然可以刪除工作階段,這會遺失未提交的變更,但會保留分支和提交。使用拒絕訊息列印的路徑執行 `git worktree remove --force --force <path>`,然後執行 `claude rm <id>`。對於已鎖定的 worktree,Git 需要兩次 `--force`。5593在 v2.1.260 之前,訊息未命名分支或提交,也沒有捨棄的途徑。您仍然可以刪除工作階段,這會遺失未提交的變更,但會保留分支和提交。使用拒絕訊息列印的路徑執行 `git worktree remove --force --force <path>`,然後執行 `claude rm <id>`。對於已鎖定的 worktree,Git 需要兩次 `--force`。
5580 5594
5581在 v2.1.248 之前,在主簽出中簽出的預設分支不計算在內:您已經合併到那裡的分支仍然會觸發此拒絕,直到其提交到達遠端。
5582
5583### Terminal host process died5595### Terminal host process died
5584 5596
5585每個[背景工作階段的](https://code.claude.com/docs/zh-TW/agent-view.md)終端機在背景服務下的主機程序中執行,該程序在服務仍保持其連線時死亡,因此無法連線到工作階段。5597每個[背景工作階段的](https://code.claude.com/docs/zh-TW/agent-view.md)終端機在背景服務下的主機程序中執行,該程序在服務仍保持其連線時死亡,因此無法連線到工作階段。
6194該行其餘部分會說明工作階段所依循的政策:6206該行其餘部分會說明工作階段所依循的政策:
6195 6207
6196* **有先前成功擷取時快取的設定**:Claude Code 會以該快取政策執行工作階段([保留的環境變數](https://code.claude.com/docs/zh-TW/server-managed-settings.md#fetch-and-caching-behavior)除外),該行顯示 `using cached policy`。6208* **有先前成功擷取時快取的設定**:Claude Code 會以該快取政策執行工作階段([保留的環境變數](https://code.claude.com/docs/zh-TW/server-managed-settings.md#fetch-and-caching-behavior)除外),該行顯示 `using cached policy`。
6197* **沒有快取**:Claude Code 會在沒有伺服器管理設定的情況下執行工作階段,該行顯示 `no remote policy applied`。6209* **沒有可套用的快取設定**:Claude Code 會在沒有伺服器管理設定的情況下執行工作階段,該行顯示 `no remote policy applied`。例如,此機器尚未擷取過設定,或上次擷取已超過 [24 小時](https://code.claude.com/docs/zh-TW/server-managed-settings.md#fetch-and-caching-behavior)。
6198 6210
6199在 Code 分頁中,當您傳送訊息時,警告會以對話中的一行出現,而當擷取的狀態改變時,會出現新的一行。三則相關訊息也會以相同方式出現:6211在 Code 分頁中,當您傳送訊息時,警告會以對話中的一行出現,而當擷取的狀態改變時,會出現新的一行。三則相關訊息也會以相同方式出現:
6200 6212