37| `Connection lost while your computer was asleep` | [自動重試](#automatic-retries) |37| `Connection lost while your computer was asleep` | [自動重試](#automatic-retries) |
38| `<model> is temporarily unavailable, so auto mode cannot determine the safety of...` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |38| `<model> is temporarily unavailable, so auto mode cannot determine the safety of...` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |
39| `Auto mode could not evaluate this action and is blocking it for safety` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |39| `Auto mode could not evaluate this action and is blocking it for safety` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |
40| `Not run · auto mode's check had no usable answer` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |
40| `Auto mode classifier transcript exceeded context window` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |41| `Auto mode classifier transcript exceeded context window` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |
41| `Agent aborted: auto mode classifier request refused by the safety safeguard` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |42| `Agent aborted: auto mode classifier request refused by the safety safeguard` | [伺服器錯誤](#auto-mode-cannot-determine-the-safety-of-an-action) |
42| `The server-side auto mode classifier gave no verdict` | [伺服器錯誤](#the-server-returned-no-safety-verdict) |43| `The server-side auto mode classifier gave no verdict` | [伺服器錯誤](#the-server-returned-no-safety-verdict) |
247| `Windows reported an error (EBADF) when Claude Code read this session's transcript file` | [命令列錯誤](#windows-reported-an-error-ebadf) |248| `Windows reported an error (EBADF) when Claude Code read this session's transcript file` | [命令列錯誤](#windows-reported-an-error-ebadf) |
248| `Cannot switch renderers in this session` | [命令列錯誤](#cannot-switch-renderers-in-this-session) |249| `Cannot switch renderers in this session` | [命令列錯誤](#cannot-switch-renderers-in-this-session) |
249| `Cannot switch renderers while work is running in the background` | [命令列錯誤](#cannot-switch-renderers-in-this-session) |250| `Cannot switch renderers while work is running in the background` | [命令列錯誤](#cannot-switch-renderers-in-this-session) |
251| `Claude Code couldn't restart` | [命令列錯誤](#claude-code-couldnt-restart) |
250| `Couldn't open Claude Desktop` | [命令列錯誤](#couldnt-open-claude-desktop) |252| `Couldn't open Claude Desktop` | [命令列錯誤](#couldnt-open-claude-desktop) |
251| `Failed to open Claude Desktop. Please try opening it manually.` | [命令列錯誤](#couldnt-open-claude-desktop) |253| `Failed to open Claude Desktop. Please try opening it manually.` | [命令列錯誤](#couldnt-open-claude-desktop) |
252| `Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap` | [命令列錯誤](#terminal-setup-left-your-zed-keymap-unchanged) |254| `Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap` | [命令列錯誤](#terminal-setup-left-your-zed-keymap-unchanged) |
262| `Marketplace "<name>" is already added from a different source` | [外掛錯誤](#marketplace-is-already-added-from-a-different-source) |264| `Marketplace "<name>" is already added from a different source` | [外掛錯誤](#marketplace-is-already-added-from-a-different-source) |
263| `"<name>" is another spelling of "<reserved>", a reserved marketplace name` | [外掛錯誤](#marketplace-name-is-another-spelling-of-a-reserved-name) |265| `"<name>" is another spelling of "<reserved>", a reserved marketplace name` | [外掛錯誤](#marketplace-name-is-another-spelling-of-a-reserved-name) |
264| `Cannot add marketplace "<name>": Claude Code cannot install plugins from a marketplace with this name` | [外掛疑難排解](/docs/zh-TW/plugins/troubleshooting#cannot-install-plugins-from-a-marketplace-with-this-name) |266| `Cannot add marketplace "<name>": Claude Code cannot install plugins from a marketplace with this name` | [外掛疑難排解](/docs/zh-TW/plugins/troubleshooting#cannot-install-plugins-from-a-marketplace-with-this-name) |
267| `Cannot add marketplace "<name>": Claude Code reserves this name and cannot register a marketplace under it` | [外掛疑難排解](/docs/zh-TW/plugins/troubleshooting#claude-code-reserves-this-name) |
265| `Marketplace "<name>" is added but ignored` | [外掛疑難排解](/docs/zh-TW/plugins/troubleshooting#marketplace-is-added-but-ignored) |268| `Marketplace "<name>" is added but ignored` | [外掛疑難排解](/docs/zh-TW/plugins/troubleshooting#marketplace-is-added-but-ignored) |
266| `Marketplace "<name>" is registered but was refused (see the debug log)` | [外掛疑難排解](/docs/zh-TW/plugins/troubleshooting#marketplace-is-added-but-ignored) |269| `Marketplace "<name>" is registered but was refused (see the debug log)` | [外掛疑難排解](/docs/zh-TW/plugins/troubleshooting#marketplace-is-added-but-ignored) |
267| `references ${user_config.*} in a shell-form command` | [外掛錯誤](#plugin-command-references-user-config) |270| `references ${user_config.*} in a shell-form command` | [外掛錯誤](#plugin-command-references-user-config) |
308| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |311| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |
309| `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |312| `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |
310| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |313| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |
314| `File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary` | [工具錯誤](#file-is-not-valid-utf-8) |
311| `the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text` | [工具錯誤](#the-source-file-is-not-valid-utf-8-text) |315| `the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text` | [工具錯誤](#the-source-file-is-not-valid-utf-8-text) |
312| `the source file has the replacement character U+FFFD` | [工具錯誤](#the-source-file-is-not-valid-utf-8-text) |316| `the source file has the replacement character U+FFFD` | [工具錯誤](#the-source-file-is-not-valid-utf-8-text) |
313| `Not published: that file is on a network share` | [工具錯誤](#not-published-that-file-is-on-a-network-share) |317| `Not published: that file is on a network share` | [工具錯誤](#not-published-that-file-is-on-a-network-share) |
334| `Session isn't responding` / `Press enter again to restart this session — it isn't responding` | [背景工作階段錯誤](#session-isnt-responding) |338| `Session isn't responding` / `Press enter again to restart this session — it isn't responding` | [背景工作階段錯誤](#session-isnt-responding) |
335| `Session <id> was stopped while the respawn was in flight` | [背景工作階段錯誤](#session-was-stopped-while-the-respawn-was-in-flight) |339| `Session <id> was stopped while the respawn was in flight` | [背景工作階段錯誤](#session-was-stopped-while-the-respawn-was-in-flight) |
336| `This session was running agent '<name>', which is no longer available` | [背景工作階段錯誤](#session-agent-no-longer-available) |340| `This session was running agent '<name>', which is no longer available` | [背景工作階段錯誤](#session-agent-no-longer-available) |
341| `This session restarted <time> after its next /loop wakeup was due, so that wakeup will not fire` | [背景工作階段錯誤](#restarted-after-its-next-loop-wakeup-was-due) |
337| `CLAUDE_CODE_PROCESS_WRAPPER: launcher ...` | [背景工作階段錯誤](#claude_code_process_wrapper-launcher-errors) |342| `CLAUDE_CODE_PROCESS_WRAPPER: launcher ...` | [背景工作階段錯誤](#claude_code_process_wrapper-launcher-errors) |
338| `EUNKNOWN: unknown error, uv_spawn` | [背景工作階段錯誤](#eunknown-when-starting-a-background-session) |343| `EUNKNOWN: unknown error, uv_spawn` | [背景工作階段錯誤](#eunknown-when-starting-a-background-session) |
339| `EACCES: permission denied, posix_spawn` | [背景工作階段錯誤](#eacces-when-starting-a-background-session) |344| `EACCES: permission denied, posix_spawn` | [背景工作階段錯誤](#eacces-when-starting-a-background-session) |
439| :- | :- | :- |444| :- | :- | :- |
440| [`CLAUDE_CODE_MAX_RETRIES`](/docs/zh-TW/env-vars) | 10 | 重試嘗試次數。從 v2.1.186 開始上限為 15;從 v2.1.199 開始 `CLAUDE_CODE_RETRY_WATCHDOG` 會提高預設值並移除上限。降低它以在指令碼中更快地顯示故障。 |445| [`CLAUDE_CODE_MAX_RETRIES`](/docs/zh-TW/env-vars) | 10 | 重試嘗試次數。從 v2.1.186 開始上限為 15;從 v2.1.199 開始 `CLAUDE_CODE_RETRY_WATCHDOG` 會提高預設值並移除上限。降低它以在指令碼中更快地顯示故障。 |
441| [`CLAUDE_CODE_RETRY_WATCHDOG`](/docs/zh-TW/env-vars) | 未設定 | 在無人值守的工作階段(例如 CI 工作)中設定為 `1`,以無限期重試 `429` 和 `529` 容量錯誤,而不是在 `CLAUDE_CODE_MAX_RETRIES` 次嘗試後失敗。當標準速度的請求收到報告支出限制或用量點數耗盡的 `429` 時,Claude Code 會立即失敗,即使該 `429` 來自按排程重設的 [gateway spend cap](#spend-limit-reached)。在 v2.1.239 之前,看門狗會無限期重試這些錯誤。如需快速模式請求,請參閱 [Handle rate limits](/docs/zh-TW/fast-mode#handle-rate-limits)。在 v2.1.199 或更新版本上,它也會將其他暫時性錯誤(例如伺服器錯誤、逾時和連線中斷)的預設重試次數提高至 300,大約三小時的退避,並在您明確設定 `CLAUDE_CODE_MAX_RETRIES` 時移除其上限 15。 |446| [`CLAUDE_CODE_RETRY_WATCHDOG`](/docs/zh-TW/env-vars) | 未設定 | 在無人值守的工作階段(例如 CI 工作)中設定為 `1`,以無限期重試 `429` 和 `529` 容量錯誤,而不是在 `CLAUDE_CODE_MAX_RETRIES` 次嘗試後失敗。當標準速度的請求收到報告支出限制或用量點數耗盡的 `429` 時,Claude Code 會立即失敗,即使該 `429` 來自按排程重設的 [gateway spend cap](#spend-limit-reached)。在 v2.1.239 之前,看門狗會無限期重試這些錯誤。如需快速模式請求,請參閱 [Handle rate limits](/docs/zh-TW/fast-mode#handle-rate-limits)。在 v2.1.199 或更新版本上,它也會將其他暫時性錯誤(例如伺服器錯誤、逾時和連線中斷)的預設重試次數提高至 300,大約三小時的退避,並在您明確設定 `CLAUDE_CODE_MAX_RETRIES` 時移除其上限 15。 |
447| [`CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS`](/docs/zh-TW/env-vars) | 未設定 | 設定 `CLAUDE_CODE_RETRY_WATCHDOG` 時,每個 API 請求等待 `429` 和 `529` 錯誤所花費的最長時間(毫秒)。未設定時,等待時間沒有限制。需要 Claude Code v2.1.295 或更新版本。 |
442| [`CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS`](/docs/zh-TW/env-vars) | 500 | API 以 `529` 過載錯誤拒絕的請求,其重試之間退避的起始延遲(毫秒)。當 API 容量已滿時,可提高此值(最高 32000),以將重試分散在較長的時間範圍內。當 `CLAUDE_CODE_RETRY_WATCHDOG` 設定為 `1`,或被拒絕的請求是以[快速模式](/docs/zh-TW/fast-mode#handle-rate-limits)發送時,此設定無效。需要 Claude Code v2.1.292 或更新版本。 |448| [`CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS`](/docs/zh-TW/env-vars) | 500 | API 以 `529` 過載錯誤拒絕的請求,其重試之間退避的起始延遲(毫秒)。當 API 容量已滿時,可提高此值(最高 32000),以將重試分散在較長的時間範圍內。當 `CLAUDE_CODE_RETRY_WATCHDOG` 設定為 `1`,或被拒絕的請求是以[快速模式](/docs/zh-TW/fast-mode#handle-rate-limits)發送時,此設定無效。需要 Claude Code v2.1.292 或更新版本。 |
443| [`API_TIMEOUT_MS`](/docs/zh-TW/env-vars) | 600000 | 每個請求的逾時(毫秒)。在慢速網路或代理伺服器上請提高此值。它也會限制 Claude Code 等待回應標頭的時間上限,如 [No response from API](#no-response-from-api) 中所述。 |449| [`API_TIMEOUT_MS`](/docs/zh-TW/env-vars) | 600000 | 每個請求的逾時(毫秒)。在慢速網路或代理伺服器上請提高此值。它也會限制 Claude Code 等待回應標頭的時間上限,如 [No response from API](#no-response-from-api) 中所述。 |
444| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](/docs/zh-TW/env-vars) | 未設定 | 逾時的[非串流請求](#streaming-response-ended-before-any-complete-data-was-received)重新發送次數上限。達到上限時,請求會失敗。Claude 產生時間超過逾時的回應在每次重新發送時都會再次逾時,因此請設定較低的數字(例如 `0`)以便更快失敗。在本機工作階段中,每次非串流嘗試會在 300 秒後逾時,或當您設定正值時在 `API_TIMEOUT_MS` 後逾時。需要 Claude Code v2.1.285 或更新版本。 |450| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](/docs/zh-TW/env-vars) | 未設定 | 逾時的[非串流請求](#streaming-response-ended-before-any-complete-data-was-received)重新發送次數上限。達到上限時,請求會失敗。Claude 產生時間超過逾時的回應在每次重新發送時都會再次逾時,因此請設定較低的數字(例如 `0`)以便更快失敗。在本機工作階段中,每次非串流嘗試會在 300 秒後逾時,或當您設定正值時在 `API_TIMEOUT_MS` 後逾時。需要 Claude Code v2.1.285 或更新版本。 |
596<model> is temporarily unavailable, so auto mode cannot determine the safety of <tool> right now. Wait a moment and then try this action again.602<model> is temporarily unavailable, so auto mode cannot determine the safety of <tool> right now. Wait a moment and then try this action again.
597```603```
598 604
605在互動式工作階段中,工具呼叫下方會出現一列淡色的 `Not run · auto mode's check had no usable answer`,而不是此訊息。按 `Ctrl+O` 可在[逐字稿檢視器](/docs/zh-TW/interactive-mode#transcript-viewer)中閱讀該訊息。[伺服器未傳回安全判決](#the-server-returned-no-safety-verdict)下的拒絕也會顯示相同的列。在 v2.1.296 之前,訊息會以紅色錯誤的形式顯示在呼叫下方。
606
599當 Claude Code 可以判斷故障類別時,它會在 `temporarily unavailable` 後面的括號中指明該類別,例如 `<model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now`。類別為 `(rate-limited)`、`(overloaded)`、`(server error)`、`(timed out)` 和 `(connection failed)`。如果 `(timed out)` 或 `(connection failed)` 重複,請檢查您的連線;請參閱[無法連線到 API](#unable-to-connect-to-api)。在 v2.1.229 之前,訊息從不指明類別,讀作 `Wait briefly and then try this action again`。607當 Claude Code 可以判斷故障類別時,它會在 `temporarily unavailable` 後面的括號中指明該類別,例如 `<model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now`。類別為 `(rate-limited)`、`(overloaded)`、`(server error)`、`(timed out)` 和 `(connection failed)`。如果 `(timed out)` 或 `(connection failed)` 重複,請檢查您的連線;請參閱[無法連線到 API](#unable-to-connect-to-api)。在 v2.1.229 之前,訊息從不指明類別,讀作 `Wait briefly and then try this action again`。
600 608
601當沒有類別符合時,訊息出現時括號中沒有類別;多個故障會產生該形式。在 [Amazon Bedrock](/docs/zh-TW/amazon-bedrock) 上,包括 [Mantle 端點](/docs/zh-TW/amazon-bedrock#use-the-mantle-endpoint),當您的 AWS 帳戶無法叫用訊息中指明的模型時,它也會出現,該故障在每次重試時重複,直到您的帳戶被授予存取該模型的權限。609當沒有類別符合時,訊息出現時括號中沒有類別;多個故障會產生該形式。在 [Amazon Bedrock](/docs/zh-TW/amazon-bedrock) 上,包括 [Mantle 端點](/docs/zh-TW/amazon-bedrock#use-the-mantle-endpoint),當您的 AWS 帳戶無法叫用訊息中指明的模型時,它也會出現,該故障在每次重試時重複,直到您的帳戶被授予存取該模型的權限。
1900 1908
1901當[受管設定檔、MDM 原則或原則協助程式](/docs/zh-TW/managed-settings)將 [`forceLoginMethod`](/docs/zh-TW/settings-reference#forceloginmethod) 設定為 `"gateway"`,或設定 [`forceLoginGatewayUrl`](/docs/zh-TW/settings-reference#forcelogingatewayurl) 而不設定 `forceLoginMethod` 時,Claude Code 會跳過此檢查。使用任一設定,Claude Code 會在 **Cloud gateway** 畫面上開啟登入步驟,而不是 Anthropic 登入方法。當機器上存在受管設定來源但無法讀取時,Claude Code 也會跳過檢查,因為該來源可能保有閘道設定。在 v2.1.247 之前,Claude Code 在此設定下也執行檢查,當 Anthropic 的端點無法到達時以此錯誤退出。1909當[受管設定檔、MDM 原則或原則協助程式](/docs/zh-TW/managed-settings)將 [`forceLoginMethod`](/docs/zh-TW/settings-reference#forceloginmethod) 設定為 `"gateway"`,或設定 [`forceLoginGatewayUrl`](/docs/zh-TW/settings-reference#forcelogingatewayurl) 而不設定 `forceLoginMethod` 時,Claude Code 會跳過此檢查。使用任一設定,Claude Code 會在 **Cloud gateway** 畫面上開啟登入步驟,而不是 Anthropic 登入方法。當機器上存在受管設定來源但無法讀取時,Claude Code 也會跳過檢查,因為該來源可能保有閘道設定。在 v2.1.247 之前,Claude Code 在此設定下也執行檢查,當 Anthropic 的端點無法到達時以此錯誤退出。
1902 1910
1911在沒有受管設定的機器上,當您自己的 `~/.claude/settings.json` 以 `forceLoginMethod` 和 `forceLoginGatewayUrl` [指定閘道](/docs/zh-TW/claude-apps-gateway#set-the-gateway-url-in-user-settings)時,Claude Code 也會跳過此檢查。在 v2.1.295 之前,Claude Code 在這種情況下會執行檢查。
1912
1903**該怎麼做:**1913**該怎麼做:**
1904 1914
1905* 如果訊息命名代理伺服器變數,檢查其值是否指向正確的代理伺服器,並要求您的網路團隊允許透過它到訊息中主機的 HTTPS 連線。請參閱[網路設定](/docs/zh-TW/network-config)。1915* 如果訊息命名代理伺服器變數,檢查其值是否指向正確的代理伺服器,並要求您的網路團隊允許透過它到訊息中主機的 HTTPS 連線。請參閱[網路設定](/docs/zh-TW/network-config)。
3412 3422
3413Claude Code 對任何[注入動態脈絡](/docs/zh-TW/skills#when-an-injected-command-fails)的 skill 都會顯示相同的錯誤,而失敗的注入命令會中止該 skill 的呼叫。另有兩個同類字串會在命令執行之前就觸發:3423Claude Code 對任何[注入動態脈絡](/docs/zh-TW/skills#when-an-injected-command-fails)的 skill 都會顯示相同的錯誤,而失敗的注入命令會中止該 skill 的呼叫。另有兩個同類字串會在命令執行之前就觸發:
3414 3424
3415* `Shell command permission check failed for pattern "..."`:該命令的權限檢查不允許它。[注入命令的權限檢查](/docs/zh-TW/skills#permission-checks-on-injected-commands)說明了在各權限模式下哪些結果會中止,以及如何使用 `allowed-tools` 預先核准命令3425* `Shell command permission check failed for pattern "..."`:該命令的權限檢查不允許它執行。[注入命令的權限檢查](/docs/zh-TW/skills#permission-checks-on-injected-commands)說明了在各權限模式下哪些結果會中止,以及如何以 `allowed-tools` 預先核准命令
3416* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``:該 skill 的 frontmatter 在沒有 bash 的機器上要求使用 bash。請安裝 Git for Windows,或將 frontmatter 變更為 `shell: powershell`。請參閱[注入命令如何執行](/docs/zh-TW/skills#how-injected-commands-run)3426* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``:該 skill 的 frontmatter 在沒有 bash 的機器上要求 bash。請安裝 Git for Windows,或將 frontmatter 變更為 `shell: powershell`。請參閱[注入命令的執行方式](/docs/zh-TW/skills#how-injected-commands-run)
3417 3427
3418**處理方式:**3428**處理方式:**
3419 3429
3562 3572
3563* **您沒有傳入基底分支**:Claude Code 與儲存庫的預設分支進行比較,並建議您明確傳入基底分支,如上例所示3573* **您沒有傳入基底分支**:Claude Code 與儲存庫的預設分支進行比較,並建議您明確傳入基底分支,如上例所示
3564* **您傳入的基底分支已存在於您的複製中**:提示內容為 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``3574* **您傳入的基底分支已存在於您的複製中**:提示內容為 ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)``
3565* **您傳入的基底分支不在您的複製中**:Claude Code 在比較前從 origin 擷取了它。提示內容為 ``<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`)``;當 Claude Code 無法判斷您的複製是否為淺層複製時,它會改為建議 `git fetch --unshallow origin`。在 v2.1.221 之前,提示會對每個被擷取的基底分支都建議 `git fetch --unshallow origin`,而在完整的複製上,該命令會以 `fatal: --unshallow on a complete repository does not make sense` 失敗。3575* **您傳入的基底分支不在您的 clone 中**:Claude Code 在比較前從 origin fetch 了該分支。提示為 ``<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 之前,提示會對每個 fetch 而來的基底分支建議 `git fetch --unshallow origin`,而在完整的 clone 上,該命令會以 `fatal: --unshallow on a complete repository does not make sense` 失敗。
3566 3576
3567**處理方式:**3577**處理方式:**
3568 3578
3756No conversation found with session ID: <session-id>3766No conversation found with session ID: <session-id>
3757```3767```
3758 3768
3759Claude Code 在顯示訊息後會以代碼 1 結束。Claude Code 會[先搜尋目前的專案,然後搜尋這台機器上的所有其他專案](/docs/zh-TW/sessions#resume-a-session)來尋找該 ID。在 v2.1.223 之前,查詢只會搜尋目前的專案目錄及其 git worktree,因此請從該工作階段最後工作的目錄繼續。3769Claude Code 顯示訊息後會以代碼 1 結束。Claude Code 會[先搜尋目前的專案,再搜尋這台機器上的所有其他專案](/docs/zh-TW/sessions#where-the-session-picker-looks)來尋找該 ID。在 v2.1.223 之前,查找只會涵蓋目前的專案目錄及其 git worktree,因此請從該工作階段最後工作的目錄進行恢復。
3760 3770
3761常見原因:3771常見原因:
3762 3772
3816 3826
3817* 在未帶有這些限制而啟動的工作階段中,執行 `/tui fullscreen`,或執行 `/tui default` 切換回來。Claude Code 會在該處儲存 [`tui` 設定](/docs/zh-TW/settings-reference#tui)3827* 在未帶有這些限制而啟動的工作階段中,執行 `/tui fullscreen`,或執行 `/tui default` 切換回來。Claude Code 會在該處儲存 [`tui` 設定](/docs/zh-TW/settings-reference#tui)
3818 3828
3829<h3 id="claude-code-couldnt-restart">
3830 Claude Code couldn't restart
3831</h3>
3832
3833Claude Code 正在重新啟動,例如在您執行 [`/tui`](/docs/zh-TW/fullscreen#enable-fullscreen-rendering) 後切換至或切換離開全螢幕渲染。它關閉了工作階段,但無法啟動新的程序,因此輸出此訊息並以狀態 1 結束:
3834
3835```text theme={null}
3836Claude Code couldn't restart. Your conversation is saved. Start Claude Code again and run /resume to pick it up.
3837```
3838
3839當重新啟動時沒有可重新開啟的對話,例如因為 `/tui` 是您在新工作階段中的第一個輸入,訊息內容為 `Claude Code couldn't restart. Start Claude Code again.`
3840
3841**處理方式:**
3842
3843* 在 shell 中從相同目錄再次執行 `claude`。若訊息表示您的對話已儲存,請在新的工作階段中執行 [`/resume`](/docs/zh-TW/sessions#resume-a-session) 並選擇該對話
3844* 若重新啟動持續失敗,請在 shell 中使用 [`claude --debug-file claude-debug.log`](/docs/zh-TW/cli-reference#cli-flags) 啟動 Claude Code。若從該工作階段重新啟動失敗,您啟動所在目錄中的 `claude-debug.log` 會記錄一行包含作業系統錯誤的 `Failed to relaunch:`。在您[回報問題](#report-an-error)時請附上該行
3845
3819<h3 id="couldnt-open-claude-desktop">3846<h3 id="couldnt-open-claude-desktop">
3820 無法開啟 Claude Desktop3847 無法開啟 Claude Desktop
3821</h3>3848</h3>
4593* 或者,將 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設為位於有空間之檔案系統上的目錄,然後重新啟動 Claude Code4620* 或者,將 [`CLAUDE_CODE_TMPDIR`](/docs/zh-TW/env-vars) 設為位於有空間之檔案系統上的目錄,然後重新啟動 Claude Code
4594* 接著讓 Claude 再次執行該命令。它先前印出的輸出已遺失,而不是被截斷4621* 接著讓 Claude 再次執行該命令。它先前印出的輸出已遺失,而不是被截斷
4595 4622
4623<h3 id="file-is-not-valid-utf-8">
4624 File is not valid UTF-8
4625</h3>
4626
4627Claude 對一個位元組無法解碼為 UTF-8 的檔案使用了 Edit 或 NotebookEdit 工具,而 Claude Code 拒絕了該變更。沒有寫入任何內容,因此檔案維持原狀。這些工具會將整個檔案以 UTF-8 存回,這會把它們無法解碼的每個位元組都變成替代字元 `U+FFFD`。訊息會出現在工具結果中:
4628
4629```text wrap theme={null}
4630File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary. This tool saves the whole file as UTF-8, which would replace every byte it cannot decode with U+FFFD. Nothing was written. Make the change with a shell command that reads and writes the file in its own encoding, or ask the user whether to convert the file to UTF-8 first.
4631```
4632
4633原本應為 UTF-8 的檔案,只要包含即使一個無效的位元組序列,也會出現此訊息,因為檢查涵蓋的是檔案的整體位元組。
4634
4635**處理方式:**
4636
4637* 若要保留檔案目前的編碼,請讓 Claude 依照訊息的指示,使用以該編碼讀取和寫入檔案的 shell 命令進行變更
4638* 若要繼續使用 Edit 工具編輯該檔案,請將其轉換為 UTF-8,或修正原本應為 UTF-8 之檔案中的無效位元組,然後要求 Claude 再次進行編輯
4639
4640在 v2.1.296 之前,Edit 和 NotebookEdit 會套用這類編輯,並將無法解碼的每個位元組儲存為 `U+FFFD`。若您使用的是這些版本,請更新 Claude Code。
4641
4596<h3 id="the-source-file-is-not-valid-utf-8-text">4642<h3 id="the-source-file-is-not-valid-utf-8-text">
4597 The source file is not valid UTF-8 text4643 The source file is not valid UTF-8 text
4598</h3>4644</h3>
4752 命令被 worktree 隔離檢查阻止4798 命令被 worktree 隔離檢查阻止
4753</h3>4799</h3>
4754 4800
4755Claude 在[在 worktree 中隔離的工作階段](/docs/zh-TW/worktrees#how-claude-code-enforces-isolation)中執行了 Bash 或 Monitor 命令,Claude Code 因以下兩個原因之一拒絕了它:4801Claude 在[在 worktree 中隔離的工作階段](/docs/zh-TW/worktrees#how-claude-code-enforces-isolation)中執行了 Bash、[PowerShell](/docs/zh-TW/tools-reference#powershell-tool) 或 [Monitor](/docs/zh-TW/tools-reference#monitor-tool) 命令,Claude Code 因以下原因之一拒絕了它:
4756 4802
4757* 命令將 git 指向主簽出。4803* 命令將在主簽出或另一個 worktree 中執行。訊息會說明其工作目錄 `resolved to the shared checkout` 或 `is in a different worktree`。
4758* Claude Code 無法從命令文字驗證命令執行的任何 git 保持在 worktree 內。從未提及 git 的命令仍然可能因此原因被拒絕,因為展開變數間接參照(例如 `${!name}`)或執行 Bash 函數替換(例如 `${ command; }`)會產生在執行時本身可能是命令的值。4804* Bash 或 Monitor 命令將 git 指向主簽出。
4805* Claude Code 無法從 Bash 或 Monitor 命令的文字驗證命令執行的任何 git 保持在 worktree 內。從未提及 git 的命令仍然可能因此原因被拒絕,因為展開變數間接參照(例如 `${!name}`)或執行 Bash 函數替換(例如 `${ command; }`)會產生在執行時本身可能是命令的值。
4759 4806
4760訊息的中間命名無法驗證的內容:4807訊息會顯示 `is isolated in the worktree <path>, but this command`,後接原因,例如 Claude Code 無法驗證其文字的命令:
4761 4808
4762```text wrap theme={null}4809```text wrap theme={null}
4763This session is isolated in the worktree /path/to/worktree, but this command evaluates ${!x@P} arithmetically inside a construct too complex to verify, which can run a command hidden in a variable's value. Refusing to run it — a worktree-isolated session's git operations must target its own worktree. Split it into plain, separate commands and run them from /path/to/worktree.4810This session is isolated in the worktree /path/to/worktree, but this command evaluates ${!x@P} arithmetically inside a construct too complex to verify, which can run a command hidden in a variable's value. Refusing to run it — a worktree-isolated session's git operations must target its own worktree. Split it into plain, separate commands and run them from /path/to/worktree.
4765 4812
4766**該怎麼做:**4813**該怎麼做:**
4767 4814
4768* 通常什麼都不做:Claude 讀取訊息並按其最後一句要求的方式重寫命令4815* **Git 指向主簽出,或無法驗證的命令文字**:什麼都不做。Claude 讀取訊息並按其最後一句要求的方式重寫命令。如果您要求的命令因其文字中的展開而持續被拒絕,請按字面拼寫標記的值,並從 worktree 內將 git 作為獨立的純命令執行
4769* 如果您要求的命令持續被拒絕,按字面拼寫標記的值:用其值替換間接參照或替換,並從 worktree 內將 git 作為獨立的純命令執行
4770* 要刻意作用於主簽出,請在工作階段外的終端機中自己執行命令4816* 要刻意作用於主簽出,請在工作階段外的終端機中自己執行命令
4771 4817
4772<h3 id="this-session-has-no-saved-transcript">4818<h3 id="this-session-has-no-saved-transcript">
4946* 或使用 `--agent <name>` 繼續,指定確實存在的 agent,以改為作為該 agent 執行工作階段4992* 或使用 `--agent <name>` 繼續,指定確實存在的 agent,以改為作為該 agent 執行工作階段
4947* 如果 agent 是專案範圍的,而您尚未信任工作階段的原始目錄,請在那裡執行 Claude Code 一次,接受信任對話框,然後再次繼續4993* 如果 agent 是專案範圍的,而您尚未信任工作階段的原始目錄,請在那裡執行 Claude Code 一次,接受信任對話框,然後再次繼續
4948 4994
4995<h3 id="restarted-after-its-next-loop-wakeup-was-due">
4996 This session restarted after its next /loop wakeup was due
4997</h3>
4998
4999[背景工作階段](/docs/zh-TW/agent-view)中的[自行調節步調的 `/loop`](/docs/zh-TW/scheduled-tasks#let-claude-choose-the-interval) 已停止。工作階段的程序在迴圈等待下一次喚醒時結束,而該次喚醒在工作階段的[下一個程序](/docs/zh-TW/agent-view#the-supervisor-process)啟動之前就已到期。錯過的喚醒不會延遲觸發。通知會說明工作階段重新啟動時該次喚醒已逾期多久:
5000
5001```text theme={null}
5002This session restarted 12m after its next /loop wakeup was due, so that wakeup will not fire. The loop stays stopped until Claude schedules it again: reply to continue it.
5003```
5004
5005在 v2.1.295 之前,迴圈在此情況下會停止而不顯示通知。
5006
5007**該怎麼做:**
5008
5009* 若要繼續迴圈,請[回覆該工作階段](/docs/zh-TW/agent-view#peek-and-reply)並如此說明,例如 `keep the loop running`。Claude 會連同您的回覆一起讀取通知,並可以排程下一次喚醒
5010* 如果您已不需要該迴圈,則什麼都不用做。它已經停止
5011
4949<h3 id="claude_code_process_wrapper-launcher-errors">5012<h3 id="claude_code_process_wrapper-launcher-errors">
4950 CLAUDE\_CODE\_PROCESS\_WRAPPER 啟動器錯誤5013 CLAUDE\_CODE\_PROCESS\_WRAPPER 啟動器錯誤
4951</h3>5014</h3>
5269當 Claude Code 退出時會列印此訊息,因為其終端介面遇到無法復原的錯誤,在任一轉譯器中都是如此。第二句僅在[全螢幕](/docs/zh-TW/fullscreen)轉譯器啟動時發生錯誤時出現:5332當 Claude Code 退出時會列印此訊息,因為其終端介面遇到無法復原的錯誤,在任一轉譯器中都是如此。第二句僅在[全螢幕](/docs/zh-TW/fullscreen)轉譯器啟動時發生錯誤時出現:
5270 5333
5271```text theme={null}5334```text theme={null}
5272Claude Code 在無法復原的介面錯誤 (<error>) 後退出。它在全螢幕轉譯器啟動時發生,因此下次啟動將使用傳統轉譯器(CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 隨時強制執行)。5335Claude Code exited after an unrecoverable interface error (<error>). It happened while the fullscreen renderer was starting, so the next launch will use the classic renderer (CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 forces that any time).
5273```5336```
5274 5337
5275**該怎麼做:**5338**該怎麼做:**
5286Claude Code 在對話檢視中顯示此警告作為啟動通知,而不是在 stderr 上。您的[子代理程式](/docs/zh-TW/sub-agents)(除了內建代理程式外)的組合描述超過 15,000 個令牌,如 Claude Code 估計的那樣。每個代理程式計算其名稱加上其 `description` frontmatter。Claude Code 無論總數是否超過限制都會載入每個代理程式,因此警告不會改變載入的內容。5349Claude Code 在對話檢視中顯示此警告作為啟動通知,而不是在 stderr 上。您的[子代理程式](/docs/zh-TW/sub-agents)(除了內建代理程式外)的組合描述超過 15,000 個令牌,如 Claude Code 估計的那樣。每個代理程式計算其名稱加上其 `description` frontmatter。Claude Code 無論總數是否超過限制都會載入每個代理程式,因此警告不會改變載入的內容。
5287 5350
5288```text theme={null}5351```text theme={null}
5289代理程式描述超過 15.0k 令牌限制(~16.2k 令牌)· 要求 Claude 修剪 .claude/agents/ 中的代理程式描述5352Agent descriptions are over the 15.0k-token limit (~16.2k tokens) · ask Claude to trim agent descriptions in .claude/agents/
5290```5353```
5291 5354
5292**該怎麼做:**5355**該怎麼做:**
5303Claude Code 在對話檢視中顯示此警告作為啟動通知,而不是在 stderr 上:5366Claude Code 在對話檢視中顯示此警告作為啟動通知,而不是在 stderr 上:
5304 5367
5305```text theme={null}5368```text theme={null}
5306未載入:重新命名 .claude/skills/anthropic-skills,然後重新啟動 — 其名稱使用 "anthropic-skills",這是為從您的 claude.ai 帳戶同步的技能保留的名稱5369Not loaded: rename .claude/skills/anthropic-skills, then restart — its name uses "anthropic-skills", a name reserved for the skills synced from your claude.ai account
5307```5370```
5308 5371
5309通知命名它拒絕的第一個項目要變更的內容:要重新命名的資料夾或檔案、要編輯的 `name:` 行,或要重新命名的工作流程。當拒絕了多個項目時,通知以計數結尾,例如 `· 2 more`,[偵錯日誌](/docs/zh-TW/debug-your-config)命名每一個。5372通知命名它拒絕的第一個項目要變更的內容:要重新命名的資料夾或檔案、要編輯的 `name:` 行,或要重新命名的工作流程。當拒絕了多個項目時,通知以計數結尾,例如 `· 2 more`,[偵錯日誌](/docs/zh-TW/debug-your-config)命名每一個。
5321Claude Code 在專案的 `.claude/settings.json` 或 `.claude/settings.local.json` 中找到 `permissions.allow` 規則或 `permissions.additionalDirectories` 項目,但未應用它們,因為[來自專案設定的允許規則需要工作區信任](/docs/zh-TW/permissions#project-allow-rules-and-workspace-trust)。計數、設定名稱和訊息中命名的檔案因您的設定而異。`deny` 和 `ask` 規則不受影響。5384Claude Code 在專案的 `.claude/settings.json` 或 `.claude/settings.local.json` 中找到 `permissions.allow` 規則或 `permissions.additionalDirectories` 項目,但未應用它們,因為[來自專案設定的允許規則需要工作區信任](/docs/zh-TW/permissions#project-allow-rules-and-workspace-trust)。計數、設定名稱和訊息中命名的檔案因您的設定而異。`deny` 和 `ask` 規則不受影響。
5322 5385
5323```text theme={null}5386```text theme={null}
5324忽略來自 .claude/settings.local.json 的 2 個 permissions.allow 項目:此工作區尚未受信任。在此處以互動方式執行 Claude Code 一次並接受信任對話,或在 /Users/you/.claude.json 中設定 projects["/Users/you/project"].hasTrustDialogAccepted: true。5387Ignoring 2 permissions.allow entries from .claude/settings.local.json: this workspace has not been trusted. Run Claude Code interactively here once and accept the trust dialog, or set projects["/Users/you/project"].hasTrustDialogAccepted: true in /Users/you/.claude.json.
5325```5388```
5326 5389
5327**該怎麼做:**5390**該怎麼做:**
5337Claude Code 不會將網路路徑新增為工作目錄。查詢網路路徑可以聯絡它命名的主機,在 Windows 上該聯絡可以將您的認證傳送給主機,因此 Claude Code 拒絕該路徑而不查詢它。當您使用此類路徑執行 `/add-dir` 時,或作為啟動時的警告時,您會看到此訊息。當它在啟動時出現時,Claude Code 啟動時不包含該目錄。5400Claude Code 不會將網路路徑新增為工作目錄。查詢網路路徑可以聯絡它命名的主機,在 Windows 上該聯絡可以將您的認證傳送給主機,因此 Claude Code 拒絕該路徑而不查詢它。當您使用此類路徑執行 `/add-dir` 時,或作為啟動時的警告時,您會看到此訊息。當它在啟動時出現時,Claude Code 啟動時不包含該目錄。
5338 5401
5339```text theme={null}5402```text theme={null}
5340\\server\share 是網路路徑,無法新增為工作目錄。在 Windows 上,將共用對應到磁碟機代號,並在啟動時使用 --add-dir 傳遞它(在工作階段中新增的磁碟機代號尚未帶有遠端讀取信任)。5403\\server\share is a network path, which cannot be added as a working directory. On Windows, map the share to a drive letter and pass it at launch with --add-dir (a drive letter added mid-session does not yet carry remote-read trust).
5341```5404```
5342 5405
5343Claude Code 以此方式拒絕的路徑包括:5406Claude Code 以此方式拒絕的路徑包括:
5344 5407
5345* UNC 共用,例如 `\\server\share`5408* UNC 共用,例如 `\\server\share`
5346* 自動掛載路徑,例如 `/net/<host>`,除非您從該主機的自動掛載下的目錄啟動 Claude Code5409* 自動掛載路徑,例如 `/net/<host>`,除非您從該主機的自動掛載下的目錄啟動 Claude Code。該自動掛載下的讀取仍會經過[網路路徑檢查](/docs/zh-TW/permissions#network-paths)。
5347* 透過符號連結或連接點到達網路位置的本機路徑5410* 透過符號連結或連接點到達網路位置的本機路徑
5348 5411
5349對應的磁碟機代號和 `\\wsl$` 路徑不計為網路路徑。5412對應的磁碟機代號和 `\\wsl$` 路徑不計為網路路徑。
5384您的組織的[伺服器受管設定](/docs/zh-TW/server-managed-settings)包括需要您批准的設定,且您拒絕了[安全批准對話](/docs/zh-TW/server-managed-settings#security-approval-dialogs),因此 Claude Code 退出而不應用它們:5447您的組織的[伺服器受管設定](/docs/zh-TW/server-managed-settings)包括需要您批准的設定,且您拒絕了[安全批准對話](/docs/zh-TW/server-managed-settings#security-approval-dialogs),因此 Claude Code 退出而不應用它們:
5385 5448
5386```text theme={null}5449```text theme={null}
5387受管設定未獲批准;退出而不應用它們。5450Managed settings were not approved; exiting without applying them.
5388```5451```
5389 5452
5390**該怎麼做:**5453**該怎麼做:**
5399您的組織的[受管設定](/docs/zh-TW/managed-settings)阻止預設選項解析為的模型以及它可以降級到的每個模型。將在預設選項上啟動的工作階段在啟動時退出,而不是執行被阻止的模型。您看到的訊息取決於阻止它的設定。當 [`deniedModels`](/docs/zh-TW/model-config#block-specific-models-or-versions) 清單阻止它時,訊息讀作:5462您的組織的[受管設定](/docs/zh-TW/managed-settings)阻止預設選項解析為的模型以及它可以降級到的每個模型。將在預設選項上啟動的工作階段在啟動時退出,而不是執行被阻止的模型。您看到的訊息取決於阻止它的設定。當 [`deniedModels`](/docs/zh-TW/model-config#block-specific-models-or-versions) 清單阻止它時,訊息讀作:
5400 5463
5401```text theme={null}5464```text theme={null}
5402Claude Code 無法啟動:您的組織的受管設定在 "deniedModels" 中阻止預設模型 (claude-opus-5-5),且它們允許的模型都無法用作預設模型。要求您的管理員更新 "deniedModels" 或 "availableModels"。5465Claude Code can't start: your organization's managed settings block the default model (claude-opus-5-5) in "deniedModels", and none of the models they allow can be used as the default instead. Ask your administrator to update "deniedModels" or "availableModels".
5403```5466```
5404 5467
5405當 `availableModels` 清單且 [`availableModelsMatch`](/docs/zh-TW/settings-reference#availablemodelsmatch) 設定為 `"exact"` 時省略它,訊息讀作:5468當 `availableModels` 清單且 [`availableModelsMatch`](/docs/zh-TW/settings-reference#availablemodelsmatch) 設定為 `"exact"` 時省略它,訊息讀作:
5406 5469
5407```text theme={null}5470```text theme={null}
5408Claude Code 無法啟動:您的組織僅允許 "availableModels" 中列出的模型,且它們都無法用作預設模型 (claude-opus-5-5 未列出)。要求您的管理員更新 "availableModels"。5471Claude Code can't start: your organization allows only the models listed in "availableModels", and none of them can be used as the default model (claude-opus-5-5 isn't listed). Ask your administrator to update "availableModels".
5409```5472```
5410 5473
5411**該怎麼做:**5474**該怎麼做:**
5420您的組織的[受管設定](/docs/zh-TW/managed-settings)設定了 [`allowedProviders`](/docs/zh-TW/settings-reference#allowedproviders) 清單,且工作階段的 API 提供者不在其上,或工作階段使用的端點不是以該項目要求的方式固定的。Claude Code 在啟動前、登入前或工作階段下次聯絡 API 時拒絕。訊息以允許的提供者開頭:5483您的組織的[受管設定](/docs/zh-TW/managed-settings)設定了 [`allowedProviders`](/docs/zh-TW/settings-reference#allowedproviders) 清單,且工作階段的 API 提供者不在其上,或工作階段使用的端點不是以該項目要求的方式固定的。Claude Code 在啟動前、登入前或工作階段下次聯絡 API 時拒絕。訊息以允許的提供者開頭:
5421 5484
5422```text theme={null}5485```text theme={null}
5423您的組織的受管設定允許 Claude Code 使用:Anthropic API、Amazon Bedrock。5486Your organization's managed settings allow Claude Code to use: Anthropic API, Amazon Bedrock.
5424```5487```
5425 5488
5426當清單為空時,訊息改為讀作:5489當清單為空時,訊息改為讀作:
5427 5490
5428```text theme={null}5491```text theme={null}
5429您的組織的受管設定允許 Claude Code 使用沒有 API 提供者(allowedProviders 是空清單),因此它無法在此機器上啟動。5492Your organization's managed settings allow Claude Code to use no API provider at all (allowedProviders is an empty list), so it cannot start on this machine.
5430```5493```
5431 5494
5432當每個項目都無法辨識時,括號讀作 `(allowedProviders lists only unrecognized entries)` 代替。5495當每個項目都無法辨識時,括號讀作 `(allowedProviders lists only unrecognized entries)` 代替。
5443您在 `/mcp` 中選擇了伺服器上的**重新連線**,或在那裡重新開啟了已停用的伺服器,且[限制 MCP 伺服器](/docs/zh-TW/managed-mcp)的設定阻止該伺服器。Claude Code 拒絕連線它並顯示:5506您在 `/mcp` 中選擇了伺服器上的**重新連線**,或在那裡重新開啟了已停用的伺服器,且[限制 MCP 伺服器](/docs/zh-TW/managed-mcp)的設定阻止該伺服器。Claude Code 拒絕連線它並顯示:
5444 5507
5445```text theme={null}5508```text theme={null}
5446MCP 伺服器 <name> 被企業受管策略阻止5509MCP server <name> is blocked by enterprise managed policy
5447```5510```
5448 5511
5449以下任何設定都可能產生訊息:5512以下任何設定都可能產生訊息:
5467您的組織部署[受管設定](/docs/zh-TW/managed-settings),且其中一個已部署的文件存在但無法解析為 JSON 物件,因此 Claude Code 在啟動時以代碼 1 退出,而不是執行而不使用文件帶來的策略。行在訊息前命名失敗的來源:5530您的組織部署[受管設定](/docs/zh-TW/managed-settings),且其中一個已部署的文件存在但無法解析為 JSON 物件,因此 Claude Code 在啟動時以代碼 1 退出,而不是執行而不使用文件帶來的策略。行在訊息前命名失敗的來源:
5468 5531
5469```text theme={null}5532```text theme={null}
5470/Library/Application Support/ClaudeCode/managed-settings.json:受管設定文件無法解析為 JSON 物件;其設定都不生效。修復或移除它。5533/Library/Application Support/ClaudeCode/managed-settings.json: Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.
5471```5534```
5472 5535
5473來源是以下其中之一:5536來源是以下其中之一:
5496您的組織部署[受管設定](/docs/zh-TW/managed-settings),且其中一個已部署的來源存在但無法讀取,原因例如 I/O 錯誤而不是作業系統拒絕讀取。沒有其他管理來源提供策略,Claude Code 在啟動時退出,而不是執行而不使用來源可能帶來的策略:5559您的組織部署[受管設定](/docs/zh-TW/managed-settings),且其中一個已部署的來源存在但無法讀取,原因例如 I/O 錯誤而不是作業系統拒絕讀取。沒有其他管理來源提供策略,Claude Code 在啟動時退出,而不是執行而不使用來源可能帶來的策略:
5497 5560
5498```text theme={null}5561```text theme={null}
5499無法讀取受管策略設定。5562Unable to read managed policy settings.
5500此機器可能需要組織登入強制執行,但策略檔案無法載入。5563This machine may require organization login enforcement, but the policy file failed to load.
5501聯絡您的管理員。5564Contact your administrator.
5502 5565
5503詳細資訊:<source>: <reason>5566Detail: <source>: <reason>
5504```5567```
5505 5568
5506在相同狀態下,登入流程、來自已執行工作階段的 API 要求,以及 [`claude gateway`](/docs/zh-TW/claude-apps-gateway) 伺服器被拒絕,使用命名 [`allowedProviders`](/docs/zh-TW/settings-reference#allowedproviders) 的第一行變體。5569在相同狀態下,登入流程、來自已執行工作階段的 API 要求,以及 [`claude gateway`](/docs/zh-TW/claude-apps-gateway) 伺服器被拒絕,使用命名 [`allowedProviders`](/docs/zh-TW/settings-reference#allowedproviders) 的第一行變體。
5525`See /status:` 後面的文字說明失敗的內容,例如指令碼的結束代碼後跟其錯誤輸出:5588`See /status:` 後面的文字說明失敗的內容,例如指令碼的結束代碼後跟其錯誤輸出:
5526 5589
5527```text theme={null}5590```text theme={null}
5528otelHeadersHelper 失敗;遙測未被匯出。請參閱 /status:exited 1: token service unreachable5591otelHeadersHelper failed; telemetry is not being exported. See /status: exited 1: token service unreachable
5529```5592```
5530 5593
5531**該怎麼做:**5594**該怎麼做:**
5545Claude Code 僅在[非互動模式](/docs/zh-TW/headless)中寫入此行,每個伺服器一次。在互動工作階段中,它改為將相同的拒絕寫入偵錯日誌。5608Claude Code 僅在[非互動模式](/docs/zh-TW/headless)中寫入此行,每個伺服器一次。在互動工作階段中,它改為將相同的拒絕寫入偵錯日誌。
5546 5609
5547```text theme={null}5610```text theme={null}
5548MCP 伺服器 'internal-api':headersHelper 未執行 — 此工作區沒有持久化信任;在此處以互動方式接受信任對話一次,或在 /Users/you/.claude.json 中設定 projects["/Users/you/project"].hasTrustDialogAccepted。5611MCP server 'internal-api': headersHelper not run — this workspace has no persisted trust; accept the trust dialog here once interactively, or set projects["/Users/you/project"].hasTrustDialogAccepted in /Users/you/.claude.json.
5549```5612```
5550 5613
5551訊息列印的 `projects` 金鑰是資料夾[專案允許規則和工作區信任](/docs/zh-TW/permissions#project-allow-rules-and-workspace-trust)說明 Claude Code 信任的金鑰。為父資料夾接受信任對話不滿足檢查,`-p` 或 SDK 工作階段也不滿足。5614訊息列印的 `projects` 金鑰是資料夾[專案允許規則和工作區信任](/docs/zh-TW/permissions#project-allow-rules-and-workspace-trust)說明 Claude Code 信任的金鑰。為父資料夾接受信任對話不滿足檢查,`-p` 或 SDK 工作階段也不滿足。
5563您的設定檔案中的[權限規則](/docs/zh-TW/permissions#permission-rule-syntax)沒有 `Tool` 或 `Tool(content)` 的形狀,例如因為文字跟在右括號後面或其中一個括號遺失。Claude Code 跳過規則,並在互動工作階段啟動時在無效設定對話中列出它,以及在 [`claude doctor`](/docs/zh-TW/debug-your-config#check-resolved-settings) 輸出中:5626您的設定檔案中的[權限規則](/docs/zh-TW/permissions#permission-rule-syntax)沒有 `Tool` 或 `Tool(content)` 的形狀,例如因為文字跟在右括號後面或其中一個括號遺失。Claude Code 跳過規則,並在互動工作階段啟動時在無效設定對話中列出它,以及在 [`claude doctor`](/docs/zh-TW/debug-your-config#check-resolved-settings) 輸出中:
5564 5627
5565```text theme={null}5628```text theme={null}
5566無效權限規則 "Bash(ls) x" 已跳過:格式不正確的 Tool(content) 規則。規則採用 Tool 或 Tool(content) 的形式,必須在右括號 ")" 處結束;括號內的內容是字面意思5629Invalid permission rule "Bash(ls) x" was skipped: Malformed Tool(content) rule. Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal
5567```5630```
5568 5631
5569**該怎麼做:**5632**該怎麼做:**
5570 5633
5571* 在訊息列出的設定檔中,重寫規則使其在其右括號處結束,例如用 `Bash(ls *)` 代替 `Bash(ls) x`5634* 在訊息列出的設定檔中,重寫規則使其在其右括號處結束,例如用 `Bash(ls *)` 代替 `Bash(ls) x`
5572* 將括號內的內容保留原樣。它們是字面意思,因此規則如 `Edit(./Finance (2024)/*)` 無需逃逸即有效5635* 內容中的括號保持原樣。它們是字面字元,因此像 `Edit(./Finance (2024)/**)` 這樣的規則無需跳脫即有效
5573 5636
5574在 v2.1.260 之前,Claude Code 將括號不相符的規則報告為 `Mismatched parentheses`。5637在 v2.1.260 之前,Claude Code 將括號不相符的規則報告為 `Mismatched parentheses`。
5575 5638
5580Claude Code 在您的[設定檔案](/docs/zh-TW/settings#where-settings-live)、[受管設定](/docs/zh-TW/managed-settings)或 `--allowedTools`、`--disallowedTools` 或 `--settings` 旗標值中找到了具有路徑的 `Write`、`NotebookEdit`、`MultiEdit` 或 `Glob`[權限規則](/docs/zh-TW/permissions#read-and-edit)。它僅針對 `Edit` 和 `Read` 規則檢查檔案權限,因此它永遠不會查詢命名其他檔案工具之一的路徑規則。它保留規則並不改變其他任何內容;警告命名規則、其在括號中的來源和要寫入的替換:5643Claude Code 在您的[設定檔案](/docs/zh-TW/settings#where-settings-live)、[受管設定](/docs/zh-TW/managed-settings)或 `--allowedTools`、`--disallowedTools` 或 `--settings` 旗標值中找到了具有路徑的 `Write`、`NotebookEdit`、`MultiEdit` 或 `Glob`[權限規則](/docs/zh-TW/permissions#read-and-edit)。它僅針對 `Edit` 和 `Read` 規則檢查檔案權限,因此它永遠不會查詢命名其他檔案工具之一的路徑規則。它保留規則並不改變其他任何內容;警告命名規則、其在括號中的來源和要寫入的替換:
5581 5644
5582```text theme={null}5645```text theme={null}
5583權限拒絕規則 (.claude/settings.json):Write(docs/**) 不符合檔案權限檢查 — 僅 Edit(path) 規則。改用 Edit(docs/**)(Edit 規則涵蓋所有檔案編輯工具)。5646Permission deny rule (.claude/settings.json): Write(docs/**) is not matched by file permission checks — only Edit(path) rules are. Use Edit(docs/**) instead (Edit rules cover all file-editing tools).
5584```5647```
5585 5648
5586**該怎麼做:**5649**該怎麼做:**
5602警告存在是為了讓您縮小萬用字元比您預期更寬的規則。Claude Code 保留規則並不改變它相符的方式;警告命名規則及其在括號中的來源:5665警告存在是為了讓您縮小萬用字元比您預期更寬的規則。Claude Code 保留規則並不改變它相符的方式;警告命名規則及其在括號中的來源:
5603 5666
5604```text theme={null}5667```text theme={null}
5605權限允許規則 (.claude/settings.json):Bash(git -C * status *) 在命令的其餘部分之前有萬用字元,因此它也符合在該位置插入的任何選項並批准它們而不提示。對於 git,選項如 -c 和 --exec-path 可以執行任意命令。將該 * 替換為您的確切值,或僅在子命令後使用 *(例如 Bash(git status *))。5668Permission allow rule (.claude/settings.json): Bash(git -C * status *) has a wildcard before the rest of the command, so it also matches any options inserted at that position and approves them without a prompt. For git, options such as -c and --exec-path can run arbitrary commands. Replace that * with the exact value you mean, or only use * after the subcommand (for example Bash(git status *)).
5606```5669```
5607 5670
5608**該怎麼做:**5671**該怎麼做:**
5638設定檔案將 [`crossSessionInbound`](/docs/zh-TW/settings-reference#crosssessioninbound) 設定為 Claude Code 無法辨識的值,例如打字錯誤 `"reject"`。警告的第二句取決於哪個檔案保持該值;在使用者、專案、本機或 `--settings` 檔案中讀取:5701設定檔案將 [`crossSessionInbound`](/docs/zh-TW/settings-reference#crosssessioninbound) 設定為 Claude Code 無法辨識的值,例如打字錯誤 `"reject"`。警告的第二句取決於哪個檔案保持該值;在使用者、專案、本機或 `--settings` 檔案中讀取:
5639 5702
5640```text theme={null}5703```text theme={null}
5641"crossSessionInbound" 必須是 "accept"、"hold"、"refuse" 之一;收到 "reject"。此值被忽略;當它存在時,跨工作階段訊息被保持以供您批准,而不是被傳遞。將其設定為上述值之一。5704"crossSessionInbound" must be one of "accept", "hold", "refuse"; received "reject". This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.
5642```5705```
5643 5706
5644在[受管設定](/docs/zh-TW/managed-settings)中,Claude Code 將無法辨識的值視為 `refuse`(最限制的值),警告說跨工作階段訊息被拒絕,直到管理員修復它。有關保持如何與您其他設定檔案中的值結合,請參閱 [`crossSessionInbound`](/docs/zh-TW/settings-reference#crosssessioninbound)。5707在[受管設定](/docs/zh-TW/managed-settings)中,Claude Code 將無法辨識的值視為 `refuse`(最限制的值),警告說跨工作階段訊息被拒絕,直到管理員修復它。有關保持如何與您其他設定檔案中的值結合,請參閱 [`crossSessionInbound`](/docs/zh-TW/settings-reference#crosssessioninbound)。
5672您設定了 [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](/docs/zh-TW/env-vars),這通常使[自動壓縮](/docs/zh-TW/model-config#default-auto-compact-thresholds)在 1M 上下文模型上保持工作階段至 200K 視窗,但沒有壓縮閾值將此工作階段限制在或低於 200K,因此對話可以超過它。5735您設定了 [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](/docs/zh-TW/env-vars),這通常使[自動壓縮](/docs/zh-TW/model-config#default-auto-compact-thresholds)在 1M 上下文模型上保持工作階段至 200K 視窗,但沒有壓縮閾值將此工作階段限制在或低於 200K,因此對話可以超過它。
5673 5736
5674```text theme={null}5737```text theme={null}
5675CLAUDE_CODE_DISABLE_1M_CONTEXT 已設定,但 <model> 的 200K 限制未強制執行,因此此工作階段可以超過它。若要強制執行,設定 CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000(或 autoCompactWindow 設定)。5738CLAUDE_CODE_DISABLE_1M_CONTEXT is set, but the 200K limit isn't enforced for <model>, so this session can grow past it. To enforce it, set CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 (or the autoCompactWindow setting).
5676```5739```
5677 5740
5678Claude Code 為它辨識為具有原生 1M 視窗的每個模型自行強制執行 200K 限制,對於它無法辨識的模型 ID,它在它假設的視窗處壓縮。當其他設定擊敗該強制執行時出現警告:5741Claude Code 為它辨識為具有原生 1M 視窗的每個模型自行強制執行 200K 限制,對於它無法辨識的模型 ID,它在它假設的視窗處壓縮。當其他設定擊敗該強制執行時出現警告:
5741當沙箱化命令執行時,沙箱透過在那裡建立 0 位元組唯讀佔位符來保持對尚不存在的檔案的寫入拒絕,並在之後移除它。在該清理執行前被殺死的工作階段(例如透過 SIGKILL)會留下佔位符。後續工作階段在每次啟動時再次唯讀繫結它們,因此設定寫入(例如儲存「是,不要再問」)在其中一個所在的位置失敗。5804當沙箱化命令執行時,沙箱透過在那裡建立 0 位元組唯讀佔位符來保持對尚不存在的檔案的寫入拒絕,並在之後移除它。在該清理執行前被殺死的工作階段(例如透過 SIGKILL)會留下佔位符。後續工作階段在每次啟動時再次唯讀繫結它們,因此設定寫入(例如儲存「是,不要再問」)在其中一個所在的位置失敗。
5742 5805
5743```text theme={null}5806```text theme={null}
5744- 被殺死的工作階段留下的過時沙箱遮罩檔案:/home/you/project/.claude/settings.local.json5807- Stale sandbox mask files left by a killed session: /home/you/project/.claude/settings.local.json
5745 修復:在該專案中沒有其他 Claude Code 工作階段執行時,使用 `rm <path>` 移除每個 — 0 位元組唯讀檔案(其中設定檔案所在)使「是,不要再問」無法儲存,沙箱在每次啟動時再次唯讀繫結它5808 Fix: Remove each with `rm <path>` while no other Claude Code session is running in that project — a 0-byte read-only file where a settings file belongs makes "Yes, and don't ask again" fail to save, and the sandbox binds it read-only again on every start
5746```5809```
5747 5810
5748**該怎麼做:**5811**該怎麼做:**