SpyBara
Go Premium

Documentation 2026-11-24 22:59 UTC to 2026-11-25 11:59 UTC

92 files changed +1,197 −784. View all changes and history on the product overview
2026
Wed 25 11:59 Tue 24 22:59 Mon 23 23:59 Sun 22 22:59 Sat 21 22:57 Fri 20 23:57 Thu 19 23:00 Wed 18 23:59 Tue 17 23:01 Mon 16 23:59 Sat 14 23:57 Fri 13 23:02 Thu 12 23:02 Wed 11 22:59 Tue 10 21:57 Mon 9 23:02 Sun 8 22:58 Sat 7 23:58 Fri 6 23:01 Thu 5 23:03 Wed 4 23:59 Tue 3 23:58 Mon 2 23:57 Sun 1 23:57

admin-setup.md +3 −3

Details

53 53 

54Claude Code 在啟動時擷取 server-managed 設定,並在工作階段期間每小時重新整理一次,無需部署端點基礎設施。透過 claude.ai 管理員控制台傳遞需要 Claude for Teams 或 Enterprise 計畫。在 Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 上的部署可以透過執行 [Claude apps gateway](https://code.claude.com/docs/zh-TW/claude-apps-gateway) 獲得相同的遠端傳遞,或改用其中一個基於檔案或作業系統級別的機制。54Claude Code 在啟動時擷取 server-managed 設定,並在工作階段期間每小時重新整理一次,無需部署端點基礎設施。透過 claude.ai 管理員控制台傳遞需要 Claude for Teams 或 Enterprise 計畫。在 Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 上的部署可以透過執行 [Claude apps gateway](https://code.claude.com/docs/zh-TW/claude-apps-gateway) 獲得相同的遠端傳遞,或改用其中一個基於檔案或作業系統級別的機制。

55 55 

56如果您在 claude.ai 的 **Organization settings > Desktop 3P** 下設定提供者或閘道,請參閱 Enterprise Admin Console 指南中的[哪些設定優先](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority)。56如果您在 claude.ai 的 [**Organization settings > Desktop 3P**](https://claude.ai/admin-settings/desktop-deployment) 下設定提供者或閘道,請參閱 Enterprise Admin Console 指南中的[哪些設定優先](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority)。

57 57 

58如果您的組織混合使用提供者,請為 claude.ai 使用者設定 [server-managed settings](https://code.claude.com/docs/zh-TW/server-managed-settings.md) 加上 [基於檔案或 plist/registry 的備援](https://code.claude.com/docs/zh-TW/managed-settings.md#delivery-mechanisms),以便其他使用者仍然接收受管政策。58如果您的組織混合使用提供者,請為 claude.ai 使用者設定 [server-managed settings](https://code.claude.com/docs/zh-TW/server-managed-settings.md) 加上 [基於檔案或 plist/registry 的備援](https://code.claude.com/docs/zh-TW/managed-settings.md#delivery-mechanisms),以便其他使用者仍然接收受管政策。

59 59 


158 158 

159**1. 允許組織**159**1. 允許組織**

160 160 

161以 Team 或 Enterprise 方案的擁有者身分,在瀏覽器中開啟 [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control) 的 GitHub 區段,然後點擊 **Choose organizations**。在表格中選取您核准的組織,然後點擊 **Allow**。請包含已連結的組織,因為它們不會自動被允許。161在 Team 或 Enterprise 方案中,[擁有者](https://code.claude.com/docs/zh-TW/server-managed-settings.md#access-control)可以進行此設定。在瀏覽器中開啟 [**Organization settings > Git providers**](https://claude.ai/admin-settings/source-control) 的 GitHub 區段,然後點擊 **Choose organizations**。在表格中選取您核准的組織,然後點擊 **Allow**。請包含已連結的組織,因為它們不會自動被允許。

162 162 

163**2. 依名稱允許其他帳戶**163**2. 依名稱允許其他帳戶**

164 164 


189| Usage monitoring | 會話、工具和令牌的 OpenTelemetry 匯出 | 所有提供者 | [Monitoring usage](https://code.claude.com/docs/zh-TW/monitoring-usage.md) |189| Usage monitoring | 會話、工具和令牌的 OpenTelemetry 匯出 | 所有提供者 | [Monitoring usage](https://code.claude.com/docs/zh-TW/monitoring-usage.md) |

190| Analytics dashboard | Teams / Enterprise 上具有排行榜的採用和貢獻指標;Console 上的每個使用者使用情況和支出指標 | Teams / Enterprise 在 [claude.ai/analytics](https://claude.ai/analytics/claude-code),Console 在 [platform.claude.com/claude-code](https://platform.claude.com/claude-code) | [Analytics](https://code.claude.com/docs/zh-TW/analytics.md) |190| Analytics dashboard | Teams / Enterprise 上具有排行榜的採用和貢獻指標;Console 上的每個使用者使用情況和支出指標 | Teams / Enterprise 在 [claude.ai/analytics](https://claude.ai/analytics/claude-code),Console 在 [platform.claude.com/claude-code](https://platform.claude.com/claude-code) | [Analytics](https://code.claude.com/docs/zh-TW/analytics.md) |

191| Programmatic reporting | 透過 API 的每個使用者使用情況和成本資料 | Enterprise 的 [Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics),Console 的 [Claude Code Analytics API](https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api) | [Costs](https://code.claude.com/docs/zh-TW/costs.md#manage-costs-for-your-organization) |191| Programmatic reporting | 透過 API 的每個使用者使用情況和成本資料 | Enterprise 的 [Enterprise Analytics API](https://platform.claude.com/docs/en/api/admin/analytics),Console 的 [Claude Code Analytics API](https://platform.claude.com/docs/en/build-with-claude/claude-code-analytics-api) | [Costs](https://code.claude.com/docs/zh-TW/costs.md#manage-costs-for-your-organization) |

192| Spend controls | 支出限制和速率限制 | Teams / Enterprise 的組織設定、Console 的工作區限制;在第三方雲端上,雲端預算控制或具有每個使用者[支出限制](https://code.claude.com/docs/zh-TW/claude-apps-gateway-spend-limits.md)的 [Claude 應用程式閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway) | [Costs](https://code.claude.com/docs/zh-TW/costs.md#manage-costs-for-your-organization) |192| Spend controls | 支出限制和速率限制 | Teams / Enterprise 的[組織設定](https://claude.ai/admin-settings/usage)、Console 的工作區限制;在第三方雲端上,雲端預算控制或具有每個使用者[支出限制](https://code.claude.com/docs/zh-TW/claude-apps-gateway-spend-limits.md)的 [Claude 應用程式閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway) | [Costs](https://code.claude.com/docs/zh-TW/costs.md#manage-costs-for-your-organization) |

193 193 

194在 Teams 和 Enterprise 上,每個使用者的使用情況和支出數字來自您組織分析設定中的[支出報告](https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans),而不是分析儀表板。雲端提供者透過 AWS Cost Explorer、GCP Billing 或 Azure Cost Management 公開支出。如需規劃跨 Claude chat、Claude Code 和 Cowork 的企業預算,請參閱 [Claude Enterprise 消費指南](https://support.claude.com/en/articles/14782391-claude-enterprise-consumption-guide)。194在 Teams 和 Enterprise 上,每個使用者的使用情況和支出數字來自您組織分析設定中的[支出報告](https://support.claude.com/en/articles/12883420-view-usage-analytics-for-team-and-enterprise-plans),而不是分析儀表板。雲端提供者透過 AWS Cost Explorer、GCP Billing 或 Azure Cost Management 公開支出。如需規劃跨 Claude chat、Claude Code 和 Cowork 的企業預算,請參閱 [Claude Enterprise 消費指南](https://support.claude.com/en/articles/14782391-claude-enterprise-consumption-guide)。

195 195 

advisor.md +2 −2

Details

50* 執行帶有模型的 `/advisor`,例如 `/advisor opus`,以設定它。50* 執行帶有模型的 `/advisor`,例如 `/advisor opus`,以設定它。

51* 執行 `/advisor off` 以關閉它。51* 執行 `/advisor off` 以關閉它。

52 52 

53Claude Code 不會叫用您組織的 [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單排除的已儲存顧問。若要使用顧問,請使用 `/advisor` 選擇允許的模型。53Claude Code 不會叫用被您設定中的 [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單排除的已儲存顧問。若要使用顧問,請使用 `/advisor` 選擇允許的模型。

54 54 

55Claude Code 仍會儲存您目前主要模型不支援的顧問。該顧問會在您使用 [`/model`](https://code.claude.com/docs/zh-TW/model-config#setting-your-model) 切換到[相容的主要模型](#choose-an-advisor-model)後啟動。如果 API 已在目前對話中拒絕了已儲存的顧問,它會保持關閉狀態,直到 `/clear` 或 `/compact`,即使在您切換模型之後也是如此。55Claude Code 仍會儲存您目前主要模型不支援的顧問。該顧問會在您使用 [`/model`](https://code.claude.com/docs/zh-TW/model-config#setting-your-model) 切換到[相容的主要模型](#choose-an-advisor-model)後啟動。如果 API 已在目前對話中拒絕了已儲存的顧問,它會保持關閉狀態,直到 `/clear` 或 `/compact`,即使在您切換模型之後也是如此。

56 56 


78 78 

79* 工作階段的主要模型不支援顧問79* 工作階段的主要模型不支援顧問

80* 要求的模型(例如 Haiku 4.5)無法充當顧問80* 要求的模型(例如 Haiku 4.5)無法充當顧問

81* 您組織的 [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單排除了要求的模型81* [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單排除了要求的模型

82* 您要求了 Fable,而您的帳戶仍需要[用量點數同意](#fable-advisor-and-usage-credits)82* 您要求了 Fable,而您的帳戶仍需要[用量點數同意](#fable-advisor-and-usage-credits)

83 83 

84如果您使用 `--advisor` 啟動[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md),且上述任何情況成立,Claude Code 會在沒有顧問的情況下啟動工作階段,而不是退出。84如果您使用 `--advisor` 啟動[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md),且上述任何情況成立,Claude Code 會在沒有顧問的情況下啟動工作階段,而不是退出。

Details

143使用 `maxTurns` / `max_turns` 和 `maxBudgetUsd` / `max_budget_usd` 限制回合和支出。當未設定時,兩個上限都關閉。當工作階段達到上限時,執行會以結果訊息結束。該結果的子類型在達到回合上限時為 `error_max_turns`,在達到支出上限時為 `error_max_budget_usd`。單次輸入與串流輸入處理上限結果的方式不同:143使用 `maxTurns` / `max_turns` 和 `maxBudgetUsd` / `max_budget_usd` 限制回合和支出。當未設定時,兩個上限都關閉。當工作階段達到上限時,執行會以結果訊息結束。該結果的子類型在達到回合上限時為 `error_max_turns`,在達到支出上限時為 `error_max_budget_usd`。單次輸入與串流輸入處理上限結果的方式不同:

144 144 

145* **單次 `query()`**:SDK 產生上限結果,然後引發,因此將迴圈包裝在 try 區塊中以在錯誤後繼續145* **單次 `query()`**:SDK 產生上限結果,然後引發,因此將迴圈包裝在 try 區塊中以在錯誤後繼續

146* **串流輸入**:工作階段在上限結果後保持活動,最大回合計數為每個排隊訊息重新開始。預算總計在訊息中累積,一旦支出達到上限,同一對話中的後續訊息以相同的預算結果結束。[`/clear`](https://code.claude.com/docs/zh-TW/agent-sdk/cost-tracking) 會重新開始預算。146* **串流輸入**:工作階段在上限結果後保持活動,最大回合計數會重新開始。預算總計在訊息中累積,一旦支出達到上限,同一對話中的後續訊息以相同的預算結果結束。[`/clear`](https://code.claude.com/docs/zh-TW/agent-sdk/cost-tracking) 會重新開始預算。

147* **TypeScript 中的串流輸入**:當最後一個回應以錯誤結果(例如 `error_max_turns`)結束時,迴圈會擲回例外。將迴圈包裝在 try 區塊中,以在錯誤後繼續。147* **TypeScript 中的串流輸入**:當最後一個回應以錯誤結果(例如 `error_max_turns`)結束時,迴圈會擲回例外。將迴圈包裝在 try 區塊中,以在錯誤後繼續。

148 148 

149兩個上限對 `0` 的處理方式不同:149兩個上限對 `0` 的處理方式不同:

Details

234| `OTEL_LOG_USER_PROMPTS=1` | `claude_code.user_prompt` 事件和 `claude_code.interaction` span 上的提示文字 |234| `OTEL_LOG_USER_PROMPTS=1` | `claude_code.user_prompt` 事件和 `claude_code.interaction` span 上的提示文字 |

235| `OTEL_LOG_TOOL_DETAILS=1` | `claude_code.tool_result` 事件上的工具輸入引數(例如檔案路徑、shell 命令和搜尋模式),以及[成本和 token 指標](https://code.claude.com/docs/zh-TW/monitoring-usage.md#cost-counter)上的真實 agent、skill、外掛和 MCP 伺服器名稱。自動模式分類器在封鎖呼叫時所指明的內建規則,會以 `claude_code.tool_decision` 事件上的 [`classifier_category`](https://code.claude.com/docs/zh-TW/monitoring-usage#tool-decision-event) 呈現 |235| `OTEL_LOG_TOOL_DETAILS=1` | `claude_code.tool_result` 事件上的工具輸入引數(例如檔案路徑、shell 命令和搜尋模式),以及[成本和 token 指標](https://code.claude.com/docs/zh-TW/monitoring-usage.md#cost-counter)上的真實 agent、skill、外掛和 MCP 伺服器名稱。自動模式分類器在封鎖呼叫時所指明的內建規則,會以 `claude_code.tool_decision` 事件上的 [`classifier_category`](https://code.claude.com/docs/zh-TW/monitoring-usage#tool-decision-event) 呈現 |

236| `OTEL_LOG_TOOL_CONTENT=1` | `claude_code.tool` 上的 [`tool.output` span 事件](https://code.claude.com/docs/zh-TW/monitoring-usage#tool-output-span-event),包含檔案內容、Bash 輸出,以及 MCP 工具、WebFetch 和 WebSearch 返回的內容,預設截斷為 60 KB,可透過 `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` 設定,需要 Claude Code v2.1.214 或更新版本。來自 MCP 工具、WebFetch 和 WebSearch 的結果需要 Claude Code v2.1.283 或更新版本。需要啟用[追蹤](#read-agent-traces)。Span 屬性在[其自身的閘道](https://code.claude.com/docs/zh-TW/monitoring-usage.md#new-context-gates)下攜帶工具內容 |236| `OTEL_LOG_TOOL_CONTENT=1` | `claude_code.tool` 上的 [`tool.output` span 事件](https://code.claude.com/docs/zh-TW/monitoring-usage#tool-output-span-event),包含檔案內容、Bash 輸出,以及 MCP 工具、WebFetch 和 WebSearch 返回的內容,預設截斷為 60 KB,可透過 `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` 設定,需要 Claude Code v2.1.214 或更新版本。來自 MCP 工具、WebFetch 和 WebSearch 的結果需要 Claude Code v2.1.283 或更新版本。需要啟用[追蹤](#read-agent-traces)。Span 屬性在[其自身的閘道](https://code.claude.com/docs/zh-TW/monitoring-usage.md#new-context-gates)下攜帶工具內容 |

237| `OTEL_LOG_RAW_API_BODIES` | 完整的 Anthropic Messages API 請求和回應 JSON 作為 `claude_code.api_request_body` 和 `claude_code.api_response_body` 日誌事件。設定為 `1` 以獲得預設截斷為 60 KB 的內聯主體,或 `file:<dir>` 以在磁碟上獲得未截斷的主體,事件中有 `body_ref` 路徑。`CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` 設定內聯截斷限制,並需要 Claude Code v2.1.214 或更新版本。主體包括整個對話歷史記錄,並且已遮蔽延伸思考內容。啟用此項意味著同意上述三個變數將揭示的所有內容 |237| `OTEL_LOG_RAW_API_BODIES` | 完整的 Anthropic Messages API 請求和回應 JSON 作為 `claude_code.api_request_body` 和 `claude_code.api_response_body` 日誌事件。設定為 `1` 以獲得[預設截斷為 60 KB](https://code.claude.com/docs/zh-TW/monitoring-usage.md#common-configuration-variables) 的內聯主體,或 `file:<dir>` 以在磁碟上獲得未截斷的主體,事件中有 `body_ref` 路徑。主體可能包含整個對話歷史記錄,並且已遮蔽延伸思考內容。啟用此項意味著同意上述三個變數將揭示的所有內容 |

238 238 

239除非您的可觀測性管道已獲准儲存您的代理處理的資料,否則請保持這些未設定。請參閱監控參考中的[安全和隱私](https://code.claude.com/docs/zh-TW/monitoring-usage.md#security-and-privacy)以了解完整的屬性清單和編輯行為。239除非您的可觀測性管道已獲准儲存您的代理處理的資料,否則請保持這些未設定。請參閱監控參考中的[安全和隱私](https://code.claude.com/docs/zh-TW/monitoring-usage.md#security-and-privacy)以了解完整的屬性清單和編輯行為。

240 240 

Details

2809 "taskId": str, # 背景監視任務的 ID2809 "taskId": str, # 背景監視任務的 ID

2810 "timeoutMs": int, # 監視的有效截止時間(毫秒)2810 "timeoutMs": int, # 監視的有效截止時間(毫秒)

2811 "persistent": bool | None, # False:每個監視都有截止時間2811 "persistent": bool | None, # False:每個監視都有截止時間

2812 "keptInSandboxByCheck": bool | None,

2812}2813}

2813```2814```

2814 2815 

Details

2088 | "org_config_required_unavailable"2088 | "org_config_required_unavailable"

2089 | "org_config_refused"2089 | "org_config_refused"

2090 | "sandbox_required_unavailable"2090 | "sandbox_required_unavailable"

2091 | "config_file_invalid";2091 | "config_file_invalid"

2092 | "sideload_flags_disabled";

2092```2093```

2093 2094 

2094每個值指名一種拒絕:2095每個值指名一種拒絕:


2116| `org_config_refused` | Anthropic 拒絕為此登入提供組織的原則和受管設定,例如因為登入已過期或已被撤銷,或組織不允許此帳戶使用 Claude Code。需要 Agent SDK v0.3.293 或更新版本 |2117| `org_config_refused` | Anthropic 拒絕為此登入提供組織的原則和受管設定,例如因為登入已過期或已被撤銷,或組織不允許此帳戶使用 Claude Code。需要 Agent SDK v0.3.293 或更新版本 |

2117| `sandbox_required_unavailable` | [`failIfUnavailable`](#sandboxsettings) 已開啟且沙箱無法啟動。`errors` 中的文字以 `Set sandbox.failIfUnavailable=false to allow unsandboxed execution.` 結尾。需要 Agent SDK v0.3.314 或更新版本 |2118| `sandbox_required_unavailable` | [`failIfUnavailable`](#sandboxsettings) 已開啟且沙箱無法啟動。`errors` 中的文字以 `Set sandbox.failIfUnavailable=false to allow unsandboxed execution.` 結尾。需要 Agent SDK v0.3.314 或更新版本 |

2118| `config_file_invalid` | `~/.claude.json` 不是有效的 JSON。Claude Code 會保持該檔案不變,因此在有人修復它之前,重試都會以相同方式失敗。`errors` 會指出該檔案並說明如何還原或修復它。請參閱 [Configuration error in \~/.claude.json](https://code.claude.com/docs/zh-TW/errors.md#configuration-error-in-claude-json)。需要 TypeScript Agent SDK v0.3.318 或更新版本,以及 Claude Code v2.1.318 或更新版本 |2119| `config_file_invalid` | `~/.claude.json` 不是有效的 JSON。Claude Code 會保持該檔案不變,因此在有人修復它之前,重試都會以相同方式失敗。`errors` 會指出該檔案並說明如何還原或修復它。請參閱 [Configuration error in \~/.claude.json](https://code.claude.com/docs/zh-TW/errors.md#configuration-error-in-claude-json)。需要 TypeScript Agent SDK v0.3.318 或更新版本,以及 Claude Code v2.1.318 或更新版本 |

2120| `sideload_flags_disabled` | 某個旗標或啟動選項違反了受管的 [`disableSideloadFlags`](https://code.claude.com/docs/zh-TW/settings-reference#disablesideloadflags)。需要 TypeScript Agent SDK v0.3.331 或更新版本,以及 Claude Code v2.1.331 或更新版本 |

2119 2121 

2120### `SDKSystemMessage`2122### `SDKSystemMessage`

2121 2123 

agent-teams.md +1 −1

Details

170>170>

171> `teammateDefaultModel` 在 v2.1.234 中被移除;Claude Code 忽略任何遺留值。改為在您的提示中命名模型。171> `teammateDefaultModel` 在 v2.1.234 中被移除;Claude Code 忽略任何遺留值。改為在您的提示中命名模型。

172 172 

173Claude Code 根據您組織的 [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單檢查為隊友選擇的模型。當允許清單阻止某個值時,Claude Code 會替換另一個模型:173Claude Code 會根據任何 [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單檢查它為隊友選擇的模型。當允許清單阻止某個值時,Claude Code 會替換另一個模型:

174 174 

175* **家族別名,例如 `opus`**:在 Anthropic API 和 AWS 上的 Claude Platform 上,Claude Code 在允許清單允許的該家族的最新版本上運行隊友。在具有提供者特定模型 ID 的提供者上,其中[替換不運行](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection),被阻止的別名會根據下一個項目符號像任何其他被阻止的值一樣回退175* **家族別名,例如 `opus`**:在 Anthropic API 和 AWS 上的 Claude Platform 上,Claude Code 在允許清單允許的該家族的最新版本上運行隊友。在具有提供者特定模型 ID 的提供者上,其中[替換不運行](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection),被阻止的別名會根據下一個項目符號像任何其他被阻止的值一樣回退

176* **任何其他被阻止的值,包括提供者特定模型 ID 提供者上的家族別名,或其家族沒有允許版本的別名**:Claude Code 在主管的模型上運行隊友。如果您設定 `CLAUDE_CODE_SUBAGENT_MODEL`,Claude Code 會先嘗試該模型,遵循相同的規則176* **任何其他被阻止的值,包括提供者特定模型 ID 提供者上的家族別名,或其家族沒有允許版本的別名**:Claude Code 在主管的模型上運行隊友。如果您設定 `CLAUDE_CODE_SUBAGENT_MODEL`,Claude Code 會先嘗試該模型,遵循相同的規則

agent-view.md +1 −1

Details

849 849 

850* **工作中、暫停在權限提示或其他對話框上,或已連接**:程序保持執行。執行中的 subagent、工作流程或監視器計為工作中,待處理的[工作階段範圍排程任務](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)(例如 `/loop` 喚醒)也是如此。850* **工作中、暫停在權限提示或其他對話框上,或已連接**:程序保持執行。執行中的 subagent、工作流程或監視器計為工作中,待處理的[工作階段範圍排程任務](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)(例如 `/loop` 喚醒)也是如此。

851* **已完成或等待您的下一條訊息,且未連接約一小時**:監督程序停止程序以釋放資源。透過提出問題結束其回合的工作階段計為等待您的下一條訊息。對話保存在磁碟上,下次您連接或回覆時,工作階段從中斷的地方恢復。使用 `Ctrl+T` 釘選工作階段以保持其程序執行。851* **已完成或等待您的下一條訊息,且未連接約一小時**:監督程序停止程序以釋放資源。透過提出問題結束其回合的工作階段計為等待您的下一條訊息。對話保存在磁碟上,下次您連接或回覆時,工作階段從中斷的地方恢復。使用 `Ctrl+T` 釘選工作階段以保持其程序執行。

852* **在監督程序執行時意外退出**:監督程序重新啟動程序。結束您自己使用 `←` 或 `/background` 背景化的工作階段(例如使用 `kill`)會將其標記為已停止而不是重新啟動。對於以關閉結束的工作階段,請參閱[工作階段在關閉後顯示為失敗或已停止](#sessions-show-as-failed-after-shutdown)。852* **在監督程序執行時意外退出**:監督程序可以重新啟動程序。結束您自己使用 `←` 或 `/background` 背景化的工作階段(例如使用 `kill`)會將其標記為已停止而不是重新啟動。如果工作階段的列顯示 `∙`,請選取它並按 `Enter` 以重新啟動該工作階段。對於以關閉結束的工作階段,請參閱[工作階段在關閉後顯示為失敗或已停止](#sessions-show-as-failed-after-shutdown)。

853* **自動更新後**:監督程序重新啟動自身到新版本,並在背景中移動閒置工作階段。正在工作、等待您或已連接的工作階段不會被中斷。853* **自動更新後**:監督程序重新啟動自身到新版本,並在背景中移動閒置工作階段。正在工作、等待您或已連接的工作階段不會被中斷。

854* **監督程序本身停止**,例如因為其程序從 Claude Code 外部被結束:在 macOS 和 Linux 上,除非新的監督程序在約一分鐘內連接,否則您的工作階段會停止。要啟動新的監督程序,請在 shell 中執行 `claude agents`。超過那一分鐘後,請參閱[在監督程序停止後保持工作階段執行](#keep-sessions-running-after-the-supervisor-stops)。854* **監督程序本身停止**,例如因為其程序從 Claude Code 外部被結束:在 macOS 和 Linux 上,除非新的監督程序在約一分鐘內連接,否則您的工作階段會停止。要啟動新的監督程序,請在 shell 中執行 `claude agents`。超過那一分鐘後,請參閱[在監督程序停止後保持工作階段執行](#keep-sessions-running-after-the-supervisor-stops)。

855 855 

Details

76* **每個政策檔案都有自己的 `mode`**:當根政策檔案處於觀察狀態時,在目錄的強制執行政策檔案之下,其規則一律不計入,包括 `nested: inherit` 規則76* **每個政策檔案都有自己的 `mode`**:當根政策檔案處於觀察狀態時,在目錄的強制執行政策檔案之下,其規則一律不計入,包括 `nested: inherit` 規則

77* **某些自訂分類器只能放在 `advisory` 下**:也就是其 [`tools`](https://code.claude.com/docs/zh-TW/approvals-classifiers#tools) 列出 `reviewers` 或 `labels` 的分類器,或具有未設定 `merge` 之[輸入](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#inputs)的分類器。請將其列在沒有 `if` 的強制執行規則中。若有規則讀取其結果,目錄政策檔案所涵蓋之 pull request 上的檢查可能會顯示 **Cannot evaluate: classifier outside advisory**77* **某些自訂分類器只能放在 `advisory` 下**:也就是其 [`tools`](https://code.claude.com/docs/zh-TW/approvals-classifiers#tools) 列出 `reviewers` 或 `labels` 的分類器,或具有未設定 `merge` 之[輸入](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#inputs)的分類器。請將其列在沒有 `if` 的強制執行規則中。若有規則讀取其結果,目錄政策檔案所涵蓋之 pull request 上的檢查可能會顯示 **Cannot evaluate: classifier outside advisory**

78 78 

79## 頂層鍵79## 適用於整個檔案的規則

80 

81在檔案的每個部分都請遵循以下規則:

80 82 

81Approvals 會拒絕含有未知鍵的檔案。鍵以及 `observe`、`approves` 等固定字詞請以小寫撰寫。每個 purpose、模式、條件與 `"!"` 項目都要加上雙引號。83* **鍵與固定值**:鍵以及 `observe` 和 `approves` 等固定值,一律以小寫撰寫。Approvals 會拒絕含有未知鍵的檔案

84* **用途、模式與條件**:每個用途、`paths` 模式與條件都要加上雙引號

85* **`!` 項目**:條件以外的每個 `"!"` 項目都要加上雙引號。在條件內,`!` 項目使用單引號。Approvals 會拒絕含有未加引號之 `!` 項目的檔案

86* **YAML**:檔案須保持為單一 YAML 文件,否則 Approvals 會拒絕該檔案。請以空格縮排。錨點(anchor)、別名(alias)與 `!!` 標籤至少會產生警告

82 87 

83請讓檔案只包含一份 YAML 文件、為每個 `!` 項目加上引號,並以空格縮排,否則 Approvals 會拒絕該檔案。錨點(anchor)、別名(alias)與 `!!` 標籤會引發警告。88## 頂層鍵

84 89 

85在檔案頂層寫入以下鍵:90請在檔案的頂層寫入以下鍵:

86 91 

87| 鍵 | 必填 | 值 | 預設 | 說明 |92| 鍵 | 必填 | 值 | 預設 | 說明 |

88| :- | :- | :- | :- | :- |93| :- | :- | :- | :- | :- |

89| `version` | 是 | `1` | | schema 版本,以不加引號的數字表示 |94| `version` | 是 | `1` | | schema 版本,以純數字表示 |

90| `rules` | 是 | [規則](#rule-keys)清單 | | 規則順序無關緊要 |95| `rules` | 是 | [規則](#rule-keys)清單 | | 規則順序無關緊要 |

91| `mode` | 否 | `enforce`、`observe` | `enforce` | `observe` 會顯示規則將做出的決定,並適用於檔案中的每條規則。關於仍非中性結果的檢查,以及目標為其他分支的 pull request,請參閱[觀察模式下的 Approvals](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#approvals-in-observe-mode) |96| `mode` | 否 | `enforce`、`observe` | `enforce` | `observe` 會顯示規則將做出的判定,並套用於檔案中的每條規則。關於仍非中立的檢查,以及目標為其他分支的 pull request,請參閱[觀察模式下的核准](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#approvals-in-observe-mode) |

92| `nested` | 否 | `overwrite`、`inherit` | `overwrite` | 此檔案規則的預設值。請參閱[子目錄中的政策檔案](#policy-files-in-subdirectories) |97| `nested` | 否 | `overwrite`、`inherit` | `overwrite` | 此檔案中規則的預設值。請參閱[子目錄中的政策檔案](#policy-files-in-subdirectories) |

93| `run` | 否 | `sequential`、`parallel` | `sequential` | 此檔案規則的預設值。請參閱[分類器何時執行](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#when-a-classifier-runs) |98| `run` | 否 | `sequential`、`parallel` | `sequential` | 此檔案中規則的預設值。請參閱[分類器何時執行](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#when-a-classifier-runs) |

94| `locals` | 否 | 名稱對應值的映射 | | 可重複使用的值。請參閱 [`locals` 與 `use`](#locals-and-use) |99| `locals` | 否 | 名稱對應值的映射 | | 可重複使用的值。請參閱 [`locals` 與 `use`](#locals-and-use) |

95 100 

96## 規則鍵101## 規則鍵

97 102 

98為每條規則提供 `purpose`、`paths`,以及 `verdict`、`advisory`、`findings` 與 `reuse` 中的至少一個。若規則在這四者中只有 `reuse`,則 `reuse` 的值必須是 `false` 或指名一個分類器。沒有 `verdict` 的規則不要求任何人核准,也不[涵蓋](#how-rules-combine-into-one-verdict)任何檔案。103為每條規則提供 `purpose`、`paths`,以及 `verdict`、`advisory`、`findings` 與 `reuse` 中的至少一項。如果規則在這四項中只有 `reuse`,則 `reuse` 的值必須為 `false` 或指定一個分類器。沒有 `verdict` 的規則不要求任何人核准,也不會[涵蓋](#how-rules-combine-into-one-verdict)任何檔案。

99 104 

100您可以在規則上寫入以下鍵:105您可以在規則上撰寫以下鍵:

101 106 

102| 鍵 | 類型 | 預設 | 說明 |107| 鍵 | 類型 | 預設值 | 說明 |

103| :- | :- | :- | :- |108| :- | :- | :- | :- |

104| `purpose` | 一行文字 | 必填 | 規則存在的原因 |109| `purpose` | 一行文字 | 必填 | 規則存在的原因 |

105| [`paths`](#paths) | 模式清單 | 必填 | 規則所符合的變更檔案 |110| [`paths`](#paths) | 模式清單 | 必填 | 規則所匹配的已變更檔案 |

106| [`verdict`](#verdict) | 映射 | | Claude 的動作以及誰必須核准 |111| [`verdict`](#verdict) | 對應表 | | Claude 的行為,以及必須由誰核准 |

107| [`if`](#if) | 條件 | `true` | 規則僅在條件為真時適用 |112| [`if`](#if) | 條件 | `true` | 規則僅在條件為 true 時適用 |

108| [`override`](#override) | 清單 | | 其他判定,各自附帶條件 |113| [`override`](#override) | 清單 | | 其他判定,各自附帶一個條件 |

109| [`advisory`](#advisory) | 分類器清單 | | 會執行但不做任何決定的分類器 |114| [`advisory`](#advisory) | 分類器清單 | | 會執行但不做任何決定的分類器 |

110| [`reuse`](#reuse) | 條件或映射 | 不保留任何項目 | 在變更差異的推送之後仍然計入的項目 |115| [`reuse`](#reuse) | 條件或對應表 | 不保留任何內容 | 在變更差異的推送之後仍然有效的內容 |

111| [`findings`](#findings) | 映射 | 無清單 | 誰可以關閉分類器的發現項目 |116| [`findings`](#findings) | 對應表 | 無清單 | 誰可以關閉分類器的發現項目 |

112| [`use`](#locals-and-use) | `"@name"` 清單 | | 其鍵會複製到規則中的 locals |117| [`use`](#locals-and-use) | `"@name"` 清單 | | 其鍵會被複製到規則中的 local |

113| `mode` | `enforce`、`observe` | 檔案的設定 | 處於觀察狀態的規則既不[適用也不涵蓋](#how-rules-combine-into-one-verdict)任何檔案 |118| `mode` | `enforce`、`observe` | 檔案的設定 | 處於 observe 的規則既不[適用也不涵蓋](#how-rules-combine-into-one-verdict)任何檔案 |

114| `nested` | `overwrite`、`inherit` | 檔案的設定 | `inherit` 會讓規則在下層的政策檔案中保持有效 |119| `nested` | `overwrite`、`inherit` | 檔案的設定 | `inherit` 讓規則在下層的政策檔中仍然有效 |

115| `run` | `sequential`、`parallel` | 檔案的設定 | 規則自身的分類器是依序啟動還是同時啟動 |120| `run` | `sequential`、`parallel` | 檔案的設定 | 規則自身的分類器是依序啟動還是同時啟動 |

116 121 

117### `paths`122### `paths`

118 123 

119將每個模式寫成從包含 `.claude` 資料夾之目錄起算的路徑。移動的檔案會同時以其舊路徑與新路徑計算。124將每個模式寫成從包含 `.claude` 資料夾的目錄起算的路徑。被移動的檔案在其舊路徑與新路徑都會計入。

120 125 

121| 模式 | 符合 |126| 模式 | 匹配 |

122| :- | :- |127| :- | :- |

123| `*` | 單一資料夾內的任意字元 |128| `*` | 單一資料夾內的任意字元 |

124| `**` | 任意數量的資料夾,包括以點開頭的資料夾。它必須是完整的路徑片段,如 `**/*.go` |129| `**` | 任意數量的資料夾,包括以點開頭的資料夾。它必須是完整的路徑段,例如 `**/*.go` |

125| `{a,b}`、`[ab]`、`?` | 替代項、集合中的一個字元,以及任意一個字元 |130| `{a,b}`、`[ab]`、`?` | 替代選項、集合中的一個字元,以及任意一個字元 |

126| `infra/**` | 該資料夾中的每個檔案。單獨的 `infra` 不符合其中任何檔案 |131| `infra/**` | 該資料夾中的所有檔案。單獨的 `infra` 不會匹配其中任何檔案,而 `infra/` 會被拒絕 |

127| `*.md` | 政策檔案 `.claude` 資料夾旁的 Markdown 檔案。若要符合任意深度,請寫入 `**/*.md` |132| `*.md` | 與政策檔的 `.claude` 資料夾同層的 Markdown 檔案。若要匹配任意深度,請寫 `**/*.md` |

128| `"!docs/**"` | 僅從此規則中排除這些檔案。規則至少需要一個不含 `!` 的模式 |133| `"!docs/**"` | 僅從此規則中排除這些檔案。規則至少需要一個不含 `!` 的模式 |

129 134 

130### `if`135### `if`

131 136 

132條件可寫成 `true`、`false`,或一個以雙引號括住、左側為事實或分類器名稱的字串,例如 `"pr/files_changed > 50"`。當您為規則加上 `if` 時,請在相同路徑上保留另一條沒有 `if` 的規則。當 `if` 為假時,具有該 `if` 的規則不適用。若有規則涵蓋某個檔案但沒有任何規則適用,[Claude Approvals 檢查會失敗](#how-rules-combine-into-one-verdict)。137將條件寫成 `true`、`false`,或一個以雙引號括住、左側為事實或分類器名稱的字串,例如 `"pr/files_changed > 50"`。當您為規則加上 `if` 時,請在相同路徑上保留另一條沒有 `if` 的規則。當 `if` 為 false 時,帶有該 `if` 的規則不適用。若有規則涵蓋某檔案但沒有任何規則適用,[Claude Approvals 檢查就會失敗](#how-rules-combine-into-one-verdict)。

133 138 

134* **運算子**:`=`、`!=`、`<`、`<=`、`>`、`>=`139* **運算子**:`=`、`!=`、`<`、`<=`、`>`、`>=`

135* **連接**:以大寫的 `AND` 與 `OR`。混用兩者時請使用括號。140* **連接**:使用大寫的 `AND` 與 `OR`。混用兩者時請使用括號。

136* **清單**:在 `pr/authors` 與 `pr/approved_by` 前寫入 `ANY` 或 `ALL`。若條件導向較寬鬆的判定,請使用 `ALL`:使用 `ANY` 時,只要有一位列出的作者,就會為其他所有人的提交放寬規則。若條件導向較嚴格的判定,請使用 `ANY`:使用 `ALL` 時,只要有一位未列出的作者,就會使其失效。141* **清單**:在 `pr/authors` 與 `pr/approved_by` 前寫上 `ANY` 或 `ALL`。若條件導向較寬鬆的判定,請使用 `ALL`:使用 `ANY` 時,只要有一位列出的作者,就會為其他所有人的提交放寬規則。若條件導向較嚴格的判定,請使用 `ANY`:使用 `ALL` 時,只要有一位未列出的作者就會使其失效。若要測試清單是否為空,兩者都不要寫,例如 `"pr/approved_by = empty"`。

137* **引號**:登入名稱或分支模式使用單引號,團隊、`bot:` 名稱或事實則不加引號,如 `"ALL pr/authors = ['ana-acme', acme/payments]"`142* **引號**:在[人員清單](#people-lists)中,登入名稱、分支模式或整個 `!` 項目要用單引號括住,例如 `"ANY pr/authors = [humans, '!acme/interns']"`。團隊、`bot:` 名稱或不含 `!` 的事實則不加引號,例如 `"ALL pr/authors = ['ana-acme', acme/payments]"`

138* **分類器**:`claude/code_review = pass`、`repo/change_risk <= medium`,以及[從規則讀取分類器的答案](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#read-a-classifier’s-answer-from-a-rule)中的其他形式143* **分類器**:`claude/code_review = pass`、`repo/change_risk <= medium`,以及[從規則讀取分類器的答案](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#read-a-classifier’s-answer-from-a-rule)中的其他形式

139 144 

140事實來自 pull request 本身:145事實來自 pull request 本身:


142| 事實 | 範例 | 內容 |147| 事實 | 範例 | 內容 |

143| :- | :- | :- |148| :- | :- | :- |

144| `pr/files_changed`、`pr/files_added`、`pr/files_removed` | `"pr/files_changed > 50"` | 整個 pull request 的計數 |149| `pr/files_changed`、`pr/files_added`、`pr/files_removed` | `"pr/files_changed > 50"` | 整個 pull request 的計數 |

145| `pr/diff_lines` | `"pr/diff_lines <= 20"` | 整個 pull request 中變更的行數 |150| `pr/diff_lines` | `"pr/diff_lines <= 20"` | 整個 pull request 中的變更行數 |

146| `rule/files_changed`、`rule/files_added`、`rule/files_removed` | `"rule/files_changed = pr/files_changed"` | 此規則 `paths` 所符合之檔案中的計數 |151| `rule/files_changed`、`rule/files_added`、`rule/files_removed` | `"rule/files_changed = pr/files_changed"` | 此規則的 `paths` 所匹配檔案中的計數 |

147| `pr/authors` | `"ALL pr/authors = bot:dependabot"` | 撰寫或推送提交的帳戶,以及開啟 pull request 的帳戶 |152| `pr/authors` | `"ALL pr/authors = bot:dependabot"` | 撰寫或推送提交的帳號,以及開啟 pull request 的帳號 |

148| `pr/opened_by` | `"pr/opened_by = acme/release"` | 開啟 pull request 的帳戶。當其他人推送到 bot 的 pull request 後,針對 `pr/opened_by = bot:dependabot` 的覆寫將不再降低規則的要求 |153| `pr/opened_by` | `"pr/opened_by = acme/release"` | 開啟 pull request 的帳號。當其他人推送到 bot 的 pull request 後,針對 `pr/opened_by = bot:dependabot` 的覆寫就不再降低規則的要求 |

149| `pr/approved_by` | `"ANY pr/approved_by = acme/security"` | 核准目前差異、具有寫入權限的人員。作者與 bot 不在其中。也接受 `= empty` 與 `!= empty` |154| `pr/approved_by` | `"ANY pr/approved_by = acme/security"` | 具有寫入權限且核准目前差異的人員。作者與 bot 不在其中。也接受 `= empty` 與 `!= empty`,此時不加 `ANY` 或 `ALL` |

150| `pr/base` | `"pr/base = 'release/**'"` | pull request 的目標分支 |155| `pr/base` | `"pr/base = 'release/**'"` | pull request 的目標分支 |

151 156 

152### `verdict`157### `verdict`

153 158 

154`verdict` 說明 Claude 的動作以及誰必須核准。在規則的 `verdict` 中寫入 `claude`,且除非 `claude` 為 `blocks`,否則也要寫入 `seats`。159`verdict` 說明 Claude 的行為以及必須由誰核准。在規則的 `verdict` 中,請寫上 `claude`,並且除非 `claude` 為 `blocks`,否則要寫上 `seats`。

155 160 

156| 欄位 | 值 | 說明 |161| 欄位 | 值 | 說明 |

157| :- | :- | :- |162| :- | :- | :- |

158| `claude` | `approves`、`comments`、`blocks` | `approves`:若[每條適用的規則都如此指定,且每個變更檔案都有被涵蓋](#how-rules-combine-into-one-verdict),Claude 可在 **Claude Approvals** 檢查通過後發布核准審查。此欄位不會啟動任何審查,因此若規則未讀取任何分類器,Claude 可能會核准一項未經任何審查的變更。`comments`:Claude 不核准。`blocks`:無論誰核准,檢查都會失敗 |163| `claude` | `approves`、`comments`、`blocks` | `approves`:若[每條適用的規則都這樣規定,且每個變更的檔案都有被涵蓋](#how-rules-combine-into-one-verdict),Claude 可在 **Claude Approvals** 檢查通過後發布核准審查。此欄位不會啟動任何審查,因此若規則未讀取任何分類器,Claude 可能核准一項未經任何審查的變更。`comments`:Claude 不核准。`blocks`:無論誰核准,檢查都會失敗 |

159| `seats` | `0` 到 `16`,或最多八個集合的清單 | 需要多少[人](#how-people’s-approvals-are-counted)核准。數字 `N` 是 `[{ count: N, from: humans }]` 的簡寫。與 `blocks` 並用時會被拒絕 |164| `seats` | `0` 到 `16`,或最多八個集合的清單 | 必須有多少[人](#how-people’s-approvals-are-counted)核准。數字 `N` 是 `[{ count: N, from: humans }]` 的簡寫。與 `blocks` 並用時會被拒絕 |

160| `max_age` | 一個整數加上 `s`、`m`、`h` 或 `d`,範圍為 `1m` 到 `83d` | 評估結果的有效時長。超過後,檢查會失敗,標題為 **Results are older than the policy allows** |165| `max_age` | 整數加上 `s`、`m`、`h` 或 `d`,範圍從 `1m` 到 `83d` | 評估結果的有效期限。超過之後,檢查會失敗,標題為 **Results are older than the policy allows** |

161 166 

162為 `seats` 中的每個集合指定 `count`(從 `1` 到 `16`)以及 `from`(一份[人員清單](#people-lists))。每個集合都必須被填滿,且同一人可以在多個集合中各填一個席位。167為 `seats` 中的每個集合提供 `count`(從 `1` 到 `16`)以及 `from`(一份[人員清單](#people-lists))。每個集合都必須填滿,且同一人可以填補多個集合中的席位。

163 168 

164### 人員清單169### 人員清單

165 170 

166人員清單用於指名帳戶。可將其寫成 [`seats`](#verdict) 下集合的 `from`,或寫在 [`findings`](#findings) 下,形式為單一項目或以方括號括住的清單。只有對儲存庫具有寫入權限的帳戶才會計入。171人員清單用於指定帳號。可將其寫為 [`seats`](#verdict) 下集合的 `from`,或寫在 [`findings`](#findings) 下,形式可以是單一項目或以方括號括住的清單。只有具有儲存庫寫入權限的帳號才會計入。

167 172 

168| 項目 | 含義 |173| 項目 | 意義 |

169| :- | :- |174| :- | :- |

170| `humans` | 每一個人,包括作者。機器使用者(即由指令碼或 agent 操作的使用者帳戶)算作人。Claude 的雲端工作階段用來提交的 `claude` 使用者帳戶則不算 |175| `humans` | 所有人,包括作者。機器使用者(即由腳本或 agent 驅動的使用者帳號)視為人。Claude 雲端工作階段用來提交的 `claude` 使用者帳號則不算 |

171| `bots` | 每個 bot 與 GitHub App,包括 Claude 的應用程式與 `github-actions` |176| `bots` | 所有 bot 與 GitHub App,包括 Claude 的應用程式與 `github-actions` |

172| `everyone` | `humans` 與 `bots` 的總和。須單獨寫入,不加方括號 |177| `everyone` | `humans` 與 `bots` 的合集。請單獨撰寫,不加方括號 |

173| `nobody` | 沒有任何人。須單獨寫入,且僅限用於 `findings` 下 |178| `nobody` | 沒有人。請單獨撰寫,且僅用於 `findings` 下 |

174| `ana-acme` | 一個登入名稱。在條件中,請以單引號括住 |179| `ana-acme` | 單一登入名稱。在條件中請以單引號括住 |

175| `acme/payments` | 儲存庫所屬 GitHub 組織的一個團隊 |180| `acme/payments` | 儲存庫所屬 GitHub 組織的團隊 |

176| `bot:dependabot` | 一個 bot,不含 `[bot]` 後綴。`bot:claude` 表示 Claude 的應用程式 |181| `bot:dependabot` | 單一 bot,不加 `[bot]` 後綴。`bot:claude` 代表 Claude 的應用程式 |

177| `pr/authors`、`pr/opened_by` | 該事實所含的帳戶 |182| `pr/authors`、`pr/opened_by` | 該事實所包含的帳號 |

178| `"!pr/authors"` | 排除帳戶。請加上引號,並放在不含 `!` 的項目旁 |183| `"!pr/authors"` | 排除帳號。請加上引號(在條件中使用單引號),並與一個不含 `!` 的項目並列 |

179 184 

180若集合的 `from` 包含 Claude(例如透過 `bots`、`everyone` 或 `bot:claude`),且每條適用的規則都指定 `approves`,Approvals 會在 Claude 核准之前就將該集合中的一個席位視為已填滿。如此一來,**Claude Approvals** 檢查可能在沒有任何人核准的情況下通過。185如果集合的 `from` 允許 Claude(例如透過 `bots`、`everyone` 或 `bot:claude`),且每條適用的規則都規定 `approves`,Approvals 會在 Claude 核准之前就將該集合中的一個席位計為已填補。如此一來,**Claude Approvals** 檢查可能在沒有任何人核准的情況下通過。

181 186 

182### `override`187### `override`

183 188 

184覆寫會在其自身的 `if` 為真時變更其所屬規則的判定。Approvals 會從頂端開始讀取 `override` 清單,並套用第一個為真的覆寫。189覆寫會在其自身的 `if` 為 true 時變更所屬規則的判定。Approvals 從上往下讀取 `override` 清單,並套用第一個為 true 的覆寫。

185 190 

186| 鍵 | 必填 | 說明 |191| 鍵 | 必填 | 說明 |

187| :- | :- | :- |192| :- | :- | :- |

188| `if` | 是 | 一個[條件](#if) |193| `if` | 是 | 一個[條件](#if) |

189| `verdict` | 這三者至少一個 | 其寫入的每個欄位都會取代規則的欄位。`seats` 會整體被取代 |194| `verdict` | 這三項中至少一項 | 其寫入的每個欄位都會取代規則的對應欄位。`seats` 會被整體取代 |

190| `reuse`、`findings` | 這三者至少一個 | 取代規則的整個值 |195| `reuse`、`findings` | 這三項中至少一項 | 取代規則的整個值 |

191| `purpose`、`use` | 否 | 與規則上的相同。此處 `use` 可以複製 `verdict` 與 `findings` |196| `purpose`、`use` | 否 | 與規則上的用法相同。在此處,`use` 可以複製 `verdict` 與 `findings` |

192 197 

193當覆寫的 `if` 讀取分類器時,**Claude Approvals** 檢查會等待該分類器的執行:198當覆寫的 `if` 讀取分類器時,**Claude Approvals** 檢查會等待該分類器執行:

194 199 

195* **執行仍在進行中**:檢查會保持進行中。若核准已滿足規則仍可能選擇的每個判定,檢查可以提前完成,但分類器的 `tools` 列出 [`reviewers`](https://code.claude.com/docs/zh-TW/approvals-classifiers#reviewers) 時除外。若政策檔案位於子目錄中,[請只將這類分類器列在 `advisory` 下](#policy-files-in-subdirectories)200* **執行仍在進行中**:檢查維持進行中狀態。當現有核准已滿足規則仍可能選用的每一個判定時,檢查可以提前完成,除非該分類器的 `tools` 列出了 [`reviewers`](https://code.claude.com/docs/zh-TW/approvals-classifiers#reviewers)。若政策檔位於子目錄中,[請僅在 `advisory` 下列出此類分類器](#policy-files-in-subdirectories)

196* **執行結束但沒有答案**:讀取會在該覆寫處停止,並套用規則本身的 `verdict`。因此,請將嚴格的判定放在規則上。201* **執行結束但沒有答案**:讀取會在該覆寫處停止,並套用規則自身的 `verdict`。因此,請將嚴格的判定放在規則上。

197* **您想要捕捉缺少的答案**:在讀取答案的覆寫之上,放置一個針對 `= error` 或 `= incomplete` 的覆寫202* **您想捕捉缺少的答案**:在讀取答案的覆寫之上,放置一個針對 `= error` 或 `= incomplete` 的覆寫

198 203 

199在規則本身的 `if` 中,除非條件的其他部分已決定結果,否則沒有答案的比較會使檢查失敗,無論誰核准。204在規則自身的 `if` 中,沒有答案的比較會使檢查失敗,無論誰核准,除非條件的其他部分已能決定結果。

200 205 

201### `advisory`206### `advisory`

202 207 

203在 `advisory` 下列出分類器名稱或呼叫,例如 `[claude/code_review, repo/change_risk]`。此處列出的 `repo/` 分類器[可以執行](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#when-a-classifier-runs),且每次執行都會計費。請將其列在具有 `verdict` 的規則中。208在 `advisory` 下列出分類器名稱或呼叫,例如 `[claude/code_review, repo/change_risk]`。列在此處的 `repo/` 分類器[可能會執行](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#when-a-classifier-runs),且每次執行都會計費。請將其列在具有 `verdict` 的規則中。

204 209 

205若要保留 Code Review 的自動審查,請在具有 `verdict` 且符合您想要審查之檔案的規則中,將 `claude/code_review` 列在此處,或在 `if` 中讀取它。210若要保留 Code Review 的自動審查,請在具有 `verdict` 且匹配您想要審查之檔案的規則中,於此處列出 `claude/code_review`,或在 `if` 中讀取它。

206 211 

207### `reuse`212### `reuse`

208 213 

209`reuse` 說明在變更差異的推送之後,哪些先前的核准與分類器答案仍繼續計入,其條件通常讀取 [`claude/diff`](https://code.claude.com/docs/zh-TW/approvals-classifiers#classifiers-anthropic-provides)。214`reuse` 說明在變更差異的推送之後,哪些先前的核准與分類器答案仍然有效,其條件通常會讀取 [`claude/diff`](https://code.claude.com/docs/zh-TW/approvals-classifiers#classifiers-anthropic-provides)。

210 215 

211當 `claude/diff` 的答案至多為 `same_intent`,且 Claude 對新提交的審查通過時,此範例可以保留人員的核准:216當 `claude/diff` 的答案至多為 `same_intent`,且 Claude 對新提交的審查通過時,此範例可以保留人員的核准:

212 217 


216 seats: "claude/diff <= same_intent AND claude/code_review = pass"221 seats: "claude/diff <= same_intent AND claude/code_review = pass"

217```222```

218 223 

219以下列其中一種形式撰寫 `reuse`:224請以下列其中一種形式撰寫 `reuse`:

220 225 

221| 形式 | 可保留 |226| 形式 | 可保留 |

222| :- | :- |227| :- | :- |

223| `seats: <condition>` | 人員的核准 |228| `seats: <condition>` | 人員的核准 |

224| `<classifier>: <condition>` | 該分類器先前的答案 |229| `<classifier>: <condition>` | 該分類器先前的答案 |

225| `reuse: <condition>` | 兩者皆可:席位以及規則所讀取的分類器 |230| `reuse: <condition>` | 兩者皆可:席位以及規則所讀取的分類器 |

226| `false` | 不保留任何項目。在覆寫中,`unset` 會移除規則的值 |231| `false` | 不保留任何內容。在覆寫中,`unset` 會移除規則的值 |

227 232 

228在依賴 `reuse` 之前,請檢查以下情況:233在依賴 `reuse` 之前,請檢查以下情況:

229 234 

230* **符合這些檔案的每條規則**:在每條規則上都寫入 `reuse`235* **每條匹配這些檔案的規則**:請在每條規則上都撰寫 `reuse`

231* **當 `claude/diff` 沒有答案時**:讀取它的條件不會保留任何項目236* **當 `claude/diff` 沒有答案時**:讀取它的條件不會保留任何內容

232* **在撤銷或強制推送之後**:此範例不會保留 GitHub 已撤銷的核准,通常也不會保留強制推送之前給出的核准。`reuse` 可以在只讀取 `claude/diff`、不讀取其他分類器的 `seats` 條件下保留它們,例如 `"claude/diff <= same_intent"`。237* **在撤銷或強制推送之後**:此範例不會保留 GitHub 已撤銷的核准,通常也不會保留在強制推送之前給出的核准。`reuse` 可以在一個只讀取 `claude/diff` 而不讀取其他分類器的 `seats` 條件下保留它們,例如 `"claude/diff <= same_intent"`。

233* **先前的作者也會計入**:當 `reuse` 保留 `seats` 時,在較早提交時持有[作者席位](#whether-a-pull-request’s-author-counts)的人員可能繼續計入。其中兩人就可能在無人核准的情況下填滿 `seats: 2`。若要避免這種情況,請以 `"!pr/authors"` 將作者排除在集合之外。238* **先前的作者也會計入**:當 `reuse` 保留 `seats` 時,在較早提交中佔有[作者席位](#whether-a-pull-request’s-author-counts)的人可能繼續計入。其中兩人可能在沒有任何人核准的情況下填滿 `seats: 2`。若要避免這種情況,請使用 `"!pr/authors"` 將作者從集合中排除。

234* **推送未變更的檔案**:在寫有 `reuse` 的政策檔案中,核准可以在僅推送到其他檔案的情況下持續有效。這些可以是沒有任何規則涵蓋的檔案,或其規則無法計入該人員的檔案。GitHub 已撤銷的核准通常不會如此239* **推送未變動的檔案**:在撰寫了 `reuse` 的政策檔中,核准只能在推送到其他檔案時延續下來。這些檔案可以是沒有任何規則涵蓋的檔案,或其規則無法計入該人的檔案。GitHub 已撤銷的核准通常不會延續

235 240 

236### `findings`241### `findings`

237 242 

238分類器可以將發現項目回報為審查討論串,而條件可以透過 `.severity` 讀取其嚴重程度。使用 `findings` 指定誰可以關閉發現項目,方式為解決其討論串,或使用 [`@claude approvals resolve`](https://code.claude.com/docs/zh-TW/approvals-pull-requests#comment-commands-for-approvals)。243分類器可以將發現項目回報為審查討論串,而條件可以透過 `.severity` 讀取其嚴重性。使用 `findings` 來指定誰可以關閉發現項目,方式是解決其討論串或使用 [`@claude approvals resolve`](https://code.claude.com/docs/zh-TW/approvals-pull-requests#comment-commands-for-approvals)。

239 244 

240在規則的 `findings` 列出誰可以關閉發現項目之前,單憑某人的解決操作並不會降低 `.severity`。分類器不需要清單即可關閉自己的發現項目,例如 Code Review 在後續審查發現問題已修正時就可以這麼做。245在規則的 `findings` 列出誰可以關閉發現項目之前,僅憑某人的解決操作不會降低 `.severity`。分類器不需要清單就能關閉自己的發現項目,例如 Code Review 可以在後續審查發現問題已修正時關閉它。

241 246 

242此範例讓 `acme/leads` 團隊(pull request 的作者除外)可以關閉 Code Review 的發現項目:247此範例讓 `acme/leads` 團隊(排除 pull request 的作者)關閉 Code Review 的發現項目:

243 248 

244```yaml theme={null}249```yaml theme={null}

245# in .claude/approvals.yml, on a rule with no if, beside verdict250# in .claude/approvals.yml, on a rule with no if, beside verdict


248 claude/code_review: [acme/leads, "!pr/authors"]253 claude/code_review: [acme/leads, "!pr/authors"]

249```254```

250 255 

251在 `findings` 下,以下列其中一個值寫入 `resolution`:256在 `findings` 下,請以下列其中一個值撰寫 `resolution`:

252 257 

253| 值 | 含義 |258| 值 | 意義 |

254| :- | :- |259| :- | :- |

255| 一份[人員清單](#people-lists) | 一份適用於所有分類器發現項目的清單。`resolution: humans` 讓具有寫入權限的人員(包括作者)都可以關閉發現項目 |260| 一份[人員清單](#people-lists) | 適用於所有分類器發現項目的單一清單。`resolution: humans` 讓具有寫入權限的人關閉它們,包括作者 |

256| 分類器名稱對應清單的映射 | 每個分類器各一份清單 |261| 分類器名稱對應到清單的對應表 | 每個分類器各一份清單 |

257| 集合清單,每個集合為 `{ if, from }` | 每個 `if` 可以讀取 `finding/severity`,如 `{ if: "finding/severity >= high", from: acme/leads }`。若每個 `if` 都只讀取 `finding/severity`,則由第一個 `if` 為真的集合決定。請以沒有 `if` 的集合作結 |262| 集合清單,每個集合為 `{ if, from }` | 每個 `if` 可以讀取 `finding/severity`,例如 `{ if: "finding/severity >= high", from: acme/leads }`。當每個 `if` 只讀取 `finding/severity` 時,由第一個 `if` 為 true 的集合決定。請以一個沒有 `if` 的集合作結 |

258| `nobody` | 單憑任何人的解決操作都無法關閉發現項目。分類器可以關閉自己的發現項目 |263| `nobody` | 僅憑任何人的解決操作都無法關閉發現項目。分類器可以關閉自己的發現項目 |

259 264 

260若要讓人員可以關閉發現項目,請將清單放在沒有 `if` 且涵蓋發現項目所在檔案的規則上。將該規則放在為該檔案[做出決定的政策檔案](#policy-files-in-subdirectories)中。若要讓單憑解決操作即可計入,適用於該檔案的每份清單都必須包含執行解決的人員。265若要讓人員關閉發現項目,請將清單放在一條沒有 `if` 且涵蓋該發現項目所在檔案的規則上。請將該規則放在對該檔案[做出決定的政策檔](#policy-files-in-subdirectories)中。若要讓單獨的解決操作生效,適用於該檔案的每份清單都必須允許執行解決的人。

261 266 

262失敗的 `claude/code_review` 是針對整個 pull request 的單一答案。請檢查比較該答案之規則(如 `claude/code_review = pass`)下的每個變更檔案:267失敗的 `claude/code_review` 是針對整個 pull request 的單一答案。請檢查每個變更的檔案是否都在比較該答案的規則之下,例如 `claude/code_review = pass`:

263 268 

264* **每個檔案的清單都包含執行解決的人員**:一旦審查的每個 Important 發現項目都已關閉,結果就可以變為 `pass`,而無需新的審查269* **每個檔案的清單都允許執行解決的人**:一旦審查的每個 Important 發現項目都已關閉,它就可以讀取為 `pass`,無需重新審查

265* **某個檔案的清單不包含執行解決的人員,或該檔案設定為 `nobody` 或沒有清單**:該人員的解決操作會讓審查維持 `fail`。請為該檔案撰寫包含該人員的清單。270* **某個檔案的清單不允許執行解決的人,或該檔案為 `nobody` 或沒有清單**:該人的解決操作會使審查維持 `fail`。請為該檔案撰寫一份允許該人的清單。

266 271 

267關閉發現項目並不會變更任何程式碼,因此人員可以在未修正任何問題的情況下降低 `.severity` 並讓失敗的審查通過。請讓清單保持精簡。272關閉發現項目並不會變更任何程式碼,因此人員可以在沒有修正任何內容的情況下降低 `.severity` 並讓失敗的審查通過。請讓清單保持精簡。

268 273 

269### `locals` 與 `use`274### `locals` 與 `use`

270 275 

271若要重複使用某個值,請在政策檔案頂端的 `locals` 下為其命名。然後在該值應出現之處寫入 `"@name"`,或使用 `use` 將整個映射複製到規則中。276若要重複使用某個值,請在政策檔頂端的 `locals` 下為其命名。然後在該值應出現的位置寫上 `"@name"`,或使用 `use` 將整個對應表複製到規則中。

272 277 

273在此範例中,`payments_owner` 指名一組人員,而 `strict` 指名一個完整的判定,由第一條規則透過 `use` 複製:278在此範例中,`payments_owner` 指定一組人員,而 `strict` 指定一個完整的判定,由第一條規則透過 `use` 複製:

274 279 

275```yaml theme={null}280```yaml theme={null}

276# .claude/approvals.yml281# .claude/approvals.yml


288 verdict: { claude: comments, seats: 2 }293 verdict: { claude: comments, seats: 2 }

289```294```

290 295 

291請確認 local 可以包含的內容以及可以使用的位置:296請確認 local 可以包含哪些內容,以及可以在哪裡使用:

292 297 

293* **local 包含的內容**:文字、數字、`true` 或 `false`、清單,或一個映射298* **local 包含的內容**:文字、數字、`true` 或 `false`、清單,或一個對應表

294* **`"@name"` 可以出現的位置**:作為整個 `paths`、人員清單、`seats`、`verdict` 或 `override`,以及作為 `paths`、人員清單或 `seats` 中的一個項目。在條件內部,它不需要額外的引號,如 `"pr/files_changed > @many"`。299* **`"@name"` 可出現的位置**:作為 `paths`、人員清單、`seats`、`verdict` 或 `override` 的整體,以及作為 `paths`、人員清單或 `seats` 中的單一項目。在條件內部,它不需要自己的引號,例如 `"pr/files_changed > @many"`。

295* **`use` 複製的內容**:`verdict`、`override`、`if`、`paths`、`reuse`、`advisory` 與 `findings`。規則本身寫入的內容優先:在 `verdict`、`findings` 與 `reuse` 映射內以逐鍵方式,其他鍵則整體優先。300* **`use` 複製的內容**:`verdict`、`override`、`if`、`paths`、`reuse`、`advisory` 與 `findings`。規則自身撰寫的內容優先:在 `verdict`、`findings` 與 `reuse` 對應表內以逐鍵方式優先,其他鍵則整體優先。

296 301 

297## 規則如何組合成單一判定302## 規則如何組合成單一判定

298 303 


332 337 

333* **誰持有作者席位**:在開啟 pull request 時的提交上,由開啟者持有。在之後的推送後,通常由同時撰寫並推送最新提交的人員持有。338* **誰持有作者席位**:在開啟 pull request 時的提交上,由開啟者持有。在之後的推送後,通常由同時撰寫並推送最新提交的人員持有。

334* **無人持有時**:例如,推送了由一人撰寫、另一人推送的提交之後。**Claude Approvals** 檢查的摘要會說明原因,若您是開啟該 pull request 的人,便可以留言 [`@claude approve`](https://code.claude.com/docs/zh-TW/approvals-pull-requests#comment-commands-for-approvals)。339* **無人持有時**:例如,推送了由一人撰寫、另一人推送的提交之後。**Claude Approvals** 檢查的摘要會說明原因,若您是開啟該 pull request 的人,便可以留言 [`@claude approve`](https://code.claude.com/docs/zh-TW/approvals-pull-requests#comment-commands-for-approvals)。

335* **排除作者**:寫入 `seats: [{ count: 1, from: [humans, "!pr/authors"] }]`。在由具名人員組成的集合中,請至少比 `count` 多指名一人,否則作者自己的 pull request 可能會一直等待。在[分支的 pull request](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors) 上,沒有任何核准會計入排除 `pr/authors` 的集合。340* **排除作者**:寫入 `seats: [{ count: 1, from: [humans, "!pr/authors"] }]`。在由具名人員組成的集合中,請至少比 `count` 多指名一人,否則作者自己的 pull request 可能會一直等待。在[來自分支儲存庫(fork)的 pull request](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#pull-requests-from-forks-and-outside-contributors) 上,沒有任何核准會計入排除 `pr/authors` 的集合。

336* **`"!pr/authors"` 的依據**:GitHub 指名為撰寫或推送提交、或開啟 pull request 的帳戶。它不會讀取 `Co-authored-by` 行,而 agent 以其他帳戶進行的提交也不會讓某人成為作者。341* **`"!pr/authors"` 的依據**:GitHub 指名為撰寫或推送提交、或開啟 pull request 的帳戶。它不會讀取 `Co-authored-by` 行,而 agent 以其他帳戶進行的提交也不會讓某人成為作者。

337* **Bot**:bot 僅在包含它的集合中,且在它所開啟並推送最新提交的 pull request 上,才能填入該席位342* **Bot**:bot 僅在包含它的集合中,且在它所開啟並推送最新提交的 pull request 上,才能填入該席位

338* **機器使用者**:以 `claude` 以外之使用者帳戶運作的 agent 會像人一樣持有該席位,並可以是[受保護檔案](#protected-files)所需的那一人。若要將其排除,請以 `"!"` 將其登入名稱從規則的集合中移除,如 `[humans, "!acme-ci"]`。對於受保護檔案,請將該集合放在 `paths` 指名這些檔案的規則中,並標記為 `nested: inherit`。343* **機器使用者**:以 `claude` 以外之使用者帳戶運作的 agent 會像人一樣持有該席位,並可以是[受保護檔案](#protected-files)所需的那一人。若要將其排除,請以 `"!"` 將其登入名稱從規則的集合中移除,如 `[humans, "!acme-ci"]`。對於受保護檔案,請將該集合放在 `paths` 指名這些檔案的規則中,並標記為 `nested: inherit`。


357* **Git 檔案**:`.gitmodules`、`.gitattributes`、符號連結與子模組指標362* **Git 檔案**:`.gitmodules`、`.gitattributes`、符號連結與子模組指標

358* **程式碼擁有者**:任何名為 `CODEOWNERS` 的檔案363* **程式碼擁有者**:任何名為 `CODEOWNERS` 的檔案

359 364 

360請勿假設其他檔案也受到保護。請為對您重要的檔案撰寫規則,例如 `.github/`、`CLAUDE.md`、`AGENTS.md`、`.mcp.json`,以及 `.claude/` 的其餘部分。365請勿假設其他檔案也受到保護。請為對您重要的檔案撰寫規則,例如 `.github` 資料夾、`CLAUDE.md`、`AGENTS.md`、`.mcp.json`,以及 `.claude` 資料夾的其餘部分。

361 366 

362### 誰必須核准受保護檔案的變更367### 誰必須核准受保護檔案的變更

363 368 

Details

26 26 

27**Claude Approvals** 檢查會在其標題中提供您 pull request 的核准狀態,也就是檢查清單中其名稱旁的文字。請在下列表格中找到您檢查的標題,以了解其含義及後續步驟。27**Claude Approvals** 檢查會在其標題中提供您 pull request 的核准狀態,也就是檢查清單中其名稱旁的文字。請在下列表格中找到您檢查的標題,以了解其含義及後續步驟。

28 28 

29若標題不在此處,請開啟 **Claude Approvals** 檢查的摘要,其中會說明原因及下一步。若要找出維護政策檔案 `.claude/approvals.yml` 的人,請查看預設分支上最後變更該檔案的人。29對於任何其他標題,請開啟 **Claude Approvals** 檢查的摘要,其中會說明原因及下一步。若要找出誰負責維護政策檔案 `.claude/approvals.yml`,請查看預設分支上最後變更該檔案的人。

30 30 

31### Approvals 正在等待人員31### Approvals 正在等待人員

32 32 


40 40 

41### Approvals 正在等待 Code Review 或分類器41### Approvals 正在等待 Code Review 或分類器

42 42 

43出現這些標題時,Approvals 正在等待 [Code Review](https://code.claude.com/docs/zh-TW/code-review-pull-requests.md) 或[分類器](https://code.claude.com/docs/zh-TW/approvals-classifiers.md)的回應,或未取得回應:43出現這些標題時,Approvals 需要 [Code Review](https://code.claude.com/docs/zh-TW/code-review-pull-requests.md) 或[分類器](https://code.claude.com/docs/zh-TW/approvals-classifiers.md)的回應:

44 44 

45| 標題 | 該怎麼做 |45| 標題 | 該怎麼做 |

46| :- | :- |46| :- | :- |

47| **Waiting for Code Review**、**Waiting for repo/change\_risk**、**Waiting for classifiers** | 目前無須任何動作 |47| **Waiting for Code Review**、**Waiting for repo/change\_risk**、**Waiting for classifiers** | 等待結果 |

48| **A classifier had no result**、**A classifier has not run**,或以名稱取代「A classifier」,如 **repo/change\_risk has not run** | [重新執行 Claude Approvals 檢查](#comment-commands-for-approvals)。請參閱[執行未產生回應時](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#what-a-rule-sees-when-a-classifier-run-gives-no-answer) |48| **A classifier had no result**、**A classifier has not run**,或以名稱取代「A classifier」,如 **repo/change\_risk has not run** | [重新執行 Claude Approvals 檢查](#comment-commands-for-approvals)。請參閱[規則在沒有回應時看到的內容](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#what-a-rule-sees-when-a-classifier-run-gives-no-answer) |

49 49 

50### 規則或政策檔案使 Approvals 無法通過50### 規則或政策檔案使 Approvals 無法通過

51 51 

52出現這些標題時,表示有規則擋住了 pull request、沒有任何規則適用於某個已變更的檔案,或某個政策檔案無法使用:52出現這些標題時,表示有規則擋住了 pull request,或政策需要修正:

53 53 

54| 標題 | 該怎麼做 |54| 標題 | 該怎麼做 |

55| :- | :- |55| :- | :- |

56| **Held by Code Review's findings** | 修正 Code Review 在 pull request 上張貼的發現項目,然後推送。若政策的 [`findings`](https://code.claude.com/docs/zh-TW/approvals-policy#findings) 清單列有您,您可以將這些發現項目的討論串標示為已解決。若標示為已解決後 **Claude Approvals** 檢查仍未通過,請推送修正 |56| **Held by Code Review's findings** | 修正 Code Review 在 pull request 上張貼的發現項目,然後推送。若政策的 [`findings`](https://code.claude.com/docs/zh-TW/approvals-policy#findings) 清單列有您,您可以將這些發現項目的討論串標示為已解決。若標示為已解決後 **Claude Approvals** 檢查仍被擋住,請推送修正 |

57| **Held by** 加上以引號標示的規則用途、**Held by a policy rule** | 詢問維護政策檔案的人,檢查摘要中的規則需要什麼,然後推送修正 |57| **Held by** 加上以引號標示的規則用途、**Held by a policy rule** | 詢問維護政策檔案的人,檢查摘要中的規則需要什麼,然後推送修正 |

58| **No rule applies to** 加上以引號標示的檔案名稱、**No rule applies to a changed file** | 請維護政策檔案的人新增一條不含 `if` 且涵蓋該檔案的規則。該規則合併後,重新執行檢查 |58| **No rule applies to** 加上以引號標示的檔案名稱、**No rule applies to a changed file** | 請維護政策檔案的人新增一條不含 `if` 且涵蓋該檔案的規則。該規則合併後,重新執行檢查 |

59| **This change breaks a policy file**、**Default branch policy file cannot be used** | [修正政策檔案](https://code.claude.com/docs/zh-TW/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |59| **This change breaks a policy file**、**Default branch policy file cannot be used** | [修正政策檔案](https://code.claude.com/docs/zh-TW/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses) |


67| 標題 | 該怎麼做 |67| 標題 | 該怎麼做 |

68| :- | :- |68| :- | :- |

69| **Passed; no approval from Claude** | 若 GitHub 要求核准,請找人核准 |69| **Passed; no approval from Claude** | 若 GitHub 要求核准,請找人核准 |

70| **Nothing ran, not blocking: no file is covered** | 無須任何動作。若 pull request 變更的檔案應由某人審查,請維護[政策檔案](https://code.claude.com/docs/zh-TW/approvals-policy.md)的人將其納入涵蓋範圍 |70| **Nothing ran, not blocking: no file is covered** | 若 pull request 變更的檔案應由某人審查,請維護[政策檔案](https://code.claude.com/docs/zh-TW/approvals-policy.md)的人將其納入涵蓋範圍 |

71| **Observe mode ended: not evaluated yet** | 推送一個提交,或[重新執行 Claude Approvals 檢查](#comment-commands-for-approvals)。若檢查通過,已開啟自動合併或位於合併佇列中的 pull request 可能會立即合併 |71| **Observe mode ended: not evaluated yet** | 推送一個提交,或[重新執行 Claude Approvals 檢查](#comment-commands-for-approvals)。若檢查通過,已開啟自動合併或位於合併佇列中的 pull request 可能會立即合併 |

72 72 

73在 **Passed; no approval from Claude** 的情況下,Claude 不會張貼核准的情形包括:73若您看到 **Passed; no approval from Claude**,請檢查是否有下列原因:

74 74 

75* 某條規則寫著 `claude: comments`75* 某條規則寫著 `claude: comments`

76* 某個已變更的檔案沒有規則,或是[符號連結、子模組指標或 `.gitattributes` 檔案](https://code.claude.com/docs/zh-TW/approvals-policy#protected-files)76* 某個已變更的檔案沒有規則,或是[符號連結、子模組指標或 `.gitattributes` 檔案](https://code.claude.com/docs/zh-TW/approvals-policy#protected-files)


80 80 

81在觀察模式下,**Claude Approvals** 檢查會以中性(neutral)結束,GitHub 會將其視為通過,且其標題以 **(observe mode)** 開頭。81在觀察模式下,**Claude Approvals** 檢查會以中性(neutral)結束,GitHub 會將其視為通過,且其標題以 **(observe mode)** 開頭。

82 82 

83在下列情況中,檢查不會是中性:83在下列等情況中,檢查可能會等待、失敗、被暫緩或不出現:

84 84 

85| 情況 | 檢查的行為 |85| 情況 | 檢查的行為 |

86| :- | :- |86| :- | :- |

87| pull request 變更了政策或分類器檔案 | 它可能會等待一個人核准,此人可以是作者。若變更破壞了其中任一檔案,檢查會失敗 |87| pull request 變更了政策或分類器檔案 | 它可能會等待一個人核准,此人可以是作者。若變更破壞了其中任一檔案,檢查會失敗 |

88| 預設分支的政策檔案無法使用 | 在您[修正政策檔案](https://code.claude.com/docs/zh-TW/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses)之前,檢查會失敗 |88| 預設分支的政策檔案無法使用 | 在您[修正政策檔案](https://code.claude.com/docs/zh-TW/approvals-troubleshooting.md#fix-a-policy-file-that-approvals-refuses)之前,檢查會失敗 |

89| 標題顯示 Withheld | Approvals 暫緩給出通過的檢查,例如因為另一個開啟中的 pull request 具有相同的最新提交。檢查的摘要會說明如何解除 |89| 標題顯示 Withheld | Approvals 暫緩了一項通過的檢查,例如因為另一個開啟中的 pull request 具有相同的最新提交。請閱讀該檢查的摘要,了解如何解除 |

90| pull request 的目標分支不是預設分支 | 不會出現檢查,除非該 pull request 變更了政策或分類器檔案 |90| pull request 的目標分支不是預設分支 | 不會出現檢查,除非該 pull request 變更了政策或分類器檔案 |

91 91 

92## Approvals 的留言命令92## Approvals 的留言命令


105 105 

106## 來自 Claude、分支儲存庫與外部貢獻者的 pull request106## 來自 Claude、分支儲存庫與外部貢獻者的 pull request

107 107 

108由 `claude[bot]` 開啟的 pull request 需要第二個 GitHub App,Claude 才能核准它。來自分支儲存庫,或來自沒有寫入權限者的 pull request,可能需要維護者處理。108在 Claude 能夠核准由 `claude[bot]` 開啟的 pull request 之前,您需要第二個 GitHub App。來自 fork 或來自沒有寫入權限之人員的 pull request,可能需要由維護者處理。

109 109 

110### Claude 開啟的 pull request110### Claude 開啟的 pull request

111 111 

112GitHub 不允許開啟 pull request 的帳號核准該 pull request。若沒有第二個應用程式,Claude 不會對 `claude[bot]` 開啟的 pull request 給予核准,而 **Claude Approvals** 檢查可能會以標題 **Passed; no approval from Claude** 通過。112在您新增第二個 GitHub App 之前,由 `claude[bot]` 開啟的 pull request 上的 **Claude Approvals** 檢查可能會以標題 **Passed; no approval from Claude** 通過。

113 113 

114若要讓 Claude 核准這些 pull request,請新增第二個應用程式:114若要讓 Claude 核准這些 pull request,請新增第二個應用程式:

115 115 

1161. **安裝**:請您 GitHub 組織的擁有者在儲存庫上安裝 [Claude Approvals GitHub App](https://github.com/apps/claude-approvals/installations/new)。1161. **安裝**:請您 GitHub 組織的擁有者在儲存庫上安裝 [Claude Approvals GitHub App](https://github.com/apps/claude-approvals/installations/new)。

1172. **連結**:[將該應用程式連結至您的 Claude 組織](https://claude.ai/settings/claude-approvals/github/finish)。這需要同時是 GitHub 組織擁有者,以及 Claude 組織 Owner 或 Primary Owner 的人來操作。若沒有人同時具備這兩種身分,請聯絡 [Anthropic 支援](https://support.claude.com)。1172. **連結**:請同時是 GitHub 組織擁有者,以及 Claude 組織 Owner 或 Primary Owner 的人[將該應用程式連結至您的 Claude 組織](https://claude.ai/settings/claude-approvals/github/finish)。若對方無法連結,請聯絡 [Anthropic 支援](https://support.claude.com)。

118 118 

119接著,在由 `claude[bot]` 開啟的開啟中 pull request 上[重新執行檢查](#comment-commands-for-approvals)。請保持必要檢查的來源不變,因為 [Claude GitHub App](https://github.com/apps/claude) 仍會回報該檢查。119接著,在由 `claude[bot]` 開啟的開啟中 pull request 上[重新執行檢查](#comment-commands-for-approvals)。請保持必要檢查的來源不變,因為 [Claude GitHub App](https://github.com/apps/claude) 仍會回報該檢查。

120 120 

121### 來自分支儲存庫與外部貢獻者的 pull request121### 來自分支儲存庫與外部貢獻者的 pull request

122 122 

123Approvals 無法確認分支儲存庫的提交是由具有寫入權限的人推送的。在來自分支儲存庫的 pull request 上,Approvals 可能會等待維護者,也就是具有寫入權限的人:123在來自分支儲存庫的 pull request 上,Approvals 可能會等待維護者,也就是具有寫入權限的人:

124 124 

125* **在維護者為提交提供擔保之前**:任何分類器的回應都不計入,包括 Code Review 的回應。若某條規則依賴其中之一,**Claude Approvals** 檢查的標題可能會顯示 **No classifier result counts on this commit**。125* **在維護者為提交提供擔保之前**:任何分類器的回應都不計入,包括 Code Review 的回應。若某條規則依賴其中之一,**Claude Approvals** 檢查的標題可能會顯示 **No classifier result counts on this commit**。

126* **為提交提供擔保**:在觀察模式以外,若您具有寫入權限,請閱讀變更。接著留言 `@claude approvals rerun`,後面接上最新提交的完整 SHA,並讓其成為留言的唯一內容。之後分類器便可針對該提交執行。若未附上 SHA,此命令可能涵蓋您留言時的最新提交。126* **為提交提供擔保**:在觀察模式以外,若您具有寫入權限,請閱讀變更。接著留言 `@claude approvals rerun`,後面接上最新提交的完整 SHA,並讓其成為留言的唯一內容。之後分類器便可針對該提交執行。若未附上 SHA,此命令可能涵蓋您留言時的最新提交。

approvals-setup.md +15 −15

Details

16* [Claude GitHub App](https://github.com/apps/claude),已安裝於該儲存庫並[連結至您的 Claude 組織](https://code.claude.com/docs/zh-TW/admin-setup.md#connected-github-accounts)16* [Claude GitHub App](https://github.com/apps/claude),已安裝於該儲存庫並[連結至您的 Claude 組織](https://code.claude.com/docs/zh-TW/admin-setup.md#connected-github-accounts)

17* 合併至預設分支的權限17* 合併至預設分支的權限

18* 在 GitHub 上對該儲存庫的管理員存取權,以便將 **Claude Approvals** 檢查設為必要。私人儲存庫還需要[付費的 GitHub 方案](https://docs.github.com/en/get-started/learning-about-github/githubs-plans)18* 在 GitHub 上對該儲存庫的管理員存取權,以便將 **Claude Approvals** 檢查設為必要。私人儲存庫還需要[付費的 GitHub 方案](https://docs.github.com/en/get-started/learning-about-github/githubs-plans)

19* 在強制執行本頁任一政策之前,需有兩位具有寫入權限的人員。若只有一位,則對於 `.claude/` 下的變更,或 Claude 的審查失敗或未提供結果的變更,檢查將無法通過。在[讓每項變更都有兩個人參與](#keep-two-people-on-each-change)的政策下,任何變更的檢查都無法通過19* 在強制執行本頁任一政策之前,需有兩位具有寫入權限的人員。兩項政策都要求 `.claude/` 下的變更(包括政策檔案)須有兩個人參與

20 20 

21## 規劃您的第一個政策21## 規劃您的第一個政策

22 22 

23[政策檔案](https://code.claude.com/docs/zh-TW/approvals-policy.md)會告訴 Approvals 誰必須核准 pull request。對於您的第一個政策,請決定 Claude 是否可以核准,然後複製相符的入門政策:23在[政策檔案](https://code.claude.com/docs/zh-TW/approvals-policy.md)中,您可以設定誰必須核准 pull request。對於您的第一個政策,請決定 Claude 是否可以核准,然後複製相符的入門政策:

24 24 

25* **[在 Code Review 通過時讓 Claude 核准](#let-claude-approve-when-code-review-passes)**:通過 Claude 審查的 pull request 通常不需要其他人的核准25* **[在 Code Review 通過時讓 Claude 核准](#let-claude-approve-when-code-review-passes)**:通過 Claude 審查的 pull request 通常只需要其作者

26* **[讓每項變更都有兩個人參與](#keep-two-people-on-each-change)**:pull request 通常需要作者以外的一個人,且 Claude 不會核准26* **[讓每項變更都有兩個人參與](#keep-two-people-on-each-change)**:pull request 通常需要作者以外的一個人,且 Claude 只會留言

27 27 

28兩個政策都從觀察模式開始,在此模式下,**Claude Approvals** 檢查會顯示政策將做出的決定,Claude 不會核准,且該檢查[通常視為通過](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#approvals-in-observe-mode)。28兩個政策都從觀察模式開始,在此模式下,**Claude Approvals** 檢查會顯示政策將做出的決定,且[通常視為通過](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#approvals-in-observe-mode)。

29 29 

30兩者也都指定了 `claude/code_review`。請在您的政策檔案中保留它。一旦該檔案位於預設分支上,無論處於觀察模式或已強制執行,在沒有任何相符規則指定它的情況下,自動 Code Review 通常會停止。30兩者也都指定了 `claude/code_review`。請將它保留在與您想要審查的檔案相符的規則中,以便在觀察模式下以及強制執行之後,[自動 Code Review 都能持續進行](https://code.claude.com/docs/zh-TW/approvals.md#keep-automatic-code-reviews)。

31 31 

32> [!TIP]32> [!TIP]

33>33>


35 35 

36### 在 Code Review 通過時讓 Claude 核准36### 在 Code Review 通過時讓 Claude 核准

37 37 

38一旦強制執行此入門政策,通過 Claude 審查的 pull request 通常不需要其他人的核准,但 `.claude/` 下的變更除外。其他 pull request 通常需要[作者以外](https://code.claude.com/docs/zh-TW/approvals-policy.md#whether-a-pull-request’s-author-counts)的一個人。38一旦強制執行此入門政策,通過 Claude 審查的 pull request 通常只需要其作者,但 `.claude/` 下的變更除外。其他 pull request 通常需要[作者以外](https://code.claude.com/docs/zh-TW/approvals-policy.md#whether-a-pull-request’s-author-counts)的一個人。

39 39 

40在此政策中,第一條規則要求一項變更由兩個人參與。其 `override` 會在 `claude/code_review` 讀取為 `pass` 時將人數降為一人,並讓 Claude 核准。第二條規則要求 `.claude/` 下的變更由兩個人參與:40在此政策中,第一條規則要求一項變更由兩個人參與。其 `override` 會在 `claude/code_review` 讀取為 `pass` 時將人數降為一人,並讓 Claude 核准。第二條規則要求 `.claude/` 下的變更由兩個人參與:

41 41 


59 59 

60### 讓每項變更都有兩個人參與60### 讓每項變更都有兩個人參與

61 61 

62此入門政策要求每項變更由兩個人參與。一旦強制執行此政策,pull request 通常需要作者以外的一個人,且 Claude 不會核准。62使用此入門政策要求每項變更由兩個人參與。一旦強制執行此政策,pull request 通常需要作者以外的一個人,且 Claude 只會留言。

63 63 

64在此政策中,兩條規則都要求兩個人。第一條規則將 `claude/code_review` 列在 [`advisory`](https://code.claude.com/docs/zh-TW/approvals-policy#advisory) 之下,因此審查會依照您的 Code Review 設定進行:64在此政策中,兩條規則都要求兩個人。第一條規則將 `claude/code_review` 列在 [`advisory`](https://code.claude.com/docs/zh-TW/approvals-policy#advisory) 之下,因此審查會依照您的 Code Review 設定進行:

65 65 


104 104 

105在您[將政策從觀察模式切換為強制執行](#switch-from-observe-mode-to-enforcement)之前,請決定哪些檔案需要人員核准、檢查要把關哪些分支,以及何時變更 GitHub 的必要核准:105在您[將政策從觀察模式切換為強制執行](#switch-from-observe-mode-to-enforcement)之前,請決定哪些檔案需要人員核准、檢查要把關哪些分支,以及何時變更 GitHub 的必要核准:

106 106 

107* **檔案**:決定哪些檔案無論 Claude 發現什麼都需要人員核准,然後複製[此規則](https://code.claude.com/docs/zh-TW/approvals-github-rules.md#ask-for-a-person-who-isn’t-an-author)並縮小其 `paths` 範圍107* **檔案**:決定哪些檔案無論 Claude 發現什麼都需要人員核准,然後複製[此規則](https://code.claude.com/docs/zh-TW/approvals-github-rules.md#ask-for-a-person-who-isn’t-an-author)並縮小其 `paths` 清單

108* **分支**:已強制執行的政策也涵蓋目標為預設分支以外分支的 pull request,因此請列出每個應由 **Claude Approvals** 檢查把關其合併的分支。在這些分支上,未包含任何受涵蓋檔案的 pull request 不會取得檢查,因此必要的檢查會持續等待108* **分支**:已強制執行的政策也涵蓋目標為預設分支以外分支的 pull request,因此請列出每個應由 **Claude Approvals** 檢查把關其合併的分支。在這些分支上,未包含任何受涵蓋檔案的 pull request 不會取得檢查,因此必要的檢查會持續等待

109* **GitHub 的必要核准**:僅在切換的最後一個步驟之後,才[變更 GitHub 要求的核准數量](https://code.claude.com/docs/zh-TW/approvals-github-rules.md#required-reviews-and-codeowners)109* **GitHub 的必要核准**:僅在切換的最後一個步驟之後,才[變更 GitHub 要求的核准數量](https://code.claude.com/docs/zh-TW/approvals-github-rules.md#required-reviews-and-codeowners)

110 110 

111### 從觀察模式切換為強制執行111### 從觀察模式切換為強制執行

112 112 

113政策檔案的 [`mode`](https://code.claude.com/docs/zh-TW/approvals-policy#top-level-keys) 為下列其中之一:113政策檔案的 [`mode`](https://code.claude.com/docs/zh-TW/approvals-policy#top-level-keys) 鍵為下列其中之一:

114 114 

115* **`observe`**:**Claude Approvals** 檢查會顯示政策將做出的決定,Claude 不會核准,且該檢查[通常視為通過](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#approvals-in-observe-mode)115* **`observe`**:**Claude Approvals** 檢查會顯示政策將做出的決定,Claude 不會核准,且該檢查[通常視為通過](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#approvals-in-observe-mode)

116* **`enforce`**:檢查可以阻擋合併,且在政策允許的情況下 Claude 可以核准。這是預設值,因此沒有 `mode` 這一行的政策檔案會被強制執行116* **`enforce`**:檢查可以阻擋合併,且在政策允許的情況下 Claude 可以核准。這是預設值,因此沒有 `mode` 這一行的政策檔案會被強制執行


137 137 

138### 設定 GitHub 接受的 Claude Approvals 來源138### 設定 GitHub 接受的 Claude Approvals 來源

139 139 

140將必要檢查的來源設為 Claude 應用程式。若設為 **any source**,GitHub 會接受來自其他地方、名為 **Claude Approvals** 的檢查。若要透過 GitHub 的 API 設定來源,請將 Claude 應用程式的 ID `1236702` 放在規則集的 `integration_id` 中,或分支保護規則的 `app_id` 中。140將必要檢查的來源設定為 Claude 應用程式。如果允許**任何來源**,GitHub 會接受來自其他地方、名為 **Claude Approvals** 的檢查。若要透過 GitHub 的 API 設定來源,請將 Claude 應用程式的 ID `1236702` 填入 ruleset 中的 `integration_id`,或分支保護規則中的 `app_id`。

141 141 

142## 控制 Approvals 的支出142## 控制 Approvals 的支出

143 143 


147 147 

148在 `if` 條件中包含 `claude/code_review` 的政策,可能會在 pull request 開啟時及每次推送時啟動[需計費的 Code Review](https://code.claude.com/docs/zh-TW/code-review-costs.md)。若要停止這些審查,請將其從條件移至 `advisory`。當 `claude/code_review` 僅位於 `advisory` 之下且沒有 [`level`](https://code.claude.com/docs/zh-TW/approvals-classifiers#read-a-classifier’s-answer-from-a-rule) 時,審查會依照您的 Code Review 設定進行。148在 `if` 條件中包含 `claude/code_review` 的政策,可能會在 pull request 開啟時及每次推送時啟動[需計費的 Code Review](https://code.claude.com/docs/zh-TW/code-review-costs.md)。若要停止這些審查,請將其從條件移至 `advisory`。當 `claude/code_review` 僅位於 `advisory` 之下且沒有 [`level`](https://code.claude.com/docs/zh-TW/approvals-classifiers#read-a-classifier’s-answer-from-a-rule) 時,審查會依照您的 Code Review 設定進行。

149 149 

150規則也可以讀取其他[分類器](https://code.claude.com/docs/zh-TW/approvals-classifiers.md)。對於 `claude/diff` 和自訂分類器,每次[呼叫模型的執行](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#what-a-classifier-run-costs)都會計費。若要限制自訂分類器的每次執行,請設定其 [`budget`](https://code.claude.com/docs/zh-TW/approvals-classifiers#budget)。150規則也可以讀取其他[分類器](https://code.claude.com/docs/zh-TW/approvals-classifiers.md)。對於 `claude/diff` 和自訂分類器,每次[呼叫模型的執行](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#what-a-classifier-run-costs)都會計費。若要限制自訂分類器的每次執行,請設定其 [`budget`](https://code.claude.com/docs/zh-TW/approvals-classifiers#budget) 鍵。

151 151 

152### 限制政策的費用152### 限制政策的費用

153 153 


172 172 

173> [!WARNING]173> [!WARNING]

174>174>

175> 請僅在關閉 Approvals 之後,才暫停或解除安裝 Claude GitHub App,或取消連結您的 GitHub 組織。如果您先執行這些操作,新的提交將不會取得檢查,因此必要的檢查可能會阻擋合併。GitHub 也可能繼續計入 Claude 留在已開啟 pull request 上的核准審查。175> 請僅在關閉 Approvals 之後,才暫停或解除安裝 Claude GitHub App,或取消連結您的 GitHub 組織。如果您先執行其中任何一個步驟,必要的 **Claude Approvals** 檢查可能會阻擋合併。GitHub 也可能繼續計入 Claude 留在已開啟 pull request 上的核准審查。

176 176 

177請依照以下順序操作:177請依照以下順序操作:

178 178 


1813. **關閉 Approvals**:依照您想要的範圍[選擇關閉方式](#ways-to-turn-off-approvals)。1813. **關閉 Approvals**:依照您想要的範圍[選擇關閉方式](#ways-to-turn-off-approvals)。

1824. **駁回 Claude 的審查**:在 Claude 已核准的已開啟 pull request 上,於 GitHub 中駁回該審查。1824. **駁回 Claude 的審查**:在 Claude 已核准的已開啟 pull request 上,於 GitHub 中駁回該審查。

183 183 

184若要在不關閉 Approvals 的情況下讓檢查停止阻擋,請先停止在預設分支以外的分支上將其設為必要。然後在每個政策檔案中加入 `mode: observe`。之後檢查通常會停止阻擋,而分類器仍會執行並計費。目標為那些其他分支的 pull request,除非變更了政策檔案或分類器檔案,否則不會取得檢查。184若要在不關閉 Approvals 的情況下讓檢查停止阻擋,請先停止在預設分支以外的分支上將其設為必要。然後在每個政策檔案中加入 `mode: observe`。之後檢查[通常會停止阻擋](https://code.claude.com/docs/zh-TW/approvals-pull-requests.md#approvals-in-observe-mode),而分類器仍會執行並計費。

185 185 

186### 關閉 Approvals 的方式186### 關閉 Approvals 的方式

187 187 


193| 一個 GitHub 組織,或其 **Edit** 對話方塊顯示 **Claude Approvals** 的儲存庫 | 以 [Owner 角色](https://code.claude.com/docs/zh-TW/server-managed-settings.md#access-control)前往 [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship),在其所在列按一下 **Edit**,然後關閉 **Claude Approvals** |193| 一個 GitHub 組織,或其 **Edit** 對話方塊顯示 **Claude Approvals** 的儲存庫 | 以 [Owner 角色](https://code.claude.com/docs/zh-TW/server-managed-settings.md#access-control)前往 [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship),在其所在列按一下 **Edit**,然後關閉 **Claude Approvals** |

194| 整個 Claude 組織 | 以 Owner 角色前往 [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship),並在 **Approve** 列中按一下 **Block globally**。若要重新開啟,請在同一列中按一下 **Allow policy files** |194| 整個 Claude 組織 | 以 Owner 角色前往 [**Organization settings > Claude Ship**](https://claude.ai/admin-settings/claude-ship),並在 **Approve** 列中按一下 **Block globally**。若要重新開啟,請在同一列中按一下 **Allow policy files** |

195 195 

196您為整個 Claude 組織關閉的功能,在之後有政策檔案合併時仍會保持關閉。如果您也要關閉 Code Review,請先關閉 Approvals,因為在 Code Review 關閉的情況下,政策仍可能啟動需計費的審查。196為整個 Claude 組織關閉 Approvals 之後,即使之後有政策檔案合併,它仍會保持關閉。如果您也要關閉 Code Review,請先關閉 Approvals,因為在 Code Review 關閉的情況下,政策仍可能啟動需計費的審查。

197 197 

198## 相關資源198## 相關資源

199 199 

Details

84| "no key of this name is read at this place" | 對照[頂層鍵](https://code.claude.com/docs/zh-TW/approvals-policy.md#top-level-keys)與[規則鍵](https://code.claude.com/docs/zh-TW/approvals-policy.md#rule-keys),檢查鍵的拼寫與其層級 |84| "no key of this name is read at this place" | 對照[頂層鍵](https://code.claude.com/docs/zh-TW/approvals-policy.md#top-level-keys)與[規則鍵](https://code.claude.com/docs/zh-TW/approvals-policy.md#rule-keys),檢查鍵的拼寫與其層級 |

85| "this names no fact and no usable classifier" | 對照 [facts](https://code.claude.com/docs/zh-TW/approvals-policy.md#if) 檢查名稱。對於 `repo/<name>`,請檢查位於政策檔案旁或其上層目錄中的 `.claude/classifiers/<name>/def.yml` 是否能載入 |85| "this names no fact and no usable classifier" | 對照 [facts](https://code.claude.com/docs/zh-TW/approvals-policy.md#if) 檢查名稱。對於 `repo/<name>`,請檢查位於政策檔案旁或其上層目錄中的 `.claude/classifiers/<name>/def.yml` 是否能載入 |

86| "a condition has no NOT" | 改寫為相反的運算子 |86| "a condition has no NOT" | 改寫為相反的運算子 |

87| "a login goes in single quotes inside a condition" | 如果該字詞是登入名稱,請將其放在單引號中,例如 `"pr/opened_by = 'ana-acme'"`。若為 bot,請撰寫 `bot:` 及其名稱,不加引號,例如 `"pr/opened_by = bot:dependabot"` |

87| "no local has this name" | 在此檔案或其上層的政策檔案中定義該 local。撰寫登入名稱或團隊時不要加 `@` |88| "no local has this name" | 在此檔案或其上層的政策檔案中定義該 local。撰寫登入名稱或團隊時不要加 `@` |

88| "this is not YAML" | 在訊息指出的行附近,尋找未閉合的引號或括號,或是 tab 字元。請使用空格縮排 |89| "this is not YAML" | 在訊息指出的行附近,尋找未閉合的引號或括號,或是 tab 字元。請使用空格縮排 |

89 90 

90## 分類器未給出答案或其定義遭拒絕91## 分類器未給出答案或其定義遭拒絕

91 92 

92若要查看每次[分類器](https://code.claude.com/docs/zh-TW/approvals-classifiers.md)執行的狀態以及缺少答案的原因,請在 Claude 於 pull request 上的留言中開啟 **Classifier results**。如果某次執行達到其預算,請拆分 pull request,或提高低於其[上限](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#budget)的 `time` 或 `cost`。93若要查看每次[分類器](https://code.claude.com/docs/zh-TW/approvals-classifiers.md)執行的狀態以及缺少答案的原因,請在 Claude 於 pull request 上的留言中開啟 **Classifier results**:

94 

95* **某次執行達到其預算**:請拆分 pull request,或提高低於其[上限](https://code.claude.com/docs/zh-TW/approvals-classifiers.md#budget)的 `time` 或 `cost`

96* **某次執行需要讀取的內容超出單次執行所能處理的量**,例如大型差異:請嘗試較小的 pull request

93 97 

94接著在這裡找出 **Claude Approvals** 檢查的標題:98接著在這裡找出 **Claude Approvals** 檢查的標題:

95 99 

artifacts.md +16 −16

Details

43Build a dashboard artifact of last week's deploy failures by service and keep it updated as you investigate.43Build a dashboard artifact of last week's deploy failures by service and keep it updated as you investigate.

44```44```

45 45 

46除非您指定位置,否則 Claude 會將頁面寫入專案外暫存目錄中的 HTML 或 Markdown 檔案,然後將其發佈。在您[分享](#share-an-artifact)之前,artifact 僅供您本人檢視。46在您[分享](#share-an-artifact)之前,artifact 僅供您本人檢視。

47 47 

48首次發佈後,Claude 會輸出 URL,您的瀏覽器會開啟新頁面。48首次發佈後,Claude 會輸出 URL,您的瀏覽器會開啟新頁面。

49 49 


58 58 

59### Claude Code 何時會在發佈前詢問59### Claude Code 何時會在發佈前詢問

60 60 

61Claude 根據您輸入的提示詞所發佈的新 artifact,會直接通過,不會出現權限提示或經過分類器審查。在下列情況中,Claude Code 會先詢問您,或在[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)中交由分類器審查該發佈:61Claude 根據您輸入的提示詞所發佈的新 artifact,可以直接通過,不會出現權限提示或經過分類器審查。

62 

63在 `bypassPermissions` 模式以外,於下列這類情況中,該發佈需要您的核准,或在[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)中需要分類器的審查:

62 64 

63| 時機 | Claude Code 的行為 |65| 時機 | Claude Code 的行為 |

64| :- | :- |66| :- | :- |


66| 該發佈為頁面宣告了執行階段功能,例如[連接器呼叫](#pull-live-data-with-mcp-connectors)或[檔案下載](#offer-a-file-download) | 在該次發佈前詢問 |68| 該發佈為頁面宣告了執行階段功能,例如[連接器呼叫](#pull-live-data-with-mcp-connectors)或[檔案下載](#offer-a-file-download) | 在該次發佈前詢問 |

67| 您已公開分享該 artifact | 在每次對話中變更前至少詢問一次,並在每次回覆其上的留言前詢問 |69| 您已公開分享該 artifact | 在每次對話中變更前至少詢問一次,並在每次回覆其上的留言前詢問 |

68| Claude 在由[工作階段範圍的排程任務](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)於您的工作階段中觸發所啟動的回合中發佈,而非由您輸入的提示詞啟動 | 在每個 artifact 首次發佈前詢問 |70| Claude 在由[工作階段範圍的排程任務](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)於您的工作階段中觸發所啟動的回合中發佈,而非由您輸入的提示詞啟動 | 在每個 artifact 首次發佈前詢問 |

69| Claude 在未經您核准的情況下無法讀取該檔案 | 在發佈前詢問。`Artifact` 工具的允許規則不會略過此提示 |71| Claude 從一個未經您核准便無法讀取的檔案進行發佈 | 在發佈前詢問,或拒絕使用該檔案。`Artifact` 工具的允許規則不算作核准 |

70| 在 [Manual](https://code.claude.com/docs/zh-TW/permission-modes.md) 或 `acceptEdits` 模式中,Claude 對某個 artifact 的檔案進行小幅變更,而該檔案未經您核准便無法編輯,例如 Manual 模式中的專案檔案 | 在發佈該變更前詢問。即使允許規則涵蓋 `Artifact` 工具,仍會詢問您,因為對該檔案的編輯需要您的核准 |72| 在 [Manual](https://code.claude.com/docs/zh-TW/permission-modes.md) 或 `acceptEdits` 模式中,Claude 對某個 artifact 的檔案進行小幅變更,而該檔案未經您核准便無法編輯,例如 Manual 模式中的專案檔案 | 在發佈該變更前詢問。即使允許規則涵蓋 `Artifact` 工具,仍會詢問您,因為對該檔案的編輯需要您的核准 |

71 73 

72若要讓 Claude 在未經您核准的情況下讀取[工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)以外的檔案,請在啟動時使用 [`--add-dir`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags),或在工作階段中使用 `/add-dir`,將其資料夾新增為工作目錄。Claude 本來就會直接讀取這些目錄中的檔案,以及其寫入頁面的暫存目錄中的檔案,而不會詢問。74若要讓 Claude 在未經您核准的情況下讀取[工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)以外的檔案,請在啟動時使用 [`--add-dir`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags),或在工作階段中使用 `/add-dir`,將其資料夾新增為工作目錄。

73 75 

74如果發佈提示中包含 `Also makes 1 edit to that file on disk.` 之類的句子,表示 Claude 正在一個步驟中變更 artifact 的檔案並將其發佈。當您核准該提示後,Claude Code 會先發佈頁面,然後將變更寫入您的檔案。76如果發佈提示中包含 `Also makes 1 edit to that file on disk.` 之類的句子,表示 Claude 正在一個步驟中變更 artifact 的檔案並將其發佈。當您核准該提示後,Claude Code 會先發佈頁面,然後將變更寫入您的檔案。

75 77 

76## 更新成品78## 更新成品

77 79 

78要求 Claude 修訂頁面,或讓長時間執行的任務在進行時重新發佈。Claude 編輯基礎檔案並重新發佈到相同的 URL。80要求 Claude 修訂頁面,或讓長時間執行的任務在進行時重新發佈。Claude 會再次發佈到相同的 URL。

79 81 

80```text wrap theme={null}82```text wrap theme={null}

81在摘要圖表下方新增按地區的細項分析,並重新發佈。83在摘要圖表下方新增按地區的細項分析,並重新發佈。


150 152 

151當有人與您共享成品時,您可以讓 Claude 閱讀它:提供 Claude 其 URL,或從 [`/artifacts`](#find-an-artifact-again) 附加它。153當有人與您共享成品時,您可以讓 Claude 閱讀它:提供 Claude 其 URL,或從 [`/artifacts`](#find-an-artifact-again) 附加它。

152 154 

153Claude 閱讀他人撰寫的頁面的方式與它使用 [WebFetch](https://code.claude.com/docs/zh-TW/tools-reference.md#webfetch-tool-behavior) 閱讀網頁的方式相同:它取得所詢問內容的摘要,而不是原始頁面,摘要報告寫入頁面的指示,而不是轉達它們。Claude Code 也會將頁面的完整原始碼儲存到本機檔案,Claude 可以在需要確切內容時開啟該檔案,例如重新發佈成品作為 [編輯器](#let-someone-edit-with-you)。155Claude Code 可以將頁面的完整原始碼儲存到本機檔案,Claude 可以開啟該檔案。

154 156 

155在以下情況下,Claude Code 會在 Claude 閱讀 artifact 之前要求您核准,此外還有您的權限模式或規則所要求的任何提示:157在以下情況下,Claude Code 可能會在 [Artifact 工具](https://code.claude.com/docs/zh-TW/tools-reference.md) 讀取 artifact 之前要求您核准,此外還有您的權限模式或規則所要求的任何提示:

156 158 

157* **沒有網路存取權的雲端工作階段**:對於 [雲端環境](https://code.claude.com/docs/zh-TW/cloud-environments.md#access-levels),即 **None** 等級。在 [自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) 中,分類器可以代為核准;在 [Cowork](https://claude.com/product/cowork) 工作階段中,核准只能由您進行。159* **沒有網路存取權的雲端工作階段**:對於 [雲端環境](https://code.claude.com/docs/zh-TW/cloud-environments.md#access-levels),即 **None** 等級。在 [自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) 中,分類器可以代為核准;在 [Cowork](https://claude.com/product/cowork) 工作階段中,核准只能由您進行。

158* **其他組織的公開 artifact**:即使在自動模式下,Claude Code 也會先詢問您。在 Claude Code 無法詢問您的情況下,例如在 `bypassPermissions` 模式中,Claude 無法閱讀該 artifact。只有在 [功能旗標擷取](https://code.claude.com/docs/zh-TW/env-vars.md#features-that-need-feature-flag-fetching) 開啟時,Claude 才能閱讀這些 artifact。160* **其他組織的公開 artifact**:即使在自動模式下,該工具也會先詢問您。在 Claude Code 無法詢問您的情況下,例如在 `bypassPermissions` 模式中,該工具無法讀取您在此對話中尚未核准的 artifact。只有在 [功能旗標擷取](https://code.claude.com/docs/zh-TW/env-vars.md#features-that-need-feature-flag-fetching) 開啟時,該工具才能讀取這些 artifact。

159* **無法確認擁有者或網路設定**:當 Claude Code 無法確認 artifact 的建立者,或無法確認雲端工作階段的網路設定時,它會詢問您,而您的核准僅適用於該次請求。在 [自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) 中,分類器可以核准或封鎖此次讀取,而不是詢問您。161* **無法確認擁有者或網路設定**:當 Claude Code 無法確認 artifact 的建立者,或無法確認雲端工作階段的網路設定時,它會詢問您,而您的核准僅適用於該次請求。在 [自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) 中,分類器可以核准或封鎖此次讀取,而不是詢問您。

160* **plan mode**:在 [plan mode](https://code.claude.com/docs/zh-TW/permission-modes.md#analyze-before-you-edit-with-plan-mode) 中,Claude Code 會在 Artifact 工具閱讀您組織中其他人建立的 artifact 之前詢問您。162* **plan mode**:在 [plan mode](https://code.claude.com/docs/zh-TW/permission-modes.md#analyze-before-you-edit-with-plan-mode) 中,Claude Code 會在 Artifact 工具閱讀您組織中其他人建立的 artifact 之前詢問您。

161 163 


165 167 

166當您在組織內分享成品時,與您分享的人可以在頁面上留下評論,您可以讓 Claude 讀取這些評論並回覆。您需要 Claude Code v2.1.221 或更新版本。Claude 在兩種情況下會讀取評論:168當您在組織內分享成品時,與您分享的人可以在頁面上留下評論,您可以讓 Claude 讀取這些評論並回覆。您需要 Claude Code v2.1.221 或更新版本。Claude 在兩種情況下會讀取評論:

167 169 

168* **您要求 Claude 讀取評論**:提供 Claude 成品的 URL 並要求查看評論。Claude 會列出每個執行緒,並標記可以編輯成品的人發送給它的評論。170* **您要求 Claude 讀取評論**:提供 Claude artifact 的 URL 並要求查看評論。

169* **可以編輯成品的人向 Claude 發送評論**:在頁面上的執行緒中,他們使用**傳送給 Claude** 發送評論,或在其中提及 `@claude`。無論哪種方式,他們都會啟動該執行緒。171* **可以編輯成品的人向 Claude 發送評論**:在頁面上的執行緒中,他們使用**傳送給 Claude** 發送評論,或在其中提及 `@claude`。無論哪種方式,他們都會啟動該執行緒。

170 172 

171Claude 只能回覆或解決已啟動的執行緒。其他執行緒保持開啟狀態,直到某人在頁面上解決它們。檢視者會看到每個回覆都歸屬於 Claude,透過您。173Claude 只能回覆或解決已啟動的執行緒。其他執行緒保持開啟狀態,直到某人在頁面上解決它們。檢視者會看到每個回覆都歸屬於 Claude,透過您。


188 190 

189您的[權限模式](https://code.claude.com/docs/zh-TW/permission-modes.md)決定了當發送的評論到達時 Claude 的行為:191您的[權限模式](https://code.claude.com/docs/zh-TW/permission-modes.md)決定了當發送的評論到達時 Claude 的行為:

190 192 

191* **Claude 自動回覆**:如果您處於允許 Claude 在不詢問您的情況下發佈回覆的權限模式,Claude 會讀取執行緒並回覆。您會看到 `Auto-replied to comment thread on Artifact: <name>`。193* **Claude 自動回覆**:如果您處於允許 Claude 在不詢問您的情況下發佈回覆的權限模式,Claude 會讀取執行緒並回覆。您會看到類似 `Auto-replied to comment thread on Artifact: <name>` 的通知。

192* **Claude 等待您**:在 plan mode 之外,當發佈回覆[需要您的核准](#when-claude-code-asks-before-publishing)時,您會看到 `Comments are waiting on Artifact: <name>`。Claude 隨後會要求您核准讀取執行緒,然後再次要求核准發佈回覆。194* **Claude 等待您**:在 plan mode 之外,當發佈回覆[需要您的核准](#when-claude-code-asks-before-publishing)時,您會看到 `Comments are waiting on Artifact: <name>`。Claude 隨後會要求您核准讀取執行緒,然後再次要求核准發佈回覆。

193* **Claude 在計畫模式中暫停**:您會看到 `Comments are waiting on Artifact: <name>`,Claude 不會回覆,直到您離開計畫模式並要求它讀取並回覆。195* **Claude 在計畫模式中暫停**:您會看到 `Comments are waiting on Artifact: <name>`,Claude 不會回覆,直到您離開計畫模式並要求它讀取並回覆。

194 196 


202* **在 `/tasks` 中停止任務**:Claude 停止回覆該成品,直到您要求它在那裡恢復回覆。重新發佈成品不會再次開始回覆,當您稍後恢復工作階段時,停止仍然適用。204* **在 `/tasks` 中停止任務**:Claude 停止回覆該成品,直到您要求它在那裡恢復回覆。重新發佈成品不會再次開始回覆,當您稍後恢復工作階段時,停止仍然適用。

203* **在 3 秒內按兩次 `Ctrl+X Ctrl+K`**:[停止每個執行中背景子代理](https://code.claude.com/docs/zh-TW/interactive-mode.md#general-controls)的和弦也會停止 Claude 在工作階段的其餘時間內回覆每個成品。要求 Claude 恢復回覆不會撤銷此停止。205* **在 3 秒內按兩次 `Ctrl+X Ctrl+K`**:[停止每個執行中背景子代理](https://code.claude.com/docs/zh-TW/interactive-mode.md#general-controls)的和弦也會停止 Claude 在工作階段的其餘時間內回覆每個成品。要求 Claude 恢復回覆不會撤銷此停止。

204 206 

205由 Claude Code 自行啟動的監視,可能會在 artifact 數小時沒有活動後結束。您會看到 `Stopped watching Artifact: <name> (idle)`。若要重新啟動監視,請再次發佈 artifact 或要求 Claude 監視它。如果您看到的是 `(made room for a newer watch)` 而非 `(idle)`,表示您的工作階段已達到 25 個監視的上限。再次發佈即可重新啟動該監視。207如果您看到 `Stopped watching Artifact: <name>` 後面接著 `(idle)`、`(connection lost)` 或 `(made room for a newer watch)`,請要求 Claude 重新發佈 artifact 以重新啟動監視。由 Claude Code 自行啟動的監視,可能會在數小時沒有活動後結束。

206 

207如果傳遞評論的服務變得不可用或停止回應,Claude Code 會嘗試重新連接一段時間,然後停止監視您的工作階段正在監視的每個成品。

208 208 

209## 使用 MCP 連接器拉取即時資料209## 使用 MCP 連接器拉取即時資料

210 210 


328若要從 Claude Code 使用範本,您需要:328若要從 Claude Code 使用範本,您需要:

329 329 

330* [artifact 可用](#availability)的工作階段330* [artifact 可用](#availability)的工作階段

331* 在 Team 和 Enterprise 方案上,您的組織已開啟該範本。如果範本已關閉,請要求擁有者在 claude.ai 的 **Organization settings > Artifacts** 下[開啟範本](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_6e06d8f1a8)。331* 在 Team 和 Enterprise 方案上,您的組織已開啟該範本。如果範本已關閉,請要求擁有者在 claude.ai 的 [**Organization settings > Artifacts**](https://claude.ai/admin-settings/artifacts) 下[開啟範本](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_6e06d8f1a8)。

332* 在具有自訂角色的 Enterprise 方案上,需要[包含該範本](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_d830917488)的角色332* 在具有自訂角色的 Enterprise 方案上,需要[包含該範本](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans#h_d830917488)的角色

333* 對於 Docs 和 Sheets 範本,需要 [Claude Docs 連接器](#write-a-document-with-claude-docs),Claude 會使用它撰寫這兩者的內容。如果您[已關閉該連接器](https://code.claude.com/docs/zh-TW/mcp.md#disable-claude-ai-connectors),請先將其重新開啟。333* 對於 Docs 和 Sheets 範本,需要 [Claude Docs 連接器](#write-a-document-with-claude-docs),Claude 會使用它撰寫這兩者的內容。如果您[已關閉該連接器](https://code.claude.com/docs/zh-TW/mcp.md#disable-claude-ai-connectors),請先將其重新開啟。

334* 如果您使用 Design 範本的 [`/design` 命令](#draft-a-design-canvas)開始,需要 Claude Code v2.1.265 或更新版本334* 如果您使用 Design 範本的 [`/design` 命令](#draft-a-design-canvas)開始,需要 Claude Code v2.1.265 或更新版本


355 355 

356## 頁面限制356## 頁面限制

357 357 

358每個成品是一個獨立的頁面。Claude Code 會將您發佈的檔案包裝在 HTML 文件殼層中,並在嚴格的內容安全政策 (CSP) 下提供服務,這會限制頁面可以執行的操作。358每個 artifact 都在嚴格的內容安全政策 (CSP) 下提供服務,這會限制頁面可以執行的操作。

359 359 

360| 限制 | 效果 |360| 限制 | 效果 |

361| :- | :- |361| :- | :- |


386 386 

387您的組織是否允許成品來自您組織的政策,Claude Code 從 `api.anthropic.com` 載入。當 Claude Code 無法載入政策時,成品不可用。當您要求一個時,Claude 會說明原因。387您的組織是否允許成品來自您組織的政策,Claude Code 從 `api.anthropic.com` 載入。當 Claude Code 無法載入政策時,成品不可用。當您要求一個時,Claude 會說明原因。

388 388 

389如果涉及代理、VPN 或網路篩選,請要求您的 IT 管理員允許 `api.anthropic.com` 通過。Claude Code 會在背景中持續重試,一旦政策載入並允許,成品就會變成可用。389如果涉及代理伺服器、VPN 或網路篩選,請要求其管理者允許 `api.anthropic.com` 通過。Claude Code 會在背景中持續重試,一旦政策載入並允許,artifact 就會變成可用。

390 390 

391## 停用 artifacts391## 停用 artifacts

392 392 

Details

25 25 

26* **Claude Pro、Max 或 Ultra 訂閱**:使用您的 claude.ai 帳戶登入。在 [claude.com/pricing](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=authentication_pro_max) 訂閱。26* **Claude Pro、Max 或 Ultra 訂閱**:使用您的 claude.ai 帳戶登入。在 [claude.com/pricing](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=authentication_pro_max) 訂閱。

27* **Claude for Teams 或 Enterprise**:使用您的團隊管理員邀請您的 claude.ai 帳戶登入。27* **Claude for Teams 或 Enterprise**:使用您的團隊管理員邀請您的 claude.ai 帳戶登入。

28* **Claude Console**:使用您的 Console 認證登入。您的管理員必須先 [邀請您](#claude-console-authentication)。您可以在有或沒有 [建立 API 金鑰](#sign-in-without-an-api-key) 的情況下登入。28* **Claude Console**:使用您的 [Console 憑證](#claude-console-authentication)登入。您可以在有或沒有 [建立 API 金鑰](#sign-in-without-an-api-key) 的情況下登入。

29* **雲端提供商**:如果您的組織使用 [Amazon Bedrock](https://code.claude.com/docs/zh-TW/amazon-bedrock.md)、[Google Cloud 的 Agent Platform](https://code.claude.com/docs/zh-TW/google-vertex-ai.md) 或 [Microsoft Foundry](https://code.claude.com/docs/zh-TW/microsoft-foundry.md),請在執行 `claude` 之前設定所需的環境變數。您也可以在登入提示處選擇 **3rd-party platform**,這會為 Bedrock 和 Agent Platform 啟動互動式設定精靈。29* **雲端提供商**:如果您使用 [Amazon Bedrock](https://code.claude.com/docs/zh-TW/amazon-bedrock.md)、[Google Cloud 的 Agent Platform](https://code.claude.com/docs/zh-TW/google-vertex-ai.md) 或 [Microsoft Foundry](https://code.claude.com/docs/zh-TW/microsoft-foundry.md),請在執行 `claude` 之前設定所需的環境變數。您也可以在登入提示處選擇 **3rd-party platform**,這會為 Bedrock 和 Agent Platform 啟動互動式設定精靈。

30* **Cloud gateway**:如果您的組織執行自託管的 [Claude 應用程式閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway),請透過 `/login` 或[從 VS Code](https://code.claude.com/docs/zh-TW/vs-code.md#sign-in-to-a-claude-apps-gateway) 使用公司 SSO 登入。閘道簽發的 token 是工作階段的唯一憑證。30* **Cloud gateway**:如果您的組織執行自託管的 [Claude 應用程式閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway),請透過 `/login` 或[從 VS Code](https://code.claude.com/docs/zh-TW/vs-code.md#sign-in-to-a-claude-apps-gateway) 使用公司 SSO 登入。閘道簽發的 token 是工作階段的唯一憑證。

31* **Enterprise Admin Console**:如果 Owner 已為您組織的提供商或閘道[開啟此登入方式](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code),請在 shell 中執行 `claude auth login`,並在瀏覽器中選擇您的組織。若要確認,請在終端機中尋找 `Signed in to the organization`。如需了解所需的 Claude Code 版本,請參閱[開始之前](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#before-you-start)。31* **Enterprise Admin Console**:如果 Owner 已為您組織的提供商或閘道[開啟此登入方式](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code),請在 shell 中執行 `claude auth login`,並在瀏覽器中選擇您的組織。若要確認,請在終端機中尋找 `Signed in to the organization`。如需了解所需的 Claude Code 版本,請參閱[開始之前](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#before-you-start)。

32 32 

Details

40 40 

41您給 Claude Code 的每一項指令都屬於以下其中一種:41您給 Claude Code 的每一項指令都屬於以下其中一種:

42 42 

431. 非確定性:您撰寫指令,由 Claude(模型)讀取。這可以是您的提示詞、`CLAUDE.md` 或 skill。接著由模型決定如何處理這些資訊。它通常會遵循您的命令,而且目前的模型很擅長在沒有太多上下文的情況下理解您的意圖,但*無法保證*它會遵循您的指令。它仍然可能決定不做某些事,或做其他的事。431. 非確定性:您撰寫指令,由 Claude(模型)讀取。這可以是您的提示詞、`CLAUDE.md` 或 skill。接著由模型決定如何處理這些資訊。它通常會遵循您的命令,而且目前的模型很擅長在沒有太多上下文的情況下理解您的意圖,但*無法保證*它會遵循您的指令。

442. 確定性:您設定指令,由 Claude Code(執行框架)*必須*執行。這可以是 hook、拒絕規則或受管設定。無論模型決定做什麼,Claude Code 每次都會套用它。442. 確定性:您設定指令,由 Claude Code(執行框架)*必須*執行。這可以是 hook、拒絕規則或受管設定。無論模型決定做什麼,Claude Code 每次都會套用它。

45 45 

46Claude Code 中的大多數功能都有這兩種形式:46Claude Code 中的大多數功能都有這兩種形式:


596您很少需要自己清理這些:596您很少需要自己清理這些:

597 597 

598* 當您結束一個未命名的 worktree 工作階段時,如果其中沒有任何內容,Claude Code 會[移除它以 git 建立的 worktree](https://code.claude.com/docs/zh-TW/worktrees.md#clean-up-worktrees)。對於已命名的工作階段或有變更的工作階段,它會詢問要怎麼做。598* 當您結束一個未命名的 worktree 工作階段時,如果其中沒有任何內容,Claude Code 會[移除它以 git 建立的 worktree](https://code.claude.com/docs/zh-TW/worktrees.md#clean-up-worktrees)。對於已命名的工作階段或有變更的工作階段,它會詢問要怎麼做。

599* Subagent 的 worktree 會在 subagent 完成且沒有變更時消失。599* 被遺留下來的 subagent 和背景工作階段 worktree,會在存在時間超過 `cleanupPeriodDays` 且不含任何工作時[被自動移除](https://code.claude.com/docs/zh-TW/worktrees.md#clean-up-subagent-and-background-session-worktrees)。

600* 確實被遺留下來的 subagent 和背景工作階段 worktree,會在存在時間超過 `cleanupPeriodDays` 且不含任何工作時被清除。

601 600 

602> [!NOTE]601> [!NOTE]

603>602>

champion-kit.md +1 −1

Details

125 125 

126### 三十天行動手冊126### 三十天行動手冊

127 127 

128如果一個寬鬆的計劃有幫助,下面的序列反映了在大多數團隊中傾向於有效的東西。自由調整以適應你的背景。128如果一份寬鬆的計畫對您有幫助,以下順序反映了在大多數團隊中通常有效的做法。

129 129 

130**1. 第 1 週:播種頻道**130**1. 第 1 週:播種頻道**

131 131 

channels.md +1 −1

Details

355| 功能 | 它的作用 | 適合 |355| 功能 | 它的作用 | 適合 |

356| - | - | - |356| - | - | - |

357| [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md) | 在新鮮雲端沙箱中執行任務,從 GitHub 複製 | 委派您稍後檢查的自包含非同步工作 |357| [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md) | 在新鮮雲端沙箱中執行任務,從 GitHub 複製 | 委派您稍後檢查的自包含非同步工作 |

358| [Claude in Slack](https://code.claude.com/docs/zh-TW/slack.md) | 從頻道或討論串中的 `@Claude` 提及產生雲端工作階段 | 直接從團隊對話中啟動任務 |358| [Claude Tag](https://claude.com/docs/claude-tag/overview) | 從頻道或討論串中的 `@Claude` 提及產生雲端工作階段 | 直接從團隊對話中啟動任務 |

359| 標準 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | Claude 在任務期間查詢它;沒有任何東西被推送到工作階段 | 讓 Claude 按需存取讀取或查詢系統 |359| 標準 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | Claude 在任務期間查詢它;沒有任何東西被推送到工作階段 | 讓 Claude 按需存取讀取或查詢系統 |

360| [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) | 您從 claude.ai 或 Claude 行動應用程式驅動您的本地工作階段 | 在遠離您的桌子時引導進行中的工作階段 |360| [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) | 您從 claude.ai 或 Claude 行動應用程式驅動您的本地工作階段 | 在遠離您的桌子時引導進行中的工作階段 |

361 361 

Details

17Claude Code 會追蹤其檔案編輯工具所做的所有變更:17Claude Code 會追蹤其檔案編輯工具所做的所有變更:

18 18 

19* 您送出的每個開啟新回合的提示詞都會建立一個新的檢查點19* 您送出的每個開啟新回合的提示詞都會建立一個新的檢查點

20* Claude Code 會在一個工作階段中保留最近 100 個檢查點的檔案快照。捨棄較舊的檢查點時,會刪除任何剩餘檢查點都不再參照的快照檔案,但每個檔案的第一個快照除外,因為 VS Code 擴充功能會將其作為工作階段差異的基準。20* Claude Code 會在一個工作階段中保留最近 100 個檢查點的檔案快照。捨棄較舊的檢查點時,會刪除任何剩餘檢查點都不再參照的快照檔案,但每個檔案的第一個快照除外。

21* Claude Code 會將檢查點與對話一起儲存,因此在您恢復工作階段後,仍然可以執行 `/rewind`21* Claude Code 會將檢查點與對話一起儲存,因此在您恢復工作階段後,仍然可以執行 `/rewind`

22* Claude Code 會在[保留期清理](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically)中刪除工作階段的檔案快照,預設大約在該工作階段最後一次儲存快照的 30 天後進行。倒轉至快照已被刪除的檢查點時,可能會失敗並顯示 [`No files were restored`](https://code.claude.com/docs/zh-TW/errors#no-files-were-restored)。若要將快照保留更久,請設定 [`cleanupPeriodDays`](https://code.claude.com/docs/zh-TW/settings-reference#cleanupperioddays)。22* Claude Code 會在[保留期清理](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically)中刪除工作階段的檔案快照,預設大約在該工作階段最後一次儲存快照的 30 天後進行。倒轉至快照已被刪除的檢查點時,可能會失敗並顯示 [`No files were restored`](https://code.claude.com/docs/zh-TW/errors#no-files-were-restored)。若要將快照保留更久,請設定 [`cleanupPeriodDays`](https://code.claude.com/docs/zh-TW/settings-reference#cleanupperioddays)。

23 23 

Details

236 236 

237* **您使用 API 金鑰或 Console 帳戶登入**:在您的 shell 中執行 `claude auth login`,然後使用 claude.ai 登入237* **您使用 API 金鑰或 Console 帳戶登入**:在您的 shell 中執行 `claude auth login`,然後使用 claude.ai 登入

238* **錯誤命名了您的提供者**:雲端工作階段無法透過第三方提供者取得。請參閱 [錯誤表](#errors-when-sending-to-a-cloud-session)238* **錯誤命名了您的提供者**:雲端工作階段無法透過第三方提供者取得。請參閱 [錯誤表](#errors-when-sending-to-a-cloud-session)

239* **您已透過 claude.ai 登入**:您的組織可能已停用雲端工作階段239* **您透過組織登入 claude.ai**:請詢問[擁有者](https://code.claude.com/docs/zh-TW/server-managed-settings.md#access-control)是否已[開啟雲端工作階段](https://code.claude.com/docs/zh-TW/errors.md#cloud-sessions-are-disabled-by-your-organizations-policy)

240 240 

241## 使用工作階段241## 使用工作階段

242 242 

Details

6 6 

7> Claude Code 讀取 CLAUDE.md、settings.json、hooks、skills、commands、subagents、workflows、rules 和自動記憶的位置。探索您專案中的 .claude 目錄和主目錄中的 ~/.claude。7> Claude Code 讀取 CLAUDE.md、settings.json、hooks、skills、commands、subagents、workflows、rules 和自動記憶的位置。探索您專案中的 .claude 目錄和主目錄中的 ~/.claude。

8 8 

9Claude Code 從您的專案目錄和主目錄中的 `~/.claude` 讀取指令、設定、skills、subagents 和記憶。將專案檔案提交到 git 以與您的團隊共享;`~/.claude` 中的檔案是個人設定,適用於您的所有專案。9Claude Code 從您的專案目錄和家目錄中的 `~/.claude` 讀取指令、設定、skills、subagents 和記憶。將專案檔案提交到 git 即可共享;`~/.claude` 中的檔案是個人設定,適用於您的所有專案。

10 10 

11在 Windows 上,`~/.claude` 解析為 `%USERPROFILE%\.claude`。如果您設定了 [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/zh-TW/env-vars),此頁面上的每個 `~/.claude` 路徑都會改為位於該目錄下。`.claude.json` 也是如此,若未設定,它位於 `~/.claude.json`。11在 Windows 上,`~/.claude` 解析為 `%USERPROFILE%\.claude`。如果您設定了 [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/zh-TW/env-vars),此頁面上的每個 `~/.claude` 路徑都會改為位於該目錄下。`.claude.json` 也是如此,若未設定,它位於 `~/.claude.json`。

12 12 


38 38 

39**`.claude/`**39**`.claude/`**

40 40 

41專案設定、規則、skill、subagent 及其他設定。如果您使用 git,請提交其中大部分檔案以便團隊共用,並將 `settings.local.json` 等個人檔案排除在提交之外。41專案設定、規則、skills、subagents 及其他設定。如果您使用 git,請提交其中大部分檔案以便共用,並將個人檔案(例如 `settings.local.json`)排除在提交之外。

42 42 

43**`.claude/settings.json`**43**`.claude/settings.json`**

44 44 


78 78 

79**When it loads**: 在終端機中於啟動時讀取,因此新增或編輯風格後請重新啟動 Claude Code79**When it loads**: 在終端機中於啟動時讀取,因此新增或編輯風格後請重新啟動 Claude Code

80 80 

81每個 Markdown 檔案定義一個[輸出風格](https://code.claude.com/docs/zh-TW/output-styles.md#how-output-styles-work),也就是一組調整 Claude 工作方式的指令。如果您的團隊共用某個風格(例如每個人都使用的審查模式),請將它放在這裡。關於如何選擇風格,請參閱 [`~/.claude/output-styles/`](#ce-global-output-styles)。81每個 Markdown 檔案定義一個[輸出風格](https://code.claude.com/docs/zh-TW/output-styles.md#how-output-styles-work),也就是一組調整 Claude 工作方式的指令。若要與專案中的每個人共用某個風格(例如審查模式),請將它提交到這裡。關於如何選擇風格,請參閱 [`~/.claude/output-styles/`](#ce-global-output-styles)。

82 82 

83**`.claude/agents/`**83**`.claude/agents/`**

84 84 

Details

84 84 

85### 從頭開始建立新專案85### 從頭開始建立新專案

86 86 

87從頭開始建立專案,是指開啟 **New project** 對話方塊、為工作流程命名,並可選擇為其設定目標以及其處理的儲存庫和檔案。只有名稱是必填的,因此您可以先建立專案,再隨著工作成形逐步補齊其餘內容。87從頭開始建立專案,是指開啟 **New project** 對話方塊、為工作流程命名,並可選擇為其設定目標以及其處理的儲存庫和檔案。

88 88 

89**1. 開啟 Projects**89**1. 開啟 Projects**

90 90 


270 270 

271執行緒在 [auto mode](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) 中執行,因此 Claude 在該資料夾中執行命令和編輯檔案而不每次都詢問您。如果 auto mode 在該電腦的 Claude Code 中不可用或關閉,執行緒執行而不使用它,並且它引發的任何權限提示等待您在執行緒中的回答,如 [解除等待批准的執行緒](#unblock-a-thread-waiting-on-approval) 所述。271執行緒在 [auto mode](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) 中執行,因此 Claude 在該資料夾中執行命令和編輯檔案而不每次都詢問您。如果 auto mode 在該電腦的 Claude Code 中不可用或關閉,執行緒執行而不使用它,並且它引發的任何權限提示等待您在執行緒中的回答,如 [解除等待批准的執行緒](#unblock-a-thread-waiting-on-approval) 所述。

272 272 

273若要以其他模式執行執行緒,請使用 [`--settings`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) 啟動 `claude remote-control`。然後,該檔案中或該電腦設定中的 [`permissions.defaultMode`](https://code.claude.com/docs/zh-TW/permission-modes#start-in-a-different-mode) 可以選擇其他模式。273若要以其他模式執行執行緒,請使用 [`--settings`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) 搭配一個將 [`disableAutoMode`](https://code.claude.com/docs/zh-TW/settings-reference#disableautomode) 設為 `"disable"` 的檔案來啟動 `claude remote-control`。然後,該檔案中或該電腦設定中的 [`permissions.defaultMode`](https://code.claude.com/docs/zh-TW/permission-modes#start-in-a-different-mode) 可以選擇其他模式,例如 `default`、`plan` 或 `dontAsk`。

274 274 

275當執行緒執行時,其標題中的筆記型電腦圖示顯示您的電腦是否已連接。點擊它以查看執行緒使用的資料夾或關閉連接。當該電腦睡眠時執行緒暫停,如果桌面應用程式或 `claude remote-control` 退出則停止。275當執行緒執行時,其標題中的筆記型電腦圖示顯示您的電腦是否已連接。點擊它以查看執行緒使用的資料夾或關閉連接。當該電腦睡眠時執行緒暫停,如果桌面應用程式或 `claude remote-control` 退出則停止。

276 276 

Details

81 81 

82**1. 從乾淨的工作樹開始**82**1. 從乾淨的工作樹開始**

83 83 

84如果您之後想要取得修補程式,請提交所有變更與未追蹤的檔案,或在掃描結束前,從 shell 使用 `git stash -u` 將它們暫存起來。84如果您之後想要取得修補程式,請提交所有變更與未追蹤的檔案,或從 shell 使用 `git stash -u` 將它們暫存起來,直到掃描結束為止。

85 85 

86**2. 開啟 Claude Security 選單**86**2. 開啟 Claude Security 選單**

87 87 


89 89 

90**3. 選擇要掃描的內容**90**3. 選擇要掃描的內容**

91 91 

92外掛會先讀取您的儲存庫,然後提供整個儲存庫或某個特定區域供您選擇。選擇整個儲存庫,或回答「我不知道」,外掛便會依據儲存庫的大小選擇合理的預設值。92外掛會先讀取您的儲存庫,然後提供整個儲存庫或某個特定區域供您選擇。選擇整個儲存庫,或回答「I don't know」,外掛便會依據儲存庫的大小選擇合理的預設值。

93 93 

94**4. 確認執行**94**4. 確認執行**

95 95 

Details

172 * **已儲存的 CLI 預設**:如果環境是您儲存的 [CLI 預設](#select-an-environment-from-the-cli),當您的清單有 Anthropic 託管環境時,Claude Code 會在其中啟動 CLI 雲端工作階段。否則,會在清單中第一個不是 [Remote Control 橋接環境](#the-default-environment)的環境中啟動。172 * **已儲存的 CLI 預設**:如果環境是您儲存的 [CLI 預設](#select-an-environment-from-the-cli),當您的清單有 Anthropic 託管環境時,Claude Code 會在其中啟動 CLI 雲端工作階段。否則,會在清單中第一個不是 [Remote Control 橋接環境](#the-default-environment)的環境中啟動。

173 * **明確設定**:任何明確設定使用該環境的項目,例如[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md#environments-and-network-access),無法在其中啟動新工作階段。請將其指向另一個環境。173 * **明確設定**:任何明確設定使用該環境的項目,例如[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md#environments-and-network-access),無法在其中啟動新工作階段。請將其指向另一個環境。

174 174 

175當您不再需要某個 Anthropic 託管環境時,請將其封存。環境對話框和**雲端環境**管理頁面都沒有刪除 Anthropic 託管環境的選項。如果該環境是[自託管](https://code.claude.com/docs/zh-TW/self-hosted-environments)的,擁有者可以從管理設定中的**雲端環境**頁面將其刪除。如果您不是擁有者,請請擁有者將其刪除。175當您不再需要某個 Anthropic 託管環境時,請將其封存。環境對話框和**雲端環境**管理頁面都沒有刪除 Anthropic 託管環境的選項。如果該環境是[自託管](https://code.claude.com/docs/zh-TW/self-hosted-environments)的,擁有者可以從管理設定中的**雲端環境**頁面將其刪除。

176 176 

177### 組織共用環境177### 組織共用環境

178 178 

code-mode.md +8 −0

Details

126>126>

127> 若要在之後繼續 Code Mode 工作階段,請在執行 `claude --continue` 或 `claude --resume` 時,讓 `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` 維持設為 `1`。在 Code Mode 關閉的情況下,Claude Code 會拒絕繼續該工作階段。您在未啟用 Code Mode 時啟動的工作階段,即使設定了該變數,也會在未啟用 Code Mode 的情況下繼續。127> 若要在之後繼續 Code Mode 工作階段,請在執行 `claude --continue` 或 `claude --resume` 時,讓 `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE` 維持設為 `1`。在 Code Mode 關閉的情況下,Claude Code 會拒絕繼續該工作階段。您在未啟用 Code Mode 時啟動的工作階段,即使設定了該變數,也會在未啟用 Code Mode 的情況下繼續。

128 128 

129### 在 subagent 中使用 Code Mode

130 

131如果您的 [subagent](https://code.claude.com/docs/zh-TW/sub-agents.md) 具有 `tools` 清單,請將 [`REPL`](https://code.claude.com/docs/zh-TW/tools-reference) 加入該清單,讓該 subagent 使用 Code Mode:

132 

133```yaml theme={null}

134tools: Read, Bash, REPL

135```

136 

129### 關閉 Code Mode137### 關閉 Code Mode

130 138 

131從您的 shell、`~/.claude/settings.json` 以及任何 `--settings` 檔案中移除 `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE`,然後啟動新的工作階段。您也可以保留該變數,並在任一處將其值改為 `0`。只要其中一處為 `0`,即使您在另一處設定了 `1`,Code Mode 仍會保持關閉。139從您的 shell、`~/.claude/settings.json` 以及任何 `--settings` 檔案中移除 `CLAUDE_CODE_EXPERIMENTAL_CODE_MODE`,然後啟動新的工作階段。您也可以保留該變數,並在任一處將其值改為 `0`。只要其中一處為 `0`,即使您在另一處設定了 `1`,Code Mode 仍會保持關閉。

code-review.md +1 −1

Details

20 20 

21## 可用性21## 可用性

22 22 

23在設定 Code Review 之前,請確認您的組織符合資格:23在設定 Code Review 之前,請先確認以下需求:

24 24 

25* **方案**:[Team 和 Enterprise](https://code.claude.com/docs/zh-TW/feature-availability.md)25* **方案**:[Team 和 Enterprise](https://code.claude.com/docs/zh-TW/feature-availability.md)

26* **程式碼託管**:託管於 GitHub 的儲存庫,包括 [GitHub Enterprise Server](https://code.claude.com/docs/zh-TW/github-enterprise-server.md) 以及具備資料落地功能的 GitHub Enterprise Cloud。若要使用資料落地,請由擁有者依照 [GitHub Enterprise Server 管理員設定](https://code.claude.com/docs/zh-TW/github-enterprise-server.md#admin-setup)操作,並輸入您企業的 `ghe.com` 主機名稱。26* **程式碼託管**:託管於 GitHub 的儲存庫,包括 [GitHub Enterprise Server](https://code.claude.com/docs/zh-TW/github-enterprise-server.md) 以及具備資料落地功能的 GitHub Enterprise Cloud。若要使用資料落地,請由擁有者依照 [GitHub Enterprise Server 管理員設定](https://code.claude.com/docs/zh-TW/github-enterprise-server.md#admin-setup)操作,並輸入您企業的 `ghe.com` 主機名稱。

Details

12 12 

13> [!NOTE]13> [!NOTE]

14>14>

15> 若要在 GitHub 上自動審查儲存庫中的每個 pull request,請參閱 [Code Review](https://code.claude.com/docs/zh-TW/code-review.md),這是由 Owner 為您的組織啟用的託管服務。15> 若要在 GitHub 上自動審查儲存庫中的每個 pull request,請參閱 [Code Review](https://code.claude.com/docs/zh-TW/code-review.md),這是由 Claude 組織的 Owner 啟用的託管服務。

16 16 

17`/review` 是 `/code-review` 的別名。17`/review` 是 `/code-review` 的別名。

18 18 

Details

117 117 

118### 開發人員可以變更的項目118### 開發人員可以變更的項目

119 119 

120開發人員若要變更審查等級、**Review runs** 設定,或哪些儲存庫接受審查,需要向您提出。在沒有 Owner 角色的情況下,他們可以在 GitHub 上執行以下操作:120開發人員若要變更審查等級、**Review runs** 設定,或哪些儲存庫接受審查,需向 Owner 提出。在沒有 Owner 角色的情況下,他們可以在 GitHub 上執行以下操作:

121 121 

122* **請求審查**:在 pull request 上留言 [`@claude review`](https://code.claude.com/docs/zh-TW/code-review-pull-requests#comment-commands)。這需要對該儲存庫具有寫入存取權,且適用於自動審查會略過的[草稿及來自 fork 的 pull request](https://code.claude.com/docs/zh-TW/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks)。122* **請求審查**:在 pull request 上留言 [`@claude review`](https://code.claude.com/docs/zh-TW/code-review-pull-requests#comment-commands)。這需要對該儲存庫具有寫入存取權,且適用於自動審查會略過的[草稿及來自 fork 的 pull request](https://code.claude.com/docs/zh-TW/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks)。

123* **讓單一 pull request 在每次推送時接受審查**:在[既非草稿也非來自 fork](https://code.claude.com/docs/zh-TW/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks) 的 pull request 上留言 `@claude review always`,例如在設定為 Manual 的儲存庫中123* **讓單一 pull request 在每次推送時接受審查**:在[既非草稿也非來自 fork](https://code.claude.com/docs/zh-TW/code-review-pull-requests.md#review-drafts-and-pull-requests-from-forks) 的 pull request 上留言 `@claude review always`,例如在設定為 Manual 的儲存庫中

commands.md +2 −2

Details

50| `/add-dir <path>` | 添加工作目錄以進行檔案存取。輸入部分路徑以查看匹配的目錄建議;按 `Tab` 接受一個。大多數 `.claude/` 設定[不會從添加的目錄中發現](https://code.claude.com/docs/zh-TW/permissions.md#additional-directories-grant-file-access-not-configuration)。您無法添加大多數[網路路徑](https://code.claude.com/docs/zh-TW/errors.md#working-directory-is-a-network-path),例如 `\\server\share`。成功添加後,您的 [`DirectoryAdded` hook](https://code.claude.com/docs/zh-TW/hooks#directoryadded) 會運行。如果您在 Claude 回應時運行 `/add-dir`,一旦您確認添加,Claude 的下一個工具呼叫就可以存取該目錄 |50| `/add-dir <path>` | 添加工作目錄以進行檔案存取。輸入部分路徑以查看匹配的目錄建議;按 `Tab` 接受一個。大多數 `.claude/` 設定[不會從添加的目錄中發現](https://code.claude.com/docs/zh-TW/permissions.md#additional-directories-grant-file-access-not-configuration)。您無法添加大多數[網路路徑](https://code.claude.com/docs/zh-TW/errors.md#working-directory-is-a-network-path),例如 `\\server\share`。成功添加後,您的 [`DirectoryAdded` hook](https://code.claude.com/docs/zh-TW/hooks#directoryadded) 會運行。如果您在 Claude 回應時運行 `/add-dir`,一旦您確認添加,Claude 的下一個工具呼叫就可以存取該目錄 |

51| `/advisor [model\|off]` | 啟用或停用[顧問工具](https://code.claude.com/docs/zh-TW/advisor.md),它在任務期間的關鍵時刻諮詢第二個模型以獲得指導。接受 `fable`、`opus`、`sonnet` 或完整的模型 ID。`fable` 需要 [Fable 存取](https://code.claude.com/docs/zh-TW/advisor.md#choose-an-advisor-model)。沒有引數時,打開選擇器。在沒有互動式終端機的工作階段中,或通過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#limitations),將模型或 `off` 作為引數傳遞;在那裡沒有引數時,命令會將目前顧問列印為文字。這些形式需要 Claude Code v2.1.260 或更新版本 |51| `/advisor [model\|off]` | 啟用或停用[顧問工具](https://code.claude.com/docs/zh-TW/advisor.md),它在任務期間的關鍵時刻諮詢第二個模型以獲得指導。接受 `fable`、`opus`、`sonnet` 或完整的模型 ID。`fable` 需要 [Fable 存取](https://code.claude.com/docs/zh-TW/advisor.md#choose-an-advisor-model)。沒有引數時,打開選擇器。在沒有互動式終端機的工作階段中,或通過 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#limitations),將模型或 `off` 作為引數傳遞;在那裡沒有引數時,命令會將目前顧問列印為文字。這些形式需要 Claude Code v2.1.260 或更新版本 |

52| `/agents` | 列印提醒以要求 Claude 建立或管理 [subagent](https://code.claude.com/docs/zh-TW/sub-agents.md),或直接編輯 `.claude/agents/` 或 `~/.claude/agents/`。在 v2.1.197 及更早版本上,打開用於建立和管理 subagent 設定的互動式介面 |52| `/agents` | 列印提醒以要求 Claude 建立或管理 [subagent](https://code.claude.com/docs/zh-TW/sub-agents.md),或直接編輯 `.claude/agents/` 或 `~/.claude/agents/`。在 v2.1.197 及更早版本上,打開用於建立和管理 subagent 設定的互動式介面 |

53| `/artifact-capabilities` | **[Skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills)。** 載入已發佈 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md) 可以使用的執行時功能的參考,例如[呼叫您的連接器](https://code.claude.com/docs/zh-TW/artifacts.md#pull-live-data-with-mcp-connectors)或[提供檔案下載](https://code.claude.com/docs/zh-TW/artifacts.md#offer-a-file-download),包括您的帳戶擁有的功能。Claude 通常在建立使用其中一個的頁面前自行載入它。在 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#availability) 可用的地方可用 |53| `/artifact-capabilities` | **[Skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills)。** 載入已發佈 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md) 可以使用的執行時功能的參考,例如[呼叫您的連接器](https://code.claude.com/docs/zh-TW/artifacts.md#pull-live-data-with-mcp-connectors)或[提供檔案下載](https://code.claude.com/docs/zh-TW/artifacts.md#offer-a-file-download),包括您的帳戶擁有的功能。需要 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#availability) |

54| `/artifact-diagramming` | **[Skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills)。** 為 Claude 在 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md) 中遵循的圖表載入指導:何時圖表有幫助、要繪製什麼以及如何編寫在淺色和深色主題中保持清晰的內聯 SVG。需要 Claude Code v2.1.221 或更新版本 |54| `/artifact-diagramming` | **[Skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills)。** 為 Claude 在 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md) 中遵循的圖表載入指導:何時圖表有幫助、要繪製什麼以及如何編寫在淺色和深色主題中保持清晰的內聯 SVG。需要 Claude Code v2.1.221 或更新版本 |

55| `/artifacts` | 列出您擁有或與您共享的 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#find-an-artifact-again),然後將其附加到工作階段、在瀏覽器中打開它或複製其連結。在 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#availability) 可用的地方可用 |55| `/artifacts` | 列出您擁有或與您共享的 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#find-an-artifact-again),然後將其附加到工作階段、在瀏覽器中打開它或複製其連結。在 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#availability) 可用的地方可用 |

56| `/auto-mode-setup` | [從您的專案和最近的工作階段草擬 `autoMode.environment` 項目](https://code.claude.com/docs/zh-TW/auto-mode-config#generate-environment-entries),然後檢查草稿並將其保存到您的使用者設定。在 Pro、Max、Ultra 或 Team 方案上,需要 Claude Code v2.1.228 或更新版本,在原生 Windows 上則需要 v2.1.233 或更新版本。在 Enterprise 方案上或使用 Claude Console API 金鑰時,需要 v2.1.283 或更新版本。如果此命令不存在,請參閱[`/auto-mode-setup` 傳回 "Unknown command"](https://code.claude.com/docs/zh-TW/auto-mode-config#auto-mode-setup-returns-unknown-command) |56| `/auto-mode-setup` | [從您的專案和最近的工作階段草擬 `autoMode.environment` 項目](https://code.claude.com/docs/zh-TW/auto-mode-config#generate-environment-entries),然後檢查草稿並將其保存到您的使用者設定。在 Pro、Max、Ultra 或 Team 方案上,需要 Claude Code v2.1.228 或更新版本,在原生 Windows 上則需要 v2.1.233 或更新版本。在 Enterprise 方案上或使用 Claude Console API 金鑰時,需要 v2.1.283 或更新版本。如果此命令不存在,請參閱[`/auto-mode-setup` 傳回 "Unknown command"](https://code.claude.com/docs/zh-TW/auto-mode-config#auto-mode-setup-returns-unknown-command) |


120| `/plugin-authoring` | 載入 Claude 用來[編寫 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#ask-claude-for-a-mod) 的參考資料。當您要求 mod 時,Claude 可以自行載入它。這是來自[內建外掛](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#mods-built-into-claude-code)的 skill,您可以在 `/plugin` 中關閉它。需要 Claude Code v2.1.287 或更新版本 |120| `/plugin-authoring` | 載入 Claude 用來[編寫 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#ask-claude-for-a-mod) 的參考資料。當您要求 mod 時,Claude 可以自行載入它。這是來自[內建外掛](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#mods-built-into-claude-code)的 skill,您可以在 `/plugin` 中關閉它。需要 Claude Code v2.1.287 或更新版本 |

121| `/powerup` | 通過帶有動畫演示的快速互動式課程發現 Claude Code 功能 |121| `/powerup` | 通過帶有動畫演示的快速互動式課程發現 Claude Code 功能 |

122| `/pr-comments [PR]` | 在 v2.1.91 中移除。改為直接要求 Claude 檢視 pull request 評論。在較早版本上,擷取並顯示來自 GitHub pull request 的評論;自動檢測目前分支的 PR,或傳遞 PR URL 或編號。需要 `gh` CLI |122| `/pr-comments [PR]` | 在 v2.1.91 中移除。改為直接要求 Claude 檢視 pull request 評論。在較早版本上,擷取並顯示來自 GitHub pull request 的評論;自動檢測目前分支的 PR,或傳遞 PR URL 或編號。需要 `gh` CLI |

123| `/privacy-settings` | 檢視和更新您的隱私設定。僅適用於 Pro、Max 和 Ultra 方案訂閱者 |123| `/privacy-settings` | 檢視和更新您的隱私設定,或取得其在 claude.ai 上的連結。僅適用於 Pro、Max 和 Ultra 方案訂閱者 |

124| `/radio` | 在瀏覽器中打開 Claude FM lo-fi 廣播。當沒有瀏覽器可用時列印串流 URL |124| `/radio` | 在瀏覽器中打開 Claude FM lo-fi 廣播。當沒有瀏覽器可用時列印串流 URL |

125| `/rate-limit-options` | 顯示在 claude.ai 用量上限阻止請求時保持工作的方式:等待並[在限制重置時自動繼續](https://code.claude.com/docs/zh-TW/interactive-mode.md#wait-for-a-usage-limit-to-reset)、添加[用量點數](https://code.claude.com/docs/zh-TW/costs.md#add-usage-credits-to-your-subscription)或升級您的方案。Claude Code 也可以在您在自己的終端機達到限制時自行打開此選單。請參閱[關閉自動繼續](https://code.claude.com/docs/zh-TW/interactive-mode.md#turn-automatic-continue-off)。需要 claude.ai 訂閱。等待和繼續行需要 Claude Code v2.1.234 或更新版本 |125| `/rate-limit-options` | 顯示在 claude.ai 用量上限阻止請求時保持工作的方式:等待並[在限制重置時自動繼續](https://code.claude.com/docs/zh-TW/interactive-mode.md#wait-for-a-usage-limit-to-reset)、添加[用量點數](https://code.claude.com/docs/zh-TW/costs.md#add-usage-credits-to-your-subscription)或升級您的方案。Claude Code 也可以在您在自己的終端機達到限制時自行打開此選單。請參閱[關閉自動繼續](https://code.claude.com/docs/zh-TW/interactive-mode.md#turn-automatic-continue-off)。需要 claude.ai 訂閱。等待和繼續行需要 Claude Code v2.1.234 或更新版本 |

126| `/recap` | 按需生成目前工作階段的單行摘要。請參閱[工作階段摘要](https://code.claude.com/docs/zh-TW/interactive-mode.md#session-recap)以了解您離開後出現的自動摘要 |126| `/recap` | 按需生成目前工作階段的單行摘要。請參閱[工作階段摘要](https://code.claude.com/docs/zh-TW/interactive-mode.md#session-recap)以了解您離開後出現的自動摘要 |

costs.md +1 −1

Details

296 296 

297> [tab] settings.json297> [tab] settings.json

298>298>

299> 將此新增到您的 [settings.json](https://code.claude.com/docs/zh-TW/settings.md#where-settings-live) 以在每個 Bash 命令之前執行 hook:299> 將此新增到您的 [settings.json](https://code.claude.com/docs/zh-TW/settings.md#where-settings-live) 以在每次 Bash 工具呼叫之前執行 hook:

300>300>

301> ```json theme={null}301> ```json theme={null}

302> {302> {

Details

62執行 `/hooks` 以列出為目前工作階段註冊的每個 hook,按事件分組。如果您定義的 hook 沒有出現,表示 Claude Code 未載入它。請檢查以下原因:62執行 `/hooks` 以列出為目前工作階段註冊的每個 hook,按事件分組。如果您定義的 hook 沒有出現,表示 Claude Code 未載入它。請檢查以下原因:

63 63 

64* hook 定義在獨立檔案中。hook 應位於[設定檔](https://code.claude.com/docs/zh-TW/settings.md#settings-files)中的 `"hooks"` 鍵下。64* hook 定義在獨立檔案中。hook 應位於[設定檔](https://code.claude.com/docs/zh-TW/settings.md#settings-files)中的 `"hooks"` 鍵下。

65* `matcher` 值是陣列而不是單一字串。當您啟動互動式工作階段時以及在 `claude doctor` 中,Claude Code 會將該項目列為無效設定。如果該陣列位於 `PreToolUse` 或 `PermissionRequest` 下,該檔案的其他 hook 也都不會載入。65* `matcher` 值是陣列而不是單一字串。當您啟動互動式工作階段時以及在 `claude doctor` 中,Claude Code 會將該項目列為無效設定。如果該陣列位於 `PreToolUse`、`PermissionRequest` 或 `PreSkillShellCommand` 下,該檔案的其他 hook 也都不會載入。

66* hook 位於 skill 的 frontmatter 中,而您和 Claude 在此工作階段中都尚未叫用該 skill。請叫用它或要求 Claude 叫用,然後再次執行 `/hooks`。如果 hook 仍未出現,請檢查其他原因,例如[未能解析的 frontmatter](https://code.claude.com/docs/zh-TW/skills.md#skill-not-triggering)或其中一項 [skill hook 的限制](https://code.claude.com/docs/zh-TW/hooks.md#limits-on-skill-hooks)。66* hook 位於 skill 的 frontmatter 中,而您和 Claude 在此工作階段中都尚未叫用該 skill。請叫用它或要求 Claude 叫用,然後再次執行 `/hooks`。如果 hook 仍未出現,請檢查其他原因,例如[未能解析的 frontmatter](https://code.claude.com/docs/zh-TW/skills.md#skill-not-triggering)或其中一項 [skill hook 的限制](https://code.claude.com/docs/zh-TW/hooks.md#limits-on-skill-hooks)。

67 67 

68如果 hook 出現但不觸發,通常是 matcher 的問題。檢查它是否有這些錯誤:68如果 hook 出現但不觸發,通常是 matcher 的問題。檢查它是否有這些錯誤:

desktop.md +21 −1

Details

1901* **設定檔損壞**:當您自己的設定檔損壞時,您管理員的項目可能會呈灰色,並顯示指出該檔案的訊息。[修正檔案](https://code.claude.com/docs/zh-TW/settings.md#fix-a-broken-settings-file)。1901* **設定檔損壞**:當您自己的設定檔損壞時,您管理員的項目可能會呈灰色,並顯示指出該檔案的訊息。[修正檔案](https://code.claude.com/docs/zh-TW/settings.md#fix-a-broken-settings-file)。

1902* **新主機**:在 Desktop 儲存主機後的一分鐘內,[**Create another**](#create-another-machine) 會呈灰色。請在這一分鐘過後再選取它。在 Claude Desktop v4.4212.0 之前,**Replace Dev box's host** 會呈灰色 10 分鐘。1902* **新主機**:在 Desktop 儲存主機後的一分鐘內,[**Create another**](#create-another-machine) 會呈灰色。請在這一分鐘過後再選取它。在 Claude Desktop v4.4212.0 之前,**Replace Dev box's host** 會呈灰色 10 分鐘。

1903* **hook 已關閉或受限**:您自己的項目只在您自己的 hook 可以執行的地方有效。請從您的設定中移除 `disableAllHooks`,或詢問您的管理員。1903* **hook 已關閉或受限**:您自己的項目只在您自己的 hook 可以執行的地方有效。請從您的設定中移除 `disableAllHooks`,或詢問您的管理員。

1904* **設定仍在載入**:在 Desktop 載入您組織的[伺服器受管設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)之前,所有項目都會呈灰色,通常是在啟動後幾秒鐘內。若項目持續呈灰色,請檢查您與 claude.ai 的連線。1904* **設定仍在載入中**:在 Desktop 載入任何[伺服器管理的設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)之前,每個項目都會呈灰色,通常是在啟動後幾秒內。若項目持續呈灰色,請檢查您與 claude.ai 的連線。

1905 1905 

1906#### 為您的團隊預先設定 SSH 連線1906#### 為您的團隊預先設定 SSH 連線

1907 1907 


2099 2099 

2100有關只有受管來源可以設定的權限、外掛和傳遞鍵,請參閱[只有受管設定可以設定的鍵](https://code.claude.com/docs/zh-TW/managed-settings.md#managed-only-settings)。2100有關只有受管來源可以設定的權限、外掛和傳遞鍵,請參閱[只有受管設定可以設定的鍵](https://code.claude.com/docs/zh-TW/managed-settings.md#managed-only-settings)。

2101 2101 

2102#### 為所有使用者部署 skill

2103 

2104若要在本機和 SSH 工作階段中為每位使用者提供相同的 skill,請將它們部署為[企業 skill](https://code.claude.com/docs/zh-TW/skills.md#where-skills-live),您只需在機器上安裝一次,即可供該機器的所有使用者使用。請將它們安裝在工作階段執行所在的機器上:

2105 

2106* **本機工作階段**:每位使用者的電腦

2107* **SSH 工作階段**:每台遠端主機

2108 

2109請將每個 skill 安裝在該機器平台對應的路徑:

2110 

2111| 平台 | 路徑 |

2112| :- | :- |

2113| macOS | `/Library/Application Support/ClaudeCode/.claude/skills/<skill-name>/SKILL.md` |

2114| Linux | `/etc/claude-code/.claude/skills/<skill-name>/SKILL.md` |

2115| Windows | `C:\Program Files\ClaudeCode\.claude\skills\<skill-name>\SKILL.md` |

2116 

2117若要確認您的 skill 已載入,請使用 [frontmatter](https://code.claude.com/docs/zh-TW/skills.md#frontmatter-reference) 僅設定 `name` 和 `description` 的 skill 進行測試。啟動新的工作階段並傳送一則訊息,然後在提示詞輸入方塊中輸入 `/` 和該 skill 名稱的前幾個字母。該 skill 會出現在清單中。

2118 

2102#### 在 Code 分頁中行為不同的 Claude Code 設定2119#### 在 Code 分頁中行為不同的 Claude Code 設定

2103 2120 

2104在本機工作階段中,下列鍵(以及其他鍵)會產生不同的效果或沒有可見的效果,因為 Code 分頁取代了終端機介面。它們在終端機中仍然適用,因此您可以保留這些設定。2121在本機工作階段中,下列鍵(以及其他鍵)會產生不同的效果或沒有可見的效果,因為 Code 分頁取代了終端機介面。它們在終端機中仍然適用,因此您可以保留這些設定。


2320* **Linux (beta)**:Linux 桌面應用程式中尚未提供電腦使用。請參閱 [Claude Desktop on Linux](https://code.claude.com/docs/zh-TW/desktop-linux.md)。2337* **Linux (beta)**:Linux 桌面應用程式中尚未提供電腦使用。請參閱 [Claude Desktop on Linux](https://code.claude.com/docs/zh-TW/desktop-linux.md)。

2321* **內嵌程式碼建議**:Desktop 不提供自動完成樣式的程式碼補全。它透過對話式提示詞和明確的程式碼變更進行工作,並可在 Claude 回覆後[建議您的下一個提示詞](#accept-a-suggested-prompt)。2338* **內嵌程式碼建議**:Desktop 不提供自動完成樣式的程式碼補全。它透過對話式提示詞和明確的程式碼變更進行工作,並可在 Claude 回覆後[建議您的下一個提示詞](#accept-a-suggested-prompt)。

2322* **Agent teams**:協調的團隊,其中 Claude 作為團隊組長從共用任務清單中指派任務給隊員,在 [CLI](https://code.claude.com/docs/zh-TW/agent-teams.md) 中可用,不在 Desktop 中。若要在一個工作階段內進行多 agent 工作,請使用 [dynamic workflows](https://code.claude.com/docs/zh-TW/workflows.md),它們在 Desktop 中執行;Claude 也可以[直接傳遞訊息和管理您的其他工作階段](#work-across-sessions)。2339* **Agent teams**:協調的團隊,其中 Claude 作為團隊組長從共用任務清單中指派任務給隊員,在 [CLI](https://code.claude.com/docs/zh-TW/agent-teams.md) 中可用,不在 Desktop 中。若要在一個工作階段內進行多 agent 工作,請使用 [dynamic workflows](https://code.claude.com/docs/zh-TW/workflows.md),它們在 Desktop 中執行;Claude 也可以[直接傳遞訊息和管理您的其他工作階段](#work-across-sessions)。

2340* **Code Mode**:即使您在設定中開啟實驗性的 [Code Mode](https://code.claude.com/docs/zh-TW/code-mode.md),Desktop 工作階段啟動時也不會啟用它。若要使用它,請在終端機中執行 CLI。

2323* **Terminal-dialog 命令**:在終端機中開啟互動式面板的內建命令,在 Code 標籤中的行為不同。直接編輯[設定檔](https://code.claude.com/docs/zh-TW/settings.md)以管理權限規則和設定,或從獨立 CLI 執行命令。2341* **Terminal-dialog 命令**:在終端機中開啟互動式面板的內建命令,在 Code 標籤中的行為不同。直接編輯[設定檔](https://code.claude.com/docs/zh-TW/settings.md)以管理權限規則和設定,或從獨立 CLI 執行命令。

2324 * 沒有引數形式的命令,例如 `/permissions`,回覆 `isn't available in this environment`。2342 * 沒有引數形式的命令,例如 `/permissions`,回覆 `isn't available in this environment`。

2325 * `/config` 開啟 **設定 > Code** 或 **設定 > Claude Code**。2343 * `/config` 開啟 **設定 > Code** 或 **設定 > Claude Code**。


2359 2377 

2360### Code 標籤中的 403 或驗證錯誤2378### Code 標籤中的 403 或驗證錯誤

2361 2379 

2380對於顯示 `For security, Claude Code needs a recent sign-in.` 的卡片,請參閱 [Claude Code needs a recent sign-in](https://code.claude.com/docs/zh-TW/errors.md#claude-code-needs-a-recent-sign-in)。

2381 

2362如果在使用 Code 標籤時看到 `Error 403: Forbidden` 或其他驗證失敗:2382如果在使用 Code 標籤時看到 `Error 403: Forbidden` 或其他驗證失敗:

2363 2383 

23641. 從應用程式選單登出並重新登入。這是最常見的修復。23841. 從應用程式選單登出並重新登入。這是最常見的修復。

Details

106 106 

107## 授予 Claude 對裝置的存取權107## 授予 Claude 對裝置的存取權

108 108 

109Claude 在控制裝置之前要求您的同意,而建置或啟動應用程式或在其上開啟 URL 遵循您工作階段的權限模式。您或您的組織也可以完全關閉 Claude 的存取。109Claude 在控制裝置之前要求您的同意,而建置或啟動應用程式或在其上開啟 URL 遵循您工作階段的權限模式。若要完全移除 Claude 的存取權,請[關閉模擬器存取](#turn-off-simulator-access)。

110 110 

111### 第一次允許裝置111### 第一次允許裝置

112 112 

env-vars.md +5 −4

Details

206| `CLAUDE_CODE_ALWAYS_ENABLE_EFFORT` | 設為 `1` 可在每個請求中傳送 [effort](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level) 參數,即使 Claude Code 無法辨識該模型 ID 支援 effort。透過 [LLM 閘道](https://code.claude.com/docs/zh-TW/llm-gateway)或以自訂識別碼提供模型的第三方供應商路由時使用。在 API 層拒絕 effort 參數的模型(包括 Claude Opus 4.1、Claude Sonnet 4.5、Claude Haiku 4.5 及更早的模型)仍會被排除,以免請求失敗 |206| `CLAUDE_CODE_ALWAYS_ENABLE_EFFORT` | 設為 `1` 可在每個請求中傳送 [effort](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level) 參數,即使 Claude Code 無法辨識該模型 ID 支援 effort。透過 [LLM 閘道](https://code.claude.com/docs/zh-TW/llm-gateway)或以自訂識別碼提供模型的第三方供應商路由時使用。在 API 層拒絕 effort 參數的模型(包括 Claude Opus 4.1、Claude Sonnet 4.5、Claude Haiku 4.5 及更早的模型)仍會被排除,以免請求失敗 |

207| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | 應重新整理憑證的間隔,單位為毫秒(使用 [`apiKeyHelper`](https://code.claude.com/docs/zh-TW/settings-reference#apikeyhelper) 時) |207| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | 應重新整理憑證的間隔,單位為毫秒(使用 [`apiKeyHelper`](https://code.claude.com/docs/zh-TW/settings-reference#apikeyhelper) 時) |

208| `CLAUDE_CODE_ARTIFACT_AUTO_OPEN` | 設定為 `0` 可阻止 Claude Code 在發布新的 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#create-an-artifact) 時自動開啟瀏覽器 |208| `CLAUDE_CODE_ARTIFACT_AUTO_OPEN` | 設定為 `0` 可阻止 Claude Code 在發布新的 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md#create-an-artifact) 時自動開啟瀏覽器 |

209| `CLAUDE_CODE_ARTIFACT_COMMENTS` | 設定為 `0` 可阻止 Claude 讀取及回覆 [artifact 上的留言](https://code.claude.com/docs/zh-TW/artifacts.md#collect-comments-on-an-artifact)。當 `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` 已[關閉 artifact](https://code.claude.com/docs/zh-TW/artifacts.md#availability) 時沒有作用。需要 Claude Code v2.1.221 或更新版本 |209| `CLAUDE_CODE_ARTIFACT_COMMENTS` | 設為 `0` 可讓 [`Artifact` 工具](https://code.claude.com/docs/zh-TW/tools-reference)停止讀取和回覆[artifact 上的留言](https://code.claude.com/docs/zh-TW/artifacts.md#collect-comments-on-an-artifact)。當 `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` 已[關閉 artifact](https://code.claude.com/docs/zh-TW/artifacts.md#availability) 時沒有作用。需要 Claude Code v2.1.221 或更新版本 |

210| `CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT` | 設定為 `0` 可阻止 Claude [自行回覆傳送給它的留言](https://code.claude.com/docs/zh-TW/artifacts.md#let-claude-reply-to-comments-on-its-own)。需要 Claude Code v2.1.228 或更新版本 |210| `CLAUDE_CODE_ARTIFACT_COMMENTS_AUTOREACT` | 設定為 `0` 可阻止 Claude [自行回覆傳送給它的留言](https://code.claude.com/docs/zh-TW/artifacts.md#let-claude-reply-to-comments-on-its-own)。需要 Claude Code v2.1.228 或更新版本 |

211| `CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS` | 設為 `0` 可讓 Claude 不要在發布 artifact 時[套用小幅變更](https://code.claude.com/docs/zh-TW/artifacts.md#turn-off-one-step-artifact-updates)至其檔案。Claude 接著會以其檔案編輯工具編輯該檔案,並以獨立步驟發布。需要 Claude Code v2.1.300 或更新版本 |211| `CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS` | 設為 `0` 可讓 Claude 停止在發佈 artifact 時[套用小幅變更](https://code.claude.com/docs/zh-TW/artifacts.md#turn-off-one-step-artifact-updates)至該 artifact 的本機檔案。需要 Claude Code v2.1.300 或更新版本 |

212| `CLAUDE_CODE_ATTRIBUTION_HEADER` | 設定為 `0` 可從系統提示詞開頭省略[歸屬區塊](https://code.claude.com/docs/zh-TW/llm-gateway-protocol.md#system-prompt-attribution-block),該區塊包含用戶端版本與提示詞指紋。無論如何,直接連線至 Anthropic API 時的快取都不受影響。在某些直接連線設定中,即使您設定了 `0`,Claude Code 仍會在[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)分類器請求中保留此區塊。請在[系統提示詞歸屬區塊](https://code.claude.com/docs/zh-TW/llm-gateway-protocol.md#system-prompt-attribution-block)中查看此情況涵蓋哪些連線與憑證。在 v2.1.181 之前,此區塊在自訂基礎 URL 與 Microsoft Foundry 連線上包含每個請求專屬的 token,因此在這些版本上,當您的 LLM 閘道依請求本文進行快取或將請求轉送至第三方提供者時,或當您直接連線至 Microsoft Foundry 時,請將其設定為 `0` |212| `CLAUDE_CODE_ATTRIBUTION_HEADER` | 設定為 `0` 可從系統提示詞開頭省略[歸屬區塊](https://code.claude.com/docs/zh-TW/llm-gateway-protocol.md#system-prompt-attribution-block),該區塊包含用戶端版本與提示詞指紋。無論如何,直接連線至 Anthropic API 時的快取都不受影響。在某些直接連線設定中,即使您設定了 `0`,Claude Code 仍會在[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)分類器請求中保留此區塊。請在[系統提示詞歸屬區塊](https://code.claude.com/docs/zh-TW/llm-gateway-protocol.md#system-prompt-attribution-block)中查看此情況涵蓋哪些連線與憑證。在 v2.1.181 之前,此區塊在自訂基礎 URL 與 Microsoft Foundry 連線上包含每個請求專屬的 token,因此在這些版本上,當您的 LLM 閘道依請求本文進行快取或將請求轉送至第三方提供者時,或當您直接連線至 Microsoft Foundry 時,請將其設定為 `0` |

213| `CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS` | 已於 v2.1.283 移除。請改用 `CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE` |213| `CLAUDE_CODE_AUTO_BACKGROUND_WORKER_CHECKIN_SECONDS` | 已於 v2.1.283 移除。請改用 `CLAUDE_CODE_WORKER_CHECKIN_SCHEDULE` |

214| `CLAUDE_CODE_AUTO_COMPACT_WINDOW` | 將自動壓縮視窗(即壓縮前上下文可填滿的程度)設為 `100000` 以上的 token 數。帶後綴的值(例如 `200k`)需要 v2.1.304 或更新版本。關於相對於其他設定視窗方式的優先順序,以及對狀態列 `used_percentage` 的影響,請參閱[設定自動壓縮視窗](https://code.claude.com/docs/zh-TW/model-config.md#set-the-auto-compact-window) |214| `CLAUDE_CODE_AUTO_COMPACT_WINDOW` | 將自動壓縮視窗(即壓縮前上下文可填滿的程度)設為 `100000` 以上的 token 數。帶後綴的值(例如 `200k`)需要 v2.1.304 或更新版本。關於相對於其他設定視窗方式的優先順序,以及對狀態列 `used_percentage` 的影響,請參閱[設定自動壓縮視窗](https://code.claude.com/docs/zh-TW/model-config.md#set-the-auto-compact-window) |


276| `CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY` | 設定為 `1` 可關閉 [PowerShell 工具](https://code.claude.com/docs/zh-TW/tools-reference.md#powershell-tool)的一項檢查,該檢查會拒絕在[系統路徑](https://code.claude.com/docs/zh-TW/permission-modes.md#remove-item-in-powershell)(例如磁碟機根目錄或您的家目錄)上使用 `cmd` 內建命令 `rd`、`rmdir`、`del` 與 `erase`。Claude Code 會忽略設定檔 `env` 區塊中的此變數。需要 Claude Code v2.1.283 或更新版本 |276| `CLAUDE_CODE_DISABLE_POWERSHELL_CMD_RM_DENY` | 設定為 `1` 可關閉 [PowerShell 工具](https://code.claude.com/docs/zh-TW/tools-reference.md#powershell-tool)的一項檢查,該檢查會拒絕在[系統路徑](https://code.claude.com/docs/zh-TW/permission-modes.md#remove-item-in-powershell)(例如磁碟機根目錄或您的家目錄)上使用 `cmd` 內建命令 `rd`、`rmdir`、`del` 與 `erase`。Claude Code 會忽略設定檔 `env` 區塊中的此變數。需要 Claude Code v2.1.283 或更新版本 |

277| `CLAUDE_CODE_DISABLE_PROXY_SCHEME_REPAIR` | 設為 `1` 可讓 Claude Code 在 `HTTPS_PROXY` 或 `https_proxy` 為單純的 `host:port` 時於啟動時停止,即使它是在沒有終端機的情況下啟動。Claude Code 會在專案和本機設定中忽略此變數。需要 Claude Code v2.1.327 或更新版本 |277| `CLAUDE_CODE_DISABLE_PROXY_SCHEME_REPAIR` | 設為 `1` 可讓 Claude Code 在 `HTTPS_PROXY` 或 `https_proxy` 為單純的 `host:port` 時於啟動時停止,即使它是在沒有終端機的情況下啟動。Claude Code 會在專案和本機設定中忽略此變數。需要 Claude Code v2.1.327 或更新版本 |

278| `CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK` | 設定為 `1` 可關閉[安全分類器標記請求時的自動模型切換](https://code.claude.com/docs/zh-TW/model-config.md#automatic-model-fallback),也就是 [`switchModelsOnFlag`](https://code.claude.com/docs/zh-TW/settings-reference#switchmodelsonflag) 設定所控制的行為 |278| `CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK` | 設定為 `1` 可關閉[安全分類器標記請求時的自動模型切換](https://code.claude.com/docs/zh-TW/model-config.md#automatic-model-fallback),也就是 [`switchModelsOnFlag`](https://code.claude.com/docs/zh-TW/settings-reference#switchmodelsonflag) 設定所控制的行為 |

279| `CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION` | 若您的[代理伺服器](https://code.claude.com/docs/zh-TW/network-config.md#proxy-configuration)讓壓縮的回應停在未完成的狀態,設為 `1` 可請求未壓縮的模型回應。不建議用於自行託管的 runner 或 Remote Control。在專案與本機設定中會被忽略。需要 Claude Code v2.1.331 或更新版本 |

279| `CLAUDE_CODE_DISABLE_SHELL_HEAD_START` | 設為 `1` 可關閉預先啟動機制;該機制可在 Claude 撰寫工作階段第一個 Bash 命令時、在該命令的權限提示出現之前,先執行您的 shell 啟動檔。需要 Claude Code v2.1.327 或更新版本 |280| `CLAUDE_CODE_DISABLE_SHELL_HEAD_START` | 設為 `1` 可關閉預先啟動機制;該機制可在 Claude 撰寫工作階段第一個 Bash 命令時、在該命令的權限提示出現之前,先執行您的 shell 啟動檔。需要 Claude Code v2.1.327 或更新版本 |

280| `CLAUDE_CODE_DISABLE_SHIP` | 設為 `1` 以關閉 [`/ship` 和 `/steward`](https://code.claude.com/docs/zh-TW/ship-command#turn-off-%2Fship-and-%2Fsteward-for-your-organization)。需要 Claude Code v2.1.331 或更新版本 |281| `CLAUDE_CODE_DISABLE_SHIP` | 設為 `1` 以關閉 [`/ship` 和 `/steward`](https://code.claude.com/docs/zh-TW/ship-command#turn-off-%2Fship-and-%2Fsteward-for-your-organization)。需要 Claude Code v2.1.331 或更新版本 |

281| `CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS` | 設定為 `1` 可阻止 Claude Code 傳送結構化輸出的 `output_config.format` 欄位與其搭配的 `anthropic-beta` 值,適用於上游會拒絕這些內容的 [LLM 閘道](https://code.claude.com/docs/zh-TW/llm-gateway-protocol.md#feature-pass-through)。這會讓 [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](https://code.claude.com/docs/zh-TW/llm-gateway-protocol#disable-pre-release-capabilities) 所關閉的其他預先發行功能保持開啟。需要 Claude Code v2.1.288 或更新版本 |282| `CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS` | 設定為 `1` 可阻止 Claude Code 傳送結構化輸出的 `output_config.format` 欄位與其搭配的 `anthropic-beta` 值,適用於上游會拒絕這些內容的 [LLM 閘道](https://code.claude.com/docs/zh-TW/llm-gateway-protocol.md#feature-pass-through)。這會讓 [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS`](https://code.claude.com/docs/zh-TW/llm-gateway-protocol#disable-pre-release-capabilities) 所關閉的其他預先發行功能保持開啟。需要 Claude Code v2.1.288 或更新版本 |


465| `DEBUG` | 設定為 `1` 可啟用偵錯模式,等同於以 [`--debug`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 啟動。偵錯日誌會寫入 `~/.claude/debug/<session-id>.txt`,或寫入 `CLAUDE_CODE_DEBUG_LOGS_DIR` 所設定的路徑。只有真值 `1`、`true`、`yes` 與 `on` 會啟用偵錯模式,因此為其他工具設定的命名空間模式(例如 `DEBUG=express:*`)不會觸發它 |466| `DEBUG` | 設定為 `1` 可啟用偵錯模式,等同於以 [`--debug`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 啟動。偵錯日誌會寫入 `~/.claude/debug/<session-id>.txt`,或寫入 `CLAUDE_CODE_DEBUG_LOGS_DIR` 所設定的路徑。只有真值 `1`、`true`、`yes` 與 `on` 會啟用偵錯模式,因此為其他工具設定的命名空間模式(例如 `DEBUG=express:*`)不會觸發它 |

466| `DISABLE_AUTOUPDATER` | 設定為 `1` 可停用自動背景更新。手動執行 `claude update` 仍可運作。使用 `DISABLE_UPDATES` 可同時封鎖兩者 |467| `DISABLE_AUTOUPDATER` | 設定為 `1` 可停用自動背景更新。手動執行 `claude update` 仍可運作。使用 `DISABLE_UPDATES` 可同時封鎖兩者 |

467| `DISABLE_AUTO_COMPACT` | 設定為 `1` 可停用接近上下文限制時的自動壓縮,以及[閒置壓縮](https://code.claude.com/docs/zh-TW/settings-reference.md#idlecompaction)。手動 `/compact` 命令仍可使用。適合在您想明確控制壓縮時機時使用。覆寫 [`autoCompactEnabled`](https://code.claude.com/docs/zh-TW/settings-reference#autocompactenabled) 設定 |468| `DISABLE_AUTO_COMPACT` | 設定為 `1` 可停用接近上下文限制時的自動壓縮,以及[閒置壓縮](https://code.claude.com/docs/zh-TW/settings-reference.md#idlecompaction)。手動 `/compact` 命令仍可使用。適合在您想明確控制壓縮時機時使用。覆寫 [`autoCompactEnabled`](https://code.claude.com/docs/zh-TW/settings-reference#autocompactenabled) 設定 |

468| `DISABLE_COMPACT` | 設定為 `1` 可停用所有壓縮:包括自動壓縮與手動 `/compact` 命令 |469| `DISABLE_COMPACT` | 設為 `1` 可停用所有壓縮,包括 `/compact` 與[倒轉選單的摘要選項](https://code.claude.com/docs/zh-TW/checkpointing.md#rewind-and-summarize) |

469| `DISABLE_COST_WARNINGS` | 設定為 `1` 可停用成本警告訊息 |470| `DISABLE_COST_WARNINGS` | 設定為 `1` 可停用成本警告訊息 |

470| `DISABLE_DOCTOR_COMMAND` | 設定為 `1` 可隱藏 [`/doctor`](https://code.claude.com/docs/zh-TW/commands#all-commands) 設定檢查 skill 及其 `/checkup` 別名。適用於使用者不應在工作階段中執行設定診斷的受管部署。不會影響 `claude doctor` 終端機命令。在 v2.1.205 之前,此變數會隱藏 `/doctor` 診斷畫面命令 |471| `DISABLE_DOCTOR_COMMAND` | 設定為 `1` 可隱藏 [`/doctor`](https://code.claude.com/docs/zh-TW/commands#all-commands) 設定檢查 skill 及其 `/checkup` 別名。適用於使用者不應在工作階段中執行設定診斷的受管部署。不會影響 `claude doctor` 終端機命令。在 v2.1.205 之前,此變數會隱藏 `/doctor` 診斷畫面命令 |

471| `DISABLE_ERROR_REPORTING` | 設定為任何非空值(例如 `1`)可選擇退出錯誤回報。**與大多數開關變數不同,設定為 `0` 或 `false` 仍會選擇退出**;取消設定此變數即可重新開啟錯誤回報 |472| `DISABLE_ERROR_REPORTING` | 設定為任何非空值(例如 `1`)可選擇退出錯誤回報。**與大多數開關變數不同,設定為 `0` 或 `false` 仍會選擇退出**;取消設定此變數即可重新開啟錯誤回報 |


518| `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` | 標準 OpenTelemetry SDK 的屬性值長度限制。Claude Code 會將帶有內容的遙測屬性上限設為此值與 `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` 中較小者,使截斷標記保持在 SDK 限制之內。Claude Code 會以相同方式讀取 `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT` 與 `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` 變體,且最小的已設定值會套用至所有訊號。需要 Claude Code v2.1.214 或更新版本。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#common-configuration-variables) |519| `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` | 標準 OpenTelemetry SDK 的屬性值長度限制。Claude Code 會將帶有內容的遙測屬性上限設為此值與 `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` 中較小者,使截斷標記保持在 SDK 限制之內。Claude Code 會以相同方式讀取 `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT` 與 `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` 變體,且最小的已設定值會套用至所有訊號。需要 Claude Code v2.1.214 或更新版本。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#common-configuration-variables) |

519| `OTEL_LOG_ASSISTANT_RESPONSES` | 設定為 `1` 可在 `assistant_response` OpenTelemetry 日誌事件中包含模型的回應文字。未設定時,Claude Code 會改用 `OTEL_LOG_USER_PROMPTS` 的值。設定為 `0` 可在已設定 `OTEL_LOG_USER_PROMPTS` 的情況下仍保持回應遮蔽。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略。需要 Claude Code v2.1.193 或更新版本。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#assistant-response-event) |520| `OTEL_LOG_ASSISTANT_RESPONSES` | 設定為 `1` 可在 `assistant_response` OpenTelemetry 日誌事件中包含模型的回應文字。未設定時,Claude Code 會改用 `OTEL_LOG_USER_PROMPTS` 的值。設定為 `0` 可在已設定 `OTEL_LOG_USER_PROMPTS` 的情況下仍保持回應遮蔽。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略。需要 Claude Code v2.1.193 或更新版本。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#assistant-response-event) |

520| `OTEL_LOG_MANAGED_SETTINGS` | 設定為 `1` 可將遮蔽後的受管設定,以及遮蔽前設定的 SHA-256 摘要,加入 `managed_settings_resolved` OpenTelemetry 日誌事件。預設為停用。請在您的 shell、使用者設定或受管設定中設定;專案或本機設定中的值不會將其開啟。需要 Claude Code v2.1.274 或更新版本。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#managed-settings-resolved-event) |521| `OTEL_LOG_MANAGED_SETTINGS` | 設定為 `1` 可將遮蔽後的受管設定,以及遮蔽前設定的 SHA-256 摘要,加入 `managed_settings_resolved` OpenTelemetry 日誌事件。預設為停用。請在您的 shell、使用者設定或受管設定中設定;專案或本機設定中的值不會將其開啟。需要 Claude Code v2.1.274 或更新版本。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#managed-settings-resolved-event) |

521| `OTEL_LOG_RAW_API_BODIES` | 將 Anthropic Messages API 請求與回應 JSON 以 `api_request_body` / `api_response_body` 日誌事件發出。設定為 `1` 可發出在內容限制處截斷的內嵌本文,或設定為 `file:<dir>` 可將未截斷的本文寫入磁碟並改為發出 `body_ref` 路徑。`CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` 可設定內容限制,預設為 60 KB。預設為停用;本文包含完整的對話記錄。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#api-request-body-event) |522| `OTEL_LOG_RAW_API_BODIES` | 將 Anthropic Messages API 請求與回應 JSON 發出為 `api_request_body` / `api_response_body` 日誌事件。設為 `1` 可取得在[內容限制](https://code.claude.com/docs/zh-TW/monitoring-usage.md#common-configuration-variables)處截斷的內嵌主體,或設為 `file:<dir>` 將未截斷的主體寫入磁碟,並改為發出 `body_ref` 路徑。預設停用;主體可能包含整個對話記錄。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#api-request-body-event) |

522| `OTEL_LOG_TOOL_CONTENT` | 設定為 `1` 可在 `tool.output` OpenTelemetry span 事件中包含工具內容。Span 屬性會依[各自的開關](https://code.claude.com/docs/zh-TW/monitoring-usage.md#new-context-gates)攜帶工具內容。需要[追蹤](https://code.claude.com/docs/zh-TW/monitoring-usage.md#traces-beta)。預設為停用以保護敏感資料。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略,但該節所述的關閉值除外。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#tool-output-span-event) |523| `OTEL_LOG_TOOL_CONTENT` | 設定為 `1` 可在 `tool.output` OpenTelemetry span 事件中包含工具內容。Span 屬性會依[各自的開關](https://code.claude.com/docs/zh-TW/monitoring-usage.md#new-context-gates)攜帶工具內容。需要[追蹤](https://code.claude.com/docs/zh-TW/monitoring-usage.md#traces-beta)。預設為停用以保護敏感資料。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略,但該節所述的關閉值除外。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md#tool-output-span-event) |

523| `OTEL_LOG_TOOL_DETAILS` | 設定為 `1` 可在 OpenTelemetry 指標、追蹤與日誌中包含工具輸入引數;MCP 伺服器名稱;使用者撰寫的工作流程名稱;工具失敗時的原始錯誤字串;`api_refusal` 事件上的拒絕 `category`;[成本與 token 指標](https://code.claude.com/docs/zh-TW/monitoring-usage.md#cost-counter)上真實的 agent、skill、外掛與 MCP 伺服器名稱;以及其他工具詳細資訊。預設為停用以保護 PII。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略,但該節所述的關閉值除外。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md) |524| `OTEL_LOG_TOOL_DETAILS` | 設定為 `1` 可在 OpenTelemetry 指標、追蹤與日誌中包含工具輸入引數;MCP 伺服器名稱;使用者撰寫的工作流程名稱;工具失敗時的原始錯誤字串;`api_refusal` 事件上的拒絕 `category`;[成本與 token 指標](https://code.claude.com/docs/zh-TW/monitoring-usage.md#cost-counter)上真實的 agent、skill、外掛與 MCP 伺服器名稱;以及其他工具詳細資訊。預設為停用以保護 PII。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略,但該節所述的關閉值除外。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md) |

524| `OTEL_LOG_USER_PROMPTS` | 設定為 `1` 可在 OpenTelemetry 追蹤與日誌中包含使用者提示詞文字。預設為停用(提示詞會被遮蔽)。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略,但該節所述的關閉值除外。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md) |525| `OTEL_LOG_USER_PROMPTS` | 設定為 `1` 可在 OpenTelemetry 追蹤與日誌中包含使用者提示詞文字。預設為停用(提示詞會被遮蔽)。請在您的 shell、使用者設定或受管設定中設定。在[專案與本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略,但該節所述的關閉值除外。請參閱[監控](https://code.claude.com/docs/zh-TW/monitoring-usage.md) |

errors.md +51 −2

Details

60| `Sign in again to take your previous account or API key off the config file.` | [身分驗證](#sign-in-again-to-take-your-previous-account-or-api-key-off-the-config-file) |60| `Sign in again to take your previous account or API key off the config file.` | [身分驗證](#sign-in-again-to-take-your-previous-account-or-api-key-off-the-config-file) |

61| `Your account or API key may still be in the config file. Run claude auth logout.` | [身分驗證](#your-account-or-api-key-may-still-be-in-the-config-file) |61| `Your account or API key may still be in the config file. Run claude auth logout.` | [身分驗證](#your-account-or-api-key-may-still-be-in-the-config-file) |

62| `Authentication required · Sign in again to continue` | [身分驗證](#not-logged-in) |62| `Authentication required · Sign in again to continue` | [身分驗證](#not-logged-in) |

63| `Sign in again to continue` 後接 `For security, Claude Code needs a recent sign-in.` | [包裝程式與 IDE 錯誤](#claude-code-needs-a-recent-sign-in) |

64| `Claude Code needs a recent sign-in. Signing in won’t stop sessions.` | [包裝程式與 IDE 錯誤](#claude-code-needs-a-recent-sign-in) |

63| `Could not resolve authentication method` | [身分驗證](#could-not-resolve-authentication-method) |65| `Could not resolve authentication method` | [身分驗證](#could-not-resolve-authentication-method) |

64| `Invalid API key` | [身分驗證](#invalid-api-key) |66| `Invalid API key` | [身分驗證](#invalid-api-key) |

65| `Your apiKeyHelper script is failing` | [身分驗證](#your-apikeyhelper-script-is-failing) |67| `Your apiKeyHelper script is failing` | [身分驗證](#your-apikeyhelper-script-is-failing) |


99| `Your account does not have access to Claude. Please login again or contact your administrator.` | [身分驗證](#oauth-token-revoked-or-expired) |101| `Your account does not have access to Claude. Please login again or contact your administrator.` | [身分驗證](#oauth-token-revoked-or-expired) |

100| `API Error: 401 Invalid authentication credentials` | [身分驗證](#api-error-401-invalid-authentication-credentials) |102| `API Error: 401 Invalid authentication credentials` | [身分驗證](#api-error-401-invalid-authentication-credentials) |

101| `Login expired · Please run /login` | [身分驗證](#login-expired) |103| `Login expired · Please run /login` | [身分驗證](#login-expired) |

104| `Authentication error · This may be a temporary network issue`(於雲端工作階段中) | 再次傳送您的訊息。 |

105| `login required — run /login`(於 agent 檢視中) | 若其後接著本表所列的訊息,請使用該列。否則請執行 `/login`。 |

102| `Warning: this sign-in` | [檢查儲存的登入何時結束](https://code.claude.com/docs/zh-TW/authentication.md#check-when-a-stored-login-ends) |106| `Warning: this sign-in` | [檢查儲存的登入何時結束](https://code.claude.com/docs/zh-TW/authentication.md#check-when-a-stored-login-ends) |

103| `The browser can't return the sign-in to Claude Code automatically` | [身分驗證](#couldnt-start-the-local-sign-in-listener) |107| `The browser can't return the sign-in to Claude Code automatically` | [身分驗證](#couldnt-start-the-local-sign-in-listener) |

104| `Couldn't start the local listener that receives the browser sign-in. Try again.` | [身分驗證](#couldnt-start-the-local-sign-in-listener) |108| `Couldn't start the local listener that receives the browser sign-in. Try again.` | [身分驗證](#couldnt-start-the-local-sign-in-listener) |

105| `Failed to start OAuth callback server` | [身分驗證](#failed-to-start-oauth-callback-server) |109| `Failed to start OAuth callback server` | [身分驗證](#failed-to-start-oauth-callback-server) |

106| `Claude login not accepted · Run /login, then try again` | [身分驗證](#claude-login-not-accepted) |110| `Claude login not accepted · Run /login, then try again` | [身分驗證](#claude-login-not-accepted) |

107| `Artifacts need a claude.ai login` | [身分驗證](#artifacts-need-a-claude-ai-login) |111| `Artifacts need a claude.ai login` | [身分驗證](#artifacts-need-a-claude-ai-login) |

112| `Your authentication token belongs to organization` | [將登入限制在您的組織](https://code.claude.com/docs/zh-TW/authentication.md#restrict-login-to-your-organization) |

108| `Not signed in to the Cloud gateway — run /login.` | [身分驗證](#administrator-policy-requires-a-cloud-gateway-sign-in) |113| `Not signed in to the Cloud gateway — run /login.` | [身分驗證](#administrator-policy-requires-a-cloud-gateway-sign-in) |

109| `Administrator policy requires a Cloud gateway sign-in on this machine` | [身分驗證](#administrator-policy-requires-a-cloud-gateway-sign-in) |114| `Administrator policy requires a Cloud gateway sign-in on this machine` | [身分驗證](#administrator-policy-requires-a-cloud-gateway-sign-in) |

110| `Managed settings on this machine configure a Cloud gateway sign-in; run interactive /login to authenticate.` | [`claude auth login`](https://code.claude.com/docs/zh-TW/cli-reference#cli-commands) |115| `Managed settings on this machine configure a Cloud gateway sign-in; run interactive /login to authenticate.` | [`claude auth login`](https://code.claude.com/docs/zh-TW/cli-reference#cli-commands) |

111| `You chose an organization that is managed in Anthropic's Enterprise Admin Console` | [從 Claude Code 開啟登入](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code) |116| `You chose an organization that is managed in Anthropic's Enterprise Admin Console` | [從 Claude Code 開啟登入](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code) |

112| `The organization's settings won't apply on this computer` | [哪些設定優先](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) |117| `The organization's settings won't apply on this computer` | [哪些設定優先](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) |

113| `no usable organization sign-in` / `no readable organization sign-in` | [登入結束時](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#when-a-sign-in-ends) |118| `no usable organization sign-in` / `no readable organization sign-in` | [登入結束時](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#when-a-sign-in-ends) |

114| `the session no longer runs under that sign-in` / `This Claude Code process ran under your organization` / `After a sign-in to your organization, only a new session sends requests` | [登入 Claude Code](https://code.claude.com/docs/zh-TW/authentication.md#log-in-to-claude-code) |119| `the session no longer runs under that sign-in` / `This Claude Code process ran under your organization` / `After a sign-in to your organization, only a new session sends requests` / `Claude Code needs to restart to use it` | [登入 Claude Code](https://code.claude.com/docs/zh-TW/authentication.md#log-in-to-claude-code) |

115| `This conversation ran under organization` / `This conversation ran under more than one organization` | [登入 Claude Code](https://code.claude.com/docs/zh-TW/authentication.md#log-in-to-claude-code) |120| `This conversation ran under organization` / `This conversation ran under more than one organization` | [登入 Claude Code](https://code.claude.com/docs/zh-TW/authentication.md#log-in-to-claude-code) |

116| `Claude Code could not read the managed settings that apply to this computer, which may require a sign-in to Anthropic` | [`enforceAnthropicSignIn`](https://code.claude.com/docs/zh-TW/settings-reference#enforceanthropicsignin) |121| `Claude Code could not read the managed settings that apply to this computer, which may require a sign-in to Anthropic` | [`enforceAnthropicSignIn`](https://code.claude.com/docs/zh-TW/settings-reference#enforceanthropicsignin) |

117| `This computer's managed settings require a sign-in to Anthropic` / `This computer's settings require a sign-in to Anthropic that this app cannot use` | [要求登入](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#require-the-sign-in-with-managed-settings) |122| `This computer's managed settings require a sign-in to Anthropic` / `This computer's settings require a sign-in to Anthropic that this app cannot use` | [要求登入](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#require-the-sign-in-with-managed-settings) |


304| `Shell command failed for pattern "..."`,來自 `/security-review` 或任何注入動態上下文的 skill | [命令列錯誤](#security-review-fails-without-origin-head) |309| `Shell command failed for pattern "..."`,來自 `/security-review` 或任何注入動態上下文的 skill | [命令列錯誤](#security-review-fails-without-origin-head) |

305| 來自注入動態上下文之 skill 的 `Shell command permission check failed for pattern "..."` | [命令列錯誤](#security-review-fails-without-origin-head) |310| 來自注入動態上下文之 skill 的 `Shell command permission check failed for pattern "..."` | [命令列錯誤](#security-review-fails-without-origin-head) |

306| ``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) |311| ``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) |

312| 來自 `/security-review` 或注入動態上下文之 skill 的 `Not run in /<name>` / `Ran anyway in /<name>` / `[not run: blocked by hook` | [PreSkillShellCommand 決策控制](https://code.claude.com/docs/zh-TW/hooks.md#preskillshellcommand-decision-control) |

307| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [命令列錯誤](#security-review-fails-without-origin-head) |313| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [命令列錯誤](#security-review-fails-without-origin-head) |

308| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [命令列錯誤](#no-shell-command-was-run) |314| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [命令列錯誤](#no-shell-command-was-run) |

309| `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) |315| `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) |


349| `/feedback is disabled by your organization's policy`,或 `/bug` 或 `/share` 的相同訊息 | [命令列錯誤](#feedback-is-disabled-by-your-organizations-policy) |355| `/feedback is disabled by your organization's policy`,或 `/bug` 或 `/share` 的相同訊息 | [命令列錯誤](#feedback-is-disabled-by-your-organizations-policy) |

350| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [外掛錯誤](#plugin-eval-is-currently-in-early-access) |356| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [外掛錯誤](#plugin-eval-is-currently-in-early-access) |

351| `credential store on this machine holds a symbolic link inside it` | [授予工具](https://code.claude.com/docs/zh-TW/plugin-evals.md#grant-tools) |357| `credential store on this machine holds a symbolic link inside it` | [授予工具](https://code.claude.com/docs/zh-TW/plugin-evals.md#grant-tools) |

358| `cannot be disallowed`(來自 `claude plugin eval`) | 使用內建工具的[確切名稱](https://code.claude.com/docs/zh-TW/plugin-evals.md#disallow-tools),並[將目標放在 `--disallow-tools` 之前](https://code.claude.com/docs/zh-TW/plugin-evals#choose-what-to-evaluate) |

352| `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) |359| `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) |

353| `Marketplace "<name>" is registered from an untrusted source` | [外掛錯誤](#marketplace-is-registered-from-an-untrusted-source) |360| `Marketplace "<name>" is registered from an untrusted source` | [外掛錯誤](#marketplace-is-registered-from-an-untrusted-source) |

354| `Claude Code refuses the marketplace name "<name>"` | [外掛錯誤](#claude-code-refuses-the-marketplace-name) |361| `Claude Code refuses the marketplace name "<name>"` | [外掛錯誤](#claude-code-refuses-the-marketplace-name) |


375| `commands path not found: <path>` | [外掛疑難排解](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md#commands-path-not-found) |382| `commands path not found: <path>` | [外掛疑難排解](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md#commands-path-not-found) |

376| `Plugin not loaded: its manifest <path> was not read` | [外掛錯誤](#plugin-not-loaded-its-manifest-was-not-read) |383| `Plugin not loaded: its manifest <path> was not read` | [外掛錯誤](#plugin-not-loaded-its-manifest-was-not-read) |

377| `path couldn't be checked` / `path could not be checked` | [外掛錯誤](#path-could-not-be-checked) |384| `path couldn't be checked` / `path could not be checked` | [外掛錯誤](#path-could-not-be-checked) |

385| `Couldn't load hooks from <path>` / `Failed to load hooks from <path>` / `Hook load failed` | [外掛疑難排解](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md#failed-to-load-hooks-from-and-hooks-that-dont-fire) |

386| `hooks.json declares PreToolUse/PermissionRequest` | 將事件放在 `hooks` 鍵下,如[外掛 hook 範例](https://code.claude.com/docs/zh-TW/plugins/components.md#hooks)所示。 |

378| `its marketplace entry path does not stay inside the marketplace directory` | [外掛錯誤](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |387| `its marketplace entry path does not stay inside the marketplace directory` | [外掛錯誤](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |

379| `Plugin source path refused` | [外掛錯誤](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |388| `Plugin source path refused` | [外掛錯誤](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |

380| `Failed to load marketplace configuration` | [外掛錯誤](#failed-to-load-marketplace-configuration) |389| `Failed to load marketplace configuration` | [外掛錯誤](#failed-to-load-marketplace-configuration) |


388| `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)` | [外掛錯誤](#skipping-connection-recent-failure-cached) |397| `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)` | [外掛錯誤](#skipping-connection-recent-failure-cached) |

389| `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) |398| `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) |

390| `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) |399| `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) |

400| `hook was skipped. "<mod>" runs first and sent the event on past it.` | 若您在使用者設定的 [`prependPlugins`](https://code.claude.com/docs/zh-TW/settings-reference#prependplugins) 中列出了引號中的 mod,請變更該 mod。否則,請詢問您的管理員。 |

401| `<file>: changed while it was read` | 若此訊息由 `claude plugin validate` 列印,請重新執行它。否則,請重新啟動工作階段。 |

402| `installed mods are off for now` | [檢查 mod 是否能載入](https://code.claude.com/docs/zh-TW/plugins/mods/troubleshoot.md#check-whether-mods-can-load) |

403| `the hooks worker was lost with <mod>'s <event> hook in flight` | 修正所指名的 mod。關於其中一種原因,請參閱 [`it crashed the hooks worker`](https://code.claude.com/docs/zh-TW/plugins/mods/troubleshoot#it-crashed-the-hooks-worker)。 |

404| `dispatches in a row for fills by <mods>` | 變更所指名的 mod,使其連續填入提示詞輸入框的次數最多八次。 |

391| `Error: No such tool available: <tool name>` | [工具錯誤](#no-such-tool-available) |405| `Error: No such tool available: <tool name>` | [工具錯誤](#no-such-tool-available) |

392| `MCP server "<name>" connection closed before the tool call was answered` | [工具錯誤](#connection-closed-before-the-tool-call-was-answered) |406| `MCP server "<name>" connection closed before the tool call was answered` | [工具錯誤](#connection-closed-before-the-tool-call-was-answered) |

393| `MCP server "<name>" is disabled — re-enable it via /mcp to use its tools` | [工具錯誤](#mcp-server-is-disabled) |407| `MCP server "<name>" is disabled — re-enable it via /mcp to use its tools` | [工具錯誤](#mcp-server-is-disabled) |

394| `MCP server "<name>" tool "<tool>" timed out after <N>s. The server asked the user a question, and no answer came before the time limit.` | [工具錯誤](#mcp-tool-call-timed-out-with-the-servers-question-unanswered) |408| `MCP server "<name>" tool "<tool>" timed out after <N>s. The server asked the user a question, and no answer came before the time limit.` | [工具錯誤](#mcp-tool-call-timed-out-with-the-servers-question-unanswered) |

409| `The server's response is not a valid MCP response, so it was not read` | 重試之前,請先檢查請求是否已執行。將此錯誤回報給 MCP 伺服器的作者。 |

395| `Permission prompt tool returned an invalid result` | [工具錯誤](#permission-prompt-tool-returned-an-invalid-result) |410| `Permission prompt tool returned an invalid result` | [工具錯誤](#permission-prompt-tool-returned-an-invalid-result) |

396| `would be spawned with zero tools — refusing` | [工具錯誤](#agent-would-be-spawned-with-zero-tools) |411| `would be spawned with zero tools — refusing` | [工具錯誤](#agent-would-be-spawned-with-zero-tools) |

397| `File is covered by a Read deny rule in your permission settings` | [工具錯誤](#file-is-covered-by-a-read-deny-rule) |412| `File is covered by a Read deny rule in your permission settings` | [工具錯誤](#file-is-covered-by-a-read-deny-rule) |


437| `Disk full: this computer's volume holding <dir> (Claude Code's temporary directory) has <n> MB free` / `Nearly out of inodes: this computer's volume holding <dir>` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |452| `Disk full: this computer's volume holding <dir> (Claude Code's temporary directory) has <n> MB free` / `Nearly out of inodes: this computer's volume holding <dir>` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |

438| `Disk full: a test write beside this command's output file` / `Disk quota used up: a test write beside this command's output file` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |453| `Disk full: a test write beside this command's output file` / `Disk quota used up: a test write beside this command's output file` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |

439| `The command was not started: this computer's disk is full (ENOSPC)` / `the user's disk quota is used up (EDQUOT)` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |454| `The command was not started: this computer's disk is full (ENOSPC)` / `the user's disk quota is used up (EDQUOT)` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |

455| `The sandbox could not create <dir>, a folder it must protect from the command, because the temp disk is full` | 釋出暫存磁碟的空間或修復該磁碟,然後讓 Claude 再次執行該命令。 |

440| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` / `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) |456| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` / `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) |

441| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |457| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [工具錯誤](#disk-quota-or-temp-filesystem-is-full) |

442| `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) |458| `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) |


489| `Subprocess initialization did not complete within 60000ms` | [包裝程式與 IDE 錯誤](#subprocess-initialization-did-not-complete-within-60000ms) |505| `Subprocess initialization did not complete within 60000ms` | [包裝程式與 IDE 錯誤](#subprocess-initialization-did-not-complete-within-60000ms) |

490| `Claude Code did not finish starting` | [包裝程式與 IDE 錯誤](#subprocess-initialization-did-not-complete-within-60000ms) |506| `Claude Code did not finish starting` | [包裝程式與 IDE 錯誤](#subprocess-initialization-did-not-complete-within-60000ms) |

491| `The connection to Claude Code ended before this message completed` | [包裝程式和 IDE 錯誤](#the-connection-to-claude-code-ended-before-this-message-completed) |507| `The connection to Claude Code ended before this message completed` | [包裝程式和 IDE 錯誤](#the-connection-to-claude-code-ended-before-this-message-completed) |

508| `Dictation error: The speech service refused the connection` / `Dictation error: The connection to the speech service was lost` / `Dictation error: Couldn’t connect to the speech service`(在 VS Code 中) | 從命令選擇區執行 **Claude Code: Show Logs**,並搜尋 `Speech-to-text`。 |

509| `The last request was refused`(在 VS Code 登入畫面上) | 選取 **Cancel**,然後在此表格中查詢該對話的錯誤。 |

510| `Plan not copied: The new session starts without a plan file.`(在 VS Code 中) | 若您需要該計畫,請要求 Claude 在新的工作階段中重新撰寫。 |

511| `A message is still queued` / `A /clear is still queued`(在 VS Code 中倒回程式碼時) | 停止 Claude,然後依照訊息其餘部分的指示操作。 |

512| `Couldn’t load the diff view or code colors`(在 VS Code 中) | 點擊差異以重試,或重新載入視窗。 |

513| `Settings file is empty, and another program may still be writing it: <path>`(在 VS Code 中) | 請於一分鐘後重試。若訊息重複出現,請在檔案中放入 `{}`。 |

492| `Could not locate the Claude CLI on PATH` | [包裝程式和 IDE 錯誤](#could-not-locate-the-claude-cli-on-path) |514| `Could not locate the Claude CLI on PATH` | [包裝程式和 IDE 錯誤](#could-not-locate-the-claude-cli-on-path) |

493| `Claude Code could not be started from <command>: it is the <system> build, and this computer needs the <build> build` | 若您設定了 [`claudeCode.claudeProcessWrapper`](https://code.claude.com/docs/zh-TW/vs-code#extension-settings),請將其指向為 `<build>` 建置的程式。否則,請安裝適用於 `<build>` 的 VS Code 擴充功能套件。 |515| `Claude Code could not be started from <command>: it is the <system> build, and this computer needs the <build> build` | 若您設定了 [`claudeCode.claudeProcessWrapper`](https://code.claude.com/docs/zh-TW/vs-code#extension-settings),請將其指向為 `<build>` 建置的程式。否則,請安裝適用於 `<build>` 的 VS Code 擴充功能套件。 |

494| `The Claude Code program for this computer, the <build> build, could not be found` | [包裝程式與 IDE 錯誤](#the-claude-code-program-for-this-computer-could-not-be-found) |516| `The Claude Code program for this computer, the <build> build, could not be found` | [包裝程式與 IDE 錯誤](#the-claude-code-program-for-this-computer-could-not-be-found) |

495| `Restored the code, but skipped N files` | [Rewind 警告和錯誤](#restored-the-code-but-skipped-files) |517| `Restored the code, but skipped N files` | [Rewind 警告和錯誤](#restored-the-code-but-skipped-files) |

496| `No files were restored: N files failed (backup missing, or the file could not be updated)` | [Rewind 警告和錯誤](#no-files-were-restored) |518| `No files were restored: N files failed (backup missing, or the file could not be updated)` | [Rewind 警告和錯誤](#no-files-were-restored) |

497| `Couldn't restore N files: the backup is missing or the file can't be written` | 將失敗的檔案設為可寫入,然後從版本控制還原這些檔案。 |519| `Couldn't restore N files: the backup is missing or the file can't be written` | 將失敗的檔案設為可寫入,然後從版本控制還原這些檔案。 |

520| `Kept N files created since then, because a restore failed` | 若您不需要 Claude 在檢查點之後建立的檔案,請將其刪除。 |

498| `The file backups are still being copied. Nothing was changed. Try again in a moment.` | 在 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 中再次選擇相同的時間點。若在 [`/branch`](https://code.claude.com/docs/zh-TW/sessions#branch-a-session) 後不久還原程式碼,Claude Code 可能仍在將檔案備份複製到新的工作階段。 |521| `The file backups are still being copied. Nothing was changed. Try again in a moment.` | 在 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 中再次選擇相同的時間點。若在 [`/branch`](https://code.claude.com/docs/zh-TW/sessions#branch-a-session) 後不久還原程式碼,Claude Code 可能仍在將檔案備份複製到新的工作階段。 |

499| `Transcript writes are failing (...)` | [工作階段儲存警告](#transcript-writes-are-failing) |522| `Transcript writes are failing (...)` | [工作階段儲存警告](#transcript-writes-are-failing) |

500| `Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set` | [工作階段儲存警告](#transcript-saving-is-off-skip-prompt-history) |523| `Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set` | [工作階段儲存警告](#transcript-saving-is-off-skip-prompt-history) |


539| `headersHelper not run — this workspace has no persisted trust` | [設定警告](#headershelper-not-run) |562| `headersHelper not run — this workspace has no persisted trust` | [設定警告](#headershelper-not-run) |

540| `Invalid permission rule "..." was skipped: Malformed Tool(content) rule` | [設定警告](#malformed-tool-content-rule) |563| `Invalid permission rule "..." was skipped: Malformed Tool(content) rule` | [設定警告](#malformed-tool-content-rule) |

541| `matches no tool · check for typos` / `matches no known tool — check for typos` | [設定警告](#matches-no-tool) |564| `matches no tool · check for typos` / `matches no known tool — check for typos` | [設定警告](#matches-no-tool) |

565| `lets <tool> run without asking only in the working directories` / `adds nothing to <tool>'s default` | [允許在工作目錄之外使用檔案工具](https://code.claude.com/docs/zh-TW/permissions.md#allow-a-file-tool-outside-the-working-directories) |

542| `... is not matched by file permission checks` | [設定警告](#is-not-matched-by-file-permission-checks) |566| `... is not matched by file permission checks` | [設定警告](#is-not-matched-by-file-permission-checks) |

543| `Write(<path>) never matches · use Edit(<path>)` / `Glob(<path>) never matches · use Read(<path>)` | [設定警告](#is-not-matched-by-file-permission-checks) |567| `Write(<path>) never matches · use Edit(<path>)` / `Glob(<path>) never matches · use Read(<path>)` | [設定警告](#is-not-matched-by-file-permission-checks) |

544| `... has a wildcard before the rest of the command` | [設定警告](#has-a-wildcard-before-the-rest-of-the-command) |568| `... has a wildcard before the rest of the command` | [設定警告](#has-a-wildcard-before-the-rest-of-the-command) |


5973* 再次傳送訊息。下一條訊息會啟動一個新的 `claude` 程序,繼續對話。5997* 再次傳送訊息。下一條訊息會啟動一個新的 `claude` 程序,繼續對話。

5974* 如果它重複發生,在同一專案中的終端機中執行 `claude`。持續結束程序的失敗通常會在那裡重現,並顯示其真實錯誤訊息。5998* 如果它重複發生,在同一專案中的終端機中執行 `claude`。持續結束程序的失敗通常會在那裡重現,並顯示其真實錯誤訊息。

5975 5999 

6000### Claude Code needs a recent sign-in

6001 

6002當 Code 分頁中的本機、WSL 或 SSH 工作階段需要新的已儲存登入,而您最近未曾登入時,[Claude Desktop 應用程式](https://code.claude.com/docs/zh-TW/desktop.md)會顯示此訊息:

6003 

6004```text theme={null}

6005For security, Claude Code needs a recent sign-in.

6006```

6007 

6008對於這些工作階段,無論是否使用單一登入(SSO),每部電腦上的每個帳戶和組織大約每個月最多被要求登入一次屬於正常情況。

6009 

6010**該怎麼做:**

6011 

6012* 點擊卡片上的 **Sign in again**,然後登入

6013* 如果 Code 分頁頂端的橫幅顯示 `Claude Code needs a recent sign-in. Signing in won’t stop sessions.`,請點擊橫幅上的 **Sign in again**

6014* 如果在同一部電腦上使用相同的帳戶和組織,這些工作階段在三週內再次要求您登入,請[檢查您的 Claude Desktop 版本](https://code.claude.com/docs/zh-TW/desktop.md#check-your-version)。如果版本早於 v5.11492.0,請更新:

6015 * **macOS**:選擇 **Claude > Check for Updates…**

6016 * **Windows**:選擇 **Help > Check for Updates…**,或者如果您是從 Microsoft Store 安裝應用程式,請透過該處更新

6017 * **Linux**:[透過 apt 更新](https://code.claude.com/docs/zh-TW/desktop-linux.md#update)

6018 * **受管理的更新**:如果您的組織[關閉了自動更新](https://code.claude.com/docs/zh-TW/desktop.md#device-management-policies),請向管理員要求 v5.11492.0 或更新版本

6019* 如果在 v5.11492.0 或更新版本上仍持續發生,請[聯絡支援](https://code.claude.com/docs/zh-TW/desktop.md#still-stuck)

6020 

6021如果您在 Remote Control 工作階段中看到此卡片,請參閱 [Trusted Devices](https://code.claude.com/docs/zh-TW/remote-control.md#trusted-devices),該功能可能會要求較近期的登入。

6022 

6023在 Claude Desktop v5.11492.0 之前,當公司的代理伺服器或閘道以 JSON 錯誤回應 Code 分頁的背景續期時,Code 分頁可能會遺失其已儲存的登入。

6024 

5976## Rewind 警告和錯誤6025## Rewind 警告和錯誤

5977 6026 

5978這些訊息來自 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 程式碼還原。`Restored the code, but skipped N files` 是一個警告,表示 Claude Code 跳過了某些路徑。`No files were restored` 是一個錯誤,表示它沒有還原任何內容。6027這些訊息來自 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 程式碼還原。`Restored the code, but skipped N files` 是一個警告,表示 Claude Code 跳過了某些路徑。`No files were restored` 是一個錯誤,表示它沒有還原任何內容。


5999 6048 

6000### No files were restored6049### No files were restored

6001 6050 

6002當您使用 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 還原程式碼,且無法還原該檢查點中的任何檔案時,Claude Code 會顯示此訊息。對於每個檔案,Claude Code 在編輯前儲存的備份遺失,或 Claude Code 無法寫入或刪除該檔案。6051當 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 程式碼還原在至少一個檔案上失敗,且沒有還原任何檔案時,您會看到此訊息。

6003 6052 

6004```text theme={null}6053```text theme={null}

6005Failed to restore the code:6054Failed to restore the code:

fast-mode.md +1 −1

Details

259* 可用性和定價可能會改變259* 可用性和定價可能會改變

260* 底層 API 配置可能會演變260* 底層 API 配置可能會演變

261 261 

262透過您通常的 Anthropic 支援管道報告問題或反饋。262透過 Anthropic 支援報告問題或反饋。

263 263 

264## 另請參閱264## 另請參閱

265 265 

Details

47以下功能需要使用 claude.ai 帳戶登入,無法透過 Anthropic Console API 金鑰或第三方供應商使用:47以下功能需要使用 claude.ai 帳戶登入,無法透過 Anthropic Console API 金鑰或第三方供應商使用:

48 48 

49* [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)與行動裝置上的 Claude Code49* [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)與行動裝置上的 Claude Code

50* [Slack 中的 Claude Code](https://code.claude.com/docs/zh-TW/slack.md):Pro、Max 與 Ultra 方案

51* [Claude Code Desktop](https://code.claude.com/docs/zh-TW/desktop.md)50* [Claude Code Desktop](https://code.claude.com/docs/zh-TW/desktop.md)

52* [雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)(`/schedule`)51* [雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)(`/schedule`)

53* [Ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md)52* [Ultrareview](https://code.claude.com/docs/zh-TW/ultrareview.md)

Details

123>123>

124> **使用輸出風格**:如果內容與回應本身有關,且您之後可能想將其關閉,例如長度、格式、Claude 解釋的詳細程度,或是寫作助理等不同的角色。Claude Code 包含[內建風格](https://code.claude.com/docs/zh-TW/output-styles.md#built-in-output-styles),您也可以撰寫自己的風格。124> **使用輸出風格**:如果內容與回應本身有關,且您之後可能想將其關閉,例如長度、格式、Claude 解釋的詳細程度,或是寫作助理等不同的角色。Claude Code 包含[內建風格](https://code.claude.com/docs/zh-TW/output-styles.md#built-in-output-styles),您也可以撰寫自己的風格。

125>125>

126> **兩者可以結合。** 無論您選擇哪種風格,CLAUDE.md 都會保持載入。Claude 會將兩者都視為指令來遵循,因此兩者都不具強制性。對於每次都必須發生的事情,請使用 [hook](https://code.claude.com/docs/zh-TW/hooks-guide.md)。126> **兩者可以結合。** Claude 會將兩者都視為指令來遵循,因此兩者都不具強制性。對於每次都必須發生的事情,請使用 [hook](https://code.claude.com/docs/zh-TW/hooks-guide.md)。

127 127 

128> [tab] CLAUDE.md、規則與 Skill128> [tab] CLAUDE.md、規則與 Skill

129>129>


252 252 

253> [tab] Skills253> [tab] Skills

254>254>

255> Skills 是 Claude 工具包中的額外功能。它們可以是參考資料(如 API 風格指南)或可調用的工作流程,您可以使用 `/<name>` 觸發(如 `/deploy`)。Claude Code 附帶[捆綁的 skills](https://code.claude.com/docs/zh-TW/commands.md),如 `/code-review`、`/batch` 和 `/debug`,開箱即用。您也可以創建自己的。255> Skills 是 Claude 工具包中的額外功能。它們可以是參考資料(如 API 風格指南)或可調用的工作流程,您可以使用 `/<name>` 觸發(如 `/deploy`)。Claude Code 包含[隨附 skill](https://code.claude.com/docs/zh-TW/commands.md),如 `/code-review`、`/batch` 和 `/debug`。您也可以建立自己的 skill。

256>256>

257> **何時:** 取決於 skill 的配置。預設情況下,描述在會話開始時載入,完整內容在使用時載入。對於僅使用者 skills(`disable-model-invocation: true`),在您調用它們之前不會載入任何內容。257> **何時:** 取決於 skill 的配置。預設情況下,描述在會話開始時載入,完整內容在使用時載入。對於僅使用者 skills(`disable-model-invocation: true`),在您調用它們之前不會載入任何內容。

258>258>

hooks.md +87 −9

Details

24* 每個轉向一次:`UserPromptSubmit`、`Stop` 和 `StopFailure`24* 每個轉向一次:`UserPromptSubmit`、`Stop` 和 `StopFailure`

25* 在代理迴圈內每個工具呼叫上:`PreToolUse` 和 `PostToolUse`,除了 [`EndConversation`](https://code.claude.com/docs/zh-TW/tools-reference#endconversation-tool-behavior) 呼叫外,兩者都會跳過25* 在代理迴圈內每個工具呼叫上:`PreToolUse` 和 `PostToolUse`,除了 [`EndConversation`](https://code.claude.com/docs/zh-TW/tools-reference#endconversation-tool-behavior) 呼叫外,兩者都會跳過

26 26 

27![Hook 生命週期圖表,顯示可選的 Setup 進入 SessionStart,然後是每個轉向的迴圈,包含 UserPromptSubmit、用於 slash commands 的 UserPromptExpansion、嵌套的代理迴圈(PreToolUse、PermissionRequest、PostToolUse、PostToolUseFailure、PostToolBatch、SubagentStart/Stop、TaskCreated、TaskCompleted)和 Stop 或 StopFailure,接著是 TeammateIdle、PreCompact、PostCompact 和 SessionEnd,Elicitation 和 ElicitationResult 嵌套在 MCP 工具執行內,PermissionDenied 作為 PermissionRequest 的側分支用於自動模式拒絕,WorktreeCreate、WorktreeRemove、Notification、ConfigChange、InstructionsLoaded、CwdChanged、FileChanged 和 DirectoryAdded 作為獨立非同步事件,PreModelSwitch 作為獨立順序事件,在請求的模型切換之前執行,PostModelSwitch 作為獨立非同步事件,在工作階段的模型變更後執行,以及 MessageDisplay 作為顯示專用事件,在助手訊息文字串流時執行](https://mintcdn.com/claude-code/x7pO8l4XcvAXCoVc/images/hooks-lifecycle.svg?fit=max\&auto=format\&n=x7pO8l4XcvAXCoVc\&q=85\&s=81b9256c1bbe8832553485f5d9e9c746)27![Hook 生命週期圖表,顯示可選的 Setup 進入 SessionStart,然後是每個回合的迴圈,包含 UserPromptSubmit、用於斜線命令的 UserPromptExpansion、嵌套的代理式迴圈(PreToolUse、PermissionRequest、PostToolUse、PostToolUseFailure、PostToolBatch、SubagentStart/Stop、TaskCreated、TaskCompleted)和 Stop 或 StopFailure,接著是 TeammateIdle、PreCompact、PostCompact 和 SessionEnd,Elicitation 和 ElicitationResult 嵌套在 MCP 工具執行內,PermissionDenied 作為 PermissionRequest 的側分支用於自動模式拒絕,WorktreeCreate、WorktreeRemove、Notification、ConfigChange、InstructionsLoaded、CwdChanged、FileChanged 和 DirectoryAdded 作為獨立非同步事件,PreSkillShellCommand 作為獨立阻擋事件,在載入中的 skill 執行 shell 命令之前執行,PreModelSwitch 作為獨立順序事件,在請求的模型切換之前執行,PostModelSwitch 作為獨立非同步事件,在工作階段的模型變更後執行,以及 MessageDisplay 作為顯示專用事件,在助手訊息文字串流時執行](https://mintcdn.com/claude-code/IWhl7FXSx6ARoVoo/images/hooks-lifecycle.svg?fit=max\&auto=format\&n=IWhl7FXSx6ARoVoo\&q=85\&s=a8adf56a3d13b8a8ba9c446bbd7171f8)

28 28 

29下表總結了每個事件何時觸發。[Hook 事件](#hook-events)部分記錄了每個事件的完整輸入架構和決定控制選項。29下表總結了每個事件何時觸發。[Hook 事件](#hook-events)部分記錄了每個事件的完整輸入架構和決定控制選項。

30 30 


34| `Setup` | 當您使用 `--init-only` 啟動 Claude Code,或在 `-p` 模式中使用 `--init` 或 `--maintenance` 時。用於 CI 或指令碼中的一次性準備 |34| `Setup` | 當您使用 `--init-only` 啟動 Claude Code,或在 `-p` 模式中使用 `--init` 或 `--maintenance` 時。用於 CI 或指令碼中的一次性準備 |

35| `UserPromptSubmit` | 當提示詞被提交時,在 Claude 處理之前。也會在 [Claude Code 自行開始的回合](https://code.claude.com/docs/zh-TW/hooks.md#userpromptsubmit)上觸發 |35| `UserPromptSubmit` | 當提示詞被提交時,在 Claude 處理之前。也會在 [Claude Code 自行開始的回合](https://code.claude.com/docs/zh-TW/hooks.md#userpromptsubmit)上觸發 |

36| `UserPromptExpansion` | 當使用者輸入的命令擴展為提示詞時,在到達 Claude 之前。可以阻止擴展 |36| `UserPromptExpansion` | 當使用者輸入的命令擴展為提示詞時,在到達 Claude 之前。可以阻止擴展 |

37| `PreSkillShellCommand` | 在 skill 的[注入 shell 命令](https://code.claude.com/docs/zh-TW/skills.md#inject-dynamic-context)執行之前。可以阻止該命令 |

37| `PreToolUse` | 在工具呼叫執行之前。可以阻止它 |38| `PreToolUse` | 在工具呼叫執行之前。可以阻止它 |

38| `PermissionRequest` | 當工具呼叫需要權限決定時 |39| `PermissionRequest` | 當工具呼叫需要權限決定時 |

39| `PermissionDenied` | 當自動模式拒絕工具呼叫時,包括沒有分類器判決的拒絕。使用 JSON `hookSpecificOutput.retry: true` 告訴模型它可能重試被拒絕的工具呼叫。Claude Code 在分類器未產生判決時忽略 `retry` |40| `PermissionDenied` | 當自動模式拒絕工具呼叫時,包括沒有分類器判決的拒絕。使用 JSON `hookSpecificOutput.retry: true` 告訴模型它可能重試被拒絕的工具呼叫。Claude Code 在分類器未產生判決時忽略 `retry` |


308| `StopFailure` | 錯誤類型 | `rate_limit`、`authentication_failed`、`oauth_org_not_allowed`、`account_on_hold`、`billing_error`、`invalid_request`、`model_not_found`、`server_error`、`max_output_tokens`、`cloud_credential_error`、`unknown` |309| `StopFailure` | 錯誤類型 | `rate_limit`、`authentication_failed`、`oauth_org_not_allowed`、`account_on_hold`、`billing_error`、`invalid_request`、`model_not_found`、`server_error`、`max_output_tokens`、`cloud_credential_error`、`unknown` |

309| `InstructionsLoaded` | 載入原因 | `session_start`、`nested_traversal`、`path_glob_match`、`include`、`compact` |310| `InstructionsLoaded` | 載入原因 | `session_start`、`nested_traversal`、`path_glob_match`、`include`、`compact` |

310| `UserPromptExpansion` | 命令名稱 | 您的 skill 或命令名稱 |311| `UserPromptExpansion` | 命令名稱 | 您的 skill 或命令名稱 |

312| `PreSkillShellCommand` | 執行該命令的工具 | `Bash`、`PowerShell` |

311| `Elicitation` | MCP 伺服器名稱 | 您已設定的 MCP 伺服器名稱 |313| `Elicitation` | MCP 伺服器名稱 | 您已設定的 MCP 伺服器名稱 |

312| `ElicitationResult` | MCP 伺服器名稱 | 與 `Elicitation` 相同的值 |314| `ElicitationResult` | MCP 伺服器名稱 | 與 `Elicitation` 相同的值 |

313| `UserPromptSubmit`、`PostToolBatch`、`Stop`、`TeammateIdle`、`TaskCreated`、`TaskCompleted`、`WorktreeCreate`、`WorktreeRemove`、`MessageDisplay` | 不支援 matcher | 每次發生時一律觸發 |315| `UserPromptSubmit`、`PostToolBatch`、`Stop`、`TeammateIdle`、`TaskCreated`、`TaskCompleted`、`WorktreeCreate`、`WorktreeRemove`、`MessageDisplay` | 不支援 matcher | 每次發生時一律觸發 |


421| 欄位 | 必要 | 說明 |423| 欄位 | 必要 | 說明 |

422| :- | :- | :- |424| :- | :- | :- |

423| `type` | 是 | `"command"`、`"http"`、`"mcp_tool"`、`"prompt"` 或 `"agent"` |425| `type` | 是 | `"command"`、`"http"`、`"mcp_tool"`、`"prompt"` 或 `"agent"` |

424| `if` | 否 | 用於篩選此 hook 執行時機的[權限規則語法](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax),例如 `"Bash(git *)"` 或 `"Edit(*.ts)"`。只有在工具呼叫符合該模式時,hook 命令才會執行。請參閱 [Bash 比對表](#bash-if-matching),了解 Bash 模式如何針對子命令、`$()` 與反引號進行評估。僅在工具事件上評估:`PreToolUse`、`PostToolUse`、`PostToolUseFailure`、`PermissionRequest` 與 `PermissionDenied`。在其他事件上,設定了 `if` 的 hook 永遠不會執行 |426| `if` | 否 | 用於篩選此 hook 執行時機的[權限規則語法](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax),例如 `"Bash(git *)"` 或 `"Edit(*.ts)"`。只有在工具呼叫符合該模式時,hook 命令才會執行。請參閱 [Bash 比對表](#bash-if-matching),了解 Bash 模式如何針對子命令、`$()` 與反引號進行評估。僅在 `PreToolUse`、`PostToolUse`、`PostToolUseFailure`、`PermissionRequest`、`PermissionDenied` 與 `PreSkillShellCommand` 上評估。在其他事件上,設定了 `if` 的 hook 不會執行 |

425| `timeout` | 否 | 取消前的秒數。對於以 [`async: true`](#run-hooks-in-the-background) 執行的命令 hook,Claude Code 不會強制執行此值。預設值:`command`、`http` 與 `mcp_tool` 為 600;`prompt` 為 30;`agent` 為 60。在 [`UserPromptSubmit`](#userpromptsubmit)、[`PreModelSwitch`](#premodelswitch) 與 [`PostModelSwitch`](#postmodelswitch) 上,Claude Code 會將 `command`、`http` 與 `mcp_tool` 的預設值降為 30,在 [`MessageDisplay`](#messagedisplay) 上則降為 10。[`SessionEnd`](#sessionend) hook 共用 1.5 秒的時間預算;若您的設定為個別 hook 設定了更長的 `timeout`,Claude Code 會將預算提高以配合,最多 60 秒 |427| `timeout` | 否 | 取消前的秒數。對於以 [`async: true`](#run-hooks-in-the-background) 執行的命令 hook,Claude Code 不會強制執行此值。預設值:`command`、`http` 與 `mcp_tool` 為 600;`prompt` 為 30;`agent` 為 60。在 [`UserPromptSubmit`](#userpromptsubmit)、[`PreModelSwitch`](#premodelswitch) 與 [`PostModelSwitch`](#postmodelswitch) 上,Claude Code 會將 `command`、`http` 與 `mcp_tool` 的預設值降為 30,在 [`MessageDisplay`](#messagedisplay) 上則降為 10。[`SessionEnd`](#sessionend) hook 共用 1.5 秒的時間預算;若您的設定為個別 hook 設定了更長的 `timeout`,Claude Code 會將預算提高以配合,最多 60 秒 |

426| `statusMessage` | 否 | hook 執行期間顯示的自訂轉圈訊息 |428| `statusMessage` | 否 | hook 執行期間顯示的自訂轉圈訊息 |

427| `once` | 否 | 若為 `true`,Claude Code 會在 hook 第一次成功執行後將其移除。執行失敗、以退出碼 2 封鎖或逾時的情況下,hook 會保留,因此在下一個符合的事件上會再次執行。僅對在 [skill frontmatter](#hooks-in-skills-and-agents) 中宣告的 hook 生效;在設定檔與 agent frontmatter 中會被忽略 |429| `once` | 否 | 若為 `true`,Claude Code 會在 hook 第一次成功執行後將其移除。執行失敗、以退出碼 2 封鎖或逾時的情況下,hook 會保留,因此在下一個符合的事件上會再次執行。僅對在 [skill frontmatter](#hooks-in-skills-and-agents) 中宣告的 hook 生效;在設定檔與 agent frontmatter 中會被忽略 |


708 710 

709若您或 Claude 叫用 skill 後,該 skill 的 frontmatter hook 未觸發,請在該工作階段中執行 [`/hooks`](#the-%2Fhooks-menu)。若清單中列出了它們,請參閱 [Hook 未觸發](https://code.claude.com/docs/zh-TW/hooks-guide.md#hook-not-firing)。若清單中一個都未列出,該 skill 可能受到僅限外掛的鎖定,或已超過 hook 上限,因而在沒有任何 frontmatter hook 的情況下執行。請逐一檢查各種情況:711若您或 Claude 叫用 skill 後,該 skill 的 frontmatter hook 未觸發,請在該工作階段中執行 [`/hooks`](#the-%2Fhooks-menu)。若清單中列出了它們,請參閱 [Hook 未觸發](https://code.claude.com/docs/zh-TW/hooks-guide.md#hook-not-firing)。若清單中一個都未列出,該 skill 可能受到僅限外掛的鎖定,或已超過 hook 上限,因而在沒有任何 frontmatter hook 的情況下執行。請逐一檢查各種情況:

710 712 

711* **僅限外掛的鎖定**:您組織的管理員可以透過 [`strictPluginOnlyCustomization`](https://code.claude.com/docs/zh-TW/settings-reference#strictpluginonlycustomization-hooks) 受管設定,將 hook 鎖定為僅限外掛與受管設定。在此鎖定下,只有外掛 skill、[隨附 skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills),或位於[受管設定目錄](https://code.claude.com/docs/zh-TW/managed-settings.md#delivery-mechanisms)中的 skill 才會保留其 frontmatter hook。您自己設定檔中的 hook 也不會執行。713* **僅限外掛的鎖定**:若您隸屬於某個組織,您的管理員可以透過 [`strictPluginOnlyCustomization`](https://code.claude.com/docs/zh-TW/settings-reference#strictpluginonlycustomization-hooks) 受管設定,將 hook 鎖定為僅限外掛與受管設定。在此鎖定下,只有外掛 skill、[隨附 skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills),或位於[受管設定目錄](https://code.claude.com/docs/zh-TW/managed-settings.md#delivery-mechanisms)中的 skill 才會保留其 frontmatter hook。您自己設定檔中的 hook 也不會執行。

712 * **檢查**:在 Claude Code 工作階段中輸入 `/status`。若 [`Setting sources` 行](https://code.claude.com/docs/zh-TW/settings#check-what-your-organization-enforces)包含 `Enterprise managed settings`,請詢問您的管理員 `strictPluginOnlyCustomization` 是否鎖定了 hook。714 * **檢查**:在 Claude Code 工作階段中輸入 `/status`。若 [`Setting sources` 行](https://code.claude.com/docs/zh-TW/settings#check-what-your-organization-enforces)包含 `Enterprise managed settings`,請詢問您的管理員 `strictPluginOnlyCustomization` 是否鎖定了 hook。

713 * **修正**:將該 skill 移入[外掛](https://code.claude.com/docs/zh-TW/plugins/create.md#convert-an-existing-claude-setup),因為外掛 skill 會保留其 frontmatter hook。將該外掛列入[市集](https://code.claude.com/docs/zh-TW/plugins/create-marketplace.md#create-a-marketplace),再從該處安裝。若 Claude Code 以 [`is blocked by enterprise policy`](https://code.claude.com/docs/zh-TW/plugins/troubleshooting#marketplace-source-is-blocked-by-enterprise-policy) 拒絕該市集,請要求您的管理員允許該市集。715 * **修正**:將該 skill 移入[外掛](https://code.claude.com/docs/zh-TW/plugins/create.md#convert-an-existing-claude-setup),因為外掛 skill 會保留其 frontmatter hook。將該外掛列入[市集](https://code.claude.com/docs/zh-TW/plugins/create-marketplace.md#create-a-marketplace),再從該處安裝。若 Claude Code 以 [`is blocked by enterprise policy`](https://code.claude.com/docs/zh-TW/plugins/troubleshooting#marketplace-source-is-blocked-by-enterprise-policy) 拒絕該市集,請要求您的管理員允許該市集。

714* **Hook 上限**:在 Claude Code v2.1.304 或更新版本中,每個 skill 來源在每個工作階段中都有各自的上限。您的專案、您的個人 skill 資料夾,以及每個外掛都算作不同的來源。來自同一來源的 skill 最多可註冊 1,024 個 hook。這些 hook 的 matcher 總計最多 16,384 個字元。底下有多個 hook 的 matcher,會針對每個 hook 各計算一次。716* **Hook 上限**:在 Claude Code v2.1.304 或更新版本中,每個 skill 來源在每個工作階段中都有各自的上限。您的專案、您的個人 skill 資料夾,以及每個外掛都算作不同的來源。來自同一來源的 skill 最多可註冊 1,024 個 hook。這些 hook 的 matcher 總計最多 16,384 個字元。底下有多個 hook 的 matcher,會針對每個 hook 各計算一次。


943 945 

944> [!NOTE]946> [!NOTE]

945>947>

946> 在沒有 Git Bash 的 Windows 上,未設定 `onFailure` 的 shell 形式 `PreToolUse` 或 `PermissionRequest` 命令 hook 失敗時,可能改為[阻止工具呼叫](#failed-hooks-on-windows-without-git-bash)。948> 在沒有 Git Bash 的 Windows 上,未設定 `onFailure` 的 shell 形式 `PreToolUse`、`PermissionRequest` 或 `PreSkillShellCommand` 命令 hook 失敗時,可能改為[阻止操作](#failed-hooks-on-windows-without-git-bash)。

947 949 

948`.claude/settings.json` 中的這個 `PreToolUse` hook 會在每個 Bash 命令之前執行專案指令碼,並在指令碼失敗時阻止該命令:950`.claude/settings.json` 中的這個 `PreToolUse` hook 會在每個 Bash 工具呼叫之前執行專案指令碼,並在指令碼失敗時阻止該命令:

949 951 

950```json theme={null}952```json theme={null}

951{953{


998 1000 

999#### Windows 上沒有 Git Bash 時失敗的 hook1001#### Windows 上沒有 Git Bash 時失敗的 hook

1000 1002 

1001如果被阻止的工具呼叫的錯誤包含以下文字,表示某個 `PreToolUse` 或 `PermissionRequest` 命令 hook 失敗或逾時,並阻止了該呼叫:1003如果被阻止的工具呼叫或 [注入的命令](#preskillshellcommand) 的錯誤包含以下文字,表示某個 `PreToolUse`、`PermissionRequest` 或 `PreSkillShellCommand` 命令 hook 失敗或逾時,並阻止了它:

1002 1004 

1003```text theme={null}1005```text theme={null}

1004blocking because Git Bash wasn't found, so only exit code 0 or 2 counts as this hook's verdict.1006blocking because Git Bash wasn't found, so only exit code 0 or 2 counts as this hook's verdict.


1037| `PermissionRequest` | 否 | 不會被視為決定。請改為透過 [`decision` 物件](#permissionrequest-decision-control) 拒絕 |1039| `PermissionRequest` | 否 | 不會被視為決定。請改為透過 [`decision` 物件](#permissionrequest-decision-control) 拒絕 |

1038| `UserPromptSubmit` | 是 | 阻止提示詞。請參閱 [被阻止的提示詞留下什麼](#what-a-blocked-prompt-leaves-behind) |1040| `UserPromptSubmit` | 是 | 阻止提示詞。請參閱 [被阻止的提示詞留下什麼](#what-a-blocked-prompt-leaves-behind) |

1039| `UserPromptExpansion` | 是 | 阻止擴展 |1041| `UserPromptExpansion` | 是 | 阻止擴展 |

1042| `PreSkillShellCommand` | 是 | 阻止該命令,skill 會在沒有其輸出的情況下載入 |

1040| `Stop` | 是 | 防止 Claude 停止,繼續對話 |1043| `Stop` | 是 | 防止 Claude 停止,繼續對話 |

1041| `SubagentStop` | 是 | 防止 subagent 停止 |1044| `SubagentStop` | 是 | 防止 subagent 停止 |

1042| `TeammateIdle` | 是 | 防止隊友閒置,所以它繼續工作 |1045| `TeammateIdle` | 是 | 防止隊友閒置,所以它繼續工作 |


1213| TaskCreated | 退出碼或頂層 `decision` | 退出碼 2 或 `decision: "block"` [取消任務](#taskcreated-decision-control) 並將訊息返回給 Claude。`continue: false` 被忽略 |1216| TaskCreated | 退出碼或頂層 `decision` | 退出碼 2 或 `decision: "block"` [取消任務](#taskcreated-decision-control) 並將訊息返回給 Claude。`continue: false` 被忽略 |

1214| PreToolUse | `hookSpecificOutput` | `permissionDecision`(allow/deny/ask/defer)、`permissionDecisionReason` |1217| PreToolUse | `hookSpecificOutput` | `permissionDecision`(allow/deny/ask/defer)、`permissionDecisionReason` |

1215| PreModelSwitch | `hookSpecificOutput` 或頂層 `decision` | `permissionDecision`(allow/deny/ask)、`permissionDecisionReason`。`decision: "block"` 也會 [取消切換](#premodelswitch-decision-control) |1218| PreModelSwitch | `hookSpecificOutput` 或頂層 `decision` | `permissionDecision`(allow/deny/ask)、`permissionDecisionReason`。`decision: "block"` 也會 [取消切換](#premodelswitch-decision-control) |

1219| PreSkillShellCommand | `hookSpecificOutput` 或頂層 `decision` | `permissionDecision`、`permissionDecisionReason`。該 hook [只能阻止](#preskillshellcommand-decision-control) |

1216| PermissionRequest | `hookSpecificOutput` | `decision.behavior`(allow/deny) |1220| PermissionRequest | `hookSpecificOutput` | `decision.behavior`(allow/deny) |

1217| PermissionDenied | `hookSpecificOutput` | `retry: true` 告訴模型它可以重試被拒絕的工具呼叫;Claude Code 對於 [no-verdict denials](#permissiondenied-decision-control) 會忽略它 |1221| PermissionDenied | `hookSpecificOutput` | `retry: true` 告訴模型它可以重試被拒絕的工具呼叫;Claude Code 對於 [no-verdict denials](#permissiondenied-decision-control) 會忽略它 |

1218| WorktreeCreate | 路徑返回 | 命令 hook 在 stdout 上列印路徑;HTTP hook 返回 `hookSpecificOutput.worktreePath`。Hook 失敗或缺少路徑會導致建立失敗 |1222| WorktreeCreate | 路徑返回 | 命令 hook 在 stdout 上列印路徑;HTTP hook 返回 `hookSpecificOutput.worktreePath`。Hook 失敗或缺少路徑會導致建立失敗 |


1229* `PostToolUse`:`updatedToolOutput` 替換工具的結果。請參閱 [PostToolUse 決定控制](#posttooluse-decision-control),包括在 [Cowork](https://claude.com/docs/cowork/overview) 雲端工作階段中的限制1233* `PostToolUse`:`updatedToolOutput` 替換工具的結果。請參閱 [PostToolUse 決定控制](#posttooluse-decision-control),包括在 [Cowork](https://claude.com/docs/cowork/overview) 雲端工作階段中的限制

1230* `UserPromptSubmit`:無法替換提示詞;僅在其旁邊注入 `additionalContext`1234* `UserPromptSubmit`:無法替換提示詞;僅在其旁邊注入 `additionalContext`

1231 1235 

1232對於遮蔽或轉換使用案例,在 `PreToolUse` 攔截外送的工具輸入,在 `PostToolUse` 攔截成功呼叫的結果。`PostToolUseFailure` 無法重寫結果,因此無法遮蔽失敗命令的輸出。

1233 

1234以下是每種模式的實際範例:1236以下是每種模式的實際範例:

1235 1237 

1236> [tab] 頂層決定1238> [tab] 頂層決定


1654}1656}

1655```1657```

1656 1658 

1659### PreSkillShellCommand

1660 

1661在[注入的命令](https://code.claude.com/docs/zh-TW/skills.md#inject-dynamic-context)執行之前執行;注入的命令是在 skill 或 `/security-review` 等命令載入時執行的 shell 命令。[PreToolUse](#pretooluse) hook 不會針對注入的命令觸發。若要使用您已在 PreToolUse 上執行的腳本來記錄或阻擋這些命令,也請將該腳本加入此事件。在 skill 的檔案中,注入的命令會以 `` !`<command>` `` 或 ` ```! ` 區塊的形式出現。

1662 

1663需要 Claude Code v2.1.332 或更新版本,包括桌面應用程式與 VS Code 擴充功能。請在新增 hook 之前先更新,因為較早的版本會在不呼叫它的情況下執行注入的命令。如果您先將它加入設定檔,v2.1.331 等較早版本會在每個互動式終端機工作階段開啟時顯示[警告對話方塊](https://code.claude.com/docs/zh-TW/settings.md#fix-a-broken-settings-file):`Unknown hook event "PreSkillShellCommand" was ignored`。若要強制最低版本,請參閱 [`requiredMinimumVersion`](https://code.claude.com/docs/zh-TW/settings-reference#requiredminimumversion)。

1664 

1665對於必須阻擋命令的 hook,請以下列方式設定 matcher、類型、位置與失敗處理:

1666 

1667* **Matcher**:使用 `Bash|PowerShell` 以涵蓋[執行注入命令的兩種工具](https://code.claude.com/docs/zh-TW/skills.md#how-injected-commands-run)。

1668* **類型**:使用非[非同步](#run-hooks-in-the-background)的 `command`、`http` 或 `mcp_tool` hook,因為非同步 hook 無法阻擋。如果您在此事件上設定 `prompt` 或 `agent` hook,Claude Code 無法執行它,並會阻擋該 hook 比對到的每個命令。

1669* **位置**:在[設定檔](#hook-locations)(例如受管設定)或外掛中定義 hook。skill 在工作階段中首次載入時,以及在 subagent 內載入時,其注入的命令執行時不會套用其自身 frontmatter 中的 hook。[分叉的 skill](https://code.claude.com/docs/zh-TW/skills.md#run-skills-in-a-subagent) 的注入命令執行時,不會套用其自身 frontmatter 或其 subagent 定義中的 hook。

1670* **失敗**:設定 [`onFailure: "block"`](#block-the-action-when-a-hook-fails),讓命令在 hook 失敗或逾時時不會執行。

1671 

1672您可以重複使用[hook 的解析方式](#how-a-hook-resolves)中的阻擋腳本。

1673 

1674在 macOS 與 Linux 上,`.claude/settings.json` 中的此項目會以 [exec 形式](#exec-form-and-shell-form)執行該腳本:

1675 

1676```json theme={null}

1677{

1678 "hooks": {

1679 "PreSkillShellCommand": [

1680 {

1681 "matcher": "Bash|PowerShell",

1682 "hooks": [

1683 { "type": "command", "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh", "args": [], "onFailure": "block" }

1684 ]

1685 }

1686 ]

1687 }

1688}

1689```

1690 

1691在 Windows 上,請將此項目中的 `command` 與 `args` 替換為[hook 的解析方式](#how-a-hook-resolves)中 Windows 分頁的對應內容。

1692 

1693若要在 macOS 或 Linux 上測試此範例,請建立 `.claude/skills/hook-test/SKILL.md`,內容僅有一行 `` !`echo 'rm -rf'` ``。這個[唯讀命令](https://code.claude.com/docs/zh-TW/permissions.md#read-only-commands)不需要核准,也不會刪除任何內容。在終端機中啟動工作階段並輸入 `/hook-test`。您會看到 `Not run in /hook-test: echo 'rm -rf' (blocked by hook: Destructive command blocked by hook)`。

1694 

1695#### 會到達 PreSkillShellCommand hook 的命令

1696 

1697您的腳本會在[注入命令的權限檢查](https://code.claude.com/docs/zh-TW/skills.md#permission-checks-on-injected-commands)之後執行,因此它收到的是通過檢查的命令。它也會在 `bypassPermissions` 模式下執行。

1698 

1699在自動模式下,原本需要核准的命令不會在 skill 載入時執行。Claude 之後可以透過工具呼叫執行它,這會觸發 `PreToolUse` 而非此事件,因此請將您的腳本同時保留在兩個事件上。

1700 

1701#### PreSkillShellCommand 輸入

1702 

1703除了包含 `permission_mode` 的[通用輸入欄位](#common-input-fields)之外,PreSkillShellCommand hook 還會收到下表中的欄位:

1704 

1705| 欄位 | 說明 |

1706| :- | :- |

1707| `tool_name` | 執行命令的工具,`Bash` 或 `PowerShell` |

1708| `tool_input.command` | 將要執行的 shell 命令 |

1709| `tool_use_id` | 此命令的 ID,它不對應逐字稿中的任何工具呼叫 |

1710| `command_name` | 正在載入的 skill 或命令名稱,例如 `pr-summary`,或外掛 skill 的 `my-plugin:deploy` |

1711| `command_source` | skill 或命令的來源,例如 `userSettings`、`projectSettings`、`policySettings`、`plugin` 或 `builtin` |

1712| `invoked_by` | 當您輸入 skill 名稱或 Agent SDK 應用程式送出它時為 `"user"`;當 Claude 或[工作階段範圍的排程任務](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)叫用該 skill 時為 `"claude"`。其他情況為 `"other"`,例如[預先載入該 skill](https://code.claude.com/docs/zh-TW/sub-agents.md#preload-skills-into-subagents) 的 subagent。 |

1713 

1714#### PreSkillShellCommand 決策控制

1715 

1716若要阻擋注入的命令,請讓您的腳本以退出碼 2 結束或傳回 `permissionDecision: "deny"`,skill 就會在不執行該命令的情況下載入。您可以從此 hook 阻擋命令,但無法核准或修改命令。

1717 

1718若要使用 JSON 回應,請使用 [PreToolUse 格式](#pretooluse-decision-control)。若要在兩個事件上使用同一個腳本,請將 `hookEventName` 保留為 `PreToolUse`。對於只在此事件上執行的腳本,您可以將 `hookEventName` 設為 `PreSkillShellCommand`。

1719 

1720| Hook 結果 | 會發生什麼 |

1721| :- | :- |

1722| 以退出碼 0 結束且未做出決策,或 `permissionDecision: "allow"` | 除非另一個 hook 阻擋,否則命令會執行 |

1723| 退出碼 2、`permissionDecision: "deny"` 或頂層 `decision: "block"` | 命令不會執行。skill 仍會載入,且 Claude 會讀到 `[not run: blocked by hook: <reason>]` 以取代命令的輸出。 |

1724| `permissionDecision: "ask"` 或 `"defer"`,或任何 `updatedInput` | Claude Code 會以與 `"deny"` 相同的方式阻擋命令 |

1725| `continue: false` | 叫用 skill 會失敗並顯示 `Operation stopped by hook: <stopReason>`。其注入的命令都不會執行,因為 Claude Code 會在執行第一個命令之前收集所有 hook 的回應。 |

1726| `command`、`http` 或 `mcp_tool` hook 失敗(例如以退出碼 1 結束且無 JSON 輸出)或逾時 | 除非該 hook 是[失敗時會阻擋動作的 hook](#block-the-action-when-a-hook-fails),否則命令會執行。在 Claude 已執行過程式碼的 [Code Mode](https://code.claude.com/docs/zh-TW/code-mode.md#tool-call-refused-by-a-hook) 工作階段中,逾時預設會阻擋命令。 |

1727 

1728當您在終端機中輸入 skill 名稱時,`Not run in /<name>` 行會回報被阻擋的命令。`Ran anyway in /<name>` 行則回報在其 hook 失敗或逾時後仍執行的命令。

1729 

1730若要提供阻擋原因,請在以退出碼 2 結束時將原因寫入 stderr。在 JSON 中,請將原因放在 `permissionDecisionReason`,或放在與頂層 `decision` 並列的 `reason` 中。當 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 連線時,hook 仍會阻擋,但您和 Claude 都看不到原因。請在[偵錯日誌](#debug-hooks)中查看。

1731 

1657### MessageDisplay1732### MessageDisplay

1658 1733 

1659在助理訊息串流顯示到螢幕上時執行。Claude Code 會分段顯示訊息:每當有一批新完成的行準備好呈現時,hook 會以這些行執行一次,Claude Code 則在其位置呈現 hook 的替換文字。長訊息會產生多次呼叫;短訊息可能只產生一次。1734在助理訊息串流顯示到螢幕上時執行。Claude Code 會分段顯示訊息:每當有一批新完成的行準備好呈現時,hook 會以這些行執行一次,Claude Code 則在其位置呈現 hook 的替換文字。長訊息會產生多次呼叫;短訊息可能只產生一次。


1791 1866 

1792> [!WARNING]1867> [!WARNING]

1793>1868>

1794> PreToolUse 只在 Claude 呼叫工具時執行。預設情況下,您[在提示詞中以 `@` 參照](https://code.claude.com/docs/zh-TW/common-workflows#reference-files-and-directories)的檔案會在沒有任何工具呼叫的情況下加入。Claude Code 會在建構提示詞時插入其內容,因此不會為它們觸發任何 PreToolUse hook,包括比對 `Read` 的 hook。PreToolUse 也不會針對 [`EndConversation`](https://code.claude.com/docs/zh-TW/tools-reference#endconversation-tool-behavior) 觸發。1869> PreToolUse 會在 Claude 呼叫工具時執行。它不會針對[注入的命令](https://code.claude.com/docs/zh-TW/skills.md#inject-dynamic-context)觸發;注入的命令是通過[權限檢查](https://code.claude.com/docs/zh-TW/skills.md#permission-checks-on-injected-commands)並在 skill 載入時執行的 shell 命令。若要記錄或阻擋這些命令,請新增 [PreSkillShellCommand](#preskillshellcommand) hook。

1870>

1871> 預設情況下,您[在提示詞中以 `@` 參照](https://code.claude.com/docs/zh-TW/common-workflows#reference-files-and-directories)的檔案會在沒有任何工具呼叫的情況下加入。Claude Code 會在建構提示詞時插入其內容,因此不會有任何 PreToolUse hook 針對它們觸發,包括比對 `Read` 的 hook。PreToolUse 也不會針對 [`EndConversation`](https://code.claude.com/docs/zh-TW/tools-reference#endconversation-tool-behavior) 觸發。

1795>1872>

1796> 您可以阻擋特定路徑被 `@` 參照,或關閉插入功能:1873> 您可以阻擋特定路徑被 `@` 參照,或關閉插入功能:

1797>1874>


4031* `PostModelSwitch`4108* `PostModelSwitch`

4032* `PreCompact`4109* `PreCompact`

4033* `PreModelSwitch`4110* `PreModelSwitch`

4111* `PreSkillShellCommand`

4034* `SessionEnd`4112* `SessionEnd`

4035* `StopFailure`4113* `StopFailure`

4036* `SubagentStart`4114* `SubagentStart`

hooks-guide.md +5 −1

Details

475| `Setup` | 當您使用 `--init-only` 啟動 Claude Code,或在 `-p` 模式中使用 `--init` 或 `--maintenance` 時。用於 CI 或指令碼中的一次性準備 |475| `Setup` | 當您使用 `--init-only` 啟動 Claude Code,或在 `-p` 模式中使用 `--init` 或 `--maintenance` 時。用於 CI 或指令碼中的一次性準備 |

476| `UserPromptSubmit` | 當提示詞被提交時,在 Claude 處理之前。也會在 [Claude Code 自行開始的回合](https://code.claude.com/docs/zh-TW/hooks.md#userpromptsubmit)上觸發 |476| `UserPromptSubmit` | 當提示詞被提交時,在 Claude 處理之前。也會在 [Claude Code 自行開始的回合](https://code.claude.com/docs/zh-TW/hooks.md#userpromptsubmit)上觸發 |

477| `UserPromptExpansion` | 當使用者輸入的命令擴展為提示詞時,在到達 Claude 之前。可以阻止擴展 |477| `UserPromptExpansion` | 當使用者輸入的命令擴展為提示詞時,在到達 Claude 之前。可以阻止擴展 |

478| `PreSkillShellCommand` | 在 skill 的[注入 shell 命令](https://code.claude.com/docs/zh-TW/skills.md#inject-dynamic-context)執行之前。可以阻止該命令 |

478| `PreToolUse` | 在工具呼叫執行之前。可以阻止它 |479| `PreToolUse` | 在工具呼叫執行之前。可以阻止它 |

479| `PermissionRequest` | 當工具呼叫需要權限決定時 |480| `PermissionRequest` | 當工具呼叫需要權限決定時 |

480| `PermissionDenied` | 當自動模式拒絕工具呼叫時,包括沒有分類器判決的拒絕。使用 JSON `hookSpecificOutput.retry: true` 告訴模型它可能重試被拒絕的工具呼叫。Claude Code 在分類器未產生判決時忽略 `retry` |481| `PermissionDenied` | 當自動模式拒絕工具呼叫時,包括沒有分類器判決的拒絕。使用 JSON `hookSpecificOutput.retry: true` 告訴模型它可能重試被拒絕的工具呼叫。Claude Code 在分類器未產生判決時忽略 `retry` |


694| `ElicitationResult` | MCP 伺服器名稱 | 與 `Elicitation` 相同的值 |695| `ElicitationResult` | MCP 伺服器名稱 | 與 `Elicitation` 相同的值 |

695| `FileChanged` | 要監視的字面檔案名稱(請參閱 [FileChanged](https://code.claude.com/docs/zh-TW/hooks.md#filechanged)) | `.envrc\|.env` |696| `FileChanged` | 要監視的字面檔案名稱(請參閱 [FileChanged](https://code.claude.com/docs/zh-TW/hooks.md#filechanged)) | `.envrc\|.env` |

696| `UserPromptExpansion` | 命令名稱 | 您的技能或命令名稱 |697| `UserPromptExpansion` | 命令名稱 | 您的技能或命令名稱 |

698| `PreSkillShellCommand` | 執行該命令的工具 | `Bash`、`PowerShell` |

697| `UserPromptSubmit`、`PostToolBatch`、`Stop`、`TeammateIdle`、`TaskCreated`、`TaskCompleted`、`WorktreeCreate`、`WorktreeRemove`、`CwdChanged`、`MessageDisplay` | 不支援匹配器 | 始終在每次出現時觸發 |699| `UserPromptSubmit`、`PostToolBatch`、`Stop`、`TeammateIdle`、`TaskCreated`、`TaskCompleted`、`WorktreeCreate`、`WorktreeRemove`、`CwdChanged`、`MessageDisplay` | 不支援匹配器 | 始終在每次出現時觸發 |

698 700 

699下面的標籤顯示不同事件類型上的一些其他匹配器。701下面的標籤顯示不同事件類型上的一些其他匹配器。


805 807 

806`if` 欄位接受與權限規則相同的模式:`"Bash(git *)"`、`"Edit(*.ts)"` 等。要匹配多個工具名稱,請使用各自具有自己 `if` 值的單獨處理程式,或在支援管道替代的 `matcher` 級別進行匹配。808`if` 欄位接受與權限規則相同的模式:`"Bash(git *)"`、`"Edit(*.ts)"` 等。要匹配多個工具名稱,請使用各自具有自己 `if` 值的單獨處理程式,或在支援管道替代的 `matcher` 級別進行匹配。

807 809 

808`if` 只適用於工具事件:`PreToolUse`、`PostToolUse`、`PostToolUseFailure`、`PermissionRequest` 和 `PermissionDenied`。將其新增到任何其他事件會防止 hook 執行。810> [!NOTE]

811>

812> `if` 只適用於 `PreToolUse`、`PostToolUse`、`PostToolUseFailure`、`PermissionRequest`、`PermissionDenied` 和 `PreSkillShellCommand`。如果您將其新增到任何其他事件,該 hook 不會執行。

809 813 

810### 設定 hook 位置814### 設定 hook 位置

811 815 

Details

18 18 

19迴圈會根據您的要求進行調整。關於您程式碼庫的問題可能只需要收集上下文。錯誤修復會反覆循環所有三個階段。重構可能涉及廣泛的驗證。Claude 根據從上一步學到的內容決定每一步需要什麼,將數十個操作鏈接在一起,並沿途進行課程修正。19迴圈會根據您的要求進行調整。關於您程式碼庫的問題可能只需要收集上下文。錯誤修復會反覆循環所有三個階段。重構可能涉及廣泛的驗證。Claude 根據從上一步學到的內容決定每一步需要什麼,將數十個操作鏈接在一起,並沿途進行課程修正。

20 20 

21您也是這個迴圈的一部分。您可以在任何時刻中斷以引導 Claude 朝不同方向發展、提供額外上下文,或要求它嘗試不同的方法。Claude 自主工作,但對您的輸入保持回應。21您也是這個迴圈的一部分。您可以在任何時刻中斷以引導 Claude 朝不同方向發展、提供額外上下文,或要求它嘗試不同的方法。

22 22 

23代理迴圈由兩個元件提供動力:[模型](#models)進行推理,[工具](#tools)採取行動。Claude Code 是 Claude 周圍的層,提供工具並管理模型看到的上下文。這個周圍層就是術語代理工具所指的。23代理迴圈由兩個元件提供動力:[模型](#models)進行推理,[工具](#tools)採取行動。Claude Code 是 Claude 周圍的層,提供工具並管理模型看到的上下文。這個周圍層就是術語代理工具所指的。

24 24 


88 88 

89### 介面89### 介面

90 90 

91您可以透過終端機、[桌面應用程式](https://code.claude.com/docs/zh-TW/desktop.md)、[IDE 擴展](https://code.claude.com/docs/zh-TW/vs-code.md)、[claude.ai/code](https://claude.ai/code)、[遠端控制](https://code.claude.com/docs/zh-TW/remote-control.md)、[Slack](https://code.claude.com/docs/zh-TW/slack.md) 和 [CI/CD 管道](https://code.claude.com/docs/zh-TW/github-actions.md)存取 Claude Code。介面決定了您如何看到和與 Claude 互動,但底層代理迴圈是相同的。請參閱[在任何地方使用 Claude Code](https://code.claude.com/docs/zh-TW/overview.md#use-claude-code-everywhere)以取得完整清單。91您可以透過終端機、[桌面應用程式](https://code.claude.com/docs/zh-TW/desktop.md)、[IDE 擴充功能](https://code.claude.com/docs/zh-TW/vs-code.md)、[claude.ai/code](https://claude.ai/code)、[Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 和 [CI/CD 管道](https://code.claude.com/docs/zh-TW/github-actions.md)存取 Claude Code。介面決定了您如何看到 Claude 以及與其互動,但底層的代理式迴圈是相同的。請參閱[在任何地方使用 Claude Code](https://code.claude.com/docs/zh-TW/overview.md#use-claude-code-everywhere)以取得清單。

92 92 

93## 使用會話93## 使用會話

94 94 


131 131 

132#### 當上下文填滿時132#### 當上下文填滿時

133 133 

134Claude Code 在您接近限制時自動管理上下文。它會將對話壓縮成摘要。摘要會保留您的請求和關鍵程式碼片段,但對話早期的詳細指示可能會丟失。將持久規則放在 CLAUDE.md 中,而不是依賴對話歷史。134Claude Code 在您接近限制時自動管理上下文。它會將對話壓縮成摘要。摘要會保留您的請求和關鍵程式碼片段,但對話早期的詳細指示可能會丟失。將持久規則放在 CLAUDE.md 中。

135 135 

136要控制在壓縮期間保留的內容,請在 CLAUDE.md 中新增「Compact Instructions」部分或使用焦點執行 `/compact`(如 `/compact focus on the API changes`)。136要控制在壓縮期間保留的內容,請在 CLAUDE.md 中新增「Compact Instructions」部分或使用焦點執行 `/compact`(如 `/compact focus on the API changes`)。

137 137 

Details

35 35 

36### 範例 monorepo36### 範例 monorepo

37 37 

38本頁面的範例參考了一個具有三個套件的 monorepo。相同的模式適用於大型單樹程式碼庫:其中範例使用 `packages/api/`,請替換為您自己的子系統目錄,例如 `src/backend/` 或 `lib/core/`。38本頁面的範例參考了一個具有三個套件的 monorepo。當範例使用 `packages/api/` 時,請替換為您自己的子系統目錄,例如 `src/backend/` 或 `lib/core/`。

39 39 

40```text theme={null}40```text theme={null}

41monorepo/41monorepo/

Details

162 162 

163## 配置每個介面163## 配置每個介面

164 164 

165CLI 讀取上面的環境變數和設定檔案。其他介面是 VS Code 擴充功能、桌面應用程式、GitHub Actions、Agent SDK 和雲端介面(例如 Slack 和網頁);下面的部分涵蓋這些設定是否到達每一個。165CLI 讀取上面的環境變數和設定檔案。其他使用介面是 VS Code 擴充功能、桌面應用程式、GitHub Actions、Agent SDK,以及雲端使用介面(例如 Claude Tag 和網頁)。下面的各節說明這些設定是否會套用到每一個使用介面。

166 166 

167### VS Code 擴充功能167### VS Code 擴充功能

168 168 


255)255)

256```256```

257 257 

258### Slack、雲端會話和遠端控制258### 雲端工作階段、Claude Tag 和 Remote Control

259 259 

260[Slack 中的 Claude Code](https://code.claude.com/docs/zh-TW/slack.md) 和[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)不屬於閘道部署的一部分。在雲端工作階段的環境設定中設定的閘道變數不會套用。如果您的流量必須保留在閘道上,請不要為這些使用者啟用這些使用介面。260[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)和 [Claude Tag](https://claude.com/docs/claude-tag/overview) 不屬於閘道部署的一部分。如果您的流量必須保留在閘道上,請關閉這些使用介面。

261 261 

262[Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 和[語音聽寫](https://code.claude.com/docs/zh-TW/voice-dictation.md)都依賴於 claude.ai 身分:Remote Control 用於將即時工作階段與您的帳戶配對,語音聽寫用於到達 claude.ai 轉錄端點。當 `ANTHROPIC_API_KEY`、`ANTHROPIC_AUTH_TOKEN` 或 `apiKeyHelper` 處於活動狀態時,它們無法使用。Remote Control 在 `ANTHROPIC_BASE_URL` 指向非 Anthropic 主機時也會被停用,因此僅使用 claude.ai 登入本身是不夠的。262[Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 和[語音聽寫](https://code.claude.com/docs/zh-TW/voice-dictation.md)都依賴於 claude.ai 身分:Remote Control 用於將即時工作階段與您的帳戶配對,語音聽寫用於到達 claude.ai 轉錄端點。當 `ANTHROPIC_API_KEY`、`ANTHROPIC_AUTH_TOKEN` 或 `apiKeyHelper` 處於活動狀態時,它們無法使用。Remote Control 在 `ANTHROPIC_BASE_URL` 指向非 Anthropic 主機時也會被停用,因此僅使用 claude.ai 登入本身是不夠的。

263 263 

Details

123 123 

124## Claude Code 如何結合受管來源124## Claude Code 如何結合受管來源

125 125 

126如果您在 claude.ai 的 **Organization settings > Desktop 3P** 下設定提供者或閘道,請先閱讀 Enterprise Admin Console 指南中的 [哪些設定優先](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority)。126如果您在 claude.ai 的 [**Organization settings > Desktop 3P**](https://claude.ai/admin-settings/desktop-deployment) 下設定提供者或閘道,請先閱讀 Enterprise Admin Console 指南中的 [哪些設定優先](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority)。

127 127 

128當您的組織向同一台機器提供多個受管來源時,[`managedSourcesBehavior`](https://code.claude.com/docs/zh-TW/settings-reference#managedsourcesbehavior) 金鑰決定 Claude Code 對其他來源的處理方式:128當您的組織向同一台機器提供多個受管來源時,[`managedSourcesBehavior`](https://code.claude.com/docs/zh-TW/settings-reference#managedsourcesbehavior) 金鑰決定 Claude Code 對其他來源的處理方式:

129 129 


333* 空的受管理設定檔案計為 `{}`。333* 空的受管理設定檔案計為 `{}`。

334* 使用者可寫的 HKCU 登錄檔金鑰中的格式不正確的值永遠不會阻止啟動。Claude Code 將其報告為 `/status` 和 `claude doctor` 中的通知。334* 使用者可寫的 HKCU 登錄檔金鑰中的格式不正確的值永遠不會阻止啟動。Claude Code 將其報告為 `/status` 和 `claude doctor` 中的通知。

335 335 

336當受管理設定檔案、drop-in 檔案、`managed-settings.d/` 目錄、MDM 設定檔或 HKLM 登錄檔值存在但無法讀取,且沒有管理員來源提供政策時,發生的情況取決於讀取失敗的原因:336當受管理設定檔案、drop-in 檔案、`managed-settings.d/` 目錄或 MDM 設定檔存在但無法讀取,且沒有管理員來源提供政策時,除非存取遭拒,否則工作階段會退出:

337 337 

338* 如果作業系統拒絕讀取,例如在僅限根目錄的檔案上,每個工作階段都會在沒有該來源政策的情況下啟動。`/status` 和 `claude doctor` 記錄失敗,使用 `-p` 執行也會將其列印到 stderr。338* 如果作業系統拒絕讀取,例如在僅限根目錄的檔案上,每個工作階段都會在沒有該來源政策的情況下啟動。`/status` 和 `claude doctor` 記錄失敗,使用 `-p` 執行也會將其列印到 stderr。

339* 對於任何其他讀取失敗,例如 I/O 錯誤,每個工作階段都會在啟動時退出,並顯示[聯絡管理員的訊息](https://code.claude.com/docs/zh-TW/errors.md#unable-to-read-managed-policy-settings)。339* 對於任何其他讀取失敗,例如 I/O 錯誤,每個工作階段都會在啟動時退出,並顯示[聯絡管理員的訊息](https://code.claude.com/docs/zh-TW/errors.md#unable-to-read-managed-policy-settings)。

mcp.md +3 −3

Details

246 246 

247#### 伺服器狀態247#### 伺服器狀態

248 248 

249`claude mcp add` 會印出一行 `Added ...` 以確認新增成功,這表示設定已寫入。若命令改為印出 `was not saved` 訊息,請參閱 [MCP server was not saved or removed](https://code.claude.com/docs/zh-TW/errors.md#mcp-server-was-not-saved-or-removed);若為 `may not have been saved` 訊息,請參閱 [MCP server may not have been saved or removed](https://code.claude.com/docs/zh-TW/errors.md#mcp-server-may-not-have-been-saved-or-removed)。249`claude mcp add` 會印出一行 `Added ...` 以確認新增成功,這表示設定已寫入。若命令改為印出 `was not saved` 訊息,請參閱 [MCP 伺服器未被儲存或移除](https://code.claude.com/docs/zh-TW/errors.md#mcp-server-was-not-saved-or-removed);若為 `may not have been saved` 訊息,請參閱 [MCP 伺服器可能未被儲存或移除](https://code.claude.com/docs/zh-TW/errors.md#mcp-server-may-not-have-been-saved-or-removed)。

250 250 

251`claude mcp list` 會在列出的每個伺服器旁顯示健康狀態,例如 `✔ Connected`、`! Needs authentication` 或 `✘ Failed to connect`。失敗狀態表示 Claude Code 無法連線至該伺服器,而不是 list 命令失敗。251`claude mcp list` 會在列出的每個伺服器旁顯示健康狀態,例如 `✔ Connected`、`! Needs authentication` 或 `✘ Failed to connect`。失敗狀態表示 Claude Code 無法連線至該伺服器,而不是 list 命令失敗。

252 252 


1231 1231 

1232### 限制 OAuth 範圍1232### 限制 OAuth 範圍

1233 1233 

1234設定 `oauth.scopes` 以固定 Claude Code 在授權流程期間請求的範圍。這是當上游授權伺服器公告的範圍超過您想授予的範圍時,將 MCP 伺服器限制為安全團隊批准的子集的支援方式。該值是單個空格分隔的字串,符合 RFC 6749 §3.3 中的 `scope` 參數格式。1234設定 `oauth.scopes` 以固定 Claude Code 在授權流程期間請求的範圍。這是當上游授權伺服器公告的範圍超過您想授予的範圍時,將 MCP 伺服器限制為已核准子集的支援方式。該值是單個空格分隔的字串,符合 RFC 6749 §3.3 中的 `scope` 參數格式。

1235 1235 

1236```json theme={null}1236```json theme={null}

1237{1237{


1847/docs:pdf report.pdf1847/docs:pdf report.pdf

1848```1848```

1849 1849 

1850連接器和外掛伺服器會加上前綴,例如名為 Docs 的連接器為 `claude_ai_Docs:pdf`,或來自 `my-plugin` 的 `docs` 伺服器為 `plugin_my-plugin_docs:pdf`。在 `<server>` 中,空格以及 `-` 以外的標點符號會變成 `_`。1850連接器和外掛伺服器會加上前綴,例如名為 Docs 的連接器為 `claude_ai_Docs:pdf`,或來自 `my-plugin` 的 `docs` 伺服器為 `plugin_my-plugin_docs:pdf`。在 `<server>` 中,空格以及除 `-` 以外的標點符號都會變成 `_`。

1851 1851 

1852### MCP skills 的核准1852### MCP skills 的核准

1853 1853 

memory.md +2 −2

Details

67 67 

68### 設定專案 CLAUDE.md68### 設定專案 CLAUDE.md

69 69 

70專案 CLAUDE.md 可以儲存在 `./CLAUDE.md` 或 `./.claude/CLAUDE.md` 中。建立此檔案並新增適用於在專案上工作的任何人的指令:建置和測試命令、編碼標準、架構決策、命名慣例和常見工作流程。這些指令透過版本控制與您的團隊共享,因此請專注於專案級標準而不是個人偏好設定。70專案 CLAUDE.md 可以儲存在 `./CLAUDE.md` 或 `./.claude/CLAUDE.md` 中。建立此檔案並新增適用於在專案上工作的任何人的指令:建置和測試命令、編碼標準、架構決策、命名慣例和常見工作流程。這些指令透過版本控制共享,因此請專注於專案級標準而不是個人偏好設定。

71 71 

72若要確認檔案已載入,請在工作階段中執行 [`/context all`](https://code.claude.com/docs/zh-TW/commands#all-commands) 並檢查 **Memory files** 下的清單。在[全螢幕模式](https://code.claude.com/docs/zh-TW/fullscreen.md)中,單獨使用 `/context` 會收合該清單。72若要確認檔案已載入,請在工作階段中執行 [`/context all`](https://code.claude.com/docs/zh-TW/commands#all-commands) 並檢查 **Memory files** 下的清單。在[全螢幕模式](https://code.claude.com/docs/zh-TW/fullscreen.md)中,單獨使用 `/context` 會收合該清單。

73 73 


393| `claude-md-or-agents-md` | 您的 `CLAUDE.md` 檔案,或當您在工作目錄或其上方沒有 `CLAUDE.md` 或 `CLAUDE.local.md` 時的 `AGENTS.md` 檔案。這是預設值 |393| `claude-md-or-agents-md` | 您的 `CLAUDE.md` 檔案,或當您在工作目錄或其上方沒有 `CLAUDE.md` 或 `CLAUDE.local.md` 時的 `AGENTS.md` 檔案。這是預設值 |

394| `claude-md-and-agents-md` | 您的 `CLAUDE.md` 和 `AGENTS.md` 檔案一起,每個目錄的 `CLAUDE.md` 檔案優先,其 `AGENTS.md` 在之後。Claude Code 會跳過已經載入的 `AGENTS.md`,因此您的 `CLAUDE.md` 匯入或符號連結到的 `AGENTS.md` 不會讀取兩次 |394| `claude-md-and-agents-md` | 您的 `CLAUDE.md` 和 `AGENTS.md` 檔案一起,每個目錄的 `CLAUDE.md` 檔案優先,其 `AGENTS.md` 在之後。Claude Code 會跳過已經載入的 `AGENTS.md`,因此您的 `CLAUDE.md` 匯入或符號連結到的 `AGENTS.md` 不會讀取兩次 |

395| `claude-md` | 僅您的 `CLAUDE.md` 檔案 |395| `claude-md` | 僅您的 `CLAUDE.md` 檔案 |

396| `managed-only` | 僅您組織的受管 `CLAUDE.md` 和啟動時的[自動記憶](#auto-memory)。您的專案、本機和使用者 `CLAUDE.md` 檔案、您的 `.claude/rules/` 檔案和每個 `AGENTS.md` 都被排除在外。子目錄的 `CLAUDE.md` 和 `.claude/rules/` 檔案,以及[路徑範圍規則](#path-specific-rules),仍會按需載入 |396| `managed-only` | 僅受管 `CLAUDE.md` 和啟動時的[自動記憶](#auto-memory)。您的專案、本機和使用者 `CLAUDE.md` 檔案、您的 `.claude/rules/` 檔案和每個 `AGENTS.md` 都被排除在外。子目錄的 `CLAUDE.md` 和 `.claude/rules/` 檔案,以及[路徑範圍規則](#path-specific-rules),仍會按需載入 |

397 397 

398您也可以在設定檔中設定值,而不是使用 `/config`。將它新增到 [`pluginConfigs`](https://code.claude.com/docs/zh-TW/settings-reference#pluginconfigs) 中的 `cc-plugin-agents-md@builtin` 下,這是讀取 `AGENTS.md` 的內建外掛的 ID。Claude Code 會從 `~/.claude/settings.json`、`--settings` 檔案或[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)中讀取該項目,並在專案和本機設定檔中忽略它。此範例讓 Claude 讀取兩個檔案:398您也可以在設定檔中設定值,而不是使用 `/config`。將它新增到 [`pluginConfigs`](https://code.claude.com/docs/zh-TW/settings-reference#pluginconfigs) 中的 `cc-plugin-agents-md@builtin` 下,這是讀取 `AGENTS.md` 的內建外掛的 ID。Claude Code 會從 `~/.claude/settings.json`、`--settings` 檔案或[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)中讀取該項目,並在專案和本機設定檔中忽略它。此範例讓 Claude 讀取兩個檔案:

399 399 

mobile.md +1 −2

Details

24 24 

25**2. 登入**25**2. 登入**

26 26 

27使用您用於 Claude Code 的相同 claude.ai 帳戶和組織登入。雲端工作階段和遠端控制需要 claude.ai 帳戶,因此無法透過 Anthropic Console API 金鑰或來自 Amazon Bedrock 等第三方提供者的帳戶存取。27使用您用於 Claude Code 的相同 claude.ai 帳戶登入;如果您隸屬於某個組織,也請使用相同的組織。雲端工作階段和 Remote Control 需要 claude.ai 帳戶,因此無法透過 Anthropic Console API 金鑰或來自 Amazon Bedrock 等第三方提供者的帳戶存取。

28 28 

29**3. 開啟 Code 標籤**29**3. 開啟 Code 標籤**

30 30 


86* [遠端控制](https://code.claude.com/docs/zh-TW/remote-control.md):從任何裝置繼續本機工作階段86* [遠端控制](https://code.claude.com/docs/zh-TW/remote-control.md):從任何裝置繼續本機工作階段

87* [來自 Dispatch 的工作階段](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch):Dispatch 工作如何在桌面應用程式中成為 Code 工作階段87* [來自 Dispatch 的工作階段](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch):Dispatch 工作如何在桌面應用程式中成為 Code 工作階段

88* [Channels](https://code.claude.com/docs/zh-TW/channels.md):在工作在您的機器上執行時,透過 Telegram、Discord 或 iMessage 從您的手機詢問 Claude 一些事情88* [Channels](https://code.claude.com/docs/zh-TW/channels.md):在工作在您的機器上執行時,透過 Telegram、Discord 或 iMessage 從您的手機詢問 Claude 一些事情

89* [Claude Code 在 Slack 中](https://code.claude.com/docs/zh-TW/slack.md):透過提及 `@Claude` 從您的 Slack 工作區委派編碼工作

model-config.md +2 −2

Details

252當您以 `/model` 選擇模型,而下一個工作階段卻以其他模型啟動時,常見原因如下:252當您以 `/model` 選擇模型,而下一個工作階段卻以其他模型啟動時,常見原因如下:

253 253 

254* **您只為單一工作階段選擇了它。** 在選擇器中按下 `s`、以 `--model` 啟動,以及在非互動模式中執行 `/model`,都只適用於目前的工作階段,不會變更您已儲存的預設值。254* **您只為單一工作階段選擇了它。** 在選擇器中按下 `s`、以 `--model` 啟動,以及在非互動模式中執行 `/model`,都只適用於目前的工作階段,不會變更您已儲存的預設值。

255* **有更高優先順序的項目設定了模型。** 專案或受管設定中的 `model` 值、您 shell 中的 `ANTHROPIC_MODEL`,或您的管理員設定為覆寫使用者選擇的[組織預設值](#organization-default-model),都會在每次啟動新工作階段時重新套用。您的 `/model` 選擇仍然已儲存,只是被更高優先順序的設定所取代。當專案或受管設定設定了模型時,啟動標頭會指出該檔案。255* **有更高優先順序的項目設定了模型。** 專案或受管設定中的 `model` 值、您 shell 中的 `ANTHROPIC_MODEL`,或設定為覆寫使用者選擇的[組織預設值](#organization-default-model),都會在每次啟動新工作階段時重新套用。您的 `/model` 選擇仍然已儲存,只是被更高優先順序的設定所取代。當專案或受管設定設定了模型時,啟動標頭會指出該檔案。

256* **Claude Code 無法儲存您的選擇。** `/model` 會將 `model` 寫入 `~/.claude/settings.json`。如果您無法寫入該檔案(例如因為另一個工具會產生它,或將它連結至唯讀副本),您選擇的模型只會在該工作階段中有效,下次啟動時會讀取舊值。請在產生該檔案的工具中設定 `model`,或讓該檔案可寫入。請參閱 [您在 Claude Code 中所做的變更在新工作階段中遺失](https://code.claude.com/docs/zh-TW/settings.md#a-change-you-made-in-claude-code-is-lost-in-new-sessions)。256* **Claude Code 無法儲存您的選擇。** `/model` 會將 `model` 寫入 `~/.claude/settings.json`。如果您無法寫入該檔案(例如因為另一個工具會產生它,或將它連結至唯讀副本),您選擇的模型只會在該工作階段中有效,下次啟動時會讀取舊值。請在產生該檔案的工具中設定 `model`,或讓該檔案可寫入。請參閱 [您在 Claude Code 中所做的變更在新工作階段中遺失](https://code.claude.com/docs/zh-TW/settings.md#a-change-you-made-in-claude-code-is-lost-in-new-sessions)。

257* **您恢復了工作階段。** 您以 `claude --resume` 或 `--continue` 恢復的工作階段通常會[保留其原本使用的模型](#which-model-a-resumed-session-uses),而非您目前的預設值。257* **您恢復了工作階段。** 您以 `claude --resume` 或 `--continue` 恢復的工作階段通常會[保留其原本使用的模型](#which-model-a-resumed-session-uses),而非您目前的預設值。

258 258 


742如果您開始新回合時此字詞未以彩虹色顯示,請嘗試下列其中一項:742如果您開始新回合時此字詞未以彩虹色顯示,請嘗試下列其中一項:

743 743 

744* 在不以 `/` 開頭的提示詞中,於引號、括號、路徑或命令等任何內容之外重新輸入它744* 在不以 `/` 開頭的提示詞中,於引號、括號、路徑或命令等任何內容之外重新輸入它

745* 如果 `CLAUDE_CODE_EFFORT_LEVEL` 設定為低於 `xhigh`,請取消設定它。或者將您自己的 [`maxEffortLevel`](https://code.claude.com/docs/zh-TW/settings-reference#maxeffortlevel) 提高至 `xhigh` 或以上,或請組織管理員提高您的[組織限制](#organization-effort-limits)745* 如果 `CLAUDE_CODE_EFFORT_LEVEL` 設定為低於 `xhigh`,請取消設定它,或將您自己的 [`maxEffortLevel`](https://code.claude.com/docs/zh-TW/settings-reference#maxeffortlevel) 提高至 `xhigh` 或以上。如果您所在的組織設有 [effort 限制](#organization-effort-limits),請要求組織管理員提高該限制

746* 在工作階段中執行 `/model` 以切換至 Opus 5.5、Sonnet 5.5、Haiku 5.5、Fable 5.2 或 Fable 5.1 模型。在此字詞無法提高回合等級的情況下(例如在 Amazon Bedrock、Google Cloud's Agent Platform 或 [Claude apps gateway](https://code.claude.com/docs/zh-TW/claude-apps-gateway) 上),請改為[設定 effort 等級](#set-the-effort-level)746* 在工作階段中執行 `/model` 以切換至 Opus 5.5、Sonnet 5.5、Haiku 5.5、Fable 5.2 或 Fable 5.1 模型。在此字詞無法提高回合等級的情況下(例如在 Amazon Bedrock、Google Cloud's Agent Platform 或 [Claude apps gateway](https://code.claude.com/docs/zh-TW/claude-apps-gateway) 上),請改為[設定 effort 等級](#set-the-effort-level)

747 747 

748若要關閉此關鍵字(包括其上下文內的指示),請在您的 shell 或[設定檔](https://code.claude.com/docs/zh-TW/env-vars.md#in-settings-files)中將 `CLAUDE_CODE_DISABLE_ULTRATHINK` 設為 `1`。需要 Claude Code v2.1.316 或更新版本。748若要關閉此關鍵字(包括其上下文內的指示),請在您的 shell 或[設定檔](https://code.claude.com/docs/zh-TW/env-vars.md#in-settings-files)中將 `CLAUDE_CODE_DISABLE_ULTRATHINK` 設為 `1`。需要 Claude Code v2.1.316 或更新版本。

Details

126| `OTEL_LOG_TOOL_DETAILS` | 在工具事件和追蹤 span 屬性中啟用工具參數與輸入引數的日誌記錄:Bash 命令、MCP 伺服器與工具名稱、skill 名稱、使用者撰寫的工作流程名稱,以及工具輸入。也會在 `user_prompt` 事件上啟用自訂、外掛和 MCP 命令名稱,並在[成本與 token 計數器](#cost-counter)上啟用真實的 agent、skill、外掛、MCP 伺服器與工具名稱(預設:停用)。對於 Claude Desktop 的內建伺服器,在 Claude Desktop 擁有的工作階段中,即使此旗標關閉,`mcp_server_name`/`mcp_tool_name` 仍會在 `tool_decision`/`tool_result` 上發出。此例外需要 Claude Code v2.1.214 或更新版本 | `1` 以啟用 |126| `OTEL_LOG_TOOL_DETAILS` | 在工具事件和追蹤 span 屬性中啟用工具參數與輸入引數的日誌記錄:Bash 命令、MCP 伺服器與工具名稱、skill 名稱、使用者撰寫的工作流程名稱,以及工具輸入。也會在 `user_prompt` 事件上啟用自訂、外掛和 MCP 命令名稱,並在[成本與 token 計數器](#cost-counter)上啟用真實的 agent、skill、外掛、MCP 伺服器與工具名稱(預設:停用)。對於 Claude Desktop 的內建伺服器,在 Claude Desktop 擁有的工作階段中,即使此旗標關閉,`mcp_server_name`/`mcp_tool_name` 仍會在 `tool_decision`/`tool_result` 上發出。此例外需要 Claude Code v2.1.214 或更新版本 | `1` 以啟用 |

127| `OTEL_LOG_TOOL_CONTENT` | 在 [`tool.output` span 事件](#tool-output-span-event)中啟用工具內容的日誌記錄(預設:停用)。Span 屬性會依[其各自的閘控](#new-context-gates)攜帶工具內容。需要[追蹤](#traces-beta)。內容會在內容上限(預設為 60 KB)處截斷 | `1` 以啟用 |127| `OTEL_LOG_TOOL_CONTENT` | 在 [`tool.output` span 事件](#tool-output-span-event)中啟用工具內容的日誌記錄(預設:停用)。Span 屬性會依[其各自的閘控](#new-context-gates)攜帶工具內容。需要[追蹤](#traces-beta)。內容會在內容上限(預設為 60 KB)處截斷 | `1` 以啟用 |

128| `OTEL_LOG_MANAGED_SETTINGS` | 將已遮蔽的受管設定,以及遮蔽前設定的 SHA-256 摘要,加入 [managed settings resolved](#managed-settings-resolved-event) 事件(預設:停用)。專案或本機設定中的值不會啟用它。需要 Claude Code v2.1.274 或更新版本 | `1` 以啟用 |128| `OTEL_LOG_MANAGED_SETTINGS` | 將已遮蔽的受管設定,以及遮蔽前設定的 SHA-256 摘要,加入 [managed settings resolved](#managed-settings-resolved-event) 事件(預設:停用)。專案或本機設定中的值不會啟用它。需要 Claude Code v2.1.274 或更新版本 | `1` 以啟用 |

129| `OTEL_LOG_RAW_API_BODIES` | 將完整的 Anthropic Messages API 請求與回應 JSON 以 `api_request_body` / `api_response_body` 日誌事件發出(預設:停用)。主體包含完整的對話歷程。啟用此項即表示同意揭露 `OTEL_LOG_USER_PROMPTS`、`OTEL_LOG_TOOL_DETAILS` 和 `OTEL_LOG_TOOL_CONTENT` 會揭露的所有內容 | `1` 表示內嵌主體,並在內容上限(預設為 60 KB)處截斷;或 `file:<dir>` 表示將未截斷的主體存放在磁碟上,並在事件中附上 `body_ref` 指標 |129| `OTEL_LOG_RAW_API_BODIES` | 將完整的 Anthropic Messages API 請求與回應 JSON 以 `api_request_body` / `api_response_body` 日誌事件發出(預設:停用)。主體可能包含完整的對話歷程。啟用此項即表示同意揭露 `OTEL_LOG_USER_PROMPTS`、`OTEL_LOG_TOOL_DETAILS` 和 `OTEL_LOG_TOOL_CONTENT` 會揭露的所有內容 | `1` 表示內嵌主體,並在內容上限(預設為 60 KB)處截斷;或 `file:<dir>` 表示將未截斷的主體存放在磁碟上,並在事件中附上 `body_ref` 指標 |

130| `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` | 內容上限:攜帶內容之屬性(例如模型回應、工具內容、系統提示詞和原始 API 主體)的最大長度,包含截斷標記,以 UTF-16 碼元為單位(預設:61440,即 60 KB)。預設值是針對將屬性值上限設為 64 KB 的後端而訂定;僅在您的後端接受更大的值時才調高,或調低以減少遙測量。當 OpenTelemetry SDK 屬性上限(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` 或其 logrecord 與 span 變體之一)設定得更低時,Claude Code 會在該較小的值處截斷,讓 `[TRUNCATED ...]` 標記維持在 SDK 上限之內 | `262144` |130| `CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH` | 內容上限:攜帶內容之屬性(例如模型回應、工具內容、系統提示詞和原始 API 主體)的最大長度,包含截斷標記,以 UTF-16 碼元為單位(預設:61440,即 60 KB)。預設值是針對將屬性值上限設為 64 KB 的後端而訂定;僅在您的後端接受更大的值時才調高,或調低以減少遙測量。當 OpenTelemetry SDK 屬性上限(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` 或其 logrecord 與 span 變體之一)設定得更低時,Claude Code 會在該較小的值處截斷,讓 `[TRUNCATED ...]` 標記維持在 SDK 上限之內 | `262144` |

131| `OTEL_RESOURCE_INCLUDE_HOST` | 將機器的名稱和 ID 加入指標、事件和追蹤的資源屬性(預設:停用)。請參閱[識別工作階段執行所在的機器](#identify-the-machine-a-session-ran-on)。需要 Claude Code v2.1.326 或更新版本 | `1` 以啟用 |131| `OTEL_RESOURCE_INCLUDE_HOST` | 將機器的名稱和 ID 加入指標、事件和追蹤的資源屬性(預設:停用)。請參閱[識別工作階段執行所在的機器](#identify-the-machine-a-session-ran-on)。需要 Claude Code v2.1.326 或更新版本 | `1` 以啟用 |

132| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | 指標時間性偏好(預設:`delta`)。如果您的後端預期累積時間性,請設為 `cumulative` | `delta`, `cumulative` |132| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | 指標時間性偏好(預設:`delta`)。如果您的後端預期累積時間性,請設為 `cumulative` | `delta`, `cumulative` |


801| - | - |801| - | - |

802| `prompt.id` | UUID v4 識別碼,連結處理單一使用者提示詞時產生的所有事件 |802| `prompt.id` | UUID v4 識別碼,連結處理單一使用者提示詞時產生的所有事件 |

803| `event.sequence` | 用於排序事件的從 0 起算計數器,依每個 Claude Code 程序計算,而非依每個工作階段 |803| `event.sequence` | 用於排序事件的從 0 起算計數器,依每個 Claude Code 程序計算,而非依每個工作階段 |

804| `message.uuid` | 保存在工作階段逐字稿(`~/.claude/projects/*/*.jsonl` 檔案)中之訊息的 UUID。出現在 `assistant_response`、`api_response_body` 上,以及 `user_prompt` 上(命令分派除外,因為命令分派可能產生零則或多則訊息)。在 `assistant_response` 與 `api_response_body` 上,這是回應的最後一筆逐字稿項目,下一個回合的 `parentUuid` 會由此串接。在 `api_response_body` 上需要 Claude Code v2.1.274 或更新版本 |804| `message.uuid` | 保存在工作階段逐字稿(即 `~/.claude/projects/*/*.jsonl` 檔案)中之訊息的 UUID。出現在 `assistant_response`、`api_response_body` 上,以及 `user_prompt` 上(命令分派除外,因為命令分派可能產生零則或多則訊息)。在 `api_response_body` 以及[沒有 `tool_use_id`](#assistant-response-event) 的 `assistant_response` 事件上,此值為回應的最後一筆逐字稿項目,下一個回合的 `parentUuid` 會從此項目串接。在 `api_response_body` 上需要 Claude Code v2.1.274 或更新版本 |

805| `request_id` | 伺服器指派給 API 請求的 ID,從 `request-id` 回應標頭讀取,例如 `req_011...`。若回應沒有 `request-id` 標頭(如在 [Amazon Bedrock](https://code.claude.com/docs/zh-TW/amazon-bedrock.md) 上),則改從 `x-amzn-requestid` 標頭取得值。當回應攜帶任一標頭時,出現在 `api_request`、`api_error`、`api_refusal`、`assistant_response`、`api_response_body`、[`tool_result`](#tool-result-event) 與 [`tool_decision`](#tool-decision-event) 上。與 `llm_request` trace span 上的同名屬性相符。`x-amzn-requestid` 來源需要 Claude Code v2.1.282 或更新版本 |805| `request_id` | 伺服器指派給 API 請求的 ID,從 `request-id` 回應標頭讀取,例如 `req_011...`。若回應沒有 `request-id` 標頭(如在 [Amazon Bedrock](https://code.claude.com/docs/zh-TW/amazon-bedrock.md) 上),則改從 `x-amzn-requestid` 標頭取得值。當回應攜帶任一標頭時,出現在 `api_request`、`api_error`、`api_refusal`、`assistant_response`、`api_response_body`、[`tool_result`](#tool-result-event) 與 [`tool_decision`](#tool-decision-event) 上。與 `llm_request` trace span 上的同名屬性相符。`x-amzn-requestid` 來源需要 Claude Code v2.1.282 或更新版本 |

806| `client_request_id` | 用戶端產生的 UUID,以 `x-client-request-id` 請求標頭傳送。在第一方 API 連線上出現在 `api_request` 與 `api_error` 上;在第三方提供者後端,以及請求透過非串流備援重試時不存在。用於將請求與其回應配對,且對於從未產生伺服器 `request_id` 的失敗(例如逾時)仍可使用。與 `llm_request` trace span 上的同名屬性相符 |806| `client_request_id` | 用戶端產生的 UUID,以 `x-client-request-id` 請求標頭傳送。在第一方 API 連線上出現在 `api_request` 與 `api_error` 上;在第三方提供者後端,以及請求透過非串流備援重試時不存在。用於將請求與其回應配對,且對於從未產生伺服器 `request_id` 的失敗(例如逾時)仍可使用。與 `llm_request` trace span 上的同名屬性相符 |

807 807 


813 813 

814* `user_prompt`、`assistant_response` 與 `api_response_body` 上的 `message.uuid`814* `user_prompt`、`assistant_response` 與 `api_response_body` 上的 `message.uuid`

815* API 事件上的 `request_id`,在逐字稿的 assistant 項目上保存為 `requestId`815* API 事件上的 `request_id`,在逐字稿的 assistant 項目上保存為 `requestId`

816* `tool_use_id` 位於 `tool_result` 與 `tool_decision` 事件上,以及 `safety_event` 事件上([回合結束](#safety-event)的事件除外)816* `tool_result` 與 `tool_decision` 事件上、針對透過工具傳送之訊息的 [`assistant_response`](#assistant-response-event) 事件上,以及 `safety_event` 事件上([回合結束](#safety-event)的事件除外)的 `tool_use_id`

817 817 

818#### 使用者提示詞事件818#### 使用者提示詞事件

819 819 


836 836 

837#### Assistant 回應事件837#### Assistant 回應事件

838 838 

839在每次從模型傳回文字內容的 API 請求後記錄。只包含回應的文字區塊;思考區塊與工具使用區塊不包含在內。839`assistant_response` 事件保存 API 回應的文字,或 Claude 透過呼叫工具寫給使用者的訊息。`tool_use_id` 屬性會告訴您是哪一種:

840 

841* **文字回覆,沒有 `tool_use_id`**:在每次從模型傳回文字內容的 API 請求之後記錄。只包含回應的文字區塊;思考區塊與工具使用區塊會被排除。

842* **透過工具傳送的訊息,具有 `tool_use_id`**:`response` 保存成功呼叫 `SendUserMessage` 或 Cowork 的 `mcp__cowork__send_user_message` 時的訊息文字。Claude Code 會在 [`PostToolUse`](https://code.claude.com/docs/zh-TW/hooks#posttooluse) hook 執行之前記錄此事件。需要 Claude Code v2.1.332 或更新版本。

843 

844只有在您包含回應文字時(如 `response` 下所述),才會收到帶有 `tool_use_id` 的 `assistant_response` 事件。

840 845 

841**事件名稱**:`claude_code.assistant_response`846**事件名稱**:`claude_code.assistant_response`

842 847 


849* `response_length`:回應文字的長度(以字元計)854* `response_length`:回應文字的長度(以字元計)

850* `response`:回應文字,在內容上限處截斷(預設 60 KB)。預設會遮蔽為 `<REDACTED>`。設定 `OTEL_LOG_ASSISTANT_RESPONSES=1` 即可包含。當未設定 `OTEL_LOG_ASSISTANT_RESPONSES` 時,改由 `OTEL_LOG_USER_PROMPTS` 控制,因此若要在開啟提示詞記錄的同時保持回應遮蔽,請設定 `OTEL_LOG_ASSISTANT_RESPONSES=0`855* `response`:回應文字,在內容上限處截斷(預設 60 KB)。預設會遮蔽為 `<REDACTED>`。設定 `OTEL_LOG_ASSISTANT_RESPONSES=1` 即可包含。當未設定 `OTEL_LOG_ASSISTANT_RESPONSES` 時,改由 `OTEL_LOG_USER_PROMPTS` 控制,因此若要在開啟提示詞記錄的同時保持回應遮蔽,請設定 `OTEL_LOG_ASSISTANT_RESPONSES=0`

851* `model`:模型識別碼(例如 "claude-sonnet-5")856* `model`:模型識別碼(例如 "claude-sonnet-5")

852* `request_id`:API 請求 ID,說明請見[事件關聯屬性](#event-correlation-attributes)857* `request_id`:API 請求 ID,說明請見[事件關聯屬性](#event-correlation-attributes)。在帶有 `tool_use_id` 的事件上,這是包含該呼叫之 API 回應的 ID。當該回應也包含文字時,兩種事件會共用同一個 `request_id`

853* `message.uuid`:回應最後一筆逐字稿項目的 UUID。API 回應會以每個內容區塊一筆逐字稿項目的方式保存;這是最後一筆,下一個回合的 `parentUuid` 會由此串接。858* `tool_use_id`:僅出現在透過工具傳送之訊息的事件上。與該呼叫之[工具結果事件](#tool-result-event)上的值相同

859* `message.uuid`:逐字稿項目的 UUID。API 回應會以每個內容區塊一筆逐字稿項目的方式保存。對於文字回覆,這是最後一筆,下一個回合的 `parentUuid` 會從此項目串接。對於帶有 `tool_use_id` 的事件,這是保存該工具呼叫的項目。

854* `query_source`:發出請求的子系統,例如 `"repl_main_thread"`、`"compact"` 或 subagent 名稱860* `query_source`:發出請求的子系統,例如 `"repl_main_thread"`、`"compact"` 或 subagent 名稱

855 861 

856#### 工具結果事件862#### 工具結果事件


1564* `event.timestamp`:ISO 8601 時間戳記1570* `event.timestamp`:ISO 8601 時間戳記

1565* `event.sequence`:用於排序事件的每個程序計數器,說明請見[事件關聯屬性](#event-correlation-attributes)1571* `event.sequence`:用於排序事件的每個程序計數器,說明請見[事件關聯屬性](#event-correlation-attributes)

1566* `managed_settings.trigger`:工作階段開始事件為 `"startup"`,在工作階段稍後受管設定或政策輔助程式狀態變更時為 `"change"`,受管設定政策停止工作階段時為 `"refused"`。Claude Code 僅在某個屬性與上次傳送的事件不同時才傳送 `change` 事件,且即使 `OTEL_LOG_MANAGED_SETTINGS` 關閉,設定值的變更仍會計入1572* `managed_settings.trigger`:工作階段開始事件為 `"startup"`,在工作階段稍後受管設定或政策輔助程式狀態變更時為 `"change"`,受管設定政策停止工作階段時為 `"refused"`。Claude Code 僅在某個屬性與上次傳送的事件不同時才傳送 `change` 事件,且即使 `OTEL_LOG_MANAGED_SETTINGS` 關閉,設定值的變更仍會計入

1567* `error.type`:Claude Code 停止工作階段的原因。僅存在於 `refused` 事件中:1573* `error.type`:Claude Code 停止工作階段的原因。僅出現在 `refused` 事件上:

1568 * `"helper_failed"`:[政策輔助程式執行失敗](https://code.claude.com/docs/zh-TW/settings-reference.md#helper-failures)1574 * `"helper_failed"`:[政策輔助程式執行失敗](https://code.claude.com/docs/zh-TW/settings-reference.md#helper-failures)

1569 * `"policy_invalid"`:受管設定包含使 Claude Code 無法啟動的錯誤,或某個管理來源因讀取被拒以外的原因載入失敗,導致 Claude Code 無法檢查組織登入或提供者強制執行1575 * `"policy_invalid"`:受管設定含有使 Claude Code 無法啟動的錯誤,或某個管理來源因讀取遭拒以外的原因而載入失敗,因此 Claude Code 無法檢查組織登入或提供者強制規定

1570 * `"provider_not_allowed"`:工作階段將使用受管 [`allowedProviders`](https://code.claude.com/docs/zh-TW/settings-reference#allowedproviders) 清單不允許的 API 提供者,或將提供者的流量傳送至不允許的主機。需要 Claude Code v2.1.285 或更新版本1576 * `"provider_not_allowed"`:工作階段將使用受管 [`allowedProviders`](https://code.claude.com/docs/zh-TW/settings-reference#allowedproviders) 清單不允許的 API 提供者,或將某提供者的流量傳送至該清單不允許的主機。需要 Claude Code v2.1.285 或更新版本

1571 * `"consent_rejected"`:使用者拒絕了伺服器受管設定的[安全核准對話框](https://code.claude.com/docs/zh-TW/server-managed-settings.md#security-approval-dialogs)1577 * `"consent_rejected"`:使用者拒絕了伺服器受管設定的[安全核准對話框](https://code.claude.com/docs/zh-TW/server-managed-settings.md#security-approval-dialogs)

1572 * `"force_refresh_failed"`:[`forceRemoteSettingsRefresh`](https://code.claude.com/docs/zh-TW/settings-reference#forceremotesettingsrefresh) 所要求的設定擷取失敗1578 * `"force_refresh_failed"`:[`forceRemoteSettingsRefresh`](https://code.claude.com/docs/zh-TW/settings-reference#forceremotesettingsrefresh) 所要求的設定擷取失敗

1573 * `"gateway_rejected"`:[Claude apps 閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway)以 HTTP 403 回應受管設定載入1579 * `"gateway_rejected"`:[Claude apps 閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway)以 HTTP 403 回應受管設定載入

1574 * `"version_below_minimum"`:此版本的 Claude Code 低於 [`requiredMinimumVersion`](https://code.claude.com/docs/zh-TW/settings-reference#requiredminimumversion) 或高於 [`requiredMaximumVersion`](https://code.claude.com/docs/zh-TW/settings-reference#requiredmaximumversion)1580 * `"version_below_minimum"`:此版本的 Claude Code 低於 [`requiredMinimumVersion`](https://code.claude.com/docs/zh-TW/settings-reference#requiredminimumversion) 或高於 [`requiredMaximumVersion`](https://code.claude.com/docs/zh-TW/settings-reference#requiredmaximumversion)

1575 * `"_OTHER"`:Claude apps 閘道受管設定因其他原因載入失敗1581 * `"_OTHER"`:沒有專屬值的原因,例如因其他原因而失敗的閘道設定載入

1576* `managed_settings.sources`:每個提供至少一個[政策鍵](https://code.claude.com/docs/zh-TW/managed-settings.md#how-claude-code-combines-managed-sources)的受管來源,依優先順序由高至低排列,包括其鍵在 `first-wins` 下未生效的來源。值為 `"remote"`;MDM 或作業系統層級政策為 `"plist"` 或 `"hklm"`;受管設定檔與 drop-in 為 `"file"`;[嵌入主機](https://code.claude.com/docs/zh-TW/managed-settings.md#let-an-embedding-host-add-policy)提供設定時為 `"parent"`;當 Claude Code [讀取](https://code.claude.com/docs/zh-TW/managed-settings.md#how-claude-code-combines-managed-sources) [Windows HKCU 登錄值](https://code.claude.com/docs/zh-TW/managed-settings.md#where-each-mechanism-stores-the-policy)時為 `"hkcu"`。僅攜帶控制鍵或 Claude Code 無法讀取的來源不會列出。以字串陣列發出,若沒有任何受管來源提供政策鍵則為空陣列1582* `managed_settings.sources`:每個提供至少一個[政策鍵](https://code.claude.com/docs/zh-TW/managed-settings.md#how-claude-code-combines-managed-sources)的受管來源,依優先順序由高至低排列,包括其鍵在 `first-wins` 下未生效的來源。值為 `"remote"`;MDM 或作業系統層級政策為 `"plist"` 或 `"hklm"`;受管設定檔與 drop-in 為 `"file"`;[嵌入主機](https://code.claude.com/docs/zh-TW/managed-settings.md#let-an-embedding-host-add-policy)提供設定時為 `"parent"`;當 Claude Code [讀取](https://code.claude.com/docs/zh-TW/managed-settings.md#how-claude-code-combines-managed-sources) [Windows HKCU 登錄值](https://code.claude.com/docs/zh-TW/managed-settings.md#where-each-mechanism-stores-the-policy)時為 `"hkcu"`。僅攜帶控制鍵或 Claude Code 無法讀取的來源不會列出。以字串陣列發出,若沒有任何受管來源提供政策鍵則為空陣列

1577* `managed_settings.source_behavior`:Claude Code 讀取到的 [`managedSourcesBehavior`](https://code.claude.com/docs/zh-TW/settings-reference#managedsourcesbehavior) 值,`"first-wins"` 或 `"merge"`。若無任何來源設定此鍵則為 `"first-wins"`1583* `managed_settings.source_behavior`:Claude Code 讀取到的 [`managedSourcesBehavior`](https://code.claude.com/docs/zh-TW/settings-reference#managedsourcesbehavior) 值,`"first-wins"` 或 `"merge"`。若無任何來源設定此鍵則為 `"first-wins"`

1578* `managed_settings.helper.state`:所選 MDM 或檔案來源所設定的政策輔助程式狀態:1584* `managed_settings.helper.state`:所選 MDM 或檔案來源所設定的政策輔助程式狀態:


1876 * [成本和 token 計數器](#cost-counter)以及 `api_request`、`api_error` 和 `api_refusal` 事件在其歸因屬性中帶有真實的 agent、skill、外掛和 MCP 伺服器和工具名稱1882 * [成本和 token 計數器](#cost-counter)以及 `api_request`、`api_error` 和 `api_refusal` 事件在其歸因屬性中帶有真實的 agent、skill、外掛和 MCP 伺服器和工具名稱

1877 * `claude_code.tool` 跨度帶有輸入衍生屬性,例如 `file_path`。在詳細的測試版追蹤下,它還會帶有 [`tool_input`](#new-context-gates) 屬性1883 * `claude_code.tool` 跨度帶有輸入衍生屬性,例如 `file_path`。在詳細的測試版追蹤下,它還會帶有 [`tool_input`](#new-context-gates) 屬性

1878* 工具內容預設不在追蹤跨度中記錄。若要包含它,請設定 `OTEL_LOG_TOOL_CONTENT=1`。`claude_code.tool` 跨度隨後帶有 [`tool.output` 跨度事件](#tool-output-span-event),其中包含原始檔案內容、Bash 命令輸出,以及 MCP 工具、WebFetch 和 WebSearch 傳回的內容,在內容限制(預設 60 KB)處按屬性截斷。來自 MCP 工具、WebFetch 和 WebSearch 的結果需要 Claude Code v2.1.283 或更新版本。工具內容也透過 [`new_context` 到達跨度,其控制因跨度而異](#new-context-gates)。根據需要配置您的遙測後端以篩選或編輯這些屬性1884* 工具內容預設不在追蹤跨度中記錄。若要包含它,請設定 `OTEL_LOG_TOOL_CONTENT=1`。`claude_code.tool` 跨度隨後帶有 [`tool.output` 跨度事件](#tool-output-span-event),其中包含原始檔案內容、Bash 命令輸出,以及 MCP 工具、WebFetch 和 WebSearch 傳回的內容,在內容限制(預設 60 KB)處按屬性截斷。來自 MCP 工具、WebFetch 和 WebSearch 的結果需要 Claude Code v2.1.283 或更新版本。工具內容也透過 [`new_context` 到達跨度,其控制因跨度而異](#new-context-gates)。根據需要配置您的遙測後端以篩選或編輯這些屬性

1879* 原始 Anthropic Messages API 請求和回應主體預設不記錄。若要包含它們,請在您的 shell、使用者設定或受管設定中設定 `OTEL_LOG_RAW_API_BODIES`。在[專案和本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略。主體包含完整的對話歷史記錄,包括系統提示詞、每個先前的使用者和 assistant 回合以及工具結果,因此啟用此選項意味著同意其他 `OTEL_LOG_*` 內容旗標會揭露的所有內容。Claude Code 始終遮蔽這些主體中 Claude 的延伸思考內容,無論其他設定如何。您設定的值決定了 Claude Code 如何傳遞主體:1885* 原始 Anthropic Messages API 請求和回應主體預設不記錄。若要包含它們,請在您的 shell、使用者設定或受管設定中設定 `OTEL_LOG_RAW_API_BODIES`。在[專案和本機設定](https://code.claude.com/docs/zh-TW/settings-reference.md#variables-claude-code-ignores-in-env)中會被忽略。

1880 * 使用 `=1` 時,Claude Code 為每個 API 呼叫發出 `api_request_body` 和 `api_response_body` 日誌事件。事件的 `body` 屬性帶有 JSON 序列化的承載,在內容限制(預設 60 KB)處截斷1886 

1881 * 使用 `=file:<dir>` 時,Claude Code 將未截斷的主體寫入該目錄下的 `.request.json` 和 `.response.json` 檔案,事件帶有 `body_ref` 路徑而不是內聯主體。使用日誌收集器或邊車傳送目錄,而不是透過遙測流1887 主體可能包含完整的對話記錄,包括系統提示詞、每個先前的使用者和 assistant 回合以及工具結果。啟用此選項意味著同意其他 `OTEL_LOG_*` 內容旗標會揭露的所有內容。Claude Code 始終遮蔽這些主體中 Claude 的延伸思考內容,無論其他設定如何。您設定的值決定了 Claude Code 如何傳遞主體:

1888 

1889 * 使用 `=1` 時,Claude Code 為每個 API 呼叫發出 `api_request_body` 和 `api_response_body` 日誌事件。事件的 `body` 屬性帶有 JSON 序列化的 payload,在內容限制(預設 60 KB)處截斷

1890 * 使用 `=file:<dir>` 時,Claude Code 將未截斷的主體寫入該目錄下的 `.request.json` 和 `.response.json` 檔案,事件帶有 `body_ref` 路徑而不是內聯主體。使用日誌收集器或邊車傳送目錄,而不是透過遙測流。

1882 1891 

1883 對於每個成功的回應,Claude Code 也會在該目錄中的 `index.jsonl` 附加一行,將回應檔案連結到產生它的請求檔案以及它成為的文字記錄訊息。每一行不包含任何訊息內容,[API 回應主體事件](#api-response-body-event)部分列出其欄位。索引檔案需要 Claude Code v2.1.274 或更新版本1892 對於每個成功的回應,Claude Code 也會在該目錄中的 `index.jsonl` 附加一行,將回應檔案連結到產生它的請求檔案以及它成為的文字記錄訊息。每一行不包含任何訊息內容,[API 回應主體事件](#api-response-body-event)部分列出其欄位。索引檔案需要 Claude Code v2.1.274 或更新版本

1884* 預設不包含機器的名稱和 ID。若要將它們以 `host.name` 和 `host.id` 包含在內,請設定 [`OTEL_RESOURCE_INCLUDE_HOST=1`](#identify-the-machine-a-session-ran-on)。主機名稱通常包含個人姓名,而 `host.id` 是該機器的持久識別碼。如果您在受管設定中設定此變數,請告知使用這些機器的人員,因為 Claude Code 不會向他們顯示任何通知。1893* 預設不包含機器的名稱和 ID。若要將它們以 `host.name` 和 `host.id` 包含在內,請設定 [`OTEL_RESOURCE_INCLUDE_HOST=1`](#identify-the-machine-a-session-ran-on)。主機名稱通常包含個人姓名,而 `host.id` 是該機器的持久識別碼。如果您在受管設定中設定此變數,請告知使用這些機器的人員,因為 Claude Code 不會向他們顯示任何通知。

Details

85 85 

86## 自訂 CA 憑證86## 自訂 CA 憑證

87 87 

88如果您的企業環境使用自訂 CA,請設定 Claude Code 以直接信任它:88如果您的環境使用自訂 CA,請設定 Claude Code 以直接信任它:

89 89 

90```bash theme={null}90```bash theme={null}

91export NODE_EXTRA_CA_CERTS=/path/to/ca-cert.pem91export NODE_EXTRA_CA_CERTS=/path/to/ca-cert.pem


242| `storage.googleapis.com` | 2.1.116 之前版本上的原生安裝程式和原生自動更新程式 |242| `storage.googleapis.com` | 2.1.116 之前版本上的原生安裝程式和原生自動更新程式 |

243| `registry.npmjs.org` | 外掛程式安裝(擷取 npm 來源外掛程式套件和安裝外掛程式的 Node.js 套件相依性)、`npx` 啟動的 MCP 伺服器,以及 npm 和 bun 安裝 Claude Code 本身的套件登錄 |243| `registry.npmjs.org` | 外掛程式安裝(擷取 npm 來源外掛程式套件和安裝外掛程式的 Node.js 套件相依性)、`npx` 啟動的 MCP 伺服器,以及 npm 和 bun 安裝 Claude Code 本身的套件登錄 |

244| `bridge.claudeusercontent.com` | [Chrome 中的 Claude](https://code.claude.com/docs/zh-TW/chrome.md) 擴充功能 WebSocket 橋接 |244| `bridge.claudeusercontent.com` | [Chrome 中的 Claude](https://code.claude.com/docs/zh-TW/chrome.md) 擴充功能 WebSocket 橋接 |

245| `*.frame.claudeusercontent.com` | [Artifact](https://code.claude.com/docs/zh-TW/artifacts.md) 內容讀取。當 Claude 開啟 Artifact 時,CLI 會從此主機擷取 Artifact 的檔案,且僅當 Artifact 工具[可用](https://code.claude.com/docs/zh-TW/artifacts.md#availability)於您的帳戶時。若要關閉工具並移除此需求,請設定 [`"enableArtifact": false`](https://code.claude.com/docs/zh-TW/settings-reference#enableartifact) 或 [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](https://code.claude.com/docs/zh-TW/env-vars) |245| `*.frame.claudeusercontent.com` | [Artifact](https://code.claude.com/docs/zh-TW/artifacts.md) 內容讀取。當 Claude 開啟 Artifact 時,CLI 會從此主機擷取該 Artifact 的檔案。只有當 Artifact 工具對您的帳戶[可用](https://code.claude.com/docs/zh-TW/artifacts.md#availability)時,您才需要此主機。若要關閉工具並移除此需求,請設定 [`"enableArtifact": false`](https://code.claude.com/docs/zh-TW/settings-reference#enableartifact) 或 [`CLAUDE_CODE_DISABLE_ARTIFACT=1`](https://code.claude.com/docs/zh-TW/env-vars) |

246| `github.com` | 複製 GitHub 託管的[外掛程式市集](https://code.claude.com/docs/zh-TW/plugins/overview.md)和外掛程式,包括官方 Anthropic 市集,透過 HTTPS 或 SSH。若要僅透過 HTTPS 複製 GitHub `owner/repo` 來源,請設定 [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](https://code.claude.com/docs/zh-TW/env-vars) |246| `github.com` | 複製 GitHub 託管的[外掛程式市集](https://code.claude.com/docs/zh-TW/plugins/overview.md)和外掛程式,包括官方 Anthropic 市集,透過 HTTPS 或 SSH。若要僅透過 HTTPS 複製 GitHub `owner/repo` 來源,請設定 [`CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1`](https://code.claude.com/docs/zh-TW/env-vars) |

247| `raw.githubusercontent.com` | [`/release-notes`](https://code.claude.com/docs/zh-TW/commands) 的變更日誌摘要。在互動式工作階段中,Claude Code 也會在啟動時在背景擷取它,當其快取的變更日誌尚未涵蓋執行中的版本時,例如更新後的首次啟動;非互動式和雲端工作階段永遠不會擷取它 |247| `raw.githubusercontent.com` | [`/release-notes`](https://code.claude.com/docs/zh-TW/commands) 的變更日誌摘要。在互動式工作階段中,Claude Code 也會在啟動時在背景擷取它,當其快取的變更日誌尚未涵蓋執行中的版本時,例如更新後的首次啟動;非互動式和雲端工作階段永遠不會擷取它 |

248| `*-review.googlesource.com` | 在 `googlesource.com` 簽出上進行 Gerrit 變更查詢。當 Claude Desktop Code 索引標籤工作階段在[受信任](https://code.claude.com/docs/zh-TW/permissions.md#project-allow-rules-and-workspace-trust)的簽出上啟動或繼續時,其 `origin` 是 `googlesource.com` 主機,Claude Code 會匿名詢問該主機的 `-review` 伺服器,以取得與 HEAD 的 `Change-Id` 相符的開啟變更,每次啟動或繼續一次。其他工作階段類型會略過查詢,且不會連線到其他 Gerrit 主機。選用:使用 [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/zh-TW/env-vars) 停用 |248| `*-review.googlesource.com` | 在 `googlesource.com` 簽出上進行 Gerrit 變更查詢。當 Claude Desktop Code 索引標籤工作階段在[受信任](https://code.claude.com/docs/zh-TW/permissions.md#project-allow-rules-and-workspace-trust)的簽出上啟動或繼續時,其 `origin` 是 `googlesource.com` 主機,Claude Code 會匿名詢問該主機的 `-review` 伺服器,以取得與 HEAD 的 `Change-Id` 相符的開啟變更,每次啟動或繼續一次。其他工作階段類型會略過查詢,且不會連線到其他 Gerrit 主機。選用:使用 [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/zh-TW/env-vars) 停用 |

overview.md +3 −3

Details

206>206>

207> 工作階段不受限於單一使用介面。當您的情境變更時,在使用介面之間移動工作:207> 工作階段不受限於單一使用介面。當您的情境變更時,在使用介面之間移動工作:

208>208>

209> * 離開您的辦公桌,使用[遠端控制](https://code.claude.com/docs/zh-TW/remote-control.md)從您的手機或任何瀏覽器繼續工作209> * 離開您的辦公桌,使用 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 從您的手機或任何瀏覽器繼續工作

210> * 從您的手機向 [Dispatch](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch) 傳送任務,並開啟它建立的桌面工作階段210> * 從您的手機向 [Dispatch](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch) 傳送任務,並開啟它建立的桌面工作階段

211> * 在[網頁](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)或 [Claude 行動應用程式](https://code.claude.com/docs/zh-TW/mobile.md)上啟動長時間執行的任務,然後使用 `claude --teleport` 將其提取到您的終端機中。Teleport 需要 claude.ai 訂閱。211> * 在[網頁](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)或 [Claude 行動應用程式](https://code.claude.com/docs/zh-TW/mobile.md)上啟動長時間執行的任務,然後使用 `claude --teleport` 將其提取到您的終端機中。Teleport 需要 claude.ai 訂閱。

212> * 執行 `/desktop` 以在[桌面應用程式](https://code.claude.com/docs/zh-TW/desktop.md)中繼續您目前的終端機工作階段,您可以在其中以視覺方式審查差異。`/desktop` 交付需要 claude.ai 訂閱。適用於 macOS 和 x64 Windows。212> * 執行 `/desktop` 以在[桌面應用程式](https://code.claude.com/docs/zh-TW/desktop.md)中繼續您目前的終端機工作階段,您可以在其中以視覺方式審查差異。`/desktop` 交付需要 claude.ai 訂閱。適用於 macOS 和 x64 Windows。

213> * 從團隊聊天路由任務:在 [Slack](https://code.claude.com/docs/zh-TW/slack.md) 中提及 `@Claude` 並提供錯誤報告,然後取回拉取請求213> * 在 Team 和 Enterprise 方案中從團隊聊天路由任務:在 [Slack](https://claude.com/docs/claude-tag/overview) 中提及 `@Claude` 並提供錯誤報告,然後取回 pull request

214 214 

215## 在任何地方使用 Claude Code215## 在任何地方使用 Claude Code

216 216 


226| 按重複排程執行 Claude | [雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)或[桌面排程任務](https://code.claude.com/docs/zh-TW/desktop-scheduled-tasks.md) |226| 按重複排程執行 Claude | [雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)或[桌面排程任務](https://code.claude.com/docs/zh-TW/desktop-scheduled-tasks.md) |

227| 自動化 PR 審查和問題分類 | [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md) 或 [GitLab CI/CD](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md) |227| 自動化 PR 審查和問題分類 | [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md) 或 [GitLab CI/CD](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md) |

228| 在每個 PR 上獲得自動程式碼審查 | [GitHub Code Review](https://code.claude.com/docs/zh-TW/code-review.md) |228| 在每個 PR 上獲得自動程式碼審查 | [GitHub Code Review](https://code.claude.com/docs/zh-TW/code-review.md) |

229| 將 Slack 中的錯誤報告路由到拉取請求 | [Slack](https://code.claude.com/docs/zh-TW/slack.md) |229| 將 Slack 中的錯誤報告路由到 pull request | [Claude Tag](https://claude.com/docs/claude-tag/overview),適用於 Team 和 Enterprise 方案 |

230| 除錯即時網頁應用程式 | [Chrome](https://code.claude.com/docs/zh-TW/chrome.md) |230| 除錯即時網頁應用程式 | [Chrome](https://code.claude.com/docs/zh-TW/chrome.md) |

231| 為您自己的工作流程建立自訂代理 | [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) |231| 為您自己的工作流程建立自訂代理 | [Agent SDK](https://code.claude.com/docs/zh-TW/agent-sdk/overview.md) |

232 232 

Details

310 310 

311計畫準備就緒後,Claude 會呈現計畫並詢問如何進行。在該提示中,您可以選擇:311計畫準備就緒後,Claude 會呈現計畫並詢問如何進行。在該提示中,您可以選擇:

312 312 

313* **Yes, and use auto mode**:核准並以[自動模式](#eliminate-prompts-with-auto-mode)開始。如果[您的工作階段無法使用](#eliminate-prompts-with-auto-mode)自動模式(例如因為您的組織已將其關閉),此選項會顯示為 **Yes, auto-accept edits**。如果您在啟動工作階段時已啟用略過權限,此選項則會顯示為 **Yes, and switch to BYPASS PERMISSIONS (no further prompts) for this session**。313* **Yes, and use auto mode**:核准並以[自動模式](#eliminate-prompts-with-auto-mode)開始。如果[您的工作階段無法使用](#eliminate-prompts-with-auto-mode)自動模式,此選項會顯示為 **Yes, auto-accept edits**。如果您在啟動工作階段時已啟用略過權限,此選項則會顯示為 **Yes, and switch to BYPASS PERMISSIONS (no further prompts) for this session**。

314* **Yes, manually approve edits**:核准並逐一審查每項編輯。314* **Yes, manually approve edits**:核准並逐一審查每項編輯。

315* **No, keep planning**:留在 plan mode 並告訴 Claude 要變更的內容。315* **No, keep planning**:留在 plan mode 並告訴 Claude 要變更的內容。

316 316 


400| 在 Claude Sonnet 4.6 上執行 | Sonnet 4.6 |400| 在 Claude Sonnet 4.6 上執行 | Sonnet 4.6 |

401| 已設定 [`ANTHROPIC_DEFAULT_SONNET_MODEL`](https://code.claude.com/docs/zh-TW/model-config#environment-variables) | 其值;若其值為 Claude Sonnet 5.5 或 Claude Opus 5.5,則為 Sonnet 5 |401| 已設定 [`ANTHROPIC_DEFAULT_SONNET_MODEL`](https://code.claude.com/docs/zh-TW/model-config#environment-variables) | 其值;若其值為 Claude Sonnet 5.5 或 Claude Opus 5.5,則為 Sonnet 5 |

402 402 

403如果您的提供商無法提供 Sonnet 5 或 `ANTHROPIC_DEFAULT_SONNET_MODEL` 中的模型,或您組織的[模型政策](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)排除了該模型,Claude Code 會使用備援模型。備援模型是您工作階段的模型,若為 [Fable 工作階段](https://code.claude.com/docs/zh-TW/model-config.md#work-with-fable)則是 Opus 模型。403如果您的提供商無法提供 Sonnet 5 或 `ANTHROPIC_DEFAULT_SONNET_MODEL` 中的模型,或該模型遭[模型政策](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)排除,Claude Code 會使用備援模型。備援模型是您工作階段的模型,若為 [Fable 工作階段](https://code.claude.com/docs/zh-TW/model-config.md#work-with-fable)則是 Opus 模型。

404 404 

405### 選擇分類器模型405### 選擇分類器模型

406 406 


419| 情況 | 會發生什麼 | 該怎麼做 |419| 情況 | 會發生什麼 | 該怎麼做 |

420| - | - | - |420| - | - | - |

421| [除錯日誌](#classifier-model-check)回報了 Anthropic 設定的分類器模型 | 由該模型審查 | 無需處理 |421| [除錯日誌](#classifier-model-check)回報了 Anthropic 設定的分類器模型 | 由該模型審查 | 無需處理 |

422| 您設定了 Claude Opus 5、Sonnet 5.5、Opus 5.5,或您組織的[模型政策](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)所排除的模型 | 由[預設分類器模型](#default-classifier-model)審查 | 設定其他模型 |422| 您設定了 Claude Opus 5、Sonnet 5.5、Opus 5.5,或[模型政策](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)所排除的模型 | 由[預設分類器模型](#default-classifier-model)審查 | 設定其他模型 |

423| 您的提供商無法提供該模型 | 分類器檢查失敗,因此 Claude Code [拒絕每個受檢查的操作](https://code.claude.com/docs/zh-TW/errors.md#auto-mode-cannot-determine-the-safety-of-an-action) | 設定提供商可提供的模型,或移除該變數 |423| 您的提供商無法提供該模型 | 分類器檢查失敗,因此 Claude Code [拒絕每個受檢查的操作](https://code.claude.com/docs/zh-TW/errors.md#auto-mode-cannot-determine-the-safety-of-an-action) | 設定提供商可提供的模型,或移除該變數 |

424| 在工作階段中,`/status` 顯示 [`Auto mode server`](#server-side-classifier-review) 為 `Enabled` | 由伺服器審查,不使用您的模型 | 無需處理 |424| 在工作階段中,`/status` 顯示 [`Auto mode server`](#server-side-classifier-review) 為 `Enabled` | 由伺服器審查,不使用您的模型 | 無需處理 |

425 425 


679 679 

680`bypassPermissions` 模式會停用權限提示與安全檢查,讓工具呼叫立即執行,包括寫入[受保護路徑](#protected-paths)。680`bypassPermissions` 模式會停用權限提示與安全檢查,讓工具呼叫立即執行,包括寫入[受保護路徑](#protected-paths)。

681 681 

682即使在 `bypassPermissions` 模式下,每一項[任何模式都不會自動核准的動作](#actions-no-mode-auto-approves)都會出現提示或遭到拒絕,不過您可以[關閉危險 `rm` 命令的提示](#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode)。讀取[其他組織的公開 artifact](https://code.claude.com/docs/zh-TW/artifacts.md#read-an-artifact-shared-with-you) 需要您的核准,而此模式不會請求核准,因此 Claude 無法讀取這類 artifact。[PowerShell 中的 Remove-Item](#remove-item-in-powershell) 拒絕規則在此模式下同樣適用。682即使在 `bypassPermissions` 模式下,每一項[任何模式都不會自動核准的動作](#actions-no-mode-auto-approves)都會出現提示或遭到拒絕,不過您可以[關閉危險 `rm` 命令的提示](#turn-off-the-critical-path-removal-prompt-in-bypasspermissions-mode)。Artifact 工具無法讀取您尚未在此對話中核准的[其他組織的公開 artifact](https://code.claude.com/docs/zh-TW/artifacts.md#read-an-artifact-shared-with-you)。[PowerShell 中的 Remove-Item](#remove-item-in-powershell) 拒絕規則在此模式下同樣適用。

683 683 

684有兩項[跨工作階段訊息](https://code.claude.com/docs/zh-TW/cross-session-messaging.md)保護措施在此模式下仍然適用,在可使用略過權限的互動式終端機 plan mode 工作階段中也同樣適用:684有兩項[跨工作階段訊息](https://code.claude.com/docs/zh-TW/cross-session-messaging.md)保護措施在此模式下仍然適用,在可使用略過權限的互動式終端機 plan mode 工作階段中也同樣適用:

685 685 


704 704 

705當您第一次在啟用此模式的情況下啟動互動式工作階段時,Claude Code 會顯示警告對話框,要求您為未經權限檢查所採取的動作承擔責任:705當您第一次在啟用此模式的情況下啟動互動式工作階段時,Claude Code 會顯示警告對話框,要求您為未經權限檢查所採取的動作承擔責任:

706 706 

707* **如果您接受**:Claude Code 會在 `~/.claude/settings.json` 中將 `skipDangerousModePermissionPrompt` 設為 `true`,之後的工作階段便會略過此對話框。若要再次看到對話框,請從該檔案中移除此設定鍵或將其設為 `false`。[`skipDangerousModePermissionPrompt` 參考](https://code.claude.com/docs/zh-TW/settings-reference#skipdangerousmodepermissionprompt)列出了您或您的組織可以設定它的其他設定檔。707* **如果您接受**:Claude Code 會在 `~/.claude/settings.json` 中將 `skipDangerousModePermissionPrompt` 設為 `true`,之後的工作階段便會略過此對話框。若要再次看到對話框,請從該檔案中移除此設定鍵或將其設為 `false`。如果對話框仍未出現,請檢查 [`skipDangerousModePermissionPrompt` 參考](https://code.claude.com/docs/zh-TW/settings-reference#skipdangerousmodepermissionprompt)所列出的其他設定檔。

708* **如果您拒絕**:Claude Code 會結束。708* **如果您拒絕**:Claude Code 會結束。

709 709 

710如果您傳入 [`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 但未包含 `user`,即使您先前已接受,對話框仍可能再次出現。若要略過它,請加入 `user`,例如 `--setting-sources user,project`。710如果您傳入 [`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 但未包含 `user`,即使您先前已接受,對話框仍可能再次出現。若要略過它,請加入 `user`,例如 `--setting-sources user,project`。

permissions.md +11 −1

Details

106 106 

107工具在逐字稿和權限對話框中顯示的標籤可能與其規範名稱不同。例如,逐字稿中標記為 `Stop Task` 的工具具有規範名稱 `TaskStop`。權限規則和 [hook matcher](https://code.claude.com/docs/zh-TW/hooks.md) 不會比對標籤,因此寫成 `Stop Task` 的規則不符合。對於拒絕和詢問規則,[啟動警告](https://code.claude.com/docs/zh-TW/errors.md#matches-no-tool)會指出這一點。請使用[工具參考](https://code.claude.com/docs/zh-TW/tools-reference.md)中列出的規範名稱。107工具在逐字稿和權限對話框中顯示的標籤可能與其規範名稱不同。例如,逐字稿中標記為 `Stop Task` 的工具具有規範名稱 `TaskStop`。權限規則和 [hook matcher](https://code.claude.com/docs/zh-TW/hooks.md) 不會比對標籤,因此寫成 `Stop Task` 的規則不符合。對於拒絕和詢問規則,[啟動警告](https://code.claude.com/docs/zh-TW/errors.md#matches-no-tool)會指出這一點。請使用[工具參考](https://code.claude.com/docs/zh-TW/tools-reference.md)中列出的規範名稱。

108 108 

109#### 允許在工作目錄之外使用檔案工具

110 

111使用 `Edit(*)`、`Write(*)` 或 `NotebookEdit(*)` 允許規則時,您僅會在[工作目錄](#working-directories)中預先核准該工具。若也要預先核准工作目錄之外的路徑,請寫出您想要的每個工具的裸名稱,例如 `Edit` 或 `Read`。部分呼叫仍不會被預先核准,例如寫入[受保護路徑](https://code.claude.com/docs/zh-TW/permission-modes.md#protected-paths)以及從[網路路徑](#network-paths)讀取。

112 

113當啟動警告指出您的 `Read(*)` 規則 `adds nothing to Read's default` 時,您可以從設定檔中刪除該規則。

114 

115> [!WARNING]

116>

117> 請勿依賴檔案工具的 `(*)` 允許規則將該工具限制在工作目錄中。v2.1.317 之前的版本會將該規則視為裸名稱,而若 Anthropic 關閉工作目錄限制,之後的版本也可能如此。請改為[封鎖工作目錄之外的檔案工具讀取和寫入](#block-file-tool-reads-and-writes-outside-the-working-directories)。

118 

109### 使用指定符進行細粒度控制119### 使用指定符進行細粒度控制

110 120 

111在括號中新增指定符以符合特定工具使用:121在括號中新增指定符以符合特定工具使用:


564| `WebFetch` | Claude 擷取時不會提示您。不會改變沙箱化命令可連線的主機。 | Claude Code 會移除 `WebFetch` 工具,因此 Claude 完全無法擷取。不會改變沙箱化命令可連線的主機。 |574| `WebFetch` | Claude 擷取時不會提示您。不會改變沙箱化命令可連線的主機。 | Claude Code 會移除 `WebFetch` 工具,因此 Claude 完全無法擷取。不會改變沙箱化命令可連線的主機。 |

565| `WebFetch(domain:*)` | Claude 擷取時不會提示您,且沙箱化命令可連線至任何主機。 | Claude Code 保留該工具並拒絕每次擷取,且沙箱化命令無法連線至任何主機。 |575| `WebFetch(domain:*)` | Claude 擷取時不會提示您,且沙箱化命令可連線至任何主機。 | Claude Code 保留該工具並拒絕每次擷取,且沙箱化命令無法連線至任何主機。 |

566 576 

567這兩種形式在讀取 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md)(Artifact 工具在 claude.ai 上發佈的頁面)時也有所不同。不帶參數的 `WebFetch` 拒絕或詢問規則不適用於這些讀取。涵蓋 `claude.ai` 或 `*.claudeusercontent.com` 內容主機的 `domain:` 規則,例如 `WebFetch(domain:claude.ai)` 或 `WebFetch(domain:*)`,會拒絕每次讀取或在讀取前提示。[`Artifact` 規則](https://code.claude.com/docs/zh-TW/artifacts#disable-artifacts)也有相同作用。577這兩種形式在讀取 [artifact](https://code.claude.com/docs/zh-TW/artifacts.md)(Artifact 工具在 claude.ai 上發佈的頁面)時也有所不同。不帶參數的 `WebFetch` 拒絕或詢問規則不適用於 Artifact 工具的讀取。涵蓋 `claude.ai` 或 `*.claudeusercontent.com` 內容主機的 `domain:` 規則,例如 `WebFetch(domain:claude.ai)` 或 `WebFetch(domain:*)`,會拒絕每次讀取或在讀取前提示。

568 578 

569當規則封鎖讀取時,拒絕訊息會指明該規則。在 v2.1.268 之前,不帶參數的 `WebFetch` 拒絕規則會封鎖每次 artifact 讀取,而不帶參數的詢問規則會在每次讀取前提示。579當規則封鎖讀取時,拒絕訊息會指明該規則。在 v2.1.268 之前,不帶參數的 `WebFetch` 拒絕規則會封鎖每次 artifact 讀取,而不帶參數的詢問規則會在每次讀取前提示。

570 580 

platforms.md +1 −4

Details

35| [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md) | 在您的 CI 管道中執行 Claude | 自動化 PR 審查、問題分類、排程維護 |35| [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md) | 在您的 CI 管道中執行 Claude | 自動化 PR 審查、問題分類、排程維護 |

36| [GitLab CI/CD](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md) | 與 GitHub Actions 相同,但用於 GitLab | GitLab 上的 CI 驅動自動化 |36| [GitLab CI/CD](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md) | 與 GitHub Actions 相同,但用於 GitLab | GitLab 上的 CI 驅動自動化 |

37| [Code Review](https://code.claude.com/docs/zh-TW/code-review.md) | 自動審查每個 PR | 在人工審查之前捕捉錯誤 |37| [Code Review](https://code.claude.com/docs/zh-TW/code-review.md) | 自動審查每個 PR | 在人工審查之前捕捉錯誤 |

38| [Slack](https://code.claude.com/docs/zh-TW/slack.md) | 以您自己的帳戶回應您的頻道中的 `@Claude` 提及 | 在 Pro、Max 和 Ultra 方案上,將團隊聊天中的錯誤報告轉換為 pull request |38| [Claude Tag](https://claude.com/docs/claude-tag) | 以您組織的共享身分執行 `@Claude`,具有管理員設定的存取權限 | Team 和 Enterprise 方案上的共享團隊存取 |

39| [Claude Tag](https://claude.com/docs/claude-tag) | 以您組織的共享身分執行 `@Claude`,具有管理員設定的存取權限 | Team 和 Enterprise 方案上的共享團隊存取,而不是按使用者的 Slack 會話 |

40 39 

41對於此處未列出的整合,[MCP servers](https://code.claude.com/docs/zh-TW/mcp.md) 和[連接器](https://code.claude.com/docs/zh-TW/desktop.md#connect-external-tools)讓您連接幾乎任何東西:Linear、Notion、Google Drive 或您自己的內部 API。40對於此處未列出的整合,[MCP servers](https://code.claude.com/docs/zh-TW/mcp.md) 和[連接器](https://code.claude.com/docs/zh-TW/desktop.md#connect-external-tools)讓您連接幾乎任何東西:Linear、Notion、Google Drive 或您自己的內部 API。

42 41 


49| [Dispatch](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch) | 從 Claude 行動應用程式傳送任務訊息 | 您的機器 (Desktop) | [將行動應用程式與 Desktop 配對](https://support.claude.com/en/articles/13947068) | 在您不在時委派工作,最少設定 |48| [Dispatch](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch) | 從 Claude 行動應用程式傳送任務訊息 | 您的機器 (Desktop) | [將行動應用程式與 Desktop 配對](https://support.claude.com/en/articles/13947068) | 在您不在時委派工作,最少設定 |

50| [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) | 從 [claude.ai/code](https://claude.ai/code) 或 Claude 行動應用程式驅動執行中的工作階段 | 您的機器 (CLI、Desktop 或 VS Code) | 執行 [`claude remote-control` 或 `/remote-control`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) | 從另一個裝置控制進行中的工作 |49| [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) | 從 [claude.ai/code](https://claude.ai/code) 或 Claude 行動應用程式驅動執行中的工作階段 | 您的機器 (CLI、Desktop 或 VS Code) | 執行 [`claude remote-control` 或 `/remote-control`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) | 從另一個裝置控制進行中的工作 |

51| [Channels](https://code.claude.com/docs/zh-TW/channels.md) | 從聊天應用程式 (如 Telegram 或 Discord) 或您自己的伺服器推送事件 | 您的機器 (CLI) | [安裝頻道外掛程式](https://code.claude.com/docs/zh-TW/channels.md#quickstart) 或 [建立您自己的](https://code.claude.com/docs/zh-TW/channels-reference.md) | 對外部事件 (如 CI 失敗或聊天訊息) 做出反應 |50| [Channels](https://code.claude.com/docs/zh-TW/channels.md) | 從聊天應用程式 (如 Telegram 或 Discord) 或您自己的伺服器推送事件 | 您的機器 (CLI) | [安裝頻道外掛程式](https://code.claude.com/docs/zh-TW/channels.md#quickstart) 或 [建立您自己的](https://code.claude.com/docs/zh-TW/channels-reference.md) | 對外部事件 (如 CI 失敗或聊天訊息) 做出反應 |

52| [Slack](https://code.claude.com/docs/zh-TW/slack.md) | 在團隊頻道中提及 `@Claude` | Anthropic 雲端 | [安裝 Slack 應用程式](https://code.claude.com/docs/zh-TW/slack.md#setting-up-claude-code-in-slack) 並啟用 [網路上的 Claude Code](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md),適用於 Pro、Max 和 Ultra 方案 | 從團隊聊天進行 PR 和審查 |

53| [Self-hosted environments](https://code.claude.com/docs/zh-TW/self-hosted-environments) | 啟動 [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md) 並選擇您組織的環境 | 您組織的基礎設施 | [部署執行器](https://code.claude.com/docs/zh-TW/self-hosted-environments-quickstart.md),在 Team 和 Enterprise 方案上 | 必須在您的網路內執行的雲端工作階段 |51| [Self-hosted environments](https://code.claude.com/docs/zh-TW/self-hosted-environments) | 啟動 [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md) 並選擇您組織的環境 | 您組織的基礎設施 | [部署執行器](https://code.claude.com/docs/zh-TW/self-hosted-environments-quickstart.md),在 Team 和 Enterprise 方案上 | 必須在您的網路內執行的雲端工作階段 |

54| [Scheduled tasks](https://code.claude.com/docs/zh-TW/scheduled-tasks.md) | 設定排程 | [CLI](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)、[Desktop](https://code.claude.com/docs/zh-TW/desktop-scheduled-tasks.md) 或 [雲端](https://code.claude.com/docs/zh-TW/routines.md) | 選擇頻率 | 定期自動化 (如每日審查) |52| [Scheduled tasks](https://code.claude.com/docs/zh-TW/scheduled-tasks.md) | 設定排程 | [CLI](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)、[Desktop](https://code.claude.com/docs/zh-TW/desktop-scheduled-tasks.md) 或 [雲端](https://code.claude.com/docs/zh-TW/routines.md) | 選擇頻率 | 定期自動化 (如每日審查) |

55 53 


74* [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md):在您的 CI 管道中執行 Claude72* [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md):在您的 CI 管道中執行 Claude

75* [GitLab CI/CD](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md):GitLab 的相同功能73* [GitLab CI/CD](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md):GitLab 的相同功能

76* [Code Review](https://code.claude.com/docs/zh-TW/code-review.md):每個拉取請求上的自動審查74* [Code Review](https://code.claude.com/docs/zh-TW/code-review.md):每個拉取請求上的自動審查

77* [Slack](https://code.claude.com/docs/zh-TW/slack.md):從團隊聊天發送任務,取回 PR,適用於 Pro、Max 和 Ultra 方案

78* [Claude Tag](https://claude.com/docs/claude-tag):在 Team 和 Enterprise 方案上執行 `@Claude` 作為您組織的共享身分75* [Claude Tag](https://claude.com/docs/claude-tag):在 Team 和 Enterprise 方案上執行 `@Claude` 作為您組織的共享身分

79 76 

80### 遠端存取77### 遠端存取

plugin-evals.md +32 −6

Details

197 197 

198### 在 prompt.md 中設定執行限制和工具198### 在 prompt.md 中設定執行限制和工具

199 199 

200在 `prompt.md` frontmatter 中設定案例的 `max_turns`、`timeout_seconds`、`model`、`tags` 和它可能使用的 `allowed_tools`;[prompt.md frontmatter](#prompt-md-fields) 參考列出每個欄位及其預設值。200在 `prompt.md` frontmatter 中設定案例的 `max_turns`、`timeout_seconds`、`model`、`tags` 和 `allowed_tools`。如需其他欄位和預設值,請參閱 [prompt.md frontmatter](#prompt-md-fields) 參考。

201 201 

202Claude 會完全按照您撰寫的方式接收本文。其中的 `@path` 提及不會展開為檔案附件,所以如果 Claude 需要讀取檔案,請在 `allowed_tools` 中授予工具。202Claude 會完全按照您撰寫的方式接收本文。其中的 `@path` 提及不會展開為檔案附件,所以如果 Claude 需要讀取檔案,請在 `allowed_tools` 中授予工具。

203 203 


336 336 

337新增 `--case <glob>` 以按案例名稱篩選,並新增 `--tag <tag>` 以保留具有任何給定標籤的案例。337新增 `--case <glob>` 以按案例名稱篩選,並新增 `--tag <tag>` 以保留具有任何給定標籤的案例。

338 338 

339將 target 放在 `--tag`、`--allow-tools` 和 `--json` 之前。前兩個採用清單,`--json` 採用選用路徑,因此它們各自讀取後面的 target 作為其自己的值。339將 target 放在 `--tag`、`--allow-tools`、`--disallow-tools` 和 `--json` 之前。前三個採用清單,`--json` 採用選用路徑,因此它們各自會將後面的 target 讀取為其自己的值。

340 340 

341### 授予工具341### 授予工具

342 342 

343執行永遠不會停止以要求許可。需要您未授予的授權的內建工具(例如 `Bash`、`Write`、`Edit`、`WebFetch` 和 `WebSearch`)會從工作階段中移除,因此 Claude 根本無法呼叫它們。343執行永遠不會停止以要求許可。需要您未授予的授權的內建工具(例如 `Bash`、`Write`、`Edit`、`WebFetch` 和 `WebSearch`)會從工作階段中移除,因此 Claude 根本無法呼叫它們。

344 344 

345執行只允許案例在 `allowed_tools` 中列出的唯讀工具,來自 `Read`、`Glob`、`Grep`、`NotebookRead`、`Skill`、`AskUserQuestion`、`Agent`、`TodoWrite` 和工作工具 `TaskCreate`、`TaskGet`、`TaskList`、`TaskUpdate` 和 `TaskStop`,加上您使用 `--allow-tools` 授予的任何工具。該授權適用於執行中的每個案例。若要讓案例使用 `Bash`、`Write`、`Edit`、`WebFetch` 或 `WebSearch`,請自行授予它們:345執行會預先核准案例在 `allowed_tools` 中列出的唯讀工具,範圍為 `Read`、`Glob`、`Grep`、`NotebookRead`、`Skill`、`AskUserQuestion`、`Agent`、`TodoWrite` 和任務工具 `TaskCreate`、`TaskGet`、`TaskList`、`TaskUpdate` 和 `TaskStop`,加上您使用 `--allow-tools` 授予的任何工具。該授權適用於執行中的每個案例。

346 

347若要讓案例使用 `Bash`、`Write`、`Edit`、`WebFetch` 或 `WebSearch`,請使用 `--allow-tools` 授予它們:

346 348 

347```bash theme={null}349```bash theme={null}

348claude plugin eval . --allow-tools Write Edit "Bash(npm test *)"350claude plugin eval . --allow-tools Write Edit "Bash(npm test *)"


350 352 

351當案例要求您未授予的工具時,進度輸出會將其列為 `not granted`。[模擬](#mock-mcp-servers) MCP 伺服器上的工具不需要授權。真實外掛程式 MCP 伺服器上的工具需要伺服器啟動(使用 `--allow-real-servers` 或 `--mocks off`)和按名稱授權,例如 `--allow-tools "mcp__plugin_my-plugin_github__*"`;外掛程式的 MCP 工具命名為 `mcp__plugin_<plugin>_<server>__<tool>`。353當案例要求您未授予的工具時,進度輸出會將其列為 `not granted`。[模擬](#mock-mcp-servers) MCP 伺服器上的工具不需要授權。真實外掛程式 MCP 伺服器上的工具需要伺服器啟動(使用 `--allow-real-servers` 或 `--mocks off`)和按名稱授權,例如 `--allow-tools "mcp__plugin_my-plugin_github__*"`;外掛程式的 MCP 工具命名為 `mcp__plugin_<plugin>_<server>__<tool>`。

352 354 

355#### 預先核准從其他路徑讀取

356 

357若要預先核准 `/data` 等資料夾下的讀取,請授予以 `//` 開頭的 [`Read` 規則](https://code.claude.com/docs/zh-TW/permissions#read-and-edit),例如 `--allow-tools "Read(//data/**)"`。在原生 Windows 上,針對 `C:\data` 的相同授權為 `Read(//c/data/**)`。僅列出 `Read`、`Glob` 或 `Grep` 並不會預先核准您機器上的每個路徑。

358 

353#### Shell 授權需要沙箱359#### Shell 授權需要沙箱

354 360 

355當您以任何形式授予 `Bash` 時,每個命令都會在 Claude Code 的 [OS 層級沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)下執行。寫入限制在執行的工作區、您的主目錄和 Claude Code 設定無法讀取,網路存取限制在您使用 `--allow-tools "WebFetch(domain:example.com)"` 授予的網域。如果您在沒有沙箱後端的機器上授予 Bash 或 PowerShell,Claude Code 會拒絕每次執行,而不是無限制地執行它,案例會顯示執行錯誤,通常得分為 0。原生 Windows 沒有後端,因此在 WSL2 下執行授予 shell 的測試套件;在 Linux 上,請先安裝 `bubblewrap` 和 `socat`。請參閱[沙箱先決條件](https://code.claude.com/docs/zh-TW/sandboxing.md)。361當您以任何形式授予 `Bash` 時,每個命令都會在 Claude Code 的 [OS 層級沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)下執行。寫入限制在執行的工作區、您的主目錄和 Claude Code 設定無法讀取,網路存取限制在您使用 `--allow-tools "WebFetch(domain:example.com)"` 授予的網域。如果您在沒有沙箱後端的機器上授予 Bash 或 PowerShell,Claude Code 會拒絕每次執行,而不是無限制地執行它,案例會顯示執行錯誤,通常得分為 0。原生 Windows 沒有後端,因此在 WSL2 下執行授予 shell 的測試套件;在 Linux 上,請先安裝 `bubblewrap` 和 `socat`。請參閱[沙箱先決條件](https://code.claude.com/docs/zh-TW/sandboxing.md)。


365 371 

366請詢問您的管理員是否可以為您的機器變更該設定,或從該次執行中移除 shell 授權。372請詢問您的管理員是否可以為您的機器變更該設定,或從該次執行中移除 shell 授權。

367 373 

374### 從執行中移除內建工具

375 

376若要從每個案例中移除某個內建工具,請將其[確切名稱](https://code.claude.com/docs/zh-TW/tools-reference.md)傳遞給 `--disallow-tools`。若只針對單一案例,請在該案例的 [`disallowed_tools`](#prompt-md-fields) 欄位中列出該名稱。需要 Claude Code v2.1.299 或更新版本。

377 

378如果您只是從 `allowed_tools` 中省略 `Agent`,Claude 仍然可以呼叫它。

379 

380若要從每個案例中移除 `Agent` 和 `TaskStop`,請在您的 shell 中執行:

381 

382```bash theme={null}

383claude plugin eval . --disallow-tools Agent TaskStop

384```

385 

386輸出會在 `Removed from Claude's tools in every case` 之後列出這兩個工具。

387 

368### 命令選項388### 命令選項

369 389 

370此表涵蓋執行次數、模型、評分、成本、工具授權、模擬和輸出的選項。執行 `claude plugin eval --help` 以取得完整清單,其中也包括 `--case`、`--tag`、`--eval-dir`、`--no-scaffold`、`--report` 和 `--verbose`。390此表涵蓋執行次數、模型、評分、成本、工具授權、模擬和輸出的選項。執行 `claude plugin eval --help` 以取得完整清單,其中也包括 `--case`、`--tag`、`--eval-dir`、`--no-scaffold`、`--report` 和 `--verbose`。


379| `--threshold <0..1>` | `1.0` | 當案例的 with 分支得分至少達到此值時,案例通過。任何低於此值的案例都會使命令以 1 結束 |399| `--threshold <0..1>` | `1.0` | 當案例的 with 分支得分至少達到此值時,案例通過。任何低於此值的案例都會使命令以 1 結束 |

380| `--max-cost-usd <usd>` | 無上限 | 執行的列表價格成本估計上限,不是計畫使用量上限。在每次執行開始前檢查。一旦花費,不會進一步開始任何內容;已經開始的執行會完成,因此花費可能會因這些執行而超過上限。如果有任何執行未開始,命令會以 2 結束並返回部分結果 |400| `--max-cost-usd <usd>` | 無上限 | 執行的列表價格成本估計上限,不是計畫使用量上限。在每次執行開始前檢查。一旦花費,不會進一步開始任何內容;已經開始的執行會完成,因此花費可能會因這些執行而超過上限。如果有任何執行未開始,命令會以 2 結束並返回部分結果 |

381| `--allow-tools <tools...>` | 無 | 授予超出唯讀集合的工具。請參閱[授予工具](#grant-tools) |401| `--allow-tools <tools...>` | 無 | 授予超出唯讀集合的工具。請參閱[授予工具](#grant-tools) |

402| `--disallow-tools <tools...>` | 無 | 從每個案例中移除內建工具。請參閱[從執行中移除內建工具](#disallow-tools) |

382| `--scaffold` | 關閉 | 執行每個案例的 [`scaffold_script`](#add-setup-or-history-with-case-yaml) |403| `--scaffold` | 關閉 | 執行每個案例的 [`scaffold_script`](#add-setup-or-history-with-case-yaml) |

383| `--trust-plugin` | 關閉 | 跳過您會自行執行其程式碼和測試套件的外掛程式的首次執行信任提示。在 CI 中傳遞它,以便工作永遠不會被提示拒絕或留在等待。請參閱[執行可以存取的內容](#security) |404| `--trust-plugin` | 關閉 | 跳過您會自行執行其程式碼和測試套件的外掛程式的首次執行信任提示。在 CI 中傳遞它,以便工作永遠不會被提示拒絕或留在等待。請參閱[執行可以存取的內容](#security) |

384| `--mocks <mode>` | `record` | `record` 從[模擬](#mock-mcp-servers)回答 MCP 工具呼叫,不啟動外掛程式的真實伺服器,並儲存代理模擬答案以供重播。`off` 忽略模擬並啟動外掛程式的真實 MCP 伺服器 |405| `--mocks <mode>` | `record` | `record` 從[模擬](#mock-mcp-servers)回答 MCP 工具呼叫,不啟動外掛程式的真實伺服器,並儲存代理模擬答案以供重播。`off` 忽略模擬並啟動外掛程式的真實 MCP 伺服器 |


537| `model` | 子工作階段的預設值 | 被測試代理的模型。`--model` 覆蓋它 |558| `model` | 子工作階段的預設值 | 被測試代理的模型。`--model` 覆蓋它 |

538| `max_turns` | `10` | 回合上限,最多 200。達到它會被記錄為執行錯誤,通常會降低分數,所以請慷慨設定 |559| `max_turns` | `10` | 回合上限,最多 200。達到它會被記錄為執行錯誤,通常會降低分數,所以請慷慨設定 |

539| `timeout_seconds` | `300` | 每次執行的牆鐘上限,最多 3600 |560| `timeout_seconds` | `300` | 每次執行的牆鐘上限,最多 3600 |

540| `allowed_tools` | `[]` | 案例想要的工具,例如 `[Read, Glob, Grep, Skill]`。唯讀工具在此列出時被授予;對於其他任何東西,請參閱 [Grant tools](#grant-tools) |561| `allowed_tools` | `[]` | 案例想要的工具,例如 `[Read, Glob, Grep, Skill]`。請參閱[授予工具](#grant-tools) |

562| `disallowed_tools` | | 要[從此案例中移除](#disallow-tools)的確切內建工具名稱,例如 `[Agent, TaskStop]` |

541| `append_system_prompt` | | 附加到子工作階段系統提示的文字 |563| `append_system_prompt` | | 附加到子工作階段系統提示的文字 |

542| `env` | `{}` | 子工作階段的額外環境變數。鍵必須符合 `EVAL_[A-Z0-9_]*`;任何其他鍵都會導致執行失敗。執行只從您的 shell 繼承一個允許清單:基本項目如 `PATH` 和語言環境、代理和憑證設定、選擇和驗證您的模型提供者的變數、大多數 `ANTHROPIC_*` 和 `CLAUDE_CODE_*` 設定,以及 `EVAL_*`。要將任何其他東西交給 plugin,例如工具鏈設定,請將其匯出為 `EVAL_*` 變數 |564| `env` | `{}` | 子工作階段的額外環境變數。鍵必須符合 `EVAL_[A-Z0-9_]*`;任何其他鍵都會導致執行失敗。執行只從您的 shell 繼承一個允許清單:基本項目如 `PATH` 和語言環境、代理和憑證設定、選擇和驗證您的模型提供者的變數、大多數 `ANTHROPIC_*` 和 `CLAUDE_CODE_*` 設定,以及 `EVAL_*`。要將任何其他東西交給 plugin,例如工具鏈設定,請將其匯出為 `EVAL_*` 變數 |

543 565 

544### case.yaml fields566### case.yaml fields

545 567 

546`case.yaml` 是 `prompt.md` 的替代或伴隨:它以 YAML 描述案例並新增指向其他檔案的欄位。它需要 `schema_version: "1.1"` 和 `name`。`prompt.md` 欄位 `description`、`tags`、`plugins`、`runs` 和 `expected_outcome` 在頂層;`model`、`max_turns`、`timeout_seconds`、`allowed_tools`、`append_system_prompt` 和 `env` 在 `execution:` 下。當兩個檔案都存在時,`prompt.md` frontmatter 覆蓋匹配的 `case.yaml` 欄位,`prompt.md` 主體是提示,`graders/*.md` 在 `case.yaml` 中列出的任何評分器之後新增。568`case.yaml` 是 `prompt.md` 的替代或伴隨:它以 YAML 描述案例並新增指向其他檔案的欄位。它需要 `schema_version: "1.1"` 和 `name`。`prompt.md` 欄位 `description`、`tags`、`plugins`、`runs` 和 `expected_outcome` 在頂層;`model`、`max_turns`、`timeout_seconds`、`allowed_tools`、`disallowed_tools`、`append_system_prompt` 和 `env` 在 `execution:` 下。

569 

570當兩個檔案都存在時,`prompt.md` frontmatter 會覆寫相符的 `case.yaml` 欄位,但 `disallowed_tools` 除外,該欄位的兩個清單會合併。`prompt.md` 主體是提示詞,`graders/*.md` 會在 `case.yaml` 中列出的任何評分器之後新增。

547 571 

548這些欄位僅存在於 `case.yaml` 中:572這些欄位僅存在於 `case.yaml` 中:

549 573 


677 701 

678此錯誤是預期的,因為 `Δ` 會將您外掛的執行與基準進行比較。在 JSON 結果中,基準執行位於 `cases[].arms.without` 下。702此錯誤是預期的,因為 `Δ` 會將您外掛的執行與基準進行比較。在 JSON 結果中,基準執行位於 `cases[].arms.without` 下。

679 703 

680在載入您外掛的執行中,在 `allowed_tools` 中列出 `Agent` 的案例可以透過命名空間名稱分派您外掛的某個 agent,例如名為 `my-plugin` 的外掛中的 `code-reviewer` agent 為 `my-plugin:code-reviewer`。若要略過基準執行,請傳遞 `--ablation none`。704> [!NOTE]

705>

706> 在載入您外掛的執行中,Claude 可以透過命名空間名稱分派您外掛的某個 agent,例如名為 `my-plugin` 的外掛中的 `code-reviewer` agent 為 `my-plugin:code-reviewer`。若要略過基準執行,請傳遞 `--ablation none`。

681 707 

682### 已產生正確的檔案,但所有項目都評分為零708### 已產生正確的檔案,但所有項目都評分為零

683 709 

Details

493* 已安裝的 plugin,如 `name` 或 `name@marketplace`493* 已安裝的 plugin,如 `name` 或 `name@marketplace`

494* `name@skills-dir`494* `name@skills-dir`

495 495 

496將目標放在 `--tag`、`--allow-tools` 和 `--json` 之前。這些選項中的每一個都將其後面的單詞作為其值,因此在其中一個之後寫入的目標被讀作標籤、工具名稱或 JSON 輸出路徑,而不是目標。496將目標放在 `--tag`、`--allow-tools`、[`--disallow-tools`](https://code.claude.com/docs/zh-TW/plugin-evals#disallow-tools) 和 `--json` 之前。寫在其中一個之後的目標可能會被讀作標籤、工具名稱或 JSON 輸出路徑。

497 497 

498此表列出大多數執行使用的選項。執行 `claude plugin eval --help` 以獲得完整集合,包括 `--case`、`--tag`、`--output-dir`、`--report`、`--allow-real-servers`、`--keep-temp` 和 `--verbose`。498此表列出大多數執行使用的選項。執行 `claude plugin eval --help` 以獲得完整集合,包括 `--case`、`--tag`、`--output-dir`、`--report`、`--allow-real-servers`、`--keep-temp` 和 `--verbose`。

499 499 

Details

6 6 

7> 從空目錄建立您的第一個 Claude Code 外掛程式,在沒有市集的情況下測試它,並轉換現有的 .claude/ 設定。7> 從空目錄建立您的第一個 Claude Code 外掛程式,在沒有市集的情況下測試它,並轉換現有的 .claude/ 設定。

8 8 

9外掛程式是一個包含技能、代理、hooks 和 MCP 伺服器的目錄,加上一個稱為清單的 `plugin.json` 檔案,用來命名外掛程式。Claude Code 將該目錄作為一個單位載入,因此您可以與隊友分享、在多個專案中安裝,或將其發佈到市集。9外掛程式是一個包含 skill、agent、hook 和 MCP 伺服器的目錄,加上一個稱為清單的 `plugin.json` 檔案,用來命名外掛程式。Claude Code 將該目錄作為一個單位載入,因此您可以與他人分享、在多個專案中安裝,或將其發佈到市集。

10 10 

11本頁面適用於編寫自己外掛程式的人員。11本頁面適用於編寫自己外掛程式的人員。

12 12 


25 25 

26## 決定何時使用外掛程式26## 決定何時使用外掛程式

27 27 

28技能、代理、hooks 和 MCP 伺服器都可以在您的專案或主目錄中獨立運作。當它只為一個專案或只為您服務時,保持該獨立設定。當您想與隊友分享設定、在多個專案中安裝,或發佈版本化版本時,請建立外掛程式。28Skill、agent、hook 和 MCP 伺服器都可以在您的專案或家目錄中獨立運作。當它只為一個專案或只為您服務時,保持該獨立設定。當您想與他人分享設定、在多個專案中安裝,或發佈版本化版本時,請建立外掛程式。

29 29 

30當您將獨立技能、代理、hooks 和 MCP 設定移到外掛程式中時,它們的位置和名稱會改變:30當您將獨立技能、代理、hooks 和 MCP 設定移到外掛程式中時,它們的位置和名稱會改變:

31 31 

Details

15> 這些情況涵蓋在其他頁面上:15> 這些情況涵蓋在其他頁面上:

16>16>

17> * **您還沒有編寫目錄檔案**:從 [建立市集](https://code.claude.com/docs/zh-TW/plugins/create-marketplace.md) 開始17> * **您還沒有編寫目錄檔案**:從 [建立市集](https://code.claude.com/docs/zh-TW/plugins/create-marketplace.md) 開始

18> * **您是管理員,需要在組織的機器上要求、限制或預先安裝市集**:閱讀 [為您的組織管理外掛程式](https://code.claude.com/docs/zh-TW/plugins/org.md)18> * **您想要在組織的機器上要求、限制或預先安裝市集**:閱讀 [為您的組織管理外掛程式](https://code.claude.com/docs/zh-TW/plugins/org.md)

19 19 

20從 [託管您的市集](#host-your-marketplace) 開始以選擇主機和您的使用者執行的命令。在您的第一次發佈之前,閱讀 [讓使用者保持最新狀態](#keep-users-up-to-date)。在您變更外掛程式的 `name` 之前,閱讀 [重新命名或移除外掛程式](#rename-or-remove-a-plugin)。20從 [託管您的市集](#host-your-marketplace) 開始以選擇主機和您的使用者執行的命令。在您的第一次發佈之前,閱讀 [讓使用者保持最新狀態](#keep-users-up-to-date)。在您變更外掛程式的 `name` 之前,閱讀 [重新命名或移除外掛程式](#rename-or-remove-a-plugin)。

21 21 


113 113 

114對於 GitHub Enterprise Server 主機,使用者需要從其機器存取該主機的 git 存取。請參閱 [Plugin marketplaces on GHES](https://code.claude.com/docs/zh-TW/github-enterprise-server.md#plugin-marketplaces-on-ghes) 以了解每個 Claude Code 表面需要什麼來到達 GHES 託管的 marketplace。114對於 GitHub Enterprise Server 主機,使用者需要從其機器存取該主機的 git 存取。請參閱 [Plugin marketplaces on GHES](https://code.claude.com/docs/zh-TW/github-enterprise-server.md#plugin-marketplaces-on-ghes) 以了解每個 Claude Code 表面需要什麼來到達 GHES 託管的 marketplace。

115 115 

116如果您改為透過 claude.ai 上的 **Organization settings > Plugins & skills** 分發,您使用者的 git 認證不涉及。請參閱 [透過組織設定分發](#distribute-through-organization-settings)。116如果您改為透過 claude.ai 上的 [**Organization settings > Plugins & skills**](https://claude.ai/admin-settings/skills?tab=inventory) 分發,則不會涉及使用者的 git 憑證。請參閱 [透過組織設定分發](#distribute-through-organization-settings)。

117 117 

118### Serve users who have no git-host account118### Serve users who have no git-host account

119 119 

Details

200 200 

201> [!NOTE]201> [!NOTE]

202>202>

203> 如果市集尚未位於您的機器上,請在安裝之前先[新增市集](https://code.claude.com/docs/zh-TW/plugins/install.md#add-a-marketplace)。您可以在 `.claude/settings.json` 的 `extraKnownMarketplaces` 設定中找到其來源,或詢問您的維護者。203> 如果市集尚未位於您的機器上,請在安裝之前先[新增市集](https://code.claude.com/docs/zh-TW/plugins/install.md#add-a-marketplace)。您可以在 `.claude/settings.json` 的 `extraKnownMarketplaces` 設定中找到其來源,或詢問專案的維護者。

204 204 

205若要安裝,請在專案中的 shell 執行以下指令,並使用該 plugin 在 `enabledPlugins` 中的金鑰:205若要安裝,請在專案中的 shell 執行以下指令,並使用該 plugin 在 `enabledPlugins` 中的金鑰:

206 206 

Details

298 298 

299請查看 `hooks:` 行,確認您的模組 hook 的事件,每個事件的篩選器都列在大括號中;並查看 `calls:` 行,確認它呼叫的每個 mod API 方法。如果您的模組會讀取或設定環境變數,也請留意 `env reads:` 和 `env writes:` 行;若使用了 [`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state),則請留意 `state reads:` 和 `state writes:`。對於每個可以拒絕動作的 hook,您也會看到一行,例如 `gating hook without .catch: tool.call`,說明該 hook 是否具有 [`.catch` 處理常式](https://code.claude.com/docs/zh-TW/plugins/mods/events#handle-a-hook-that-fails)。299請查看 `hooks:` 行,確認您的模組 hook 的事件,每個事件的篩選器都列在大括號中;並查看 `calls:` 行,確認它呼叫的每個 mod API 方法。如果您的模組會讀取或設定環境變數,也請留意 `env reads:` 和 `env writes:` 行;若使用了 [`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state),則請留意 `state reads:` 和 `state writes:`。對於每個可以拒絕動作的 hook,您也會看到一行,例如 `gating hook without .catch: tool.call`,說明該 hook 是否具有 [`.catch` 處理常式](https://code.claude.com/docs/zh-TW/plugins/mods/events#handle-a-hook-that-fails)。

300 300 

301如果您想處理的事件沒有出現在 `hooks:` 行中,Claude Code 也不會呼叫該 hook。常見原因是事件名稱拼寫錯誤,命令會將其回報為錯誤,例如 `"tool.calls" is not an event`。301如果您想處理的事件沒有出現在 `hooks:` 行中,Claude Code 也不會呼叫該 hook。請對照[您建置的型別](#get-the-types-for-your-build)檢查每個事件名稱,因為驗證無法捕捉到每個拼寫錯誤。例如,`tool.calls` 會失敗並出現 `"tool.calls" is not an event`,但 `tol.call` 會通過驗證,而 mod 隨後卻無法載入。

302 302 

303遵循這些規則,以便靜態分析可以找到每個 hook 和呼叫:303遵循這些規則,以便靜態分析可以找到每個 hook 和呼叫:

304 304 

305* 完整寫出每個 mods API 呼叫:`$`、命名空間,然後是方法,如 `$.store.get('notes')`。您可以將 `$` 傳遞給在同一檔案頂層宣告的函式;若您的函式名為 `loadNotes`,`calls:` 行就會顯示 `$.store.get (via loadNotes)`。將 `$` 傳遞給方法、在 hook 內定義的函式,或您從自己的另一個檔案匯入的函式,都會導致驗證失敗。[`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state) 使用的 `read` 和 `update` 函式是可以接收它的匯入。不要將 `$` 或其命名空間之一指派給變數、對其解構,或以計算名稱對其進行索引。`const ui = $.ui` 會失敗,並出現 `$.ui is used as a value`。305* 完整寫出每個 mods API 呼叫:`$`、命名空間,然後是方法,如 `$.store.get('notes')`。不要將 `$` 或其命名空間之一指派給變數、對其解構,或以計算名稱對其進行索引。`const ui = $.ui` 會失敗,並出現 `$.ui is used as a value`。

306* 在每個 `on` 呼叫中將事件名稱寫為字串文字,例如 `'tool.call'`。變數或名稱列表上的迴圈失敗,出現 `the event name passed to on() is not a string literal`。306* 在每個 `on` 呼叫中將事件名稱寫為字串文字,例如 `'tool.call'`。變數或名稱列表上的迴圈失敗,出現 `the event name passed to on() is not a string literal`。

307* 在 `register` 內,不要宣告名為 `on` 的第二個變數或引數。驗證失敗,出現 `"on" is declared again (shadowed)`。307* 在 `register` 內,不要宣告名為 `on` 的第二個變數或引數。驗證失敗,出現 `"on" is declared again (shadowed)`。

308* 僅從 plugin 目錄內的檔案匯入,按相對路徑。允許的唯一裸匯入是 `claude-code`,用於型別和一些幫助程式。308* 僅從 plugin 目錄內的檔案匯入,按相對路徑。允許的唯一裸匯入是 `claude-code`,用於型別和一些幫助程式。

309* 在檔案頂部使用 `import` 宣告,如 `import { name } from './file.js'`。動態 `import()` 失敗,出現 `a dynamic import(); a hooks module imports its own files with an import declaration`。309* 在檔案頂部使用 `import` 宣告,如 `import { name } from './file.js'`。動態 `import()` 失敗,出現 `a dynamic import(); a hooks module imports its own files with an import declaration`。

310* 將每個檔案寫為 ES 模組,使用 `import` 而不是 `require`。[參考](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#files)列出 Claude Code 載入的檔案副檔名。310* 將每個檔案寫為 ES 模組,使用 `import` 而不是 `require`。[參考](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#files)列出 Claude Code 載入的檔案副檔名。

311 311 

312#### 將 `$` 傳遞給您的函式

313 

314您可以將 `$` 傳遞給在 hook 檔案頂層宣告的函式,以及 [`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state) 使用的 `read` 和 `update` 函式。若名為 `loadNotes` 的函式呼叫了 `$.store.get`,`calls:` 行就會顯示 `$.store.get (via loadNotes)`。將 `$` 傳遞給方法或在 hook 內定義的函式,會導致驗證失敗。

315 

316在 Claude Code v2.1.299 或更新版本中,您也可以將 `$` 傳遞給從您的另一個檔案匯入的函式。請在該檔案中使用 `function` 關鍵字宣告它,如 `export function loadNotes($) { ... }`。匯入的箭頭函式會失敗,並出現 `a name bound to a function expression, outside the hook's own file`。

317 

312### 測試 mod318### 測試 mod

313 319 

314您可以為 mod 撰寫自動化測試,並使用 `claude plugin test` 從您的 shell 執行,無需工作階段、登入或網路。測試會觸發您的 hook 處理的事件,並檢查 hook 做了什麼。320您可以為 mod 撰寫自動化測試,並使用 `claude plugin test` 從您的 shell 執行,無需工作階段、登入或網路。測試會觸發您的 hook 處理的事件,並檢查 hook 做了什麼。


362 368 

363在你這樣做之前,檢查 plugin 的 `name`:`claude plugin validate` 失敗一個[看起來像 Anthropic 自己的](https://code.claude.com/docs/zh-TW/plugins/manifest-reference.md#name)名稱,例如以 `claude-` 開頭的名稱。事件和方法可以在版本之間變更,所以你的 README 是說明你測試的 Claude Code 版本的地方。369在你這樣做之前,檢查 plugin 的 `name`:`claude plugin validate` 失敗一個[看起來像 Anthropic 自己的](https://code.claude.com/docs/zh-TW/plugins/manifest-reference.md#name)名稱,例如以 `claude-` 開頭的名稱。事件和方法可以在版本之間變更,所以你的 README 是說明你測試的 Claude Code 版本的地方。

364 370 

365請使用 `--plugin-dir` 針對目錄繼續開發,而不是針對已安裝的副本。Claude Code 會按版本快取已安裝的外掛,因此在您提高版本並再次安裝之前,您的編輯不會反映到已安裝的副本。371請使用 `--plugin-dir` 針對目錄繼續開發,而不是針對[已安裝的副本](https://code.claude.com/docs/zh-TW/plugins/loading.md#in-place-and-copied-plugins)。

366 372 

367## 後續步驟373## 後續步驟

368 374 

Details

46 46 

47### 重寫事件47### 重寫事件

48 48 

49若要變更 Claude Code 作用的內容,例如提示詞的文字,請使用修改後的事件副本呼叫 `next`。事件本身是不可變的:它在每個深度都被凍結,分配給欄位會擲回。此 hook 在傳送前修剪每個提示詞:49若要變更 Claude Code 作用的內容,請使用修改後的事件副本呼叫 `next`。

50 

51此 hook 在傳送前修剪提示詞:

50 52 

51```javascript theme={null}53```javascript theme={null}

52on('prompt.submit', async ($, e, next) => {54on('prompt.submit', async ($, e, next) => {


55})57})

56```58```

57 59 

58稍後的處理程式和 Claude Code 會收到修剪後的提示,永遠看不到原始提示。您也可以變更結果:`await next(e)`,然後傳回結果的副本,其中欄位已替換。60對於以純文字輸入的提示詞,稍後的處理程式和 Claude 會收到修剪後的提示詞。

59 61 

60### 回答事件62### 回答事件

61 63 


150* **自行回應呼叫**:在不呼叫 `next` 的情況下傳回具有 `result` 欄位的物件;若為內建工具,請讓 `result` 符合該工具本身的結果在[您建置版本的型別](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build)中的形狀。不會出現權限提示,工具也不會執行,因此您傳回的結果就是 Claude 對所發生事情的全部了解。152* **自行回應呼叫**:在不呼叫 `next` 的情況下傳回具有 `result` 欄位的物件;若為內建工具,請讓 `result` 符合該工具本身的結果在[您建置版本的型別](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build)中的形狀。不會出現權限提示,工具也不會執行,因此您傳回的結果就是 Claude 對所發生事情的全部了解。

151* **對 Claude 隱藏結果**:在 `await next(e)` 之後傳回 `{ deny: reason }`。Claude 會讀取您的原因,而非 `next` 傳回的內容。當工具已執行時,deny 會讓 Claude 看不到其結果,但不會復原工具所做的任何事。當工具已執行且成功時,原因會接在如 `Bash ran, and a plugin withheld its result:` 之類的註記之後。153* **對 Claude 隱藏結果**:在 `await next(e)` 之後傳回 `{ deny: reason }`。Claude 會讀取您的原因,而非 `next` 傳回的內容。當工具已執行時,deny 會讓 Claude 看不到其結果,但不會復原工具所做的任何事。當工具已執行且成功時,原因會接在如 `Bash ran, and a plugin withheld its result:` 之類的註記之後。

152 154 

153您組織的[受管設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)中的 hook 會在任何 mod 的 `tool.call` hook 之前執行。當受管 hook 封鎖該呼叫時,任何 mod 的 `tool.call` hook 都不會針對該呼叫執行。155[受管設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)中的 hook 會在任何 mod 的 `tool.call` hook 之前執行。當受管 hook 封鎖該呼叫時,任何 mod 的 `tool.call` hook 都不會針對該呼叫執行。

154 156 

155#### 暫停工具呼叫,直到使用者做出決定157#### 暫停工具呼叫,直到使用者做出決定

156 158 


260 262 

261### 改寫或補充提示詞263### 改寫或補充提示詞

262 264 

263`prompt.submit` hook 會在回合開始之前看到每個提示詞,因此可以改寫文字或加入內容。`e.text` 是輸入的內容。265若要改寫提示詞或為其補充內容,請處理 `prompt.submit`,從 `e.text` 讀取提示詞,並傳回下表中的值:

264 266 

265| 若要執行此操作 | 請傳回 |267| 若要執行此操作 | 請傳回 |

266| :- | :- |268| :- | :- |

267| 改寫提示詞。逐字稿和您的[提示詞歷史記錄](https://code.claude.com/docs/zh-TW/interactive-mode.md#command-history)會顯示新文字。 | `next({ ...e, text: newText })` |269| 改寫以純文字輸入的提示詞。逐字稿和您的[提示詞歷史記錄](https://code.claude.com/docs/zh-TW/interactive-mode.md#command-history)會顯示新文字。 | `next({ ...e, text: newText })` |

268| 在提示詞之後加入只有 Claude 會讀取的文字 | `next({ ...e, context: [...(e.context ?? []), extraText] })` |270| 在提示詞之後加入只有 Claude 會讀取的文字 | `next({ ...e, context: [...(e.context ?? []), extraText] })` |

269| 阻止送出提示詞 | `{ drop: 'the reason' }` |271| 阻止送出提示詞 | `{ drop: 'the reason' }` |

270 272 

271每當提示詞提及 pull request 時,此 hook 就會為 Claude 加入目前的分支名稱:273當提示詞提及 pull request 時,此 hook 會為 Claude 加入目前的分支名稱:

272 274 

273```javascript theme={null}275```javascript theme={null}

274on('prompt.submit', async ($, e, next) => {276on('prompt.submit', async ($, e, next) => {


284 286 

285當您送出如 `open a PR for this change` 之類的提示詞時,您的訊息在逐字稿中看起來不變,而 Claude 還會在其後讀到如 `Current branch: feature/auth` 之類的一行。未提及 pull request 的提示詞會原封不動地通過,且不會執行 `git`。287當您送出如 `open a PR for this change` 之類的提示詞時,您的訊息在逐字稿中看起來不變,而 Claude 還會在其後讀到如 `Current branch: feature/auth` 之類的一行。未提及 pull request 的提示詞會原封不動地通過,且不會執行 `git`。

286 288 

287若要阻止提示詞,請在不呼叫 `next` 的情況下傳回 `{ drop: 'the reason' }`。文字會回到使用者的提示詞輸入欄中,而使用者會看到 `Prompt dropped by a hook:` 後接您的原因,因此請以使用者為對象撰寫原因。在以下情況中,提示詞仍會送出:289若要阻止提示詞,請在不呼叫 `next` 的情況下傳回 `{ drop: 'the reason' }`。文字會回到使用者的提示詞輸入欄中,而使用者會看到 `Prompt dropped by a hook:` 後接您的原因,因此請以使用者為對象撰寫原因。請勿依賴 `drop` 來阻止所有提示詞。例如,在以下情況中,提示詞仍會送出:

288 290 

289* **您的 hook 在其 `next(e)` 呼叫已讓提示詞通過之後才傳回 `drop`**:回合仍會執行,且該 hook 會[失敗](#handle-a-hook-that-fails),並顯示包含 `a drop after its next() was answered` 的訊息291* **您的 hook 在其 `next(e)` 呼叫已讓提示詞通過之後才傳回 `drop`**:回合仍會執行,且該 hook 會[失敗](#handle-a-hook-that-fails),並顯示包含 `a drop after its next() was answered` 的訊息

290* **您的 hook 擲出例外或逾時**:Claude Code 會略過它並送出提示詞。請[加入 `.catch` 處理常式](#handle-a-hook-that-fails),以免失敗時送出 hook 原本會阻止的提示詞。292* **您的 hook 擲出例外或逾時**:Claude Code 會略過它並送出提示詞。請[加入 `.catch` 處理常式](#handle-a-hook-that-fails),以免失敗時送出 hook 原本會阻止的提示詞。

293* **提示詞是[具有 `context: fork` 的 skill](https://code.claude.com/docs/zh-TW/skills#run-skills-in-a-subagent) 的 `/command`**:您的 hook 不會執行。若要阻止該命令,請從 [`command.run`](https://code.claude.com/docs/zh-TW/plugins/mods/api#add-a-command) hook 在不呼叫 `next` 的情況下傳回 `{ text: 'the reason' }`。

291 294 

292[其他事件](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#prompts-and-what-claude-reads)涵蓋 Claude 讀取的其餘內容:`prompt.section` 用於系統提示詞的每個區段,`prompt.context` 用於隨第一則訊息送出的上下文,而 `skill.prompt` 用於 skill 的文字。若要在對話開始後變更某個區段,請參閱[傳送變更後的系統提示詞區段或工具描述](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#break-prompt-cache)。在 `skill.prompt` hook 中,您也可以讀取[該 skill 來自哪個外掛或檔案](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#skill-prompt-fields)。295[其他事件](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#prompts-and-what-claude-reads)涵蓋 Claude 讀取的其餘內容:`prompt.section` 用於系統提示詞的每個區段,`prompt.context` 用於隨第一則訊息送出的上下文,而 `skill.prompt` 用於 skill 的文字。若要在對話開始後變更某個區段,請參閱[傳送變更後的系統提示詞區段或工具描述](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#break-prompt-cache)。在 `skill.prompt` hook 中,您也可以讀取[該 skill 來自哪個外掛或檔案](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#skill-prompt-fields)。

293 296 


297 300 

298| 事件 | 觸發時機 | hook 可以做什麼 |301| 事件 | 觸發時機 | hook 可以做什麼 |

299| :- | :- | :- |302| :- | :- | :- |

300| `turn.start` | 回合開始時 | 觀察。`e.turnId` 會在另外兩個事件中識別該回合。 |303| `turn.start` | 回合開始時。subagent 的回合觸發此事件時會設定 `e.agentId`,這需要 Claude Code v2.1.299 或更新版本。 | 觀察。`e.turnId` 會在另外兩個事件中識別該回合。 |

301| `turn.step` | Claude Code 即將向模型送出一個請求時。包含工具呼叫的回合會有多個請求。subagent 的請求會設定 `e.agentId`。 | 讀取每個請求的 token 使用量、使用 `next({ ...e, model })` 將其送往不同的模型,或在不呼叫模型的情況下自行回應 |304| `turn.step` | Claude Code 即將向模型送出一個請求時。包含工具呼叫的回合會有多個請求。subagent 的請求會設定 `e.agentId`。 | 讀取每個請求的 token 使用量、使用 `next({ ...e, model })` 將其送往不同的模型,或在不呼叫模型的情況下自行回應 |

302| `turn.complete` | 回合結束時,包括使用者中斷的回合,此時 `e.isAborted` 為 `true`。`e.answer` 是 Claude 的最終文字,`e.durationMs` 是所花費的時間,`e.usage` 是該回合的 token 總數。subagent 的回合觸發此事件時會設定 `e.agentId`。 | 觀察,或傳回具有 `text` 欄位的物件(例如 `{ text: 'Done in 12 seconds' }`),以在答案下方顯示一行文字 |305| `turn.complete` | 回合結束時,包括使用者中斷的回合,此時 `e.isAborted` 為 `true`。`e.answer` 是 Claude 的最終文字,`e.durationMs` 是所花費的時間,`e.usage` 是該回合的 token 總數。subagent 的回合觸發此事件時會設定 `e.agentId`。 | 觀察。在主要對話中,傳回具有 `text` 欄位的物件(例如 `{ text: 'Done in 12 seconds' }`),以在答案下方顯示一行文字。 |

303 306 

304請將 `turn.step` hook 撰寫為非同步產生器(async generator),因為此事件是串流的。`yield* next(e)` 會在串流時轉送回應,並求值為最終結果。此 hook 會記錄每個請求中有多少是由 Claude API 從[提示快取](https://code.claude.com/docs/zh-TW/prompt-caching.md)提供:307請將 `turn.step` hook 撰寫為非同步產生器(async generator),因為此事件是串流的。`yield* next(e)` 會在串流時轉送回應,並求值為最終結果。此 hook 會記錄每個請求中有多少是由 Claude API 從[提示快取](https://code.claude.com/docs/zh-TW/prompt-caching.md)提供:

305 308 

Details

201 201 

202### 變更 Claude Code 已繪製的內容202### 變更 Claude Code 已繪製的內容

203 203 

204Claude Code 自行繪製大部分介面:訊息、工具呼叫列、spinner 等等。其中每個部分也都是轉譯位置,因此 mod 可以重新設定其樣式或加以取代。若要變更其中之一,請以下表中的名稱篩選您的 `ui.render` hook:204若要變更 Claude Code 繪製的某個部分,請以下表中的轉譯位置篩選您的 `ui.render` hook:

205 205 

206| 位置 | 說明 |206| 位置 | 說明 |

207| :- | :- |207| :- | :- |

208| `UserMessage`、`AssistantMessage` | 逐字稿中的一則訊息 |208| `UserMessage`、`AssistantMessage` | 逐字稿中的一則訊息 |

209| `ToolUse`、`ToolResult`、`ToolGroup` | 工具呼叫的列、其結果,以及收合起來的一組呼叫 |209| `ToolUse`、`ToolResult`、`ToolGroup` | 工具呼叫的列、其結果,以及收合起來的一組呼叫 |

210| `CommandOutput` | 命令輸出的列 |210| `CommandOutput` | 命令輸出的列 |

211| `AskUserQuestion` | Claude 開啟以向您提問的對話框 |211| `AskUserQuestion` | Claude 開啟以向您提問的對話框。`ui.render` hook 無法取代它。 |

212| `Spinner`、`ToolProgress`、`TurnDuration` | 回合的狀態列:Claude 工作時播放動畫的那一行、執行中工具的即時進度行,以及結束一個回合的那一行 |212| `Spinner`、`ToolProgress`、`TurnDuration` | 回合的狀態列:Claude 工作時播放動畫的那一行、執行中工具的即時進度行,以及結束一個回合的那一行 |

213| `InfoNotice`、`SessionMode`、`PromptHint` | 標誌下方的狀態列、頁尾的模式標籤,以及提示詞下方的提示行 |213| `InfoNotice`、`SessionMode`、`PromptHint` | 標誌下方的狀態列、頁尾的模式標籤,以及提示詞下方的提示行 |

214| `AgentRow` | agent 面板中 subagent 或隊友的列 |214| `AgentRow` | agent 面板中 subagent 或隊友的列 |

215 215 

216`Pane`、`AskUserQuestion`、`Spinner`、`UserMessage`、`AssistantMessage` 以及工具呼叫位置可在終端機、Desktop 應用程式和 VS Code 擴充功能中運作。[轉譯位置表](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#render-sites)列出了其他各位置在何處觸發。216`Pane`、`AbovePrompt`、`AskUserQuestion`、`Spinner`、`UserMessage`、`AssistantMessage` 以及工具呼叫位置可在終端機、Desktop 應用程式和 VS Code 擴充功能中運作。[轉譯位置表](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#render-sites)列出了其他各位置在何處觸發。若要在不使用 `ui.render` hook 的情況下變更 Desktop 應用程式中訊息的泡泡與字型,請[以主題設定訊息樣式](#style-messages-in-the-desktop-app)。

217 217 

218在 Claude Code 已繪製的位置,您的 hook 可以變更某個細節、取代繪製內容,或保持不變。選擇一個分頁,查看每種做法套用於 spinner 的效果。這些範例會讀取由另一個 hook 計數的 `calls` 變數,如同[教學 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#write-a-mod-yourself) 中的做法。218選擇一個分頁,查看 hook 如何變更 spinner 的細節、取代 spinner,或保持不變。這些範例會讀取由另一個 hook 計數的 `calls` 變數,如同[教學 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#write-a-mod-yourself) 中的做法。

219 219 

220> [tab] 變更細節220> [tab] 變更細節

221>221>


439 439 

440* **`backdrop` 欄位**:`scene` 是您為 hook 所繪製的背景選擇的[名稱](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#limits)。關於其他欄位與 `overrideColorScheme`,請參閱[適用於您建置版本的型別](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build)。440* **`backdrop` 欄位**:`scene` 是您為 hook 所繪製的背景選擇的[名稱](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#limits)。關於其他欄位與 `overrideColorScheme`,請參閱[適用於您建置版本的型別](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build)。

441* **背景是否已繪製**:當連線到工作階段的 Desktop 或行動應用程式表示它會繪製背景時,`$.theme.set` 會以 `isDrawn: true` 解析。否則 `isDrawn` 為 `false`,而 `reason` 會說明原因。441* **背景是否已繪製**:當連線到工作階段的 Desktop 或行動應用程式表示它會繪製背景時,`$.theme.set` 會以 `isDrawn: true` 解析。否則 `isDrawn` 為 `false`,而 `reason` 會說明原因。

442* **每個工作階段一個主題**:呼叫 `$.theme.set` 的 mod 會取代工作階段的背景與[色彩](#change-the-colors-of-the-desktop-app),而呼叫 `$.theme.clear()` 的 mod 會移除它們,無論是哪個 mod 設定的。請只在使用者要求時才呼叫 `$.theme.clear()`。442* **每個工作階段一個主題**:呼叫 `$.theme.set` 的 mod 會取代工作階段的背景、[色彩](#change-the-colors-of-the-desktop-app)、[訊息樣式](#style-messages-in-the-desktop-app)與[音效](#add-sound-to-a-theme),而呼叫 `$.theme.clear()` 的 mod 會移除它們,無論是哪個 mod 設定的。請只在使用者要求時才呼叫 `$.theme.clear()`。

443 

444### 以著色器為背景加上動畫

445 

446若要在 Desktop 應用程式的 Code 分頁中製作會移動並跟隨使用者指標的[背景](#put-a-backdrop-behind-the-conversation),請將 `Svg` 包在 [`Shader`](https://code.claude.com/docs/zh-TW/plugins/mods/reference#elements) 元素中。該元素會指定一個著色器檔案,也就是在 GPU 上計算每個像素色彩的程式碼。應用程式會將結果繪製在 `Svg` 之上。`Shader` 需要 Code 分頁中的 Claude Code 為 v2.1.326 或更新版本,因此請先[在該處確認版本](https://code.claude.com/docs/zh-TW/desktop.md#claude-code-version-in-the-code-tab)。

447 

448以下步驟會建立一個名為 `glow` 的 mod。它會在指標下方繪製一道光,而在背景上點擊會變更光的色彩。

449 

450**1. 儲存 manifest 與 hooks.json**

451 

452依照[自行撰寫 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#write-a-mod-yourself),將 `.claude-plugin/plugin.json` 和 `hooks/hooks.json` 儲存到 `~/.claude/skills/glow/` 中,並在這兩個檔案中將 `first-mod` 改為 `glow`。[位於 `~/.claude/skills/` 之下](https://code.claude.com/docs/zh-TW/plugins/create#scaffold-a-plugin-that-loads-every-session)的 mod 會在您開始工作階段時載入。

453 

454**2. 撰寫著色器**

455 

456將此檔案儲存為 `~/.claude/skills/glow/hooks/glow.ts`。它匯入的 `claude-code/shader` 模組由 Claude Code 提供。

457 

458此著色器會在指標周圍繪製一道光,`warm` 為 `0` 時為藍色,為 `1` 時為橘色:

459 

460```typescript glow/hooks/glow.ts theme={null}

461import {

462 length, max, min, mix, picture, pointers, shader, smoothstep, values, vec2, vec3, vec4,

463} from 'claude-code/shader'

464 

465// Declare each number the mod sets through the Shader's values, with its range

466const { warm } = values({ warm: [0, 1] })

467 

468// This function runs once for every pixel and returns that pixel's color

469const glow = picture(pixel => {

470 let light = 0

471 // The loop sees the mouse, each finger, and for one second each pointer that lifted

472 // A mouse that rests for half a second counts as lifted

473 for (const pointer of pointers) {

474 // Subtracting two positions subtracts their x and their y, in points

475 // The result is typed as a plain number, so vec2() marks it as a position again

476 const near = smoothstep(200, 0, length(vec2(pixel.point - pointer.at)))

477 // A pointer fades in over a quarter second, then out as gone counts from 0 to 1

478 const fade = min(pointer.age * 4, 1) * (1 - pointer.gone)

479 light = max(light, near * near * fade)

480 }

481 const color = mix(vec3(0.25, 0.55, 1), vec3(1, 0.45, 0), warm)

482 const alpha = 0.7 * light

483 // The color is premultiplied: red, green and blue are multiplied by alpha

484 return vec4(color * alpha, alpha)

485})

486 

487// A shader runs its passes in order, and this one has a single pass

488export default shader({ passes: [glow] })

489```

490 

491**3. 繪製背景**

492 

493將此檔案儲存為 `~/.claude/skills/glow/hooks/register.js`。此 mod 會在工作階段開始時設定主題,並繪製一個帶有一個 `Svg` 子元素的 `Shader`。

494 

495此 mod 的 [`ui.pointer`](https://code.claude.com/docs/zh-TW/plugins/mods/reference#interface) hook 會在點擊後執行,切換 `warm`,並請求重新繪製:

496 

497```javascript glow/hooks/register.js theme={null}

498const STILL =

499 '<svg xmlns="http://www.w3.org/2000/svg"' +

500 ' viewBox="0 0 1 1" preserveAspectRatio="none">' +

501 '<rect width="1" height="1" fill="#1a3a9c"/>' +

502 '</svg>'

503 

504let warm = 0

505 

506export function register(on) {

507 on('session.start', async ($, e, next) => {

508 // The scene is a name you choose for the backdrop your hook draws

509 await $.theme.set({ backdrop: { scene: 'glow' }, overrideColorScheme: 'dark' })

510 return next(e)

511 })

512 

513 on('ui.render', { component: 'Backdrop' }, async ($, e, next) => {

514 // This hook runs for every mod's backdrop, so pass on the others

515 if (e.props.plugin !== $.plugin.name || e.props.scene !== 'glow') return next(e)

516 const { Shader, Svg } = $.ui.resolve(e)

517 // module must be a string literal, relative to this file

518 return Shader({

519 module: './glow.ts',

520 values: { warm },

521 children: [Svg({ source: STILL, alt: 'A dark blue background' })],

522 })

523 })

524 

525 on('ui.pointer', async ($, e, next) => {

526 warm = 1 - warm

527 $.ui.invalidate('ui.render')

528 return next(e)

529 })

530}

531```

532 

533**4. 檢查著色器**

534 

535此步驟為選用,且需要 [CLI](https://code.claude.com/docs/zh-TW/quickstart.md),CLI 有自己的版本號。在 shell 中前往 `~/.claude/skills/`,執行 `claude plugin validate ./glow`,並在輸出中尋找 `shader hooks/glow.ts: runs on any GPU`。若輸出將 `glow.ts` 中的某一行列為錯誤,請修正該行。

536 

537早於 v2.1.326 的 CLI 會回報 `"ui.pointer" is not an event`。若您的 CLI 如此回報,請[更新它](https://code.claude.com/docs/zh-TW/setup.md#update-claude-code)並再次執行該命令。

538 

539**5. 試用背景**

540 

541透過傳送訊息,在 Code 分頁中開始新的本機工作階段。背景會變成深藍色。若沒有變化,請關閉任何其他設定主題的 mod 並開始新的工作階段,因為一個工作階段只有[一個主題](#put-a-backdrop-behind-the-conversation)。若背景仍未變更,請[找出 mod 沒有作用的原因](https://code.claude.com/docs/zh-TW/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing)。

542 

543移動指標。一道藍光會跟隨指標,並在您停止時淡出。若沒有出現光,請參閱[修正只顯示 `Svg` 的背景](#fix-a-backdrop-that-shows-only-the-svg)。點擊對話旁的空白處,然後再次移動指標。光現在會是橘色。若仍為藍色,請回答 Claude 的任何權限提示或問題,然後在遠離訊息和按鈕的地方快速再點擊一次,不要拖曳。

544 

545若要試用變更,請儲存 `glow.ts` 或 `register.js`,mod 就會在執行中的工作階段中重新載入。若變更在幾秒內沒有出現,請傳送一則訊息來載入它。若要關閉此 mod,請將 `glow` 移出 `~/.claude/skills/` 並開始新的工作階段。

546 

547以此範例為基礎進行開發時,請遵循下列關於指標輸入、著色器與 `Svg` 的規則:

548 

549* **點擊**:當您的 mod 已設定主題,且使用者點擊背景中未被應用程式遮蓋的部分時,您的 mod 會收到 `ui.pointer`。應用程式每秒最多傳送兩次點擊,其餘會被捨棄。若要在不變更 mod 狀態的情況下繪製按壓效果,請在著色器中使用 `pointer.down * (1 - pointer.gone)`,它在按壓期間為 `1`,之後逐漸淡出。

550* **點擊位置**:`e.x` 和 `e.y` 的範圍為 `0` 到 `1`,從背景的左上角開始。在著色器中,`pixel.uv` 的比例相同,但從左下角開始。若要在點擊處繪製,請透過 `values` 傳送 `e.x` 和 `1 - e.y`。

551* **移動**:請在著色器中從 `pointers` 讀取指標移動,因為移動指標不會觸發 `ui.pointer`。若要製作隨時間變化的動態,請匯入 `time`,即著色器啟動以來的秒數。

552* **按壓**:若要從按壓開始計時效果,請在迴圈中檢查每個指標的 `down` 是否為 `1`,並讀取其 `age`,即按壓以來的秒數。按壓會以新指標的形式出現,因此它不一定是 `pointers` 中的第一個。

553* **`values`**:在著色器檔案中宣告最多八個數字,並以 `values` prop 設定它們。當您的 mod 狀態變更時,請呼叫 `$.ui.invalidate('ui.render')` 以傳送新的數字。

554* **著色器檔案**:撰寫不含 `while` 迴圈、遞迴或從其他檔案匯入的 TypeScript 子集。關於完整規則以及您可以呼叫的函式,請[使用 CLI 取得型別定義](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build),並在其中搜尋 `claude-code/shader`。

555* **`Svg`**:請將它繪製為完整的圖片,因為當著色器無法執行時,使用者只會看到它。

556 

557#### 修正只顯示 `Svg` 的背景

558 

559請先檢查減少動態效果,因為它會讓所有著色器都無法執行,然後再檢查下列其他原因:

560 

561* **已開啟減少動態效果**:若您不需要減少動態效果,請在系統設定中關閉它,並在 Desktop 應用程式的 **Settings > General** 中將 **Motion** 設為 **System**。

562* **著色器檔案違反規則**:在您的 shell 中,對 mod 的目錄執行 `claude plugin validate`,並修正輸出所指出的那一行。

563* **著色器對 GPU 來說負擔過重**:若 `claude plugin validate` 印出 `needs a fast GPU`,請簡化著色器,直到輸出顯示 `runs on any GPU`。請從輸出中列為成本最高的幾行開始。

564* **`Svg` 含有會阻擋著色器的內容**:將 `Svg` 的來源替換為 [`glow` 範例](#animate-a-backdrop-with-a-shader)中的 `STILL`。若著色器因此得以執行,請還原您的來源,但去除會阻擋它的內容,例如光照濾鏡或 `feTile`。

565* **任何 mod 的著色器曾執行後停止**:應用程式因閃爍或執行過慢而停止某個著色器後,最長五分鐘內不會啟動任何著色器。請將亮度或色彩的大幅變化維持在每秒三次以下,或簡化執行緩慢的著色器。然後等待五分鐘,再開始新的工作階段。

443 566 

444### 變更 Desktop 應用程式的色彩567### 變更 Desktop 應用程式的色彩

445 568 


510* **版本過舊**:[更新 Desktop 應用程式](https://code.claude.com/docs/zh-TW/desktop.md#claude-code-version-in-the-code-tab)、重新啟動它,並在 Code 分頁中開始新的本機工作階段。若 mod 是 Claude 撰寫的,請在該處再次請 Claude 建立。633* **版本過舊**:[更新 Desktop 應用程式](https://code.claude.com/docs/zh-TW/desktop.md#claude-code-version-in-the-code-tab)、重新啟動它,並在 Code 分頁中開始新的本機工作階段。若 mod 是 Claude 撰寫的,請在該處再次請 Claude 建立。

511* **mod 未載入**:若 mod 是 Claude 撰寫的,請參閱[請 Claude 建立 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#ask-claude-for-a-mod) 了解其載入時機。若 mod 是您自行撰寫的,請將您的檔案及其路徑與[自行撰寫色彩 mod](#write-a-colors-mod-yourself) 進行比對。634* **mod 未載入**:若 mod 是 Claude 撰寫的,請參閱[請 Claude 建立 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#ask-claude-for-a-mod) 了解其載入時機。若 mod 是您自行撰寫的,請將您的檔案及其路徑與[自行撰寫色彩 mod](#write-a-colors-mod-yourself) 進行比對。

512* **主題遭拒絕**:請要求 Claude 執行 mod 的 [`makeColors`](#write-a-colors-mod-yourself) 呼叫。若該呼叫擲出錯誤,或其 `problems` 清單中有以 `Desktop won't paint this theme` 開頭的項目,請讓 Claude 修正主題。若 mod 是您安裝的,請將 Claude 發現的內容傳送給其作者。635* **主題遭拒絕**:請要求 Claude 執行 mod 的 [`makeColors`](#write-a-colors-mod-yourself) 呼叫。若該呼叫擲出錯誤,或其 `problems` 清單中有以 `Desktop won't paint this theme` 開頭的項目,請讓 Claude 修正主題。若 mod 是您安裝的,請將 Claude 發現的內容傳送給其作者。

513* **另一個 `$.theme` 呼叫**:當工作階段中任何 mod 呼叫 `$.theme.set` 或 `$.theme.clear()` 時,先前呼叫所設定的色彩與[背景](#put-a-backdrop-behind-the-conversation)就會消失。在您自己的 mod 中,請在同一個 `$.theme.set` 呼叫中傳入 `colors` 和 `backdrop`。一次只使用一個設定主題的 mod。636* **另一個 `$.theme` 呼叫**:當工作階段中任何 mod 呼叫 `$.theme.set` 或 `$.theme.clear()` 時,先前呼叫所設定的色彩、[背景](#put-a-backdrop-behind-the-conversation)、[訊息樣式](#style-messages-in-the-desktop-app)與[音效](#add-sound-to-a-theme)就會消失。在您自己的 mod 中,請在同一個 `$.theme.set` 呼叫中傳入主題的每個部分。一次只使用一個設定主題的 mod。

514 637 

515### 從 Desktop 應用程式移除 mod 色彩638### 從 Desktop 應用程式移除 mod 色彩

516 639 


530 653 

531若色彩仍然存在,請從 Code 分頁開啟 **Settings**,並在其中搜尋 `code appearance`。開啟搜尋結果,然後選取 **Remove colors**。654若色彩仍然存在,請從 Code 分頁開啟 **Settings**,並在其中搜尋 `code appearance`。開啟搜尋結果,然後選取 **Remove colors**。

532 655 

656### 在 Desktop 應用程式中設定訊息樣式

657 

658若要讓 Desktop 應用程式 Code 分頁中的訊息擁有自己的泡泡、字型與文字大小,請撰寫一個以 `style` 物件呼叫 `$.theme.set` 的 mod。這需要 Code 分頁中的 Claude Code 為 v2.1.329 或更新版本,因此請先[在該處確認版本](https://code.claude.com/docs/zh-TW/desktop.md#claude-code-version-in-the-code-tab)。終端機、VS Code 擴充功能和行動應用程式顯示訊息時不會套用此樣式。

659 

660此 mod 會為訊息設定襯線字型,並將每則訊息放入圓角泡泡中。若 `$.theme.set` 拒絕此樣式,mod 會將錯誤寫入逐字稿:

661 

662```javascript theme={null}

663const style = {

664 Text: { fontFamily: ['serif'], fontSize: 15, lineHeight: 22 },

665 // The corners run top left, top right, bottom right, bottom left

666 UserMessage: { backgroundColor: '#1d5fd1', color: '#ffffff', radius: [18, 18, 4, 18], padding: 12 },

667 AssistantMessage: { backgroundColor: '#e9e9ec', color: '#1c1c1f', radius: [18, 18, 18, 4], padding: 12 },

668}

669 

670export function register(on) {

671 on('session.start', async ($, e, next) => {

672 try {

673 await $.theme.set({ style })

674 } catch (error) {

675 $.ui.log(error.message)

676 }

677 return next(e)

678 })

679}

680```

681 

682若要試用此範例:

683 

684**1. 儲存 mod**

685 

686將程式碼儲存為 `~/.claude/skills/bubbles/hooks/register.js`。依照[自行撰寫 mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#write-a-mod-yourself),將 `.claude-plugin/plugin.json` 和 `hooks/hooks.json` 儲存到 `~/.claude/skills/bubbles/` 中,並在這兩個檔案中將 `first-mod` 改為 `bubbles`。

687 

688**2. 關閉其他主題 mod**

689 

690[關閉任何其他](#remove-mod-colors-from-the-desktop-app)呼叫 `$.theme.set` 的 mod,因為每次呼叫都會取代整個主題。若要同時使用樣式與色彩,請參閱[將樣式與色彩或背景搭配使用](#combine-a-style-with-colors-or-a-backdrop)。

691 

692**3. 檢查樣式**

693 

694在 Code 分頁中開始新的本機工作階段並傳送一則訊息。您的訊息會出現在藍色泡泡中,Claude 的回覆則出現在淺灰色泡泡中,兩者皆使用襯線字型。若沒有任何變化,請參閱[修正缺少的訊息樣式](#fix-a-missing-message-style-in-the-desktop-app)。

695 

696若要移除此樣式,請將 `~/.claude/skills/bubbles/` 移出 `~/.claude/skills/`,並開始新的工作階段。

697 

698#### 將樣式與色彩或背景搭配使用

699 

700若要將訊息樣式與[色彩](#write-a-colors-mod-yourself)或[背景](#put-a-backdrop-behind-the-conversation)搭配使用,請從同一個 mod 在一次呼叫中傳入所有內容,例如 `$.theme.set({ colors: theme, style })`。v2.1.329 之前的 Claude Code 版本會拒絕包含 `style` 或 [`sound`](#add-sound-to-a-theme) 的呼叫。若要在這些版本上保留您的色彩與背景,請攔截錯誤、將其記入日誌,並在不含 `style` 和 `sound` 的情況下重複該呼叫。

701 

702#### 選擇要設定樣式的對話部分

703 

704您傳給 `$.theme.set` 的 `style` 物件中,每個鍵都代表對話的一個部分。

705 

706| 鍵 | 設定樣式的對象 | 可設定的項目 |

707| :- | :- | :- |

708| `Text` | 您的訊息與 Claude 回覆中的文字,但 `UserMessage` 或 `AssistantMessage` 已設定相同屬性者除外 | 文字屬性 |

709| `Heading` | Claude 回覆中的標題,否則會使用回覆的字型 | 文字屬性 |

710| `UserMessage` | 您的訊息 | 文字屬性、方塊屬性與 `rotate` |

711| `AssistantMessage` | Claude 回覆中的每個文字區塊 | 文字屬性、方塊屬性與 `rotate` |

712| `ToolUse` | 工具呼叫的列 | `color`、`fontFamily` 與方塊屬性 |

713 

714其他部分會保留應用程式的外觀,例如權限提示、Claude 在對話框中提出的問題、程式碼區塊以及提示詞輸入框。

715 

716請以點數撰寫大小,例如 `lineHeight: 22`。關於每個值的格式與範圍,請參閱[適用於您建置版本的型別](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build)中的 `ThemeStyle`。

717 

718* **文字屬性**:`color`、`fontFamily`、`fontSize`、`fontWeight`、`italic`、`letterSpacing` 和 `lineHeight`。請將 `fontFamily` 寫成只有一個項目的清單,例如 `['serif']`。該項目必須是 `sans`、`serif`、`mono`、`cursive` 或 `code`,`$.theme.set` 會拒絕任何其他值。若要使用應用程式的程式碼字型,請使用 `code`。

719* **方塊屬性**:`backgroundColor`、`radius`、`borderColor`、`borderWidth`、`shadow`、`fill`,以及 `padding` 或 `paddingTop` 等內距。陰影請寫成 `{ x: 0, y: 2, blur: 8, color: 'rgba(0, 0, 0, 0.15)' }`。使用 `fill` 可在文字背後繪製漸層或向量圖,例如 `{ gradient: { stops: ['#dbe8ff', '#c4d6f5'] } }`。

720* **`rotate`**:訊息傾斜的角度,從 `-3` 到 `3`

721 

722若要讓泡泡有所變化,請將 `UserMessage` 或 `AssistantMessage` 設為最多四個物件的清單。每則訊息會以不固定的順序取得其中一個物件,並持續使用它。

723 

724#### 為淺色模式與深色模式設定訊息色彩

725 

726若要讓訊息在淺色模式與深色模式中使用不同色彩,請將下列訊息色彩加入 [`makeColors`](#write-a-colors-mod-yourself) 所回傳主題的 `inputs.light` 和 `inputs.dark` 中:

727 

728* **您的訊息**:`bg-user-message` 用於泡泡,`text-user-message` 用於文字

729* **Claude 的回覆**:`bg-assistant-message` 用於泡泡,`text-assistant-message` 用於文字

730 

731在將它們加入傳入 `style` 的 mod 之前,請從對應的 `UserMessage` 或 `AssistantMessage` 中移除 `color` 和 `backgroundColor`,因為這些屬性優先於訊息色彩。

732 

733此範例會在[自行撰寫色彩 mod](#write-a-colors-mod-yourself) 的 `paper` mod 中為您的訊息上色。在該 mod 的 `register.js` 中,於 `makeColors` 呼叫與 `register` 函式之間加入下列幾行:

734 

735```javascript theme={null}

736Object.assign(theme.inputs.light, { 'bg-user-message': '#d9c4a0', 'text-user-message': '#2a241d' })

737Object.assign(theme.inputs.dark, { 'bg-user-message': '#4a3a2b', 'text-user-message': '#f0e7d7' })

738```

739 

740將 `paper` 放在 `~/.claude/skills/` 之下,並將其他主題 mod(例如 `bubbles`)移出該目錄。開始新的本機工作階段並傳送一則訊息。您的泡泡在淺色模式下為黃褐色,在深色模式下為棕色。若不是如此,請參閱[修正缺少的 mod 色彩](#fix-missing-mod-colors-in-the-desktop-app)和[修正缺少的訊息樣式](#fix-a-missing-message-style-in-the-desktop-app)。

741 

742#### 修正 Desktop 應用程式中缺少的訊息樣式

743 

744若訊息樣式的全部或部分未出現在 Code 分頁中,請檢查下列原因:

745 

746* **mod 未載入**:[找出 mod 沒有作用的原因](https://code.claude.com/docs/zh-TW/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing)

747* **呼叫遭拒絕**:攔截 `$.theme.set` 的錯誤並將其寫入逐字稿,如同[範例](#style-messages-in-the-desktop-app)的做法。若錯誤包含 `theme.set does not know the attribute "style"`,請在顯示該錯誤的應用程式中[更新 Claude Code](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#turn-mods-on-or-off)。若錯誤指出某個屬性,例如 `style.Text.fontSize is a number of points, 11 to 28`,請變更該屬性的值。

748* **另一個 `$.theme` 呼叫**:若工作階段中任何 mod 呼叫 `$.theme.clear()`,或在不含您的 `style` 的情況下呼叫 `$.theme.set`,樣式就會消失。在您自己的 mod 中,請[在一次呼叫中傳入整個主題](#combine-a-style-with-colors-or-a-backdrop)。關閉任何其他設定主題的 mod。

749* **對比過低**:當文字與其背景的對比低於 3:1 時,該訊息、標題或工具列會以應用程式自己的色彩顯示。`$.theme.set` 不會回報錯誤。請選擇差異更大的色彩,並同時檢查淺色模式與深色模式。

750* **背景**:在[背景](#put-a-backdrop-behind-the-conversation)之上,文字色彩只會在純色或接近純色的底色上顯示。凡是您為 `UserMessage`、`AssistantMessage` 和 `ToolUse` 的文字上色(包括透過 `Text` 或 `Heading`),請在其上設定純色的 `backgroundColor`。

751* **協助工具設定**:在應用程式或作業系統中開啟較高對比時,訊息會在不套用樣式的情況下顯示。使用 OpenDyslexic 等協助工具字型時,訊息會保留該字型。若要看到完整樣式,請關閉這些設定。

752* **未處理的提示**:當螢幕上有權限提示或 Claude 的問題時,新樣式會等待套用。回答它即可看到樣式。

753 

754### 為主題加入音效

755 

756若要為您的主題在 Desktop 應用程式的 Code 分頁中加入背景音效以及事件的短音效,請將 `sound` 傳給 [`$.theme.set`](https://code.claude.com/docs/zh-TW/plugins/mods/reference#mods-api-methods)。`sound` 需要 Code 分頁中的 Claude Code 為 v2.1.329 或更新版本,因此請先[在該處確認版本](https://code.claude.com/docs/zh-TW/desktop.md#claude-code-version-in-the-code-tab)。終端機、VS Code 擴充功能和行動應用程式不會播放主題音效。

757 

758您以音調與雜訊的層來描述每個音效,不需要音訊檔案,Desktop 應用程式會產生音訊。

759 

760此 mod 會設定深色模式、在背景播放柔和的雜訊,並在 Claude 完成一個回合時播放三個鐘聲音符:

761 

762```javascript theme={null}

763// The rest of the theme, which still works without sound

764const look = { overrideColorScheme: 'dark' }

765 

766const sound = {

767 ambience: {

768 // A layer with drone: true plays without a break

769 // A layer with scatter plays now and then

770 // gain is how loud a layer is, from 0 to 1

771 layers: [{ wave: 'brown', drone: true, gain: 0.2 }],

772 },

773 cues: {

774 done: {

775 // step is the seconds from one note to the next

776 layers: [{ wave: 'bell', notes: ['C5', 'E5', 'G5'], step: 0.15, gain: 0.3 }],

777 },

778 },

779}

780 

781export function register(on) {

782 on('session.start', async ($, e, next) => {

783 try {

784 await $.theme.set({ ...look, sound })

785 } catch (error) {

786 // A refused call sets nothing, so set the theme again without sound

787 $.ui.log(error.message)

788 await $.theme.set(look)

789 }

790 return next(e)

791 })

792}

793```

794 

795關於其他波形、欄位與範圍,請參閱[適用於您建置版本的型別](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build)中的 `ThemeSound`。若要聆聽此範例:

796 

797**1. 開始工作階段**

798 

799將程式碼放入一個 [mod](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#write-a-mod-yourself),並將 mod 的目錄儲存[在 `~/.claude/skills/` 之下](https://code.claude.com/docs/zh-TW/plugins/create#scaffold-a-plugin-that-loads-every-session),讓它在您開始工作階段時載入。在 Code 分頁中,傳送第一則訊息以[開始本機工作階段](https://code.claude.com/docs/zh-TW/desktop.md#start-a-session)。若工作階段的標題列中沒有出現喇叭按鈕,請參閱[修正缺少的喇叭按鈕](#fix-a-missing-speaker-button)。

800 

801**2. 開啟主題音效**

802 

803若喇叭按鈕顯示為劃掉的狀態,請選取它。三個音符會播放一次以確認音效已開啟,雜訊也會逐漸淡入。若要變更音量或關閉雜訊,請開啟按鈕旁的選單。

804 

805**3. 聆聽提示音**

806 

807再傳送一則訊息。Claude 完成時會播放三個音符。

808 

809#### 各主題音效的播放時機

810 

811在使用者以喇叭按鈕開啟之前,主題音效都是關閉的。開啟後,它會在該裝置上的其他工作階段與主題中保持開啟,直到使用者關閉它、登出或切換帳戶為止。請選擇適合使用者在主題一載入就聽到的 `gain`。

812 

813Desktop 應用程式會在下列時機自行播放各個音效,mod 無法觸發:

814 

815| 音效 | 播放時機 |

816| :- | :- |

817| `ambience` | 工作階段的視窗具有焦點時。在 10 分鐘沒有輸入後暫停,並在下一次輸入時恢復。 |

818| `cues.send` | 使用者傳送訊息時 |

819| `cues.tool` | Claude 開始工具呼叫時 |

820| `cues.compact` | 對話被壓縮時 |

821| `cues.done` | Claude 完成一個回合時,但使用者停止該回合或將另一則訊息排入佇列時除外 |

822| `cues.ask` | 出現權限提示或問題時 |

823| `cues.error` | 回合以錯誤結束時 |

824| `cues.click` | 使用者點擊沒有被訊息、控制項或面板遮蓋的背景時 |

825 

826當使用者開啟音效或選擇音量時,也會聽到一個提示音,即主題依下列順序所擁有的第一個:`send`、`done`、`tool`、`compact`、`ask`、`error`。

827 

828在有未回答的提示、正在播放語音,以及視窗沒有焦點時,表中的音效播放次數會較少。若要再次聽到所有音效:

829 

830* **有權限提示或問題在等待**:回答它。在那之前,只有 `cues.ask` 可以播放。

831* **正在聽寫、語音通話或朗讀回覆**:結束它。在那之前,環境音與提示音都會保持靜音。

832* **視窗沒有焦點**:在視窗中點擊。在那之前,只有 `cues.done` 可以播放。

833 

834#### 修正缺少的喇叭按鈕

835 

836若工作階段的標題列中沒有顯示喇叭按鈕,請檢查您的版本、mod 是否已載入,以及工作階段中的 `$.theme` 呼叫:

837 

838* **版本過舊**:若 Code 分頁中的 `/status` 顯示早於 v2.1.329 的版本,請[更新 Desktop 應用程式](https://code.claude.com/docs/zh-TW/desktop.md#claude-code-version-in-the-code-tab)並開始新的本機工作階段。在這些版本上,呼叫會失敗並出現錯誤,例如 `theme.set does not know the attribute "sound"`。

839* **mod 未載入**:請依照[找出 mod 沒有作用的原因](https://code.claude.com/docs/zh-TW/plugins/mods/troubleshoot.md#find-out-why-a-mod-does-nothing)操作。

840* **值超出範圍**:呼叫會失敗,因此在範例的 `catch` 區塊下,主題會在沒有音效的情況下載入。在逐字稿中找到範例記錄的錯誤,並修正其指出的欄位,例如 `sound.cues.done.layers[0].gain is a number, 0 to 1`。

841* **另一個 `$.theme` 呼叫**:當任何 mod 之後在不含 `sound` 的情況下呼叫 `$.theme.set`,或呼叫 `$.theme.clear()` 時,音效與按鈕就會消失。在您自己的 mod 中,請在與主題其餘部分相同的呼叫中傳入 `sound`。關閉任何其他設定主題的 mod。

842 

533## 從元素建立樹843## 從元素建立樹

534 844 

535`ui.render` hook 返回的是元素樹:對要繪製的內容的描述,由相互嵌套的框、文字和控制項組成。845`ui.render` hook 返回的是元素樹:對要繪製的內容的描述,由相互嵌套的框、文字和控制項組成。


613| `Button` | 呼叫 `onPress` 的控制項 | 到處 |923| `Button` | 呼叫 `onPress` 的控制項 | 到處 |

614| `Link`, `Code`, `Markdown` | 具有 `href` 和可選 `label` 的連結、程式碼區塊和格式化為 Claude 回覆方式的文字。`Markdown` 在 `text` 屬性中而不是在 `children` 中採用其內容,並在您傳遞 `onLinkPress` 時需要 `key`。 | 到處 |924| `Link`, `Code`, `Markdown` | 具有 `href` 和可選 `label` 的連結、程式碼區塊和格式化為 Claude 回覆方式的文字。`Markdown` 在 `text` 屬性中而不是在 `children` 中採用其內容,並在您傳遞 `onLinkPress` 時需要 `key`。 | 到處 |

615| `Input`, `Select` | 文字欄位和下拉式選單 | 終端機、桌面、VS Code |925| `Input`, `Select` | 文字欄位和下拉式選單 | 終端機、桌面、VS Code |

926| `Shader` | 在 `Svg` 上方[於 GPU 上繪製的背景](#animate-a-backdrop-with-a-shader) | 桌面 |

616| `Svg` | SVG 文件 | 桌面、VS Code |927| `Svg` | SVG 文件 | 桌面、VS Code |

617| `Client` | 由您的第二個檔案繪製的區域,用於動畫和指標輸入。該檔案不取得 mods API。它透過發佈資料到達您的 hook,該資料作為 `ui.message` 事件到達。如果它無法載入、繪製或執行,您的 hook 會收到 [`ui.fault`](https://code.claude.com/docs/zh-TW/plugins/mods/reference#interface) 事件。 | 終端機、桌面 |928| `Client` | 由您的第二個檔案繪製的區域,用於動畫和指標輸入。該檔案不取得 mods API。它透過發佈資料到達您的 hook,該資料作為 `ui.message` 事件到達。如果它無法載入、繪製或執行,您的 hook 會收到 [`ui.fault`](https://code.claude.com/docs/zh-TW/plugins/mods/reference#interface) 事件。 | 終端機、桌面 |

618| `Raster`, `Image` | [彩色儲存格網格](#draw-a-grid-of-colored-cells)和圖片 | 終端機 |929| `Raster`, `Image` | [彩色儲存格網格](#draw-a-grid-of-colored-cells)和圖片 | 終端機 |

Details

17設定 hooks、skills、狀態行和 MCP 伺服器從 Claude Code 外部運作:每一個都執行指令碼,或為 Claude 提供文字或工具。Mod 在 Claude Code 內執行,因此它可以做他們無法做的事情:17設定 hooks、skills、狀態行和 MCP 伺服器從 Claude Code 外部運作:每一個都執行指令碼,或為 Claude 提供文字或工具。Mod 在 Claude Code 內執行,因此它可以做他們無法做的事情:

18 18 

19* **繪製您可以使用的介面**:文字記錄旁邊的窗格或提示上方的帶狀區域,具有標籤、按鈕和文字欄位。請參閱[在介面中繪製](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md)。19* **繪製您可以使用的介面**:文字記錄旁邊的窗格或提示上方的帶狀區域,具有標籤、按鈕和文字欄位。請參閱[在介面中繪製](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md)。

20* **重新繪製 Claude Code 自己的介面**:取代或重新設定 Claude Code 自己繪製的部分,例如工具呼叫的列、微調器或 Claude 提出問題的對話框。請參閱[變更 Claude Code 已繪製的內容](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#change-what-claude-code-already-draws)。20* **重新繪製 Claude Code 的介面**:取代或重新設定 Claude Code 自己繪製的部分,例如工具呼叫的列或微調器。請參閱[變更 Claude Code 已繪製的內容](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#change-what-claude-code-already-draws)。

21* **進入工具呼叫或請求**:例如,在您詢問使用者問題時保留工具呼叫、在不執行工具的情況下回答,或將一個請求傳送到不同的模型。請參閱[保護或變更工具呼叫](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#guard-or-change-a-tool-call)和[跟隨一個回合](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#follow-a-turn)。21* **進入工具呼叫或請求**:例如,在您詢問使用者問題時保留工具呼叫、在不執行工具的情況下回答,或將一個請求傳送到不同的模型。請參閱[保護或變更工具呼叫](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#guard-or-change-a-tool-call)和[跟隨一個回合](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#follow-a-turn)。

22* **在命令上執行您自己的程式碼**:一個 `/command`,立即執行您的函式,沒有 Claude 回合,即使 Claude 正在工作。請參閱[新增命令或工具](https://code.claude.com/docs/zh-TW/plugins/mods/api.md#add-a-command-or-a-tool)。22* **在命令上執行您自己的程式碼**:一個 `/command`,立即執行您的函式,沒有 Claude 回合,即使 Claude 正在工作。請參閱[新增命令或工具](https://code.claude.com/docs/zh-TW/plugins/mods/api.md#add-a-command-or-a-tool)。

23* **在 hooks 之間共享資料**:mod 的 hooks 共享其檔案中的變數,因此一個 hook 記錄的內容,另一個可以顯示。例如,一個 hook 可以計算工具呼叫,而另一個在微調器旁邊顯示計數,或一個可以讀取每個請求的權杖使用量,而另一個在窗格中繪製它。請參閱[對事件做出反應](https://code.claude.com/docs/zh-TW/plugins/mods/events.md)。23* **在 hooks 之間共享資料**:mod 的 hooks 共享其檔案中的變數,因此一個 hook 記錄的內容,另一個可以顯示。例如,一個 hook 可以計算工具呼叫,而另一個在微調器旁邊顯示計數,或一個可以讀取每個請求的權杖使用量,而另一個在窗格中繪製它。請參閱[對事件做出反應](https://code.claude.com/docs/zh-TW/plugins/mods/events.md)。

Details

33| 引數 | 說明 |33| 引數 | 說明 |

34| :- | :- |34| :- | :- |

35| [`$`](https://code.claude.com/docs/zh-TW/plugins/mods/events#how-a-hook-handles-an-event) | mods API:[mods API 方法](#mods-api-methods)中的每個方法。每次呼叫請完整寫出,先命名空間再方法,例如 `$.fs.read('notes.md')`。 |35| [`$`](https://code.claude.com/docs/zh-TW/plugins/mods/events#how-a-hook-handles-an-event) | mods API:[mods API 方法](#mods-api-methods)中的每個方法。每次呼叫請完整寫出,先命名空間再方法,例如 `$.fs.read('notes.md')`。 |

36| [`e`](https://code.claude.com/docs/zh-TW/plugins/mods/events#how-a-hook-handles-an-event) | 事件的輸入,為深度凍結的純資料。若要變更,請將副本傳給 `next`。 |36| [`e`](https://code.claude.com/docs/zh-TW/plugins/mods/events#how-a-hook-handles-an-event) | 事件的輸入。若要變更,請將副本傳給 `next`。 |

37| [`next(e)`](https://code.claude.com/docs/zh-TW/plugins/mods/events#how-a-hook-handles-an-event) | 下一個處理常式,如同中介軟體。會執行此 hook 之後的 hook,接著執行 Claude Code 的行為。解析為事件的結果。 |37| [`next(e)`](https://code.claude.com/docs/zh-TW/plugins/mods/events#how-a-hook-handles-an-event) | 下一個處理常式,如同中介軟體。會執行此 hook 之後的 hook,接著執行 Claude Code 的行為。解析為事件的結果。 |

38| [`next.signal`](https://code.claude.com/docs/zh-TW/plugins/mods/api#stop-background-work) | 一個 `AbortSignal`,在事件被放棄時中止 |38| [`next.signal`](https://code.claude.com/docs/zh-TW/plugins/mods/api#stop-background-work) | 一個 `AbortSignal`,在事件被放棄時中止 |

39| `next.origin` | 觸發事件者的 `{ plugin, tier }`。Claude Code 本身為 `{ plugin: 'engine', tier: 'core' }`。mod 的 `tier` 是它在 [mod 執行順序](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#the-order-mods-run-in)中的優先群組:`prepend`、`user`、`append` 或 `builtin`。 |39| `next.origin` | 觸發事件者的 `{ plugin, tier }`。Claude Code 本身為 `{ plugin: 'engine', tier: 'core' }`。mod 的 `tier` 是它在 [mod 執行順序](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#the-order-mods-run-in)中的優先群組:`prepend`、`user`、`append` 或 `builtin`。 |


59| `tool.judge` | [自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)即將就某個呼叫詢問其分類器時。需要 Claude Code v2.1.326 或更新版本。 | `next(e)` 或 `{ decision }` |59| `tool.judge` | [自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)即將就某個呼叫詢問其分類器時。需要 Claude Code v2.1.326 或更新版本。 | `next(e)` 或 `{ decision }` |

60| `tool.run` | 已允許的呼叫即將執行時。需要 Claude Code v2.1.326 或更新版本。 | `next(e)`、`{ deny: reason }` 或 `{ result }` |60| `tool.run` | 已允許的呼叫即將執行時。需要 Claude Code v2.1.326 或更新版本。 | `next(e)`、`{ deny: reason }` 或 `{ result }` |

61| `tool.describe` | 每個工具一次,在其說明首次傳送給 Claude 時。當 Claude 透過[工具搜尋](https://code.claude.com/docs/zh-TW/mcp.md#scale-with-mcp-tool-search)載入 MCP 工具時會再觸發一次,此時 `e.description` 設為 Claude 針對已載入工具所讀取的文字。 | `{ description }`,可選擇將 `isDeferred` 設為 `true` 以將該工具置於工具搜尋之後,或設為 `false` 以預先載入。加上 [`breakPromptCache: true`](#break-prompt-cache) 即可在下一個回合傳送變更後的說明。 |61| `tool.describe` | 每個工具一次,在其說明首次傳送給 Claude 時。當 Claude 透過[工具搜尋](https://code.claude.com/docs/zh-TW/mcp.md#scale-with-mcp-tool-search)載入 MCP 工具時會再觸發一次,此時 `e.description` 設為 Claude 針對已載入工具所讀取的文字。 | `{ description }`,可選擇將 `isDeferred` 設為 `true` 以將該工具置於工具搜尋之後,或設為 `false` 以預先載入。加上 [`breakPromptCache: true`](#break-prompt-cache) 即可在下一個回合傳送變更後的說明。 |

62| `tool.offer` | Claude Code 建置 Claude 的工具清單時,以及 Claude 呼叫工具時再次觸發。需要 Claude Code v2.1.328 或更新版本。 | `next(e)`,或以 `{ isOffered: false }` 對 Claude 保留不提供該工具。請參閱[傳送變更後的工具清單](#send-a-changed-tool-list)。 |

62 63 

63#### `tool.check` 上的 agent 與組織欄位64#### `tool.check` 上的 agent 與組織欄位

64 65 


115 116 

116變更後的文字會在下一個回合傳達給 Claude,且[提示快取](https://code.claude.com/docs/zh-TW/prompt-caching.md)會重新開始,因此該回合會較慢且成本較高。此欄位需要 Claude Code v2.1.321 或更新版本。從 v2.1.299 到 v2.1.321 之前,進行中的對話會在下一個回合取得變更後的文字。117變更後的文字會在下一個回合傳達給 Claude,且[提示快取](https://code.claude.com/docs/zh-TW/prompt-caching.md)會重新開始,因此該回合會較慢且成本較高。此欄位需要 Claude Code v2.1.321 或更新版本。從 v2.1.299 到 v2.1.321 之前,進行中的對話會在下一個回合取得變更後的文字。

117 118 

119#### 傳送變更後的工具清單

120 

121若要變更主對話的工具清單,請呼叫 `$.ui.invalidate('tool.offer')`,並從您的 `tool.offer` hook 回傳 `{ isOffered, breakPromptCache: true }`。[提示快取](https://code.claude.com/docs/zh-TW/prompt-caching.md)隨後會重新開始。需要 Claude Code v2.1.331 或更新版本。

122 

118### 命令與設定123### 命令與設定

119 124 

120| 事件 | 觸發時機 | hook 可回傳 |125| 事件 | 觸發時機 | hook 可回傳 |


138| :- | :- | :- |143| :- | :- | :- |

139| [`turn.start`](https://code.claude.com/docs/zh-TW/plugins/mods/events#follow-a-turn) | 回合開始時 | `next(e)` |144| [`turn.start`](https://code.claude.com/docs/zh-TW/plugins/mods/events#follow-a-turn) | 回合開始時 | `next(e)` |

140| [`turn.step`](https://code.claude.com/docs/zh-TW/plugins/mods/events#follow-a-turn) | 一個請求即將傳送給模型時 | `yield* next(e)`,或 `next({ ...e, model })`、`next({ ...e, effort })` |145| [`turn.step`](https://code.claude.com/docs/zh-TW/plugins/mods/events#follow-a-turn) | 一個請求即將傳送給模型時 | `yield* next(e)`,或 `next({ ...e, model })`、`next({ ...e, effort })` |

141| [`turn.complete`](https://code.claude.com/docs/zh-TW/plugins/mods/events#follow-a-turn) | 回合結束時 | `next(e)`,或以 `{ text }` 在回答下方顯示一行 |146| [`turn.complete`](https://code.claude.com/docs/zh-TW/plugins/mods/events#follow-a-turn) | 回合結束時 | `next(e)`,或以 `{ text }` 在主對話的回答下方顯示一行 |

142 147 

143### 工作階段148### 工作階段

144 149 


181| [`ui.render`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | [轉譯位置](#render-sites)即將被繪製時 |186| [`ui.render`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | [轉譯位置](#render-sites)即將被繪製時 |

182| `ui.resolve` | mod 載入時,每個應用程式、轉譯位置與 mod 各一次。結果是 `$.ui.resolve(e)` 讀取的元素表。 |187| `ui.resolve` | mod 載入時,每個應用程式、轉譯位置與 mod 各一次。結果是 `$.ui.resolve(e)` 讀取的元素表。 |

183| [`ui.press`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#respond-to-presses-and-typing)、[`ui.input`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#respond-to-presses-and-typing)、[`ui.select`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#respond-to-presses-and-typing) | mod 所繪製的 `Button`、`Input` 或 `Select` 被使用時 |188| [`ui.press`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#respond-to-presses-and-typing)、[`ui.input`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#respond-to-presses-and-typing)、[`ui.select`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#respond-to-presses-and-typing) | mod 所繪製的 `Button`、`Input` 或 `Select` 被使用時 |

189| [`ui.pointer`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#animate-a-backdrop-with-a-shader) | 使用者點擊您的 mod 背景中未被應用程式覆蓋的部分時。需要 Claude Code v2.1.326 或更新版本。 |

184| `ui.focus`、`ui.scroll` | 焦點所在的控制項,或窗格或橫帶的捲動位置即將變更時 |190| `ui.focus`、`ui.scroll` | 焦點所在的控制項,或窗格或橫帶的捲動位置即將變更時 |

185| `ui.close` | 窗格即將關閉時。`e.id` 為該窗格,`e.origin.kind` 為 `plugin`、`person` 或 `unload`。 |191| `ui.close` | 窗格即將關閉時。`e.id` 為該窗格,`e.origin.kind` 為 `plugin`、`person` 或 `unload`。 |

186| [`ui.message`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#build-a-tree-from-elements) | `Client` 元素將資料傳送給其 mod 時 |192| [`ui.message`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#build-a-tree-from-elements) | `Client` 元素將資料傳送給其 mod 時 |


236| :- | :- |242| :- | :- |

237| `$.plugin` | `name`、`root`:此外掛的名稱與目錄 |243| `$.plugin` | `name`、`root`:此外掛的名稱與目錄 |

238| [`$.ui`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | `resolve`、`invalidate`、`open`、`close`、`panes`、[`place`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#place-a-row-in-the-transcript)、`focus`、`scroll`、`toast`、`notify`、`status`、`log`、`notice`、`ask`、`copy`、`selection`、`blit`、`view`。`view` 需要 Claude Code v2.1.300 或更新版本,`place` 需要 v2.1.314 或更新版本。 |244| [`$.ui`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | `resolve`、`invalidate`、`open`、`close`、`panes`、[`place`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#place-a-row-in-the-transcript)、`focus`、`scroll`、`toast`、`notify`、`status`、`log`、`notice`、`ask`、`copy`、`selection`、`blit`、`view`。`view` 需要 Claude Code v2.1.300 或更新版本,`place` 需要 v2.1.314 或更新版本。 |

239| [`$.theme`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `set`、`clear`:設定供 Desktop 或行動應用程式繪製的背景,以及移除該背景。需要 Claude Code v2.1.319 或更新版本。 |245| [`$.theme`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `set`、`clear`:設定供 Desktop 或行動應用程式繪製的背景,以及移除該背景。需要 Claude Code v2.1.319 或更新版本。[訊息樣式](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#style-messages-in-the-desktop-app)與[音效](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#add-sound-to-a-theme)需要 v2.1.329 或更新版本。 |

240| [`$.command`](https://code.claude.com/docs/zh-TW/plugins/mods/api#add-a-command) | `register`、`run`、`list` |246| [`$.command`](https://code.claude.com/docs/zh-TW/plugins/mods/api#add-a-command) | `register`、`run`、`list` |

241| [`$.tool`](https://code.claude.com/docs/zh-TW/plugins/mods/api#add-a-tool) | `register`、`call`、`check`、`list` |247| [`$.tool`](https://code.claude.com/docs/zh-TW/plugins/mods/api#add-a-tool) | `register`、`call`、`check`、`list` |

242| `$.agent` | `register`、`spawn`、`call`、`list`、`limits`。`call` 與 `limits` 需要 Claude Code v2.1.326 或更新版本。`list()` 會回傳此工作階段的 subagent 與隊友,每個都帶有 `status`,其值為 `pending`、`running`、`waiting`、`idle`、`completed`、`failed` 或 `killed`,其中 `idle` 與 `waiting` 需要 Claude Code v2.1.289 或更新版本。 |248| `$.agent` | `register`、`spawn`、`call`、`list`、`limits`。`call` 與 `limits` 需要 Claude Code v2.1.326 或更新版本。`list()` 會回傳此工作階段的 subagent 與隊友,每個都帶有 `status`,其值為 `pending`、`running`、`waiting`、`idle`、`completed`、`failed` 或 `killed`,其中 `idle` 與 `waiting` 需要 Claude Code v2.1.289 或更新版本。 |

243| [`$.model`](https://code.claude.com/docs/zh-TW/plugins/mods/api#call-a-model) | `complete`、`fork`、`classify` |249| [`$.model`](https://code.claude.com/docs/zh-TW/plugins/mods/api#call-a-model) | `complete`、`fork`、`classify` |

244| [`$.prompt`](https://code.claude.com/docs/zh-TW/plugins/mods/api#start-a-turn-from-a-background-job) | `submit`、`read`、`fill`、`suggest`、`compose`。Claude 會在一個指明您的 mod 為傳送者的句子之後,讀取來自 `submit({ text })` 的文字。`submit({ text, asUser: true })` 會將文字當作使用者本人的話傳送,不附帶該句子。 |250| [`$.prompt`](https://code.claude.com/docs/zh-TW/plugins/mods/api#start-a-turn-from-a-background-job) | `submit`、`read`、`fill`、`suggest`、`compose`。Claude 會在一個指明您的 mod 為傳送者的句子之後,讀取來自 `submit({ text })` 的文字。`submit({ text, asUser: true })` 會將文字當作使用者本人的話傳送,不附帶該句子。 |

245| `$.turn` | `abort` |251| `$.turn` | `abort` |

246| [`$.session`](https://code.claude.com/docs/zh-TW/plugins/mods/api#send-and-receive-messages-between-sessions) | `messages`、`cwd`、`root`、`model`、`turns`、`id`、`repo`、`surfaces`、`usage`、`version`、`info`、`compact`、`send`、`append`、`authorize`。`info` 需要 Claude Code v2.1.326 或更新版本。`usage()` 回傳 `{ startedAt, context, rateLimits, cost }`:`context` 包含 `tokens`、`window` 與 `percent`,`rateLimits` 是 `{ kind, percentUsed, resetsAt }` 的清單。 |252| [`$.session`](https://code.claude.com/docs/zh-TW/plugins/mods/api#send-and-receive-messages-between-sessions) | `messages`、`cwd`、`root`、`model`、`turns`、`id`、`repo`、`surfaces`、`usage`、`version`、`info`、`compact`、`send`、`append`、`authorize`、`redact`。`info` 需要 Claude Code v2.1.326 或更新版本。`redact` 是僅針對憑證的盡力而為遮蔽功能,需要 v2.1.331 或更新版本。`usage()` 回傳 `{ startedAt, context, rateLimits, cost }`:`context` 包含 `tokens`、`window` 與 `percent`,`rateLimits` 是 `{ kind, percentUsed, resetsAt }` 的清單。 |

247| `$.config` | `list`、`set` |253| `$.config` | `list`、`set` |

248| [`$.settings`](https://code.claude.com/docs/zh-TW/plugins/mods/api#reach-files-processes-and-the-network) | `read` |254| [`$.settings`](https://code.claude.com/docs/zh-TW/plugins/mods/api#reach-files-processes-and-the-network) | `read` |

249| [`$.env`](https://code.claude.com/docs/zh-TW/plugins/mods/api#reach-files-processes-and-the-network) | `get`、`set` |255| [`$.env`](https://code.claude.com/docs/zh-TW/plugins/mods/api#reach-files-processes-and-the-network) | `get`、`set`。被拒絕的 `set` 會拒絕(reject),或解析為 `{ deny }`。`{ deny }` 結果需要 Claude Code v2.1.301 或更新版本。 |

250| [`$.fs`](https://code.claude.com/docs/zh-TW/plugins/mods/api#reach-files-processes-and-the-network) | `read`、`write`、`list`、`exists`、`stat`、`ancestors`。`write` 不是不可分割的操作:它會就地取代檔案內容,因此其他程序可能讀到寫入一半的檔案。多個工作階段都會變更的資料,請存放在 `$.store` 中。 |256| [`$.fs`](https://code.claude.com/docs/zh-TW/plugins/mods/api#reach-files-processes-and-the-network) | `read`、`write`、`list`、`exists`、`stat`、`ancestors`。`write` 不是不可分割的操作:它會就地取代檔案內容,因此其他程序可能讀到寫入一半的檔案。多個工作階段都會變更的資料,請存放在 `$.store` 中。 |

251| [`$.store`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state) | `get`、`set`、`delete`、`keys`。由機器上每個工作階段共用的鍵值儲存區。請參閱[從多個工作階段儲存](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#save-from-more-than-one-session)。 |257| [`$.store`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state) | `get`、`set`、`delete`、`keys`。由機器上每個工作階段共用的鍵值儲存區。請參閱[從多個工作階段儲存](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#save-from-more-than-one-session)。 |

252| [`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-a-value-in-\$-state) | 反應式狀態:`get`、`set`,以及從 `claude-code` 匯入的輔助函式 `atom`、`read`、`update`、`derive` 與 `memberOf` |258| [`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-a-value-in-\$-state) | 反應式狀態:`get`、`set`,以及從 `claude-code` 匯入的輔助函式 `atom`、`read`、`update`、`derive` 與 `memberOf` |


258| `$.audio` | `play`、`speak` |264| `$.audio` | `play`、`speak` |

259| `$.telemetry` | `log`、`mark`。只有當 Claude Code 或內建 mod 發出呼叫時,才會傳送紀錄。 |265| `$.telemetry` | `log`、`mark`。只有當 Claude Code 或內建 mod 發出呼叫時,才會傳送紀錄。 |

260 266 

267在終端機中,`$.ui.view({ agentId })` 會顯示某個 agent 的逐字稿,而 `$.ui.view({})` 會切換回來。請從命令或按鈕呼叫其中任一者。由計時器發出的呼叫會解析為 `{ deny: 'not person-initiated' }`。

268 

261## 轉譯位置269## 轉譯位置

262 270 

263轉譯位置是 Claude Code 介面中的擴充點。每一列都是 `ui.render` hook 中 `e.component` 的一個值,並列出 `e.props` 的欄位以及轉譯它的應用程式。`e.surface` 指出正在繪製的應用程式,例如 `terminal`、`desktop` 或 `vscode`。[變更 Claude Code 既有的繪製內容](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#change-what-claude-code-already-draws)說明 hook 能在某個位置做什麼,並為每種選擇提供範例。271轉譯位置是 Claude Code 介面中的擴充點。每一列都是 `ui.render` hook 中 `e.component` 的一個值,並列出 `e.props` 的欄位以及轉譯它的應用程式。`e.surface` 指出正在繪製的應用程式,例如 `terminal`、`desktop` 或 `vscode`。[變更 Claude Code 既有的繪製內容](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#change-what-claude-code-already-draws)說明 hook 能在某個位置做什麼,並為每種選擇提供範例。


267| 位置 | `e.props` | `e.requestId` | 轉譯於 |275| 位置 | `e.props` | `e.requestId` | 轉譯於 |

268| :- | :- | :- | :- |276| :- | :- | :- | :- |

269| [`Pane`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | `title`、`isFocused`、`bodyColumns`、`placement`、`scroll`、`view` | 窗格的 `id` | 終端機、Desktop、VS Code |277| [`Pane`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | `title`、`isFocused`、`bodyColumns`、`placement`、`scroll`、`view` | 窗格的 `id` | 終端機、Desktop、VS Code |

270| [`AbovePrompt`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | `hasSurvey`、[`isCollapsed`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#when-the-user-collapses-the-band)、`isWorking`、`maxRows`、`bodyColumns`、`scroll`、`view` | 單一實例 | 終端機、Desktop |278| [`AbovePrompt`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#pick-where-to-draw) | `hasSurvey`、[`isCollapsed`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#when-the-user-collapses-the-band)、`isWorking`、`maxRows`、`bodyColumns`、`scroll`、`view` | 單一實例 | 終端機、Desktop、VS Code |

271| `AbovePromptList`,即 `AbovePrompt` 列的堆疊 | `rows`,一個清單,其中每個 mod 的列各有一個 `{ plugin, tree }`,另加上 `AbovePrompt` 的 prop | 單一實例 | 終端機、Desktop。需要 Claude Code v2.1.323 或更新版本。 |279| `AbovePromptList`,即 `AbovePrompt` 列的堆疊 | `rows`,一個清單,其中每個 mod 的列各有一個 `{ plugin, tree }`,另加上 `AbovePrompt` 的 prop | 單一實例 | 終端機、Desktop、VS Code。需要 Claude Code v2.1.323 或更新版本。 |

280| `BesidePrompt`,提示詞右側的儲存格 | `maxColumns`、`floatRows`、`floatColumns`、`isWorking`、`view` | 單一實例 | [全螢幕轉譯](https://code.claude.com/docs/zh-TW/fullscreen.md)中的終端機、Desktop。需要 Claude Code v2.1.331 或更新版本。 |

281| `Underlay`,僅在介面空白處可見的圖層 | `columns`、`rows`、`isWorking`、`view` | `site:underlay` | 全螢幕轉譯中的終端機。需要 Claude Code v2.1.331 或更新版本。 |

282| `BesidePromptList` 與 `UnderlayList`,即 `BesidePrompt` 儲存格與 `Underlay` 圖層的順序 | `plugins` | 單一實例 | 與其所排序之位置相同的應用程式。需要 Claude Code v2.1.331 或更新版本。 |

272| [`Placed`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#place-a-row-in-the-transcript) | `id`、`plugin`、`onScreen` | `$.ui.place` 傳回的 `requestId` | 終端機 |283| [`Placed`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#place-a-row-in-the-transcript) | `id`、`plugin`、`onScreen` | `$.ui.place` 傳回的 `requestId` | 終端機 |

273| [`Backdrop`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `scene`、`plugin`、`glass`、`overrideColorScheme`。在 v2.1.323 之前,`scene` 為 `id`,`overrideColorScheme` 為 `colorScheme`。 | `backdrop` | `desktop` 與 `mobile` 使用介面。當 Desktop 或行動應用程式要求繪製背景時,您的 hook 就會執行。 |284| [`Backdrop`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#put-a-backdrop-behind-the-conversation) | `scene`、`plugin`、`glass`、`overrideColorScheme`。在 v2.1.323 之前,`scene` 為 `id`,`overrideColorScheme` 為 `colorScheme`。 | `backdrop` | `desktop` 與 `mobile` 使用介面。當 Desktop 或行動應用程式要求繪製背景時,您的 hook 就會執行。 |

274| `UserMessage` | `text`、`origin`、`isExpanded`,以及依來源而定的 `task` 或 `from` | 所繪製列的 id | 終端機、Desktop、VS Code |285| `UserMessage` | `text`、`origin`、`isExpanded`,以及依來源而定的 `task` 或 `from` | 所繪製列的 id | 終端機、Desktop、VS Code |


309| [`Input`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#take-typed-input-and-draw-a-row-for-each-item) | `key`、`label`、`placeholder`、`value`、`submitLabel`、[`rows`](https://code.claude.com/docs/zh-TW/plugins/mods/gallery#input)、`onSubmit`、`onInput`、`autoFocus` | ✓ | ✓ | ✓ |320| [`Input`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#take-typed-input-and-draw-a-row-for-each-item) | `key`、`label`、`placeholder`、`value`、`submitLabel`、[`rows`](https://code.claude.com/docs/zh-TW/plugins/mods/gallery#input)、`onSubmit`、`onInput`、`autoFocus` | ✓ | ✓ | ✓ |

310| `Select` | `key`、`label`、`options`、`value`、`onSelect`、`autoFocus` | ✓ | ✓ | ✓ |321| `Select` | `key`、`label`、`options`、`value`、`onSelect`、`autoFocus` | ✓ | ✓ | ✓ |

311| `Svg` | 最多 131,072 個字元的 SVG 標記 `source`、`alt` 文字、`width`、`height` 和 `isInteractive` | | ✓ | ✓ |322| `Svg` | 最多 131,072 個字元的 SVG 標記 `source`、`alt` 文字、`width`、`height` 和 `isInteractive` | | ✓ | ✓ |

323| [`Shader`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#animate-a-backdrop-with-a-shader) | `module`、`values`,以及一個 `Svg` 子元素。僅在 [`Backdrop`](#render-sites) 中繪製。需要 Claude Code v2.1.326 或更新版本。 | | ✓ | |

312| [`Client`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#build-a-tree-from-elements) | `module`、`key`、`props`、`width`、`height`、`flexGrow` | ✓ | ✓ | |324| [`Client`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#build-a-tree-from-elements) | `module`、`key`、`props`、`width`、`height`、`flexGrow` | ✓ | ✓ | |

313| [`Raster`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#draw-a-grid-of-colored-cells) | `key`、最多 512 的 `columns`、最多 256 的 `rows`、`cells`。請參閱[繪製彩色儲存格網格](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#draw-a-grid-of-colored-cells)。 | ✓ | | |325| [`Raster`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#draw-a-grid-of-colored-cells) | `key`、最多 512 的 `columns`、最多 256 的 `rows`、`cells`。請參閱[繪製彩色儲存格網格](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#draw-a-grid-of-colored-cells)。 | ✓ | | |

314| `Image` | `key`、`source`(例如最多 2 MiB 的 PNG 或 RGBA 位元組,或檔案路徑)、最多 255 的 `columns` 和 `rows`,以及 `alt` 文字。請參閱[哪些終端機會繪製它](https://code.claude.com/docs/zh-TW/plugins/mods/gallery.md#image-and-client)。 | ✓ | | |326| `Image` | `key`、`source`(例如最多 2 MiB 的 PNG 或 RGBA 位元組,或檔案路徑)、最多 255 的 `columns` 和 `rows`,以及 `alt` 文字。請參閱[哪些終端機會繪製它](https://code.claude.com/docs/zh-TW/plugins/mods/gallery.md#image-and-client)。 | ✓ | | |


413| `$.model.complete` `maxTokens` | 預設 1024,最多 64,000 或模型的輸出上限 |425| `$.model.complete` `maxTokens` | 預設 1024,最多 64,000 或模型的輸出上限 |

414| `$.fs.read` 與 `$.fs.write` | 單一檔案 4 MiB。在 v2.1.326 或更新版本中,可使用 `$.fs.read(path, { offset, length })` 分段讀取較大的檔案,兩者皆以位元組為單位。 |426| `$.fs.read` 與 `$.fs.write` | 單一檔案 4 MiB。在 v2.1.326 或更新版本中,可使用 `$.fs.read(path, { offset, length })` 分段讀取較大的檔案,兩者皆以位元組為單位。 |

415| `$.http.fetch` 請求本文 | 4 MiB,以字元計算。本文較大的呼叫會被拒絕。 |427| `$.http.fetch` 請求本文 | 4 MiB,以字元計算。本文較大的呼叫會被拒絕。 |

416| `$.http.fetch` 回應本文 | 4 MiB。`text` 保存前 4 MiB,其餘部分不會被讀取。當 `Content-Length` 標頭宣告的大小超過此值時,呼叫會改為被拒絕,原因以 `is over the 4194304-byte limit` 結尾,但經過任何重新導向後的最後一個請求使用 `HEAD` 方法時除外。`HEAD` 豁免需要 Claude Code v2.1.296 或更新版本。 |428| `$.http.fetch` 回應本文 | 4 MiB。`text` 保存前 4 MiB,其餘部分不會被讀取。當 `Content-Length` 標頭宣告的大小超過此值時,呼叫會改為被拒絕,原因以 `is over the 4194304-byte limit` 結尾。對於 204、205 或 304 回應,以及經過任何重新導向後的最後一個請求使用 `HEAD` 時,呼叫會忽略該標頭。`HEAD` 情況需要 Claude Code v2.1.296 或更新版本,其他情況則需要 v2.1.299 或更新版本。 |

417| 單一 `$.http.fetch` 呼叫,包含重新導向與本文 | 30 秒 |429| 單一 `$.http.fetch` 呼叫,包含重新導向與本文 | 30 秒 |

418| 單一 `$.http.fetch` 呼叫會跟隨的重新導向次數 | 5 |430| 單一 `$.http.fetch` 呼叫會跟隨的重新導向次數 | 5 |

419| hook 的 `drop` 原因或 `config.set` `deny` 原因 | 4,096 個字元。較長原因的結尾會被截斷,drop 或 deny 仍會生效。截斷需要 Claude Code v2.1.292 或更新版本,在較早的版本中,hook 則會改為[失敗](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#handle-a-hook-that-fails)。 |431| hook 的 `drop` 原因或 `config.set` `deny` 原因 | 4,096 個字元。較長原因的結尾會被截斷,drop 或 deny 仍會生效。截斷需要 Claude Code v2.1.292 或更新版本,在較早的版本中,hook 則會改為[失敗](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#handle-a-hook-that-fails)。 |

432| 所有 mod 位於[問題對話框上方](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#change-what-claude-code-already-draws)的元素 | 在終端機中為 12 列,在 Desktop 應用程式或 VS Code 擴充功能中為 48 列,以 40 欄寬度計算。超過限制時,對話框會在不含您的元素的情況下顯示。 |

433| 呼叫另一個 mod 在 [`engine.create`](#other-mods) 中新增的方法 | 10 秒。超過後,呼叫會被拒絕,原因以 `did not answer within 10000ms` 結尾。 |

420| 單一樹狀結構中的文字 | 只繪製前 100,000 個字元 |434| 單一樹狀結構中的文字 | 只繪製前 100,000 個字元 |

421| `Code` 的 `language` 或 `path`、`Select` 選項的 `value`,或 `Client` 的 `module` | 10,000 個字元。若其中任一項較長,傳回它的 `ui.render` hook 會[失敗](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#handle-a-hook-that-fails)。 |435| `Code` 的 `language` 或 `path`、`Select` 選項的 `value`,或 `Client` 的 `module` | 10,000 個字元。若其中任一項較長,傳回它的 `ui.render` hook 會[失敗](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#handle-a-hook-that-fails)。 |

422| `Link` 的 `href` | 2,048 個字元。若其較長,傳回它的 `ui.render` hook 會[失敗](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#handle-a-hook-that-fails)。 |436| `Link` 的 `href` | 2,048 個字元。若其較長,傳回它的 `ui.render` hook 會[失敗](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#handle-a-hook-that-fails)。 |


428| 單一樹狀結構中所有 `Image` 的 PNG 或 RGBA 位元組 | 2 MiB |442| 單一樹狀結構中所有 `Image` 的 PNG 或 RGBA 位元組 | 2 MiB |

429| `$.store` | 總計 4 MiB 的 JSON |443| `$.store` | 總計 4 MiB 的 JSON |

430| `$.session.messages()` | 最新的 4,096 個項目 |444| `$.session.messages()` | 最新的 4,096 個項目 |

445| 傳給 `$.session.redact` 的文字 | 100,000 個字元。文字較長的呼叫會被拒絕。 |

431| `$.ui.invalidate('ui.render')` 重新繪製 | 節流為每秒 10 次,在終端機中針對可見窗格、展開的橫帶與提示詞下方的提示行則為每秒 30 次。更早到來的呼叫會被合併。 |446| `$.ui.invalidate('ui.render')` 重新繪製 | 節流為每秒 10 次,在終端機中針對可見窗格、展開的橫帶與提示詞下方的提示行則為每秒 30 次。更早到來的呼叫會被合併。 |

447| [`ui.pointer`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#animate-a-backdrop-with-a-shader) 點擊 | 每秒兩次。應用程式會捨棄其餘的點擊。 |

448| [`Shader`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#animate-a-backdrop-with-a-shader) 的 `values` | 八個數字 |

432| `$.ui.toast` | 顯示 4 秒,除非您傳入 `{ timeoutMs }`。在[傳統轉譯器](https://code.claude.com/docs/zh-TW/fullscreen.md#enable-fullscreen-rendering)中,mod 較新的 toast 可能會[取代其較舊的 toast](https://code.claude.com/docs/zh-TW/plugins/mods/troubleshoot.md#a-toast-doesn’t-appear),無論後者正在顯示或正等待顯示。 |449| `$.ui.toast` | 顯示 4 秒,除非您傳入 `{ timeoutMs }`。在[傳統轉譯器](https://code.claude.com/docs/zh-TW/fullscreen.md#enable-fullscreen-rendering)中,mod 較新的 toast 可能會[取代其較舊的 toast](https://code.claude.com/docs/zh-TW/plugins/mods/troubleshoot.md#a-toast-doesn’t-appear),無論後者正在顯示或正等待顯示。 |

433| 未經使用者要求而開啟的窗格 | 自 144 個終端機欄寬起放置,使用者開啟過一次後則為 110 |450| 未經使用者要求而開啟的窗格 | 自 144 個終端機欄寬起放置,使用者開啟過一次後則為 110 |

434| 單一 mod 在一個對話中同時擁有的來自 `$.ui.place` 的列 | 500。達到上限時,使用新 `id` 的呼叫會解析為 `{ isPlaced: false, reason: 'a plugin holds at most 500 placed rows' }`。 |451| 單一 mod 在一個對話中同時擁有的來自 `$.ui.place` 的列 | 500。達到上限時,使用新 `id` 的呼叫會解析為 `{ isPlaced: false, reason: 'a plugin holds at most 500 placed rows' }`。 |


468| [`/plugin`](https://code.claude.com/docs/zh-TW/plugins/mods/overview#see-which-mods-a-session-loaded) | 當非內建的 mod 已載入時,在其分頁下方顯示如 `1 mod active · first-mod` 的一行 |485| [`/plugin`](https://code.claude.com/docs/zh-TW/plugins/mods/overview#see-which-mods-a-session-loaded) | 當非內建的 mod 已載入時,在其分頁下方顯示如 `1 mod active · first-mod` 的一行 |

469| [`claude plugin validate <directory>`](https://code.claude.com/docs/zh-TW/plugins/mods/create#check-what-claude-code-reads-from-your-mod) | 讀取外掛的資訊清單與 hook 模組,並回報錯誤、其處理的事件,以及其發出的 mods API 呼叫。`--strict` 會將警告視為錯誤,`--json` 會印出機器可讀的報告。 |486| [`claude plugin validate <directory>`](https://code.claude.com/docs/zh-TW/plugins/mods/create#check-what-claude-code-reads-from-your-mod) | 讀取外掛的資訊清單與 hook 模組,並回報錯誤、其處理的事件,以及其發出的 mods API 呼叫。`--strict` 會將警告視為錯誤,`--json` 會印出機器可讀的報告。 |

470| [`claude plugin test [directory]`](https://code.claude.com/docs/zh-TW/plugins/mods/test#write-a-test) | 執行該目錄下(未指定時則為目前目錄)所有檔名以 `.test.ts` 或 `.test.tsx` 結尾的檔案。測試失敗時以狀態 1 結束。 |487| [`claude plugin test [directory]`](https://code.claude.com/docs/zh-TW/plugins/mods/test#write-a-test) | 執行該目錄下(未指定時則為目前目錄)所有檔名以 `.test.ts` 或 `.test.tsx` 結尾的檔案。測試失敗時以狀態 1 結束。 |

471| [`claude --plugin-dir <directory>`](https://code.claude.com/docs/zh-TW/plugins/mods/create#write-a-mod-yourself) | 為單一工作階段載入外掛目錄,並在您儲存時重新載入其 hook 模組。重複使用此旗標可載入多個目錄。 |488| [`claude --plugin-dir <directory>`](https://code.claude.com/docs/zh-TW/plugins/mods/create#write-a-mod-yourself) | 為單一工作階段載入外掛目錄。在互動式終端機工作階段中,會在您儲存時重新載入 hook 模組。重複使用此旗標可載入多個目錄。 |

472| `/reload-plugins` | 在您執行時重新載入外掛 |489| `/reload-plugins` | 在您執行時重新載入外掛 |

Details

163 163 

164### 查詢 stub 返回的內容164### 查詢 stub 返回的內容

165 165 

166您的 mod 在測試中進行的每個 mods API 呼叫都需要一個代替 Claude Code 回答的 stub,除了套件自己回答的少數幾個:[`$.ui.invalidate`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#redraw-when-something-changes)、[`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state) 和 `$.session.append` 呼叫。對於 `$.clock` 呼叫,使用 `mock.clock(on)`,否則您的 mod 的 `$.clock.now()` 會失敗,並顯示 `no implementation for clock.now`。166[`$.ui.invalidate`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#redraw-when-something-changes)、[`$.state`](https://code.claude.com/docs/zh-TW/plugins/mods/interface#keep-state) 和 `$.session.append` 呼叫不需要 stub。對於 `$.clock` 呼叫,使用 `mock.clock(on)`,否則您的 mod 的 `$.clock.now()` 會失敗,並顯示 `no implementation for clock.now`。通過的測試[可能會隱藏](#follow-the-test-kit’s-rules) `no implementation for` 錯誤,而每個因此錯誤而失敗的呼叫都需要一個 stub。

167 167 

168此表列出了 mods 最常使用的。第一列是您的 mod 進行的呼叫或它使用 `next(e)` 傳遞的事件。第二列是傳遞給該名稱下的 `on` 的函數,因此 `$.store.get` 列變成 `on('store.get', ($, e) => ({ value: saved.get(e.key) }))`。stub 中的 `'...'` 標記您要填入的文字:168此表列出了 mods 最常使用的。第一列是您的 mod 進行的呼叫或它使用 `next(e)` 傳遞的事件。第二列是傳遞給該名稱下的 `on` 的函數,因此 `$.store.get` 列變成 `on('store.get', ($, e) => ({ value: saved.get(e.key) }))`。stub 中的 `'...'` 標記您要填入的文字:

169 169 


176| `$.ui.ask` | 一個 `tool.call` stub,因為問題作為對 `AskUserQuestion` 工具的呼叫到達它:`($, e) => ({ result: { answers: { [e.questions[0].question]: 'Run it' } } })`。如果您的 mod 傳遞其他工具呼叫,請先檢查 `e.tool`。 |176| `$.ui.ask` | 一個 `tool.call` stub,因為問題作為對 `AskUserQuestion` 工具的呼叫到達它:`($, e) => ({ result: { answers: { [e.questions[0].question]: 'Run it' } } })`。如果您的 mod 傳遞其他工具呼叫,請先檢查 `e.tool`。 |

177| `$.model.complete` | `() => ({ value: { isAnswered: true, text: '...', usage } })` |177| `$.model.complete` | `() => ({ value: { isAnswered: true, text: '...', usage } })` |

178| `$.process.run` | `($, e) => ({ value: { exitCode: 0, stdout: '...', stderr: '' } })`。`e.argv` 是引數列表,`e.init` 保存 `cwd` 和 `timeoutMs`。 |178| `$.process.run` | `($, e) => ({ value: { exitCode: 0, stdout: '...', stderr: '' } })`。`e.argv` 是引數列表,`e.init` 保存 `cwd` 和 `timeoutMs`。 |

179| 任何應該失敗的 mods API 呼叫 | `() => ({ deny: 'the reason' })`,這使呼叫在您的 mod 中拒絕。拋出的 stub 會被跳過。 |179| 要讓 stub 返回 `{ value }` 的呼叫失敗 | `() => ({ deny: 'the reason' })`,這使呼叫在您的 mod 中拒絕。`ui.toast`、`ui.log` 和 `ui.status` 不會拒絕。拋出的 stub 會被跳過。 |

180| `session.start` | `() => ({ cwd: '/work' })` |180| `session.start` | `() => ({ cwd: '/work' })` |

181| `turn.start` | `($, e) => ({ turnId: e.turnId })` |181| `turn.start` | `($, e) => ({ turnId: e.turnId })` |

182| `tool.call` | `() => ({ result: '...' })` |182| `tool.call` | `() => ({ result: '...' })` |


316| `select({ key: 'size', value: 'large' })` | 在具有該 key 的 `Select` 中選擇具有該值的選項 |316| `select({ key: 'size', value: 'large' })` | 在具有該 key 的 `Select` 中選擇具有該值的選項 |

317| `keepsBeneath()` | 在沒有 `ui.render` stub 的測試中,當繪圖包含 `next(e)` 傳回的內容時,它解析為 `true`;當您的 hook 將其省略時,則解析為 `false`。在有註冊 stub 的測試中,請使用 `find` 尋找該 stub 繪製的內容。需要 Claude Code v2.1.321 或更新版本。 |317| `keepsBeneath()` | 在沒有 `ui.render` stub 的測試中,當繪圖包含 `next(e)` 傳回的內容時,它解析為 `true`;當您的 hook 將其省略時,則解析為 `false`。在有註冊 stub 的測試中,請使用 `find` 尋找該 stub 繪製的內容。需要 Claude Code v2.1.321 或更新版本。 |

318| `find({ key: 'more' })` 或 `find({ type: 'Text', text: 'Count: 2' })` | 返回第一個匹配的元素作為 `{ type, props, children }`,或 `undefined`。`text` 可以是字串或正規表達式。 |318| `find({ key: 'more' })` 或 `find({ type: 'Text', text: 'Count: 2' })` | 返回第一個匹配的元素作為 `{ type, props, children }`,或 `undefined`。`text` 可以是字串或正規表達式。 |

319| `drawn()` | 返回最後一次繪製時的整棵樹 |

319| `unmount()` | 移除繪圖 |320| `unmount()` | 移除繪圖 |

320 321 

321每個方法在您的處理程式完成後解析,因此您可以在下一行檢查結果。將 `props` 設定為 Claude Code 為該網站傳遞的內容。[render sites table](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#render-sites) 列出每個網站的 props,[your build 的類型](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build) 有它們的類型。322每個方法在您的處理程式完成後解析,因此您可以在下一行檢查結果。將 `props` 設定為 Claude Code 為該網站傳遞的內容。[render sites table](https://code.claude.com/docs/zh-TW/plugins/mods/reference.md#render-sites) 列出每個網站的 props,[your build 的類型](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#get-the-types-for-your-build) 有它們的類型。

Details

10 10 

11## 找出 mod 為什麼沒有作用11## 找出 mod 為什麼沒有作用

12 12 

13當 mod 沒有作用時,請檢查 Claude Code 從 mod 的檔案讀取的內容,以及它在跳過某些內容時寫入的那一行。對於第一項,在您的 shell 中執行 [`claude plugin validate`](https://code.claude.com/docs/zh-TW/plugins/mods/create#check-what-claude-code-reads-from-your-mod),並使用 mod 的目錄,例如 `claude plugin validate ./first-mod`。它會捕捉拼寫錯誤的事件、不良的資訊清單和 Claude Code 無法讀取的模組,而無需啟動工作階段。13當 mod 沒有作用時,請檢查 Claude Code 從 mod 的檔案讀取的內容,以及它在跳過某些內容時寫入的那一行。若要檢查檔案,請在您的 shell 中執行 [`claude plugin validate`](https://code.claude.com/docs/zh-TW/plugins/mods/create#check-what-claude-code-reads-from-your-mod),並使用 mod 的目錄,例如 `claude plugin validate ./first-mod`。它會捕捉不良的資訊清單和 Claude Code 無法讀取的模組,而無需啟動工作階段。

14 14 

15當模組未載入、hook 被跳過或另一個 mod 拒絕您的 mod 時,Claude Code 會寫入一行,其中命名您的 mod。您讀取該行的位置取決於工作階段:15在某些情況下,例如程式碼錯誤導致 mod 無法載入、hook 被跳過,或另一個 mod 拒絕時,Claude Code 會寫入一行,其中命名您的 mod。請依工作階段類型,在逐字稿、偵錯日誌或 stderr 中尋找該行:

16 16 

17* **熱重新載入外掛目錄的工作階段**:逐字稿中的暗淡行。這是您使用 `--plugin-dir` 啟動的互動式工作階段,或您[為 Claude 編寫的 mod 啟用熱重新載入](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#ask-claude-for-a-mod)的工作階段。17* **熱重新載入外掛目錄的工作階段**:逐字稿中的暗淡行。這是您使用 `--plugin-dir` 啟動的互動式工作階段,或您[為 Claude 編寫的 mod 啟用熱重新載入](https://code.claude.com/docs/zh-TW/plugins/mods/create.md#ask-claude-for-a-mod)的工作階段。

18* **任何其他互動式工作階段,例如執行您從市集安裝的 mod 的工作階段**:[偵錯日誌](#read-the-debug-log)。若要取得偵錯日誌,請使用 `claude --debug` 啟動工作階段。18* **任何其他互動式工作階段,例如執行您從市集安裝的 mod 的工作階段**:[偵錯日誌](#read-the-debug-log)。若要取得偵錯日誌,請使用 `claude --debug` 啟動工作階段。


61| :- | :- |61| :- | :- |

62| `hooks modules are turned off for installed plugins in this process: the rollout switch served off` | Anthropic 已遠端關閉已安裝的 mod。 |62| `hooks modules are turned off for installed plugins in this process: the rollout switch served off` | Anthropic 已遠端關閉已安裝的 mod。 |

63| `hooks modules are turned off for installed plugins in this process: the rollout switch was saved off by an earlier session` | 該工作階段使用了先前工作階段儲存的值,該值可能已過時。請重新啟動 Claude Code 以重新整理它。 |63| `hooks modules are turned off for installed plugins in this process: the rollout switch was saved off by an earlier session` | 該工作階段使用了先前工作階段儲存的值,該值可能已過時。請重新啟動 Claude Code 以重新整理它。 |

64| `hooks modules a person installed wait for the rollout switch in this process` | 在[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)中,您的 mod 正在等待載入,因此請再傳送一則訊息。如果該行包含 `could not be read`,或您看到 `Mods you installed aren't running in this session`,請改為啟動新的工作階段。 |

64| `disableAllHooks in managed settings` | 您的組織關閉了已安裝 plugin 的 hooks |65| `disableAllHooks in managed settings` | 您的組織關閉了已安裝 plugin 的 hooks |

65| `only managed plugins and built-in plugins run` | 設定了 `allowManagedHooksOnly`,或在受管設定以外的設定檔中設定了 `disableAllHooks` |66| `only managed plugins and built-in plugins run` | 設定了 `allowManagedHooksOnly`,或在受管設定以外的設定檔中設定了 `disableAllHooks` |

66| `installed plugins that are not managed load no hooks module in this mode (--bare)` | 您使用 `--bare` 啟動了 Claude Code |67| `installed plugins that are not managed load no hooks module in this mode (--bare)` | 您使用 `--bare` 啟動了 Claude Code |


145 146 

146修復錯誤。偵錯日誌對每次發生都有一行。147修復錯誤。偵錯日誌對每次發生都有一行。

147 148 

149### `call refused` 或 `result withheld`

150 

151任一行都表示 Claude Code 無法將值複製到檢查某個動作的 hook(例如 `tool.call` hook),或無法從該 hook 複製值。比對[逐字稿或偵錯日誌中的該行](#find-out-why-a-mod-does-nothing),以確認該動作是否已執行:

152 

153* `call refused`:Claude Code 代替您的 hook 拒絕了該動作

154* `result withheld`:工具已完成的操作維持不變,Claude 會讀到一則說明來取代其結果

155 

156Claude 收到的回傳內容可能包含 `could not be given to a hook that checks it` 或 `a hook that checks this result could not hand back its answer`。

157 

158如果該行包含 `could not be given its argument`,表示您的 hook 並未執行,因此請保持原樣。如果包含 `is not plain data: nesting deeper than 28000 levels`,請減少您的 hook 所回傳或傳遞之值的巢狀層數。

159 

148### `no command.run hook answered it`160### `no command.run hook answered it`

149 161 

150您執行 mod 新增的命令,回覆命名 mod 和命令,例如 `first-mod registered /tally but no command.run hook answered it`,然後告訴您新增 hook。Claude Code 在命令到達鏈的末端且沒有答案時列印該回覆,這在兩種情況下發生:162您執行 mod 新增的命令,回覆命名 mod 和命令,例如 `first-mod registered /tally but no command.run hook answered it`,然後告訴您新增 hook。Claude Code 在命令到達鏈的末端且沒有答案時列印該回覆,這在兩種情況下發生:


296 308 

297### `$.ui.open` 執行且沒有窗格出現309### `$.ui.open` 執行且沒有窗格出現

298 310 

299呼叫不是來自使用者所做的操作,並且終端機的寬度小於[該窗格所需的寬度](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#when-a-pane-waits-for-a-wider-terminal)。311請檢查呼叫的結果。當 `isPlaced` 為 `false` 時,`reason` 的開頭會說明原因,例如以下情況:

300 312 

301從命令或按鈕開啟窗格,或檢查呼叫的 `isPlaced` 結果。請參閱[在正確的時間開啟窗格](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#open-a-pane-at-the-right-time)。313* **`unasked below`**:從命令或按鈕開啟窗格,或使用[較寬的終端機](https://code.claude.com/docs/zh-TW/plugins/mods/interface.md#when-a-pane-waits-for-a-wider-terminal)。

314* **`no-surface`**:沒有附加任何可供繪製的介面,例如在 `claude -p` 或 Agent SDK 執行中。請改為從 `command.run` hook 返回 `{ text }`。

302 315 

303### toast 未出現316### toast 未出現

304 317 


341 354 

342### 您的編輯不生效355### 您的編輯不生效

343 356 

344您正在編輯您安裝的 plugin。Claude Code 執行已安裝版本的快取副本。357如果您的外掛是[在安裝時複製的](https://code.claude.com/docs/zh-TW/plugins/loading.md#in-place-and-copied-plugins),Claude Code 會執行該副本。

345 358 

346使用指向您的工作副本的 `--plugin-dir` 進行開發,例如 `claude --plugin-dir ./first-mod`,它在您儲存時重新載入。359使用指向您的工作副本的 `--plugin-dir` 進行開發,例如 `claude --plugin-dir ./first-mod`,它在您儲存時重新載入。

347 360 


369| `settings.read bypassed by cc-plugin-sec-default`,出現在於其前方列出您的 mod 名稱的行上 | [內建防護](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md#know-what-happens-by-default)略過了您的 hook。請您組織的管理員[將該 mod 安裝為組織的 mod 之一](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md#install-your-organizations-mods)。 |382| `settings.read bypassed by cc-plugin-sec-default`,出現在於其前方列出您的 mod 名稱的行上 | [內建防護](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md#know-what-happens-by-default)略過了您的 hook。請您組織的管理員[將該 mod 安裝為組織的 mod 之一](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md#install-your-organizations-mods)。 |

370| `settings.read: the answer for <key> is no value the key can hold` | Claude Code 拒絕了某個 hook 針對該設定鍵傳回的值。該 hook 可能是您的,也可能是其他 mod 的。請依照[適用於您情況的步驟](#settings-read-key-refused)進行。 |383| `settings.read: the answer for <key> is no value the key can hold` | Claude Code 拒絕了某個 hook 針對該設定鍵傳回的值。該 hook 可能是您的,也可能是其他 mod 的。請依照[適用於您情況的步驟](#settings-read-key-refused)進行。 |

371| `settings.read: the merge never settles for <key>` | 該行列出的設定鍵會保留設定來源的值。請在設定檔中設定它們。 |384| `settings.read: the merge never settles for <key>` | 該行列出的設定鍵會保留設定來源的值。請在設定檔中設定它們。 |

372| `answered settings.read without next()`,位於某個 mod 名稱之後 | 若該 mod [於您的 mod 之前執行](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#the-order-mods-run-in),您的 hook 就會受到影響。此時您的 hook 未在該次讀取中執行。[關閉該 mod](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#turn-mods-on-or-off),或者若是您的組織部署了它,請其管理員關閉。 |385| `answered settings.read without next()`,出現在某個 mod 的名稱之後 | 如果該 mod [在您的 mod 之前執行](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#the-order-mods-run-in),您的 hook 就會受到影響。此時您的 hook 並未在該次讀取時執行。請[關閉該 mod](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#turn-mods-on-or-off);如果您所在的組織部署了該 mod,請要求您的管理員關閉。 |

373| `settings.read: refused to the engine` | 由於 Claude Code 本身的讀取遭到拒絕,您的值未生效。[找出拒絕的來源](#settings-read-refused)。 |386| `settings.read: refused to the engine` | 由於 Claude Code 本身的讀取遭到拒絕,您的值未生效。[找出拒絕的來源](#settings-read-refused)。 |

374 387 

375若沒有任何一行能解釋該設定鍵,請檢查在您的 mod 之前執行的 mod 中,是否有[變更該設定鍵](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#settings-read-example)的 `settings.read` hook。關閉該 mod,或請您組織的管理員關閉。若沒有任何 hook 變更它,請在設定檔中設定該設定鍵。388若沒有任何一行能解釋該設定鍵,請檢查在您的 mod 之前執行的 mod 中,是否有[變更該設定鍵](https://code.claude.com/docs/zh-TW/plugins/mods/events.md#settings-read-example)的 `settings.read` hook。關閉該 mod,或者若是您的組織部署了它,請您的管理員關閉。若沒有任何 hook 變更它,請在設定檔中設定該設定鍵。

376 389 

377### `the answer for <key> is no value the key can hold`390### `the answer for <key> is no value the key can hold`

378 391 


400在您的程式碼中搜尋括號內的原因:413在您的程式碼中搜尋括號內的原因:

401 414 

402* **您的程式碼中有此文字**:您的 hook 拒絕了該讀取。請讓它在 [`next.origin`](https://code.claude.com/docs/zh-TW/plugins/mods/events#settings-read-origin) 顯示為 Claude Code 本身的讀取時傳回 `{ value }`。415* **您的程式碼中有此文字**:您的 hook 拒絕了該讀取。請讓它在 [`next.origin`](https://code.claude.com/docs/zh-TW/plugins/mods/events#settings-read-origin) 顯示為 Claude Code 本身的讀取時傳回 `{ value }`。

403* **您的程式碼中沒有此原因**:逐一[關閉](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#turn-mods-on-or-off)您的其他 mod。若某個 mod 是您的組織部署的,請其管理員將其關閉。每關閉一個後:416* **您的程式碼中沒有它**:逐一[關閉](https://code.claude.com/docs/zh-TW/plugins/mods/overview.md#turn-mods-on-or-off)您的其他 mod;如果您所在的組織部署了某個 mod,請要求您的管理員逐一關閉。每關閉一個之後:

404 1. 從您的 shell 以 `claude --debug-file ./settings-read-2.log` 啟動工作階段,並在後面加上原本啟動時使用的旗標。每次都使用新的路徑。417 1. 從您的 shell 以 `claude --debug-file ./settings-read-2.log` 啟動工作階段,後面接上它原本啟動時使用的旗標。每次都使用新的路徑。

405 2. 在該檔案中搜尋 `refused to the engine`。若該行存在,請關閉下一個 mod。若不存在,則您最後關閉的 mod 拒絕了該讀取,請保持其關閉。418 2. 在該檔案中搜尋 `refused to the engine`。如果該行存在,請關閉下一個 mod。如果不存在,表示您最後關閉的 mod 拒絕了該讀取,因此請保持其關閉狀態。

406 419 

407若沒有其他 mod 可關閉而該行仍然存在,請在[設定檔](https://code.claude.com/docs/zh-TW/settings.md)中設定您的 hook 傳回的設定鍵。在讀取遭到拒絕期間,其值仍然有效。420若沒有其他 mod 可關閉而該行仍然存在,請在[設定檔](https://code.claude.com/docs/zh-TW/settings.md)中設定您的 hook 傳回的設定鍵。在讀取遭到拒絕期間,其值仍然有效。

408 421 

Details

42 42 

43Skills、子代理、hooks 和 MCP 伺服器都可以獨立運作,無需 plugin。例如,您在 `~/.claude/skills/` 中保存的 skill 在您機器上的每個專案中都可用。若要單獨設定其中一個,請參閱 [Skills](https://code.claude.com/docs/zh-TW/skills.md)、[Subagents](https://code.claude.com/docs/zh-TW/sub-agents.md)、[Hooks](https://code.claude.com/docs/zh-TW/hooks-guide.md) 或 [MCP](https://code.claude.com/docs/zh-TW/mcp.md)。43Skills、子代理、hooks 和 MCP 伺服器都可以獨立運作,無需 plugin。例如,您在 `~/.claude/skills/` 中保存的 skill 在您機器上的每個專案中都可用。若要單獨設定其中一個,請參閱 [Skills](https://code.claude.com/docs/zh-TW/skills.md)、[Subagents](https://code.claude.com/docs/zh-TW/sub-agents.md)、[Hooks](https://code.claude.com/docs/zh-TW/hooks-guide.md) 或 [MCP](https://code.claude.com/docs/zh-TW/mcp.md)。

44 44 

45當您想要將多個 skills、子代理、hooks 或 MCP 伺服器打包為一個單位時,請使用 plugin。安裝一個以獲得某人建立的設定,只需一個命令並從其 marketplace 獲得更新。建立一個以將您自己的設定提供給隊友,在許多專案中安裝它,或發佈版本化版本。45當您想要將多個 skill、subagent、hook 或 MCP 伺服器打包為一個單位時,請使用外掛。安裝一個以獲得他人建立的設定,只需一個命令並從其市集獲得更新。建立一個以分享您自己的設定、在許多專案中安裝它,或發佈版本化的版本。

46 46 

47### 啟用的 plugin 對您的工作階段的影響47### 啟用的 plugin 對您的工作階段的影響

48 48 


122 122 

123* **分享您建立的內容**:[發佈和分發 plugin](https://code.claude.com/docs/zh-TW/plugins/publish.md),透過您自己的 marketplace 或 [Anthropic 的目錄](https://code.claude.com/docs/zh-TW/plugins/publish.md#submit-to-anthropics-directory)123* **分享您建立的內容**:[發佈和分發 plugin](https://code.claude.com/docs/zh-TW/plugins/publish.md),透過您自己的 marketplace 或 [Anthropic 的目錄](https://code.claude.com/docs/zh-TW/plugins/publish.md#submit-to-anthropics-directory)

124* **檢查它是否有效且被使用**:[使用 evals 測試 plugins](https://code.claude.com/docs/zh-TW/plugin-evals.md) 和[測量 plugin 成本和使用情況](https://code.claude.com/docs/zh-TW/plugins/measure.md)124* **檢查它是否有效且被使用**:[使用 evals 測試 plugins](https://code.claude.com/docs/zh-TW/plugin-evals.md) 和[測量 plugin 成本和使用情況](https://code.claude.com/docs/zh-TW/plugins/measure.md)

125* **為您的團隊執行 marketplace**:[建立 marketplace](https://code.claude.com/docs/zh-TW/plugins/create-marketplace.md),然後[託管和維護 marketplace](https://code.claude.com/docs/zh-TW/plugins/host-marketplace.md)125* **經營 marketplace**:[建立 marketplace](https://code.claude.com/docs/zh-TW/plugins/create-marketplace.md),然後[託管和維護 marketplace](https://code.claude.com/docs/zh-TW/plugins/host-marketplace.md)

126* **為組織設定 plugin 原則**:[為您的組織管理 plugins](https://code.claude.com/docs/zh-TW/plugins/org.md)126* **為組織設定 plugin 原則**:[為您的組織管理 plugins](https://code.claude.com/docs/zh-TW/plugins/org.md)

127* **修復問題**:[Plugin 故障排除](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md)127* **修復問題**:[Plugin 故障排除](https://code.claude.com/docs/zh-TW/plugins/troubleshooting.md)

Details

132 132 

133**1. 確認您可以提交**133**1. 確認您可以提交**

134 134 

135提交需要付費的 claude.ai 方案。在 Pro、Max 和 Ultra 上,您可以從自己的帳戶提交。在 Team 和 Enterprise 上,擁有者可以提交,在 Enterprise 上,擁有者也可以透過 **組織設定 > 角色** 下的自訂角色將 **目錄** 權限授予其他成員。請參閱 [確認您可以提交到目錄](https://claude.com/docs/directory/publish#confirm-you-can-submit-to-the-directory)。135提交需要付費的 claude.ai 方案。在 Pro、Max 和 Ultra 上,您可以從自己的帳戶提交。在 Team 和 Enterprise 上,擁有者可以提交,在 Enterprise 上,擁有者也可以透過 [**組織設定 > 角色**](https://claude.ai/admin-settings/roles) 下的自訂角色將 **目錄** 權限授予其他成員。請參閱 [確認您可以提交到目錄](https://claude.com/docs/directory/publish#confirm-you-can-submit-to-the-directory)。

136 136 

137**2. 在本機驗證外掛程式**137**2. 在本機驗證外掛程式**

138 138 

Details

856 856 

857#### Hooks fail to load857#### Hooks fail to load

858 858 

859**Errors** 標籤顯示以下其中一個訊息:859**Errors** 標籤或 `claude plugin list` 會顯示如下的訊息:

860 860 

861* **`Couldn't load hooks from <path>: <reason>`** 或 **`Failed to load hooks from <path>: <reason>`**:修正 `<reason>` 所指出的問題,例如無效的 JSON 或缺少頂層 `hooks` 鍵。若要在發佈外掛程式前找出 `hooks/hooks.json` 中的 JSON 語法問題,請在 shell 中執行 `claude plugin validate <plugin-directory>`861* **`Couldn't load hooks from <path>`**、**`Failed to load hooks from <path>`** 或 **`Hook load failed`**:修正所指出的問題,例如無效的 JSON 或缺少頂層 `hooks` 鍵。若要在發佈外掛程式前找出 `hooks/hooks.json` 中的 JSON 語法問題,請在 shell 中執行 `claude plugin validate <plugin-directory>`

862* **`hooks path not found: <path>`**:清單的 `hooks` 欄位命名在相對於外掛程式根目錄的該路徑處不存在的檔案。修復路徑或新增檔案862* **`hooks path not found: <path>`** 或 **`Path not found: <path> (hooks)`**:`<path>` 處不存在任何檔案。修正路徑或新增該檔案

863* **`hooks path escapes plugin directory: <path>`**:請參閱 [Path escapes plugin directory](https://code.claude.com/docs/zh-TW/errors.md#path-escapes-plugin-directory)863* **`hooks path escapes plugin directory: <path>`**:請參閱 [Path escapes plugin directory](https://code.claude.com/docs/zh-TW/errors.md#path-escapes-plugin-directory)

864 864 

865#### `hook error` notices in the transcript865#### `hook error` notices in the transcript


1184 1184 

1185受管設定阻止此外掛程式、其市集或它需要的依賴項。詢問您的管理員哪個條目適用。被阻止的依賴項表示外掛程式在依賴項的市集被允許前無法安裝。1185受管設定阻止此外掛程式、其市集或它需要的依賴項。詢問您的管理員哪個條目適用。被阻止的依賴項表示外掛程式在依賴項的市集被允許前無法安裝。

1186 1186 

1187當您從 `/plugin` 安裝時,也請就此訊息的其他形式詢問您的管理員,例如:

1188 

1189* `Plugin "<name>" is blocked by your organization's policy and can't be installed`

1190* `Can't install "<name>": dependency "<dep>" is blocked by your organization's policy`

1191 

1187### `--plugin-dir is disabled by your organization's managed settings (disableSideloadFlags)`1192### `--plugin-dir is disabled by your organization's managed settings (disableSideloadFlags)`

1188 1193 

1189您使用 `--plugin-dir`、`--plugin-url`、`--agents` 或 `--mcp-config` 啟動了 `claude`。Claude Code 以此訊息退出,並顯示 `Plugins, custom agents, and MCP servers can only be loaded from sources your administrator has approved.`1194您使用 `--plugin-dir`、`--plugin-url`、`--agents` 或 `--mcp-config` 啟動了 `claude`。Claude Code 以此訊息退出,並顯示 `Plugins, custom agents, and MCP servers can only be loaded from sources your administrator has approved.`

Details

147 147 

148若要新增設定指令碼、環境變數或不同的網路存取權限,請使用[組織共用環境](https://code.claude.com/docs/zh-TW/cloud-environments.md#organization-shared-environments)。在 **Claude Ship** 頁面上,於 **Where it runs** 下選取 **Default environment**。若要針對單一儲存庫覆寫此設定,請在 **Edit** 對話方塊中按一下 **Environment** 旁的 **Change**。148若要新增設定指令碼、環境變數或不同的網路存取權限,請使用[組織共用環境](https://code.claude.com/docs/zh-TW/cloud-environments.md#organization-shared-environments)。在 **Claude Ship** 頁面上,於 **Where it runs** 下選取 **Default environment**。若要針對單一儲存庫覆寫此設定,請在 **Edit** 對話方塊中按一下 **Environment** 旁的 **Change**。

149 149 

150若兩者皆未設定,PR Steward 可以使用您組織的[預設環境](https://code.claude.com/docs/zh-TW/cloud-environments.md#the-default-environment)。若沒有預設環境,它會在沒有設定指令碼和環境變數的 Anthropic 託管環境中執行。150若兩者皆未設定,PR Steward 可以使用您組織的[預設環境](https://code.claude.com/docs/zh-TW/cloud-environments.md#the-default-environment)。若該預設環境是[自行託管的](#run-pr-steward-in-a-self-hosted-environment),請在 **Where it runs** 下為 PR Steward 選取該環境或其他環境。在您完成此操作之前,pull request 可能會收到[表示 PR Steward 尚未啟動的留言](https://code.claude.com/docs/zh-TW/pr-steward-troubleshooting.md#pr-steward-posted-a-comment-that-says-why)。若您的組織沒有預設環境,PR Steward 會在沒有設定指令碼和環境變數的 Anthropic 託管環境中執行。

151 151 

152### 在自行託管的環境中執行 PR Steward152### 在自行託管的環境中執行 PR Steward

153 153 

154對於 PR Steward 執行的環境,您可以選取[自行託管的環境](https://code.claude.com/docs/zh-TW/self-hosted-environments)。[核准與合併的限制](https://code.claude.com/docs/zh-TW/pr-steward-security.md#limits-on-approvals-and-merges)僅針對 Anthropic 託管的工作階段說明。在沒有 [Anthropic 管理的 git](https://code.claude.com/docs/zh-TW/self-hosted-environments-deploy.md#use-the-anthropic-git-proxy) 的 runner 上,PR Steward 會使用 runner 本身的 git 憑證進行推送。154對於 PR Steward 執行的環境,您可以選取[自行託管的環境](https://code.claude.com/docs/zh-TW/self-hosted-environments)。其 runner 需要 Claude Code v2.1.317 或更新版本。[核准與合併的限制](https://code.claude.com/docs/zh-TW/pr-steward-security.md#limits-on-approvals-and-merges)僅針對 Anthropic 託管的工作階段說明。在沒有 [Anthropic 管理的 git](https://code.claude.com/docs/zh-TW/self-hosted-environments-deploy.md#use-the-anthropic-git-proxy) 的 runner 上,PR Steward 會使用 runner 本身的 git 憑證進行推送。

155 155 

156> [!WARNING]156> [!WARNING]

157>157>

Details

61| `PR Steward didn't start: only someone with write access` | 請具有寫入權限的人新增 `claude-pr-steward-watching` 標籤或留言 `@claude steward` |61| `PR Steward didn't start: only someone with write access` | 請具有寫入權限的人新增 `claude-pr-steward-watching` 標籤或留言 `@claude steward` |

62| `PR Steward hasn't started: your organization has no extra usage available` | 請 Owner 在 [**Organization settings > Usage**](https://claude.ai/admin-settings/usage) 中新增用量點數或提高支出上限。如果是您要求 PR Steward 啟動,則當您再次要求時它就會啟動。否則,它會在下一次推送時啟動 |62| `PR Steward hasn't started: your organization has no extra usage available` | 請 Owner 在 [**Organization settings > Usage**](https://claude.ai/admin-settings/usage) 中新增用量點數或提高支出上限。如果是您要求 PR Steward 啟動,則當您再次要求時它就會啟動。否則,它會在下一次推送時啟動 |

63| `PR Steward hasn't started: billing for PR Steward isn't set up` | 請 Owner 選擇一個已開啟 PR Steward 的儲存庫,並將其 [**Steward** 設定變更](https://code.claude.com/docs/zh-TW/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository)為 **Off** 以外的選項。他們可以立即再改回來 |63| `PR Steward hasn't started: billing for PR Steward isn't set up` | 請 Owner 選擇一個已開啟 PR Steward 的儲存庫,並將其 [**Steward** 設定變更](https://code.claude.com/docs/zh-TW/pr-steward-setup.md#choose-when-pr-steward-starts-in-each-repository)為 **Off** 以外的選項。他們可以立即再改回來 |

64| `PR Steward hasn't started: your Claude organization hasn't picked where it runs yet` | 請 Owner [為 PR Steward 選擇環境](https://code.claude.com/docs/zh-TW/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in),然後留言 `@claude steward` |

65| `PR Steward hasn't started: it can't use the environment that your Claude organization picked for it` | 請 Owner [為 PR Steward 選擇另一個環境](https://code.claude.com/docs/zh-TW/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in),然後留言 `@claude steward` |

66| `PR Steward hasn't started: the self-hosted runners it would run on need Claude Code 2.1.317 or newer` | 請負責執行您的[自行託管環境](https://code.claude.com/docs/zh-TW/pr-steward-setup.md#run-pr-steward-in-a-self-hosted-environment)的人[更新其 runner](https://code.claude.com/docs/zh-TW/self-hosted-environments-deploy.md#pin-the-version),然後留言 `@claude steward` |

64| `Claude PR Steward couldn't start, so it isn't watching this pull request` | 新增標籤或留言 `@claude steward` 以重試 |67| `Claude PR Steward couldn't start, so it isn't watching this pull request` | 新增標籤或留言 `@claude steward` 以重試 |

65| `Claude PR Steward couldn't start on this pull request because the setup script` | 請可編輯 [PR Steward 執行環境](https://code.claude.com/docs/zh-TW/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in)的人修正其設定指令碼,然後再次啟動 PR Steward |68| `Claude PR Steward couldn't start on this pull request because the setup script` | 請可編輯 [PR Steward 執行環境](https://code.claude.com/docs/zh-TW/pr-steward-setup.md#choose-the-environment-pr-steward-runs-in)的人修正其設定指令碼,然後再次啟動 PR Steward |

66| `this repository has PR Steward enabled in more than one Claude workspace` | 請各 Owner 將該儲存庫保留在一個 Claude 組織中,並從其他組織中移除 |69| `this repository has PR Steward enabled in more than one Claude workspace` | 請各 Owner 將該儲存庫保留在一個 Claude 組織中,並從其他組織中移除 |

Details

88 88 

89[自動模型備援](https://code.claude.com/docs/zh-TW/model-config.md#automatic-model-fallback)在 Fable 模型、Opus 5.5、Sonnet 5.5 和 Opus 5 上也是模型切換。當安全分類器在具有備援模型的類別中標記請求時,Claude Code 會在該模型上重新執行請求,並且工作階段會在那裡繼續。89[自動模型備援](https://code.claude.com/docs/zh-TW/model-config.md#automatic-model-fallback)在 Fable 模型、Opus 5.5、Sonnet 5.5 和 Opus 5 上也是模型切換。當安全分類器在具有備援模型的類別中標記請求時,Claude Code 會在該模型上重新執行請求,並且工作階段會在那裡繼續。

90 90 

91當 skill 或命令的 frontmatter 指定的 [`model`](https://code.claude.com/docs/zh-TW/skills#frontmatter-reference) 不同於工作階段目前模型時,該回合也是模型切換:下一個請求會讀取整個對話歷史記錄而沒有快取命中。工作階段模型會在您的下一個提示詞時恢復。`context: fork` skill 則會改為設定[分叉 subagent 的模型](https://code.claude.com/docs/zh-TW/skills.md#run-skills-in-a-subagent)。91#### 設定模型的 skill 和命令

92 

93當 skill 或命令的 [`model` 值適用](https://code.claude.com/docs/zh-TW/skills#frontmatter-reference)且不同於工作階段目前的模型時,該回合即為模型切換。下一個請求會讀取整個對話歷史記錄而沒有快取命中。工作階段模型會在您的下一個提示詞時恢復。使用 `context: fork` 時,該值則會改為套用至具有[自己快取](#subagents-and-the-cache)的 [subagent](https://code.claude.com/docs/zh-TW/skills.md#run-skills-in-a-subagent)。

92 94 

93### 變更 effort 等級95### 變更 effort 等級

94 96 


240 242 

241### 叫用 skill 和命令243### 叫用 skill 和命令

242 244 

243[Skill](https://code.claude.com/docs/zh-TW/skills.md) 和[命令](https://code.claude.com/docs/zh-TW/commands.md)在叫用點將其指示作為使用者訊息注入。對話中較早的任何內容都不會改變。frontmatter 命名 `model` 的 skill 或命令可以是該回合的[模型切換](#switching-models)。245[Skill](https://code.claude.com/docs/zh-TW/skills.md) 和[命令](https://code.claude.com/docs/zh-TW/commands.md)在叫用點將其指示作為使用者訊息注入。對話中較早的任何內容都不會改變。[`model` 值生效](https://code.claude.com/docs/zh-TW/skills#frontmatter-reference)的 skill 或命令可以是該回合的[模型切換](#switching-models)。

244 246 

245### 執行 `/recap`247### 執行 `/recap`

246 248 

quickstart.md +1 −1

Details

21> 以下情況在其他頁面中說明:21> 以下情況在其他頁面中說明:

22>22>

23> * **從未使用過終端機**:請從[終端機指南](https://code.claude.com/docs/zh-TW/terminal-guide)開始23> * **從未使用過終端機**:請從[終端機指南](https://code.claude.com/docs/zh-TW/terminal-guide)開始

24> * **想在終端機以外的地方使用 Claude Code**:Claude Code 也可在[網頁](https://claude.ai/code)、[桌面應用程式](https://code.claude.com/docs/zh-TW/desktop.md)、[VS Code](https://code.claude.com/docs/zh-TW/vs-code.md) 和 [JetBrains IDE](https://code.claude.com/docs/zh-TW/jetbrains.md)、[Slack](https://code.claude.com/docs/zh-TW/slack.md) 中使用,以及透過 [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md) 和 [GitLab](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md) 在 CI/CD 中使用。請參閱[所有介面](https://code.claude.com/docs/zh-TW/overview.md#use-claude-code-everywhere)。24> * **想在終端機以外的地方使用 Claude Code**:Claude Code 也可在[網頁](https://claude.ai/code)、[桌面應用程式](https://code.claude.com/docs/zh-TW/desktop.md)、[VS Code](https://code.claude.com/docs/zh-TW/vs-code.md) 和 [JetBrains IDE](https://code.claude.com/docs/zh-TW/jetbrains.md) 中使用,以及透過 [GitHub Actions](https://code.claude.com/docs/zh-TW/github-actions.md) 和 [GitLab](https://code.claude.com/docs/zh-TW/gitlab-ci-cd.md) 在 CI/CD 中使用。請參閱[所有介面](https://code.claude.com/docs/zh-TW/overview.md#use-claude-code-everywhere)。

25 25 

26## 步驟 1:安裝 Claude Code26## 步驟 1:安裝 Claude Code

27 27 

Details

325| [Dispatch](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch) | 從 Claude 行動應用程式傳送任務訊息 | 您的機器 (Desktop) | [將行動應用程式與 Desktop 配對](https://support.claude.com/en/articles/13947068) | 在您不在時委派工作,最少設定 |325| [Dispatch](https://code.claude.com/docs/zh-TW/desktop.md#sessions-from-dispatch) | 從 Claude 行動應用程式傳送任務訊息 | 您的機器 (Desktop) | [將行動應用程式與 Desktop 配對](https://support.claude.com/en/articles/13947068) | 在您不在時委派工作,最少設定 |

326| [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) | 從 [claude.ai/code](https://claude.ai/code) 或 Claude 行動應用程式驅動執行中的工作階段 | 您的機器 (CLI、Desktop 或 VS Code) | 執行 [`claude remote-control` 或 `/remote-control`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) | 從另一個裝置控制進行中的工作 |326| [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) | 從 [claude.ai/code](https://claude.ai/code) 或 Claude 行動應用程式驅動執行中的工作階段 | 您的機器 (CLI、Desktop 或 VS Code) | 執行 [`claude remote-control` 或 `/remote-control`](https://code.claude.com/docs/zh-TW/remote-control#start-a-remote-control-session) | 從另一個裝置控制進行中的工作 |

327| [Channels](https://code.claude.com/docs/zh-TW/channels.md) | 從聊天應用程式 (如 Telegram 或 Discord) 或您自己的伺服器推送事件 | 您的機器 (CLI) | [安裝頻道外掛程式](https://code.claude.com/docs/zh-TW/channels.md#quickstart) 或 [建立您自己的](https://code.claude.com/docs/zh-TW/channels-reference.md) | 對外部事件 (如 CI 失敗或聊天訊息) 做出反應 |327| [Channels](https://code.claude.com/docs/zh-TW/channels.md) | 從聊天應用程式 (如 Telegram 或 Discord) 或您自己的伺服器推送事件 | 您的機器 (CLI) | [安裝頻道外掛程式](https://code.claude.com/docs/zh-TW/channels.md#quickstart) 或 [建立您自己的](https://code.claude.com/docs/zh-TW/channels-reference.md) | 對外部事件 (如 CI 失敗或聊天訊息) 做出反應 |

328| [Slack](https://code.claude.com/docs/zh-TW/slack.md) | 在團隊頻道中提及 `@Claude` | Anthropic 雲端 | [安裝 Slack 應用程式](https://code.claude.com/docs/zh-TW/slack.md#setting-up-claude-code-in-slack) 並啟用 [網路上的 Claude Code](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md),適用於 Pro、Max 和 Ultra 方案 | 從團隊聊天進行 PR 和審查 |

329| [Self-hosted environments](https://code.claude.com/docs/zh-TW/self-hosted-environments) | 啟動 [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md) 並選擇您組織的環境 | 您組織的基礎設施 | [部署執行器](https://code.claude.com/docs/zh-TW/self-hosted-environments-quickstart.md),在 Team 和 Enterprise 方案上 | 必須在您的網路內執行的雲端工作階段 |328| [Self-hosted environments](https://code.claude.com/docs/zh-TW/self-hosted-environments) | 啟動 [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md) 並選擇您組織的環境 | 您組織的基礎設施 | [部署執行器](https://code.claude.com/docs/zh-TW/self-hosted-environments-quickstart.md),在 Team 和 Enterprise 方案上 | 必須在您的網路內執行的雲端工作階段 |

330| [Scheduled tasks](https://code.claude.com/docs/zh-TW/scheduled-tasks.md) | 設定排程 | [CLI](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)、[Desktop](https://code.claude.com/docs/zh-TW/desktop-scheduled-tasks.md) 或 [雲端](https://code.claude.com/docs/zh-TW/routines.md) | 選擇頻率 | 定期自動化 (如每日審查) |329| [Scheduled tasks](https://code.claude.com/docs/zh-TW/scheduled-tasks.md) | 設定排程 | [CLI](https://code.claude.com/docs/zh-TW/scheduled-tasks.md)、[Desktop](https://code.claude.com/docs/zh-TW/desktop-scheduled-tasks.md) 或 [雲端](https://code.claude.com/docs/zh-TW/routines.md) | 選擇頻率 | 定期自動化 (如每日審查) |

331 330 

routines.md +6 −6

Details

41 41 

42* **待辦事項維護**:排程觸發條件每個工作日晚上在您的儲存庫中執行,並將您的問題追蹤器新增為連接器。排程任務讀取自上次執行以來開啟的問題、套用標籤,並依據所引用的程式碼區域指派負責人。接著將摘要發布到 Slack,讓團隊每天一開始就有整理好的佇列。42* **待辦事項維護**:排程觸發條件每個工作日晚上在您的儲存庫中執行,並將您的問題追蹤器新增為連接器。排程任務讀取自上次執行以來開啟的問題、套用標籤,並依據所引用的程式碼區域指派負責人。接著將摘要發布到 Slack,讓團隊每天一開始就有整理好的佇列。

43* **警報分類**:當錯誤閾值被超過時,您的監控工具會呼叫排程任務的 API 端點,並將警報內文作為 `text` 傳遞。任務的提示詞指示 Claude 調查觸發 payload 中的警報,因此它會擷取堆疊追蹤,並將其與儲存庫中最近的提交相互關聯。接著它會開啟一個草稿 pull request,內含建議的修正以及返回警報的連結。值班人員只需審查 PR,而不必從空白的終端機開始。43* **警報分類**:當錯誤閾值被超過時,您的監控工具會呼叫排程任務的 API 端點,並將警報內文作為 `text` 傳遞。任務的提示詞指示 Claude 調查觸發 payload 中的警報,因此它會擷取堆疊追蹤,並將其與儲存庫中最近的提交相互關聯。接著它會開啟一個草稿 pull request,內含建議的修正以及返回警報的連結。值班人員只需審查 PR,而不必從空白的終端機開始。

44* **客製化程式碼審查**:GitHub 觸發條件在 `pull_request.opened` 時執行。排程任務套用您團隊自己的審查檢查清單,針對安全性、效能和風格問題留下行內註解。它也會新增一則摘要註解,讓人工審查者可以專注於設計,而不是機械式的檢查。44* **客製化程式碼審查**:GitHub 觸發條件在 `pull_request.opened` 時執行。排程任務套用您自己的審查檢查清單,針對安全性、效能和風格問題留下行內註解。它也會新增一則摘要註解,讓人工審查者可以專注於設計,而不是機械式的檢查。

45* **部署驗證**:您的 CD 管線在每次正式環境部署後呼叫排程任務的 API 端點。任務針對新的建置執行冒煙檢查、掃描錯誤日誌以找出回歸問題,並在部署時段結束前向發布頻道發布可否部署的結論。45* **部署驗證**:您的 CD 管線在每次正式環境部署後呼叫排程任務的 API 端點。任務針對新的建置執行冒煙檢查、掃描錯誤日誌以找出回歸問題,並在部署時段結束前向發布頻道發布可否部署的結論。

46* **文件偏移**:排程觸發條件每週執行。排程任務掃描自上次執行以來合併的 PR、標記引用了已變更 API 的文件,並針對文件儲存庫開啟更新 PR,供編輯者審查。46* **文件偏移**:排程觸發條件每週執行。排程任務掃描自上次執行以來合併的 PR、標記引用了已變更 API 的文件,並針對文件儲存庫開啟更新 PR,供編輯者審查。

47* **函式庫移植**:GitHub 觸發條件在 `pull_request.closed` 時執行,並篩選為某個 SDK 儲存庫中已合併的 PR。排程任務將變更移植到另一種語言的平行 SDK,並開啟對應的 PR,讓兩個函式庫保持同步,而無需人工重新實作每項變更。47* **函式庫移植**:GitHub 觸發條件在 `pull_request.closed` 時執行,並篩選為某個 SDK 儲存庫中已合併的 PR。排程任務將變更移植到另一種語言的平行 SDK,並開啟對應的 PR,讓兩個函式庫保持同步,而無需人工重新實作每項變更。


344* **Failed**:工作階段未正常結束。例如,它意外停止、以錯誤結束,或在執行開始前就已被封存344* **Failed**:工作階段未正常結束。例如,它意外停止、以錯誤結束,或在執行開始前就已被封存

345* **Cancelled**:執行並未失敗,且其工作階段已被封存。如果您封存了一次成功執行的工作階段,該執行會變為 **Cancelled**。任務本身無需任何變更345* **Cancelled**:執行並未失敗,且其工作階段已被封存。如果您封存了一次成功執行的工作階段,該執行會變為 **Cancelled**。任務本身無需任何變更

346 346 

347如果 **History** 下出現警告,請參閱[「The last run」警告](#the-last-run-didnt-start)。347如果 **History** 下出現警告,請參閱[History 下的警告](#the-last-run-didnt-start)。

348 348 

349### 編輯與控制排程任務349### 編輯與控制排程任務

350 350 


510 510 

511您的組織已關閉雲端排程任務,且您無法從本機設定變更此狀態。請詢問您的 Team 或 Enterprise 擁有者,是否能在 [**Organization settings > Capabilities > Remote sessions**](https://claude.ai/admin-settings/capabilities) 開啟 **Scheduled tasks (Was Routines)** 或 **Routines** 切換開關。511您的組織已關閉雲端排程任務,且您無法從本機設定變更此狀態。請詢問您的 Team 或 Enterprise 擁有者,是否能在 [**Organization settings > Capabilities > Remote sessions**](https://claude.ai/admin-settings/capabilities) 開啟 **Scheduled tasks (Was Routines)** 或 **Routines** 切換開關。

512 512 

513### "The last run" 警告513### History 下的警告

514 514 

515當 **History** 下的警告以 "The last run" 開頭時,請在第一欄中找到該警告,並依照該列的說明操作。之後的某次執行開始後,警告就會清除。515當 **History** 下的警告以 "The last run" 或 "This didn't run" 開頭時,請在第一欄中找到該警告,並依照該列的說明操作。之後的某次執行開始後,警告就會清除。

516 516 

517| 警告 | 處理方式 |517| 警告 | 處理方式 |

518| :- | :- |518| :- | :- |

519| "The last run didn't start because your organization had reached its limit on cloud sessions running at once." | 任務無需變更。請稍後點選 **Run now**,或等待下一次執行 |519| "This didn't run" 後接該次執行的時間,接著是 "You were at the limit for tasks Claude can work on at the same time." 或 "Your organization was at its limit for tasks Claude can work on at the same time." | 任務無需變更。請稍後點選 **Run now**,或等待下一次執行 |

520| "The last run didn't start because its cloud environment couldn't be found or used." | 在任務的詳細資料頁面上,開啟其名稱旁的選單,選取 **Edit**,然後找到[雲端環境選擇器](#environments-and-network-access)。如果其顯示 **Unavailable environment**,表示該環境已封存或您的帳戶已無法使用,請在該處選擇其他環境並儲存變更。否則,請在詳細資料頁面上以 **Run now** 重試,或在選擇器中挑選其他環境並儲存變更 |520| "The last run didn't start because its environment couldn't be found or used." | 在任務的詳細資料頁面上,開啟其名稱旁的選單,選取 **Edit**,然後找到[雲端環境選擇器](#environments-and-network-access)。如果其顯示 **Unavailable environment**,表示該環境已封存或您的帳戶已無法使用,請在該處選擇其他環境並儲存變更。否則,請在詳細資料頁面上以 **Run now** 重試,或在選擇器中挑選其他環境並儲存變更 |

521| "The last run was blocked because it couldn't access something it needs, or your organization's policy doesn't allow it." | 請確認您的 [GitHub 存取權](#repositories-and-branch-permissions)涵蓋任務的儲存庫。如果已涵蓋,請詢問您 Claude 組織的[擁有者](https://code.claude.com/docs/zh-TW/server-managed-settings.md#access-control)是否有政策封鎖了該任務 |521| "The last run was blocked because it couldn't access something it needs, or your organization's policy doesn't allow it." | 請確認您的 [GitHub 存取權](#repositories-and-branch-permissions)涵蓋任務的儲存庫。如果已涵蓋,請詢問您 Claude 組織的[擁有者](https://code.claude.com/docs/zh-TW/server-managed-settings.md#access-control)是否有政策封鎖了該任務 |

522| "The last run didn't start because of a problem that's usually temporary." | 點選 **Run now** 再試一次,或等待下一次執行 |522| "The last run didn't start because of a problem that's usually temporary." | 點選 **Run now** 再試一次,或等待下一次執行 |

523| "The last run didn't start because its repository or branch wasn't available." | 請在 GitHub 上確認任務中的每個儲存庫都有[執行起始所用的分支](#repositories-and-branch-permissions)。也請確認您的 [GitHub 存取權](#repositories-and-branch-permissions)涵蓋每個儲存庫,如果您的連線已過期,請重新連接 GitHub |523| "The last run didn't start because its repository or branch wasn't available." | 請在 GitHub 上確認任務中的每個儲存庫都有[執行起始所用的分支](#repositories-and-branch-permissions)。也請確認您的 [GitHub 存取權](#repositories-and-branch-permissions)涵蓋每個儲存庫,如果您的連線已過期,請重新連接 GitHub |

Details

783# shellcheck disable=SC2086 # $base is either "" or "FETCH_HEAD", intentional word-split783# shellcheck disable=SC2086 # $base is either "" or "FETCH_HEAD", intentional word-split

784unpushed=$(git -C "$d" rev-list HEAD --not $base --remotes=origin --count 2>/dev/null) || unpushed=0784unpushed=$(git -C "$d" rev-list HEAD --not $base --remotes=origin --count 2>/dev/null) || unpushed=0

785if [ "$unpushed" -gt 0 ]; then785if [ "$unpushed" -gt 0 ]; then

786 branch=$(git -C "$d" symbolic-ref --short -q HEAD)786 # The branch name is not trusted text, so the message leaves it out.

787 if [ -n "$branch" ]; then787 # $unpushed is a count from git rev-list, or 0.

788 # $branch is attacker-influenced — git-check-ref-format(1) allows `"`788 # With -q, symbolic-ref exits 1 on a detached HEAD.

789 # in ref names. `\` is forbidden (rule 10) but escaped anyway as cheap789 git -C "$d" symbolic-ref -q HEAD >/dev/null 2>&1

790 # defense-in-depth.790 if [ $? -eq 1 ]; then

791 # Escape JSON metacharacters before interpolating into the hand-built

792 # payload so a branch like x","continue":false can't inject keys into

793 # the hook-output JSON the harness parses. $unpushed is safe — the

794 # -gt guard above rejects anything that isn't a plain integer.

795 branch_esc=$(printf '%s' "$branch" | sed 's/\\/\\\\/g; s/"/\\"/g')

796 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on branch '\''%s'\''. Please push these changes to the remote repository."}' "$unpushed" "$branch_esc"

797 else

798 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on a detached HEAD. Please create a branch and push it to the remote repository."}' "$unpushed"791 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on a detached HEAD. Please create a branch and push it to the remote repository."}' "$unpushed"

792 else

793 printf '{"decision":"block","reason":"There are %s unpushed commit(s) on the branch checked out in the project directory. Please push these changes to the remote repository."}' "$unpushed"

799 fi794 fi

800 exit 0795 exit 0

801fi796fi


825 820 

826### 替換較早版本的 Stop hook 指令碼821### 替換較早版本的 Stop hook 指令碼

827 822 

828在您的 `stop-hook-nudge.sh` 副本中搜尋 `GIT_OPTIONAL_LOCKS`。若找不到,表示您使用的是較早的版本。請在所有安裝位置將其替換為[目前的指令碼](#prompt-sessions-to-push-their-work),然後重新啟動執行器。請保留您的 Stop hook 設定,僅在大型 checkout 上提高 `timeout`。823在您的 `stop-hook-nudge.sh` 副本中搜尋文字 `checked out in the project directory`。若找不到,表示您使用的是較早的版本。請立即在所有安裝位置將其替換為[目前的指令碼](#prompt-sessions-to-push-their-work),然後重新啟動執行器。請保留您的 Stop hook 設定,僅在大型 checkout 上提高 `timeout`。

829 824 

830* **時機**:若您的工作階段在啟用 [Bash 沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)的情況下執行,請立即替換。否則,請在下次建置映像或重新啟動執行器時替換。825替換指令碼後,關於未推送提交的提示將不再包含分支名稱。若您較早的版本會針對子模組中未提交的檔案提示 Claude,該提示將會停止。關於目前指令碼如何處理子模組,請參閱[子模組與 Stop hook](#submodules-and-the-stop-hook)。

831* **變更內容**:子模組中未提交的檔案不再提示 Claude。而在 `.gitmodules` 中標記為 `ignore = all` 的子模組若有新提交,現在則會提示。

832 826 

833> [!WARNING]827> [!WARNING]

834>828>

835> hook 在 Bash 沙箱之外執行,因此目前指令碼的 git 呼叫會略過某些可能啟動 checkout 之 git 設定中所指定程式的 git 功能。但並未全部略過。請勿僅依賴沙箱,並依照[強化您的部署](https://code.claude.com/docs/zh-TW/self-hosted-environments-deploy.md#harden-your-deployment)所述隔離工作階段。829> hook 在 [Bash 沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)之外執行,因此目前指令碼的 git 呼叫會略過某些可能啟動 checkout 之 git 設定中所指定程式的 git 功能。但並未全部略過。請勿僅依賴沙箱,並依照[強化您的部署](https://code.claude.com/docs/zh-TW/self-hosted-environments-deploy.md#harden-your-deployment)所述隔離工作階段。

836 830 

837## 權限和工具核准831## 權限和工具核准

838 832 

Details

12>12>

13> 伺服器管理的設定適用於 [Claude for Teams](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_teams#team-&-enterprise) 和 [Claude for Enterprise](https://anthropic.com/contact-sales?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_enterprise) 客戶。13> 伺服器管理的設定適用於 [Claude for Teams](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_teams#team-&-enterprise) 和 [Claude for Enterprise](https://anthropic.com/contact-sales?utm_source=claude_code\&utm_medium=docs\&utm_content=server_settings_enterprise) 客戶。

14>14>

15> 如果您是在 claude.ai 的 **Organization settings > Desktop 3P** 下設定供應商或閘道,請改為參閱 [Enterprise Admin Console 指南](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code)。15> 如果您是在 claude.ai 的 [**Organization settings > Desktop 3P**](https://claude.ai/admin-settings/desktop-deployment) 下設定供應商或閘道,請改為參閱 [Enterprise Admin Console 指南](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code)。

16 16 

17## 需求17## 需求

18 18 

settings.md +2 −2

Details

72 72 

73### 將個人設定保留在儲存庫之外73### 將個人設定保留在儲存庫之外

74 74 

75若要在一個專案中為自己變更設定而不為隊友變更,請將其儲存在專案內的 `.claude/settings.local.json` 中。Claude Code 在提交的 `.claude/settings.json` 上套用該檔案,因此如果您的團隊檔案設定 `"model": "claude-sonnet-5"` 而您想要 Opus,請在本機檔案中放入 `"model": "claude-opus-5-5"`,只有您的工作階段會變更。75若要在一個專案中為自己變更設定,請將其儲存在專案內的 `.claude/settings.local.json` 中。Claude Code 在提交的 `.claude/settings.json` 上套用該檔案,因此如果提交的檔案設定 `"model": "claude-sonnet-5"` 而您想要 Opus,請在本機檔案中放入 `"model": "claude-opus-5-5"`,只有您的工作階段會變更。

76 76 

77Claude Code 也寫入此檔案,將其保留在您的提交之外,並在不需要信任步驟的情況下套用其允許規則:77Claude Code 也寫入此檔案,將其保留在您的提交之外,並在不需要信任步驟的情況下套用其允許規則:

78 78 


2301. **受管設定**:您的組織透過 `managed-settings.json` 檔案、MDM 政策,或來自 claude.ai 主控台的[伺服器受管設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)所部署的設定。您自己的設定檔或 `--settings` 中的任何內容都無法覆寫受管的鍵,而像 `--model` 這樣的旗標只能從您的組織允許的模型中選擇。受管的 [`model`](https://code.claude.com/docs/zh-TW/settings-reference#model) 是起始預設值,而非鎖定;鎖定由 [`availableModels`](https://code.claude.com/docs/zh-TW/settings-reference#availablemodels) 和 [`deniedModels`](https://code.claude.com/docs/zh-TW/settings-reference#deniedmodels) 負責。當您的組織提供多個受管來源時,[受管層級內的優先順序](https://code.claude.com/docs/zh-TW/managed-settings.md#precedence-within-the-managed-tier)規則說明了 Claude Code 會從每個來源讀取什麼。2301. **受管設定**:您的組織透過 `managed-settings.json` 檔案、MDM 政策,或來自 claude.ai 主控台的[伺服器受管設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)所部署的設定。您自己的設定檔或 `--settings` 中的任何內容都無法覆寫受管的鍵,而像 `--model` 這樣的旗標只能從您的組織允許的模型中選擇。受管的 [`model`](https://code.claude.com/docs/zh-TW/settings-reference#model) 是起始預設值,而非鎖定;鎖定由 [`availableModels`](https://code.claude.com/docs/zh-TW/settings-reference#availablemodels) 和 [`deniedModels`](https://code.claude.com/docs/zh-TW/settings-reference#deniedmodels) 負責。當您的組織提供多個受管來源時,[受管層級內的優先順序](https://code.claude.com/docs/zh-TW/managed-settings.md#precedence-within-the-managed-tier)規則說明了 Claude Code 會從每個來源讀取什麼。

2312. **命令列**:您在啟動 `claude` 時透過 `--settings <file-or-json>` 傳入的 JSON,僅適用於該工作階段;請參閱[針對單一工作階段變更設定](#change-a-setting-for-one-session)。您在此處設定的鍵會覆寫專案和使用者設定檔中的相同鍵,而您未設定的鍵則保留這些檔案中的值。其他旗標(例如 `--model`)會為工作階段設定單一項目,且不屬於此堆疊;[設定參考](https://code.claude.com/docs/zh-TW/settings-reference.md)中各鍵的條目會說明哪些旗標會覆寫該鍵。2312. **命令列**:您在啟動 `claude` 時透過 `--settings <file-or-json>` 傳入的 JSON,僅適用於該工作階段;請參閱[針對單一工作階段變更設定](#change-a-setting-for-one-session)。您在此處設定的鍵會覆寫專案和使用者設定檔中的相同鍵,而您未設定的鍵則保留這些檔案中的值。其他旗標(例如 `--model`)會為工作階段設定單一項目,且不屬於此堆疊;[設定參考](https://code.claude.com/docs/zh-TW/settings-reference.md)中各鍵的條目會說明哪些旗標會覆寫該鍵。

2323. **專案本機設定**(`.claude/settings.local.json`):您在此專案中的個人設定。2323. **專案本機設定**(`.claude/settings.local.json`):您在此專案中的個人設定。

2334. **共用專案設定**(`.claude/settings.json`):您的團隊簽入版本控制的設定。2334. **共用專案設定**(`.claude/settings.json`):簽入版本控制的設定。

2345. **使用者設定**(`~/.claude/settings.json`):您適用於所有專案的個人設定。2345. **使用者設定**(`~/.claude/settings.json`):您適用於所有專案的個人設定。

235 235 

236環境變數不是此堆疊中的一個層級。當某個行為同時具有 shell 變數和設定鍵時,由哪一個生效是依每一組個別決定的,而非依層級:在您的 shell 中匯出的 `ANTHROPIC_MODEL` 會優先於任何檔案中的 `model` 鍵,而 `ANTHROPIC_DEFAULT_MODEL` 僅在沒有任何檔案設定 `model` 時才會生效。[環境變數參考](https://code.claude.com/docs/zh-TW/env-vars.md#precedence)說明了哪些鍵有對應的變數,以及 Claude Code 會先讀取哪一個。設定檔中的 `env` 區塊是一般的鍵,遵循上述層級。236環境變數不是此堆疊中的一個層級。當某個行為同時具有 shell 變數和設定鍵時,由哪一個生效是依每一組個別決定的,而非依層級:在您的 shell 中匯出的 `ANTHROPIC_MODEL` 會優先於任何檔案中的 `model` 鍵,而 `ANTHROPIC_DEFAULT_MODEL` 僅在沒有任何檔案設定 `model` 時才會生效。[環境變數參考](https://code.claude.com/docs/zh-TW/env-vars.md#precedence)說明了哪些鍵有對應的變數,以及 Claude Code 會先讀取哪一個。設定檔中的 `env` 區塊是一般的鍵,遵循上述層級。

Details

183> "Read(./secrets/**)"183> "Read(./secrets/**)"

184> ]184> ]

185> },185> },

186> // 在每個 Bash 命令前,執行儲存庫中可以阻止它的指令碼186> // 在每個 Bash 工具呼叫前,執行儲存庫中可以阻止它的指令碼

187> "hooks": {187> "hooks": {

188> "PreToolUse": [188> "PreToolUse": [

189> {189> {

settings-reference.md +159 −159

Details

12 12 

13## 設定索引13## 設定索引

14 14 

15下方每個鍵都連結到其對應項目。Scope 列出該鍵可以放在哪些[檔案](https://code.claude.com/docs/zh-TW/settings.md#settings-files-and-who-they-affect)中:`User` 是 `~/.claude/settings.json`,`Project` 是 `.claude/settings.json`,`Local` 是 `.claude/settings.local.json`,而 `Managed` 是[您的組織所部署的設定](https://code.claude.com/docs/zh-TW/managed-settings.md)。`Any file` 表示以上四者皆可,`Global config` 則表示 [`~/.claude.json`](#global-config-settings)。15下方每個鍵都連結至其條目。Scope 列出該鍵可放入的[檔案](https://code.claude.com/docs/zh-TW/settings.md#settings-files-and-who-they-affect):`User` 是 `~/.claude/settings.json`,`Project` 是 `.claude/settings.json`,`Local` 是 `.claude/settings.local.json`,而 `Managed` 是[您的組織所部署的設定](https://code.claude.com/docs/zh-TW/managed-settings.md)。`Any file` 表示以上四者皆可,`Global config` 則表示 [`~/.claude.json`](#global-config-settings)。

16 16 

17| Key | Description | Topic | Scope |17| Key | Description | Topic | Scope |

18| :- | :- | :- | :- |18| :- | :- | :- | :- |

19| [`advisorModel`](#advisormodel) | 選擇 Claude 詢問 [advisor 工具](https://code.claude.com/docs/zh-TW/advisor.md)時由哪個模型回答 | 模型與回應 | Any file |19| [`advisorModel`](#advisormodel) | 選擇 Claude 詢問 [advisor 工具](https://code.claude.com/docs/zh-TW/advisor.md)時由哪個模型回答 | 模型與回應 | Any file |

20| [`agent`](#agent) | 以具名的 [subagent](https://code.claude.com/docs/zh-TW/sub-agents.md) 啟動每個工作階段,並使用其提示詞、工具與模型 | Agent、工作階段與 worktree | Any file |20| [`agent`](#agent) | 以具名 [subagent](https://code.claude.com/docs/zh-TW/sub-agents.md) 啟動工作階段,並使用其提示詞、工具與模型 | Agent、工作階段與 worktree | Any file |

21| [`agentPushNotifEnabled`](#agentpushnotifenabled) | 讓 Claude 在其判斷需要時[傳送推播通知到您的手機](https://code.claude.com/docs/zh-TW/remote-control.md#mobile-push-notifications) | 遠端、桌面與通知 | Any file |21| [`agentPushNotifEnabled`](#agentpushnotifenabled) | 讓 Claude 在其判斷需要時[傳送推播通知到您的手機](https://code.claude.com/docs/zh-TW/remote-control.md#mobile-push-notifications) | 遠端、桌面與通知 | Any file |

22| [`allowAllClaudeAiMcps`](#allowallclaudeaimcps) | 在已部署 [`managed-mcp.json`](https://code.claude.com/docs/zh-TW/managed-mcp#exclusive-control-with-managed-mcp-json) 的情況下,同時載入 Claude Code 自行擷取的 [claude.ai 連接器](https://code.claude.com/docs/zh-TW/mcp.md) | MCP | Managed |22| [`allowAllClaudeAiMcps`](#allowallclaudeaimcps) | 在已部署 [`managed-mcp.json`](https://code.claude.com/docs/zh-TW/managed-mcp#exclusive-control-with-managed-mcp-json) 的同時,載入 Claude Code 自行擷取的 [claude.ai 連接器](https://code.claude.com/docs/zh-TW/mcp.md) | MCP | Managed |

23| [`allowClaudeInChromeWithManagedMcp`](#allowclaudeinchromewithmanagedmcp) | 讓內建的 [Claude in Chrome](https://code.claude.com/docs/zh-TW/chrome.md) 伺服器與已部署的 [`managed-mcp.json`](https://code.claude.com/docs/zh-TW/managed-mcp#exclusive-control-with-managed-mcp-json) 同時執行 | MCP | Managed |23| [`allowClaudeInChromeWithManagedMcp`](#allowclaudeinchromewithmanagedmcp) | 讓內建的 [Claude in Chrome](https://code.claude.com/docs/zh-TW/chrome.md) 伺服器與已部署的 [`managed-mcp.json`](https://code.claude.com/docs/zh-TW/managed-mcp#exclusive-control-with-managed-mcp-json) 並行執行 | MCP | Managed |

24| [`allowedChannelPlugins`](#allowedchannelplugins) | 取代可推送訊息之[頻道外掛](https://code.claude.com/docs/zh-TW/channels.md#restrict-which-channel-plugins-can-run)的預設允許清單 | 外掛與 skill | Managed |24| [`allowedChannelPlugins`](#allowedchannelplugins) | 取代可推送訊息之[頻道外掛](https://code.claude.com/docs/zh-TW/channels.md#restrict-which-channel-plugins-can-run)的預設允許清單 | 外掛與 skill | Managed |

25| [`allowedHttpHookUrls`](#allowedhttphookurls) | 限制 [HTTP hook](https://code.claude.com/docs/zh-TW/hooks.md) 可以指向哪些 URL | hook 與自動化 | Any file |25| [`allowedHttpHookUrls`](#allowedhttphookurls) | 限制 [HTTP hook](https://code.claude.com/docs/zh-TW/hooks.md) 可指向的 URL | hook 與自動化 | Any file |

26| [`allowedMcpServers`](#allowedmcpservers) | 設定使用者可新增哪些 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md)的允許清單 | MCP | Any file |26| [`allowedMcpServers`](#allowedmcpservers) | 設定使用者可新增之 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md)的允許清單 | MCP | Any file |

27| [`allowedProviders`](#allowedproviders) | 限制機器可以使用哪些 [API 供應商](https://code.claude.com/docs/zh-TW/third-party-integrations.md) | 身分驗證與供應商 | Managed |27| [`allowedProviders`](#allowedproviders) | 限制機器可使用的 [API 供應商](https://code.claude.com/docs/zh-TW/third-party-integrations.md) | 身分驗證與供應商 | Managed |

28| [`allowManagedHooksOnly`](#allowmanagedhooksonly) | 僅執行您的組織所部署的 [hook](https://code.claude.com/docs/zh-TW/hooks.md) | hook 與自動化 | Managed |28| [`allowManagedHooksOnly`](#allowmanagedhooksonly) | 僅執行您的組織所部署的 [hook](https://code.claude.com/docs/zh-TW/hooks.md) | hook 與自動化 | Managed |

29| [`allowManagedMcpServersOnly`](#allowmanagedmcpserversonly) | 讓受管的 [MCP](https://code.claude.com/docs/zh-TW/mcp.md) 允許清單成為唯一適用的清單 | MCP | Managed |29| [`allowManagedMcpServersOnly`](#allowmanagedmcpserversonly) | 讓受管 [MCP](https://code.claude.com/docs/zh-TW/mcp.md) 允許清單成為唯一適用的允許清單 | MCP | Managed |

30| [`allowManagedPermissionRulesOnly`](#allowmanagedpermissionrulesonly) | 讓[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)成為[權限規則](https://code.claude.com/docs/zh-TW/permissions.md#managed-settings)的唯一設定來源 | 權限設定 | Managed |30| [`allowManagedPermissionRulesOnly`](#allowmanagedpermissionrulesonly) | 讓[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)成為[權限規則](https://code.claude.com/docs/zh-TW/permissions.md#managed-settings)唯一的設定來源 | 權限設定 | Managed |

31| [`alwaysThinkingEnabled`](#alwaysthinkingenabled) | 為每個工作階段關閉[延伸思考](https://code.claude.com/docs/zh-TW/model-config.md#extended-thinking) | 模型與回應 | Any file |31| [`alwaysThinkingEnabled`](#alwaysthinkingenabled) | 為每個工作階段關閉[延伸思考](https://code.claude.com/docs/zh-TW/model-config.md#extended-thinking) | 模型與回應 | Any file |

32| [`apiKeyHelper`](#apikeyhelper) | 使用您自己的命令產生 [API 憑證](https://code.claude.com/docs/zh-TW/authentication.md#credential-management) | 身分驗證與供應商 | Any file |32| [`apiKeyHelper`](#apikeyhelper) | 以您自己的命令產生 [API 憑證](https://code.claude.com/docs/zh-TW/authentication.md#credential-management) | 身分驗證與供應商 | Any file |

33| [`askUserQuestionTimeout`](#askuserquestiontimeout) | 讓未回答的問題在閒置一段時間後[自動繼續](https://code.claude.com/docs/zh-TW/tools-reference.md#question-auto-continue-timeout) | 介面與終端機 | User or managed |33| [`askUserQuestionTimeout`](#askuserquestiontimeout) | 讓未回答的問題在閒置一段時間後[自動繼續](https://code.claude.com/docs/zh-TW/tools-reference.md#question-auto-continue-timeout) | 介面與終端機 | User or managed |

34| [`appendPlugins`](#appendplugins) | 在使用者安裝的每個 mod 之後,執行您組織的 [mod](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md) | 外掛與 skill | User or managed |34| [`appendPlugins`](#appendplugins) | 在使用者安裝的每個 mod 之後執行您組織的 [mod](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md) | 外掛與 skill | User or managed |

35| [`attribution`](#attribution) | 自訂 Claude Code 加到提交與 pull request 中的署名 | Git 與署名 | Any file |35| [`attribution`](#attribution) | 自訂 Claude Code 加入提交與 pull request 的署名 | Git 與署名 | Any file |

36| [`attribution.commit`](#attribution-commit) | 變更或隱藏 Claude Code 加到提交中的 trailer | Git 與署名 | Any file |36| [`attribution.commit`](#attribution-commit) | 變更或隱藏 Claude Code 加入提交的 trailer | Git 與署名 | Any file |

37| [`attribution.pr`](#attribution-pr) | 變更或隱藏 pull request 描述中的署名行 | Git 與署名 | Any file |37| [`attribution.pr`](#attribution-pr) | 變更或隱藏 pull request 描述中的署名行 | Git 與署名 | Any file |

38| [`attribution.sessionUrl`](#attribution-sessionurl) | 從[雲端](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)與 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 提交中省略 claude.ai 工作階段連結 | Git 與署名 | Any file |38| [`attribution.sessionUrl`](#attribution-sessionurl) | 從[雲端](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)與 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 提交中省略 claude.ai 工作階段連結 | Git 與署名 | Any file |

39| [`autoCompactEnabled`](#autocompactenabled) | 關閉或開啟[自動壓縮](https://code.claude.com/docs/zh-TW/context-window.md) | 記憶與上下文 | Any file |39| [`autoCompactEnabled`](#autocompactenabled) | 關閉或開啟[自動壓縮](https://code.claude.com/docs/zh-TW/context-window.md) | 記憶與上下文 | Any file |

40| [`autoCompactWindow`](#autocompactwindow) | 設定上下文填滿到什麼程度時 Claude Code 會進行[壓縮](https://code.claude.com/docs/zh-TW/context-window.md) | 記憶與上下文 | Any file |40| [`autoCompactWindow`](#autocompactwindow) | 設定上下文填滿到什麼程度時 Claude Code 會進行[壓縮](https://code.claude.com/docs/zh-TW/context-window.md) | 記憶與上下文 | Any file |

41| [`autoConnectIde`](#autoconnectide) | 從外部終端機自動連線到執行中的 [VS Code](https://code.claude.com/docs/zh-TW/vs-code.md) 或 [JetBrains](https://code.claude.com/docs/zh-TW/jetbrains.md#from-external-terminals) IDE | 全域設定 | Global config |41| [`autoConnectIde`](#autoconnectide) | 從外部終端機自動連線至執行中的 [VS Code](https://code.claude.com/docs/zh-TW/vs-code.md) 或 [JetBrains](https://code.claude.com/docs/zh-TW/jetbrains.md#from-external-terminals) IDE | 全域設定 | Global config |

42| [`autoContinueAtUsageLimit`](#autocontinueatusagelimit) | 在開啟的工作階段中等待,並在 claude.ai 用量上限重設後[自動繼續任務](https://code.claude.com/docs/zh-TW/interactive-mode.md#wait-for-a-usage-limit-to-reset) | 介面與終端機 | User or managed |42| [`autoContinueAtUsageLimit`](#autocontinueatusagelimit) | 在開啟的工作階段中等待,並於 claude.ai 用量上限重設後[自動繼續任務](https://code.claude.com/docs/zh-TW/interactive-mode.md#wait-for-a-usage-limit-to-reset) | 介面與終端機 | User or managed |

43| [`autoInstallIdeExtension`](#autoinstallideextension) | 讓 `/ide` 從外部終端機安裝 [IDE 擴充功能](https://code.claude.com/docs/zh-TW/vs-code.md#install-the-extension) | 全域設定 | Global config |43| [`autoInstallIdeExtension`](#autoinstallideextension) | 讓 `/ide` 從外部終端機安裝 [IDE 擴充功能](https://code.claude.com/docs/zh-TW/vs-code.md#install-the-extension) | 全域設定 | Global config |

44| [`autoMemoryDirectory`](#automemorydirectory) | 將[自動記憶](https://code.claude.com/docs/zh-TW/memory.md#auto-memory)儲存在您選擇的目錄中 | 記憶與上下文 | Any file |44| [`autoMemoryDirectory`](#automemorydirectory) | 將[自動記憶](https://code.claude.com/docs/zh-TW/memory.md#auto-memory)儲存在您選擇的目錄 | 記憶與上下文 | Any file |

45| [`autoMemoryEnabled`](#automemoryenabled) | 關閉或開啟[自動記憶](https://code.claude.com/docs/zh-TW/memory.md#auto-memory) | 記憶與上下文 | Any file |45| [`autoMemoryEnabled`](#automemoryenabled) | 關閉或開啟[自動記憶](https://code.claude.com/docs/zh-TW/memory.md#auto-memory) | 記憶與上下文 | Any file |

46| [`autoMode`](#automode) | 將您自己的允許與拒絕規則加入[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)分類器 | 權限設定 | User or managed |46| [`autoMode`](#automode) | 為[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)分類器加入您自己的允許與拒絕規則 | 權限設定 | User or managed |

47| [`autoMode.classifyAllShell`](#automode-classifyallshell) | 將每個 shell 命令都送交[自動模式分類器](https://code.claude.com/docs/zh-TW/permission-modes.md#what-the-classifier-blocks-by-default),即使是符合狹義允許規則的命令 | 權限設定 | User or managed |47| [`autoMode.classifyAllShell`](#automode-classifyallshell) | 將每個 shell 命令送交[自動模式分類器](https://code.claude.com/docs/zh-TW/permission-modes.md#what-the-classifier-blocks-by-default),即使是符合狹窄允許規則的命令 | 權限設定 | User or managed |

48| [`autoScrollEnabled`](#autoscrollenabled) | 在全螢幕渲染中[跟隨新輸出](https://code.claude.com/docs/zh-TW/fullscreen.md#auto-follow)捲動到底部 | 介面與終端機 | Any file |48| [`autoScrollEnabled`](#autoscrollenabled) | 在全螢幕渲染中[跟隨新輸出](https://code.claude.com/docs/zh-TW/fullscreen.md#auto-follow)捲動至底部 | 介面與終端機 | Any file |

49| [`autoUpdatesChannel`](#autoupdateschannel) | 追蹤 stable [發布通道](https://code.claude.com/docs/zh-TW/setup.md#configure-release-channel)而非 latest | 更新與版本控制 | Any file |49| [`autoUpdatesChannel`](#autoupdateschannel) | 跟隨 stable [發布通道](https://code.claude.com/docs/zh-TW/setup.md#configure-release-channel)而非 latest | 更新與版本控制 | Any file |

50| [`availableModels`](#availablemodels) | [限制使用者可以選擇哪些模型](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection) | 模型與回應 | Any file |50| [`availableModels`](#availablemodels) | [限制可供選擇的模型](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection) | 模型與回應 | Any file |

51| [`availableModelsMatch`](#availablemodelsmatch) | 讓每個 `availableModels` 模型 ID 項目[僅允許其所指名的版本](https://code.claude.com/docs/zh-TW/model-config.md#block-specific-models-or-versions) | 模型與回應 | Managed |51| [`availableModelsMatch`](#availablemodelsmatch) | 讓每個 `availableModels` 模型 ID 項目[僅允許其指定的版本](https://code.claude.com/docs/zh-TW/model-config.md#block-specific-models-or-versions) | 模型與回應 | Managed |

52| [`awaySummaryEnabled`](#awaysummaryenabled) | 關閉您回到終端機時顯示的[工作階段摘要](https://code.claude.com/docs/zh-TW/interactive-mode.md#session-recap) | 遠端、桌面與通知 | Any file |52| [`awaySummaryEnabled`](#awaysummaryenabled) | 關閉您回到終端機時顯示的[工作階段回顧](https://code.claude.com/docs/zh-TW/interactive-mode.md#session-recap) | 遠端、桌面與通知 | Any file |

53| [`awsAuthRefresh`](#awsauthrefresh) | 使用您自己的命令重新整理 `.aws` 中已過期的 [Bedrock 憑證](https://code.claude.com/docs/zh-TW/amazon-bedrock.md#advanced-credential-configuration) | 身分驗證與供應商 | Any file |53| [`awsAuthRefresh`](#awsauthrefresh) | 以您自己的命令重新整理 `.aws` 中過期的 [Bedrock 憑證](https://code.claude.com/docs/zh-TW/amazon-bedrock.md#advanced-credential-configuration) | 身分驗證與供應商 | Any file |

54| [`awsCredentialExport`](#awscredentialexport) | 由您自己的命令以 JSON 提供 [Bedrock 憑證](https://code.claude.com/docs/zh-TW/amazon-bedrock.md#advanced-credential-configuration) | 身分驗證與供應商 | Any file |54| [`awsCredentialExport`](#awscredentialexport) | 從您自己的命令以 JSON 提供 [Bedrock 憑證](https://code.claude.com/docs/zh-TW/amazon-bedrock.md#advanced-credential-configuration) | 身分驗證與供應商 | Any file |

55| [`axScreenReader`](#axscreenreader) | 輸出[適合螢幕閱讀器的內容](https://code.claude.com/docs/zh-TW/accessibility.md) | 介面與終端機 | User or managed |55| [`axScreenReader`](#axscreenreader) | 渲染[適合螢幕閱讀器的輸出](https://code.claude.com/docs/zh-TW/accessibility.md) | 介面與終端機 | User or managed |

56| [`bashEditDiffEnabled`](#basheditdiffenabled) | 在每種權限模式中記錄 [Bash 命令執行期間變更的檔案](https://code.claude.com/docs/zh-TW/hooks.md#bash) | 介面與終端機 | User or managed |56| [`bashEditDiffEnabled`](#basheditdiffenabled) | 在每種權限模式下記錄 [Bash 命令執行期間變更的檔案](https://code.claude.com/docs/zh-TW/hooks.md#bash) | 介面與終端機 | User or managed |

57| [`bashOutputMaxChars`](#bashoutputmaxchars) | 設定 Claude 以內嵌方式接收成功命令之[輸出](https://code.claude.com/docs/zh-TW/tools-reference.md#output-limits)的量 | 記憶與上下文 | Any file |57| [`bashOutputMaxChars`](#bashoutputmaxchars) | 設定 Claude 以內嵌方式接收成功命令[輸出](https://code.claude.com/docs/zh-TW/tools-reference.md#output-limits)的多少內容 | 記憶與上下文 | Any file |

58| [`blockedMarketplaces`](#blockedmarketplaces) | 為您的組織封鎖[外掛市集](https://code.claude.com/docs/zh-TW/plugins/overview.md)來源 | 外掛與 skill | Managed |58| [`blockedMarketplaces`](#blockedmarketplaces) | 為您的組織封鎖[外掛市集](https://code.claude.com/docs/zh-TW/plugins/overview.md)來源 | 外掛與 skill | Managed |

59| [`browserExternalPageTools`](#browserexternalpagetools) | 讓 Claude 的工具不作用於[桌面版](https://code.claude.com/docs/zh-TW/desktop.md) Browser 窗格中的外部頁面 | 工具 | Managed |59| [`browserExternalPageTools`](#browserexternalpagetools) | 讓 Claude 的工具不作用於[桌面版](https://code.claude.com/docs/zh-TW/desktop.md) Browser 窗格中的外部頁面 | 工具 | Managed |

60| [`channelsEnabled`](#channelsenabled) | 為您的組織允許[頻道](https://code.claude.com/docs/zh-TW/channels.md#enable-channels-for-your-organization) | 外掛與 skill | Managed |60| [`channelsEnabled`](#channelsenabled) | 為您的組織允許[頻道](https://code.claude.com/docs/zh-TW/channels.md#enable-channels-for-your-organization) | 外掛與 skill | Managed |

61| [`claudeInChromeDefaultEnabled`](#claudeinchromedefaultenabled) | 在互動式 CLI 與 VS Code 擴充功能中,於工作階段開始時開啟 [Chrome 整合](https://code.claude.com/docs/zh-TW/chrome.md) | 全域設定 | Global config |61| [`claudeInChromeDefaultEnabled`](#claudeinchromedefaultenabled) | 在互動式 CLI 與 VS Code 擴充功能中,於工作階段開始時開啟 [Chrome 整合](https://code.claude.com/docs/zh-TW/chrome.md) | 全域設定 | Global config |

62| [`claudeMd`](#claudemd) | 從受管設定注入全組織的 [CLAUDE.md](https://code.claude.com/docs/zh-TW/memory.md#deploy-organization-wide-claude-md) 指令 | 記憶與上下文 | Managed |62| [`claudeMd`](#claudemd) | 從受管設定注入全組織的 [CLAUDE.md](https://code.claude.com/docs/zh-TW/memory.md#deploy-organization-wide-claude-md) 指令 | 記憶與上下文 | Managed |

63| [`claudeMdExcludes`](#claudemdexcludes) | 載入記憶時略過特定的 [CLAUDE.md](https://code.claude.com/docs/zh-TW/memory.md#exclude-specific-claude-md-files) 檔案 | 記憶與上下文 | Any file |63| [`claudeMdExcludes`](#claudemdexcludes) | 載入記憶時略過特定 [CLAUDE.md](https://code.claude.com/docs/zh-TW/memory.md#exclude-specific-claude-md-files) 檔案 | 記憶與上下文 | Any file |

64| [`cleanupPeriodDays`](#cleanupperioddays) | 選擇 Claude Code 在刪除[逐字稿](https://code.claude.com/docs/zh-TW/data-usage.md#data-retention)之前保留多少天 | 隱私與遙測 | Any file |64| [`cleanupPeriodDays`](#cleanupperioddays) | 選擇 Claude Code 保留[逐字稿](https://code.claude.com/docs/zh-TW/data-usage.md#data-retention)多少天後將其刪除 | 隱私與遙測 | Any file |

65| [`companyAnnouncements`](#companyannouncements) | 在啟動時顯示您組織的公告 | 介面與終端機 | Any file |65| [`companyAnnouncements`](#companyannouncements) | 在啟動時顯示您組織的公告 | 介面與終端機 | Any file |

66| [`copyFullResponse`](#copyfullresponse) | 讓 [`/copy`](https://code.claude.com/docs/zh-TW/commands) 直接複製完整回應,而不顯示選擇器 | 全域設定 | Global config |66| [`copyFullResponse`](#copyfullresponse) | 讓 [`/copy`](https://code.claude.com/docs/zh-TW/commands) 直接複製完整回應而不顯示選擇器 | 全域設定 | Global config |

67| [`copyOnSelect`](#copyonselect) | 在[全螢幕渲染](https://code.claude.com/docs/zh-TW/fullscreen.md#use-the-mouse)與 agent view 中,關閉以滑鼠選取文字時的自動複製 | 全域設定 | Global config |67| [`copyOnSelect`](#copyonselect) | 關閉在[全螢幕渲染](https://code.claude.com/docs/zh-TW/fullscreen.md#use-the-mouse)與 agent view 中自動複製以滑鼠選取之文字的功能 | 全域設定 | Global config |

68| [`crossSessionInbound`](#crosssessioninbound) | 選擇 Claude Code 要傳遞[來自您其他工作階段的訊息](https://code.claude.com/docs/zh-TW/cross-session-messaging.md#control-inbound-messages)、僅顯示通知而不傳遞,還是拒絕這些訊息 | Agent、工作階段與 worktree | Any file |68| [`crossSessionInbound`](#crosssessioninbound) | 選擇 Claude Code 要傳遞[來自您其他工作階段的訊息](https://code.claude.com/docs/zh-TW/cross-session-messaging.md#control-inbound-messages)、僅顯示通知而不傳遞,或拒絕這些訊息 | Agent、工作階段與 worktree | Any file |

69| [`defaultShell`](#defaultshell) | 選擇由 Bash 或 PowerShell 執行您以 [`!` 前綴](https://code.claude.com/docs/zh-TW/interactive-mode#shell-mode-with-prefix)輸入的 shell 命令 | 介面與終端機 | Any file |69| [`defaultShell`](#defaultshell) | 選擇由 Bash 或 PowerShell 執行您以 [`!` 前綴](https://code.claude.com/docs/zh-TW/interactive-mode#shell-mode-with-prefix)輸入的 shell 命令 | 介面與終端機 | Any file |

70| [`defaultToAgentsView`](#defaulttoagentsview) | 在不帶引數執行 `claude` 時開啟 [agent view](https://code.claude.com/docs/zh-TW/agent-view.md),而非新對話 | 全域設定 | Global config |70| [`defaultToAgentsView`](#defaulttoagentsview) | 不帶引數執行 `claude` 時開啟 [agent view](https://code.claude.com/docs/zh-TW/agent-view.md) 而非新對話 | 全域設定 | Global config |

71| [`deniedMcpServers`](#deniedmcpservers) | 依 URL、命令或名稱封鎖特定的 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | MCP | Any file |71| [`deniedMcpServers`](#deniedmcpservers) | 依 URL、命令或名稱封鎖特定 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | MCP | Any file |

72| [`deniedModels`](#deniedmodels) | [封鎖特定模型](https://code.claude.com/docs/zh-TW/model-config.md#block-specific-models-or-versions),即使是 `availableModels` 允許的模型 | 模型與回應 | Managed |72| [`deniedModels`](#deniedmodels) | [封鎖特定模型](https://code.claude.com/docs/zh-TW/model-config.md#block-specific-models-or-versions),即使 `availableModels` 允許這些模型 | 模型與回應 | Managed |

73| [`desktopSessionCleanupPeriodDays`](#desktopsessioncleanupperioddays) | 為 [Claude Desktop 與 Cowork 逐字稿](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically)設定以天數計的保存期限 | 隱私與遙測 | User or managed |73| [`desktopSessionCleanupPeriodDays`](#desktopsessioncleanupperioddays) | 以天為單位設定 [Claude Desktop 與 Cowork 逐字稿](https://code.claude.com/docs/zh-TW/claude-directory.md#cleaned-up-automatically)的保存期限 | 隱私與遙測 | User or managed |

74| [`dialogExpiry`](#dialogexpiry) | 設定 Claude Code 在取消轉送的對話框之前,等待 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 或 SDK 主機回應的時間 | 介面與終端機 | User or managed |74| [`dialogExpiry`](#dialogexpiry) | 設定 Claude Code 等待 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 或 SDK 主機回應轉送對話框的時間,逾時即取消該對話框 | 介面與終端機 | User or managed |

75| [`diffTool`](#difftool) | 選擇 Claude 提議的檔案變更要在 [VS Code](https://code.claude.com/docs/zh-TW/vs-code.md) 或 [JetBrains](https://code.claude.com/docs/zh-TW/jetbrains.md#features) 差異檢視器中開啟,還是留在終端機中 | 全域設定 | Global config |75| [`diffTool`](#difftool) | 選擇 Claude 提議的檔案變更要在 [VS Code](https://code.claude.com/docs/zh-TW/vs-code.md) 或 [JetBrains](https://code.claude.com/docs/zh-TW/jetbrains.md#features) 差異檢視器中開啟,或留在終端機中 | 全域設定 | Global config |

76| [`disableAgentView`](#disableagentview) | 關閉背景 agent 與 [agent view](https://code.claude.com/docs/zh-TW/agent-view.md) | Agent、工作階段與 worktree | Any file |76| [`disableAgentView`](#disableagentview) | 關閉背景 agent 與 [agent view](https://code.claude.com/docs/zh-TW/agent-view.md) | Agent、工作階段與 worktree | Any file |

77| [`disableAllHooks`](#disableallhooks) | 一次關閉 [hook](https://code.claude.com/docs/zh-TW/hooks.md)、自訂[狀態列](https://code.claude.com/docs/zh-TW/statusline.md),以及自訂 [`@` 檔案建議](https://code.claude.com/docs/zh-TW/interactive-mode#quick-commands)命令 | hook 與自動化 | Any file |77| [`disableAllHooks`](#disableallhooks) | 一次關閉 [hook](https://code.claude.com/docs/zh-TW/hooks.md)、自訂[狀態列](https://code.claude.com/docs/zh-TW/statusline.md)與自訂 [`@` 檔案建議](https://code.claude.com/docs/zh-TW/interactive-mode#quick-commands)命令 | hook 與自動化 | Any file |

78| [`disableArtifact`](#disableartifact) | 已棄用;請使用 `enableArtifact` 關閉 [Artifact 工具](https://code.claude.com/docs/zh-TW/artifacts.md) | 遠端、桌面與通知 | Any file |78| [`disableArtifact`](#disableartifact) | 已棄用;請使用 `enableArtifact` 關閉 [Artifact 工具](https://code.claude.com/docs/zh-TW/artifacts.md) | 遠端、桌面與通知 | Any file |

79| [`disableAutoMode`](#disableautomode) | 從權限模式循環中移除[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) | 權限設定 | Any file |79| [`disableAutoMode`](#disableautomode) | 從權限模式循環中移除[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode) | 權限設定 | Any file |

80| [`disableBrowserExternalNavigation`](#disablebrowserexternalnavigation) | 將[桌面版](https://code.claude.com/docs/zh-TW/desktop.md) Browser 窗格限制為使用者與 Claude 皆只能存取 localhost | 工具 | Managed |80| [`disableBrowserExternalNavigation`](#disablebrowserexternalnavigation) | 將[桌面版](https://code.claude.com/docs/zh-TW/desktop.md) Browser 窗格限制為僅能存取 localhost,對使用者與 Claude 皆然 | 工具 | Managed |

81| [`disableBundledSkills`](#disablebundledskills) | 關閉 Claude Code 隨附的 [skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills) 與[工作流程](https://code.claude.com/docs/zh-TW/workflows.md) | 外掛與 skill | Any file |81| [`disableBundledSkills`](#disablebundledskills) | 關閉 Claude Code 隨附的 [skill](https://code.claude.com/docs/zh-TW/skills.md#bundled-skills) 與[工作流程](https://code.claude.com/docs/zh-TW/workflows.md) | 外掛與 skill | Any file |

82| [`disableClaudeAiConnectors`](#disableclaudeaiconnectors) | 關閉 [claude.ai 連接器](https://code.claude.com/docs/zh-TW/mcp.md#disable-claude-ai-connectors),讓 Claude Code 不去擷取它們 | MCP | Any file |82| [`disableClaudeAiConnectors`](#disableclaudeaiconnectors) | 關閉 [claude.ai 連接器](https://code.claude.com/docs/zh-TW/mcp.md#disable-claude-ai-connectors),讓 Claude Code 不擷取這些連接器 | MCP | Any file |

83| [`disableCommandPluginSources`](#disablecommandpluginsources) | 封鎖透過執行市集所宣告之命令來安裝的[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md) | 外掛與 skill | Managed |83| [`disableCommandPluginSources`](#disablecommandpluginsources) | 封鎖透過執行市集所宣告之命令進行安裝的[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md) | 外掛與 skill | Managed |

84| [`disableDeepLinkRegistration`](#disabledeeplinkregistration) | 阻止 Claude Code 註冊 [`claude-cli://` 處理常式](https://code.claude.com/docs/zh-TW/deep-links) | 遠端、桌面與通知 | Any file |84| [`disableDeepLinkRegistration`](#disabledeeplinkregistration) | 阻止 Claude Code 註冊 [`claude-cli://` 處理常式](https://code.claude.com/docs/zh-TW/deep-links) | 遠端、桌面與通知 | Any file |

85| [`disableDesktopLocalSessions`](#disabledesktoplocalsessions) | 關閉在裝置上執行的 [Desktop Code 工作階段](https://code.claude.com/docs/zh-TW/desktop.md#local-sessions-on-managed-devices),僅保留連往其他主機的 SSH 與雲端 | 遠端、桌面與通知 | Managed |85| [`disableDesktopLocalSessions`](#disabledesktoplocalsessions) | 關閉在裝置上執行的 [Desktop Code 工作階段](https://code.claude.com/docs/zh-TW/desktop.md#local-sessions-on-managed-devices),僅保留透過 SSH 連至其他主機與雲端的工作階段 | 遠端、桌面與通知 | Managed |

86| [`disableDirectMcpSkills`](#disabledirectmcpskills) | 為您的組織開啟或關閉[來自 MCP 伺服器的 skill](https://code.claude.com/docs/zh-TW/mcp.md#turn-on-skills-for-an-organization)(連接器除外) | MCP | Managed |86| [`disableDirectMcpSkills`](#disabledirectmcpskills) | 為您的組織開啟或關閉連接器以外之 [MCP 伺服器所提供的 skill](https://code.claude.com/docs/zh-TW/mcp.md#turn-on-skills-for-an-organization) | MCP | Managed |

87| [`disabledMcpjsonServers`](#disabledmcpjsonservers) | 拒絕專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-scope) 中的特定伺服器 | MCP | Any file |87| [`disabledMcpjsonServers`](#disabledmcpjsonservers) | 拒絕專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-scope) 中的特定伺服器 | MCP | Any file |

88| [`disableMobileSimulatorTools`](#disablemobilesimulatortools) | 在[桌面版](https://code.claude.com/docs/zh-TW/desktop.md) iOS Simulator 窗格中封鎖 Claude 的工具 | 工具 | Managed |88| [`disableMobileSimulatorTools`](#disablemobilesimulatortools) | 封鎖 Claude 在[桌面版](https://code.claude.com/docs/zh-TW/desktop.md) iOS Simulator 窗格中使用工具 | 工具 | Managed |

89| [`disableRemoteControl`](#disableremotecontrol) | 在所有可啟動 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 的地方將其關閉 | 遠端、桌面與通知 | Any file |89| [`disableRemoteControl`](#disableremotecontrol) | 在所有可啟動 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md) 的地方將其關閉 | 遠端、桌面與通知 | Any file |

90| [`disableRemotePreviewScripts`](#disableremotepreviewscripts) | 在[桌面](https://code.claude.com/docs/zh-TW/desktop.md#preview-html-files-in-ssh-and-wsl-sessions)應用程式的 SSH 與 WSL 工作階段中,關閉 Browser 窗格 HTML 預覽內的指令碼 | 遠端、桌面與通知 | Managed |90| [`disableRemotePreviewScripts`](#disableremotepreviewscripts) | 在[桌面版](https://code.claude.com/docs/zh-TW/desktop.md#preview-html-files-in-ssh-and-wsl-sessions)應用程式的 SSH 與 WSL 工作階段中,關閉 Browser 窗格 HTML 預覽內的指令碼 | 遠端、桌面與通知 | Managed |

91| [`disableSideloadFlags`](#disablesideloadflags) | 拒絕用來側載[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)、[subagent](https://code.claude.com/docs/zh-TW/sub-agents.md) 與 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md)的 CLI 旗標 | 企業與受管設定 | Managed |91| [`disableSideloadFlags`](#disablesideloadflags) | 拒絕用於側載[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)、[subagent](https://code.claude.com/docs/zh-TW/sub-agents.md) 與 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md)的 CLI 旗標 | 企業與受管設定 | Managed |

92| [`disableSkillShellExecution`](#disableskillshellexecution) | 阻止 [skill](https://code.claude.com/docs/zh-TW/skills.md) 與自訂命令執行內嵌 shell | 外掛與 skill | Any file |92| [`disableSkillShellExecution`](#disableskillshellexecution) | 阻止 [skill](https://code.claude.com/docs/zh-TW/skills.md) 與自訂命令執行內嵌 shell | 外掛與 skill | Any file |

93| [`disableWorkflows`](#disableworkflows) | 為所有人關閉[動態工作流程](https://code.claude.com/docs/zh-TW/workflows.md);若只針對您自己,請使用 `enableWorkflows` | hook 與自動化 | Any file |93| [`disableWorkflows`](#disableworkflows) | 為所有人關閉[動態工作流程](https://code.claude.com/docs/zh-TW/workflows.md);若只針對自己,請使用 `enableWorkflows` | hook 與自動化 | Any file |

94| [`editorMode`](#editormode) | 在提示詞輸入框中使用 [vim 按鍵綁定](https://code.claude.com/docs/zh-TW/interactive-mode.md#vim-editor-mode) | 介面與終端機 | Any file |94| [`editorMode`](#editormode) | 在輸入框中使用 [vim 按鍵綁定](https://code.claude.com/docs/zh-TW/interactive-mode.md#vim-editor-mode) | 介面與終端機 | Any file |

95| [`effortLevel`](#effortlevel) | 為沒有自己已儲存等級的模型設定預設 [effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level) | 模型與回應 | Any file |95| [`effortLevel`](#effortlevel) | 為沒有自行儲存等級的模型設定預設 [effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level) | 模型與回應 | Any file |

96| [`emojiCompletionEnabled`](#emojicompletionenabled) | 關閉提示詞輸入框中的 [`:shortcode:` 表情符號建議與取代](https://code.claude.com/docs/zh-TW/interactive-mode#emoji-shortcodes) | 介面與終端機 | Any file |96| [`emojiCompletionEnabled`](#emojicompletionenabled) | 關閉提示詞輸入中的 [`:shortcode:` 表情符號建議與替換](https://code.claude.com/docs/zh-TW/interactive-mode#emoji-shortcodes) | 介面與終端機 | Any file |

97| [`enableAllProjectMcpServers`](#enableallprojectmcpservers) | 無需提示即核准專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-server-approvals-and-workspace-trust) 檔案中的每個伺服器 | MCP | Any file |97| [`enableAllProjectMcpServers`](#enableallprojectmcpservers) | 不經提示即核准專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-server-approvals-and-workspace-trust) 檔案中的所有伺服器 | MCP | Any file |

98| [`enableArtifact`](#enableartifact) | 在任何檔案中設為 `false` 即可關閉 [Artifact 工具](https://code.claude.com/docs/zh-TW/artifacts.md);沒有任何檔案能將其重新開啟 | 遠端、桌面與通知 | Any file |98| [`enableArtifact`](#enableartifact) | 在任何檔案中設為 `false` 即可關閉 [Artifact 工具](https://code.claude.com/docs/zh-TW/artifacts.md);任何檔案都無法再將其重新開啟 | 遠端、桌面與通知 | Any file |

99| [`enabledMcpjsonServers`](#enabledmcpjsonservers) | 核准專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-server-approvals-and-workspace-trust) 中的特定伺服器 | MCP | Any file |99| [`enabledMcpjsonServers`](#enabledmcpjsonservers) | 核准專案 [`.mcp.json`](https://code.claude.com/docs/zh-TW/mcp#project-server-approvals-and-workspace-trust) 中的特定伺服器 | MCP | Any file |

100| [`enabledPlugins`](#enabledplugins) | 依範圍開啟或關閉個別[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md) | 外掛與 skill | Any file |100| [`enabledPlugins`](#enabledplugins) | 依範圍開啟或關閉個別[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md) | 外掛與 skill | Any file |

101| [`enableWorkflows`](#enableworkflows) | 不依方案的預設值,自行開啟或關閉[動態工作流程](https://code.claude.com/docs/zh-TW/workflows.md) | hook 與自動化 | Any file |101| [`enableWorkflows`](#enableworkflows) | 相對於您方案的預設值開啟或關閉[動態工作流程](https://code.claude.com/docs/zh-TW/workflows.md) | hook 與自動化 | Any file |

102| [`enforceAnthropicSignIn`](#enforceanthropicsignin) | 要求在 Anthropic 的 API 上以 claude.ai 登入,或以 Enterprise Admin Console 登入 | 身分驗證與供應商 | Managed |102| [`enforceAnthropicSignIn`](#enforceanthropicsignin) | 在 Anthropic 的 API 上要求 claude.ai 登入,或要求 Enterprise Admin Console 登入 | 身分驗證與供應商 | Managed |

103| [`enforceAvailableModels`](#enforceavailablemodels) | 讓 [`/model` 的 Default 選項](https://code.claude.com/docs/zh-TW/model-config#enforce-the-allowlist-for-the-default-model)保持在您的 `availableModels` 允許清單內 | 模型與回應 | Any file |103| [`enforceAvailableModels`](#enforceavailablemodels) | 讓 [`/model` Default 選項](https://code.claude.com/docs/zh-TW/model-config#enforce-the-allowlist-for-the-default-model)保持在您的 `availableModels` 允許清單內 | 模型與回應 | Any file |

104| [`env`](#env) | 為每個工作階段及其子程序設定[環境變數](https://code.claude.com/docs/zh-TW/env-vars.md#in-settings-files) | 記憶與上下文 | Any file |104| [`env`](#env) | 為每個工作階段及其子程序設定[環境變數](https://code.claude.com/docs/zh-TW/env-vars.md#in-settings-files) | 記憶與上下文 | Any file |

105| [`externalEditorContext`](#externaleditorcontext) | 按下 [Ctrl+G](https://code.claude.com/docs/zh-TW/interactive-mode.md#general-controls) 進行編輯時,將 Claude 的最後一則回應顯示為註解 | 全域設定 | Global config |105| [`externalEditorContext`](#externaleditorcontext) | 按 [Ctrl+G](https://code.claude.com/docs/zh-TW/interactive-mode.md#general-controls) 進行編輯時,以註解形式顯示 Claude 的上一則回應 | 全域設定 | Global config |

106| [`extraKnownMarketplaces`](#extraknownmarketplaces) | 為儲存庫或組織註冊[市集](https://code.claude.com/docs/zh-TW/plugins/overview.md) | 外掛與 skill | Any file |106| [`extraKnownMarketplaces`](#extraknownmarketplaces) | 為儲存庫或組織註冊[市集](https://code.claude.com/docs/zh-TW/plugins/overview.md) | 外掛與 skill | Any file |

107| [`fallbackModel`](#fallbackmodel) | 指定主要模型過載時使用的[備用模型](https://code.claude.com/docs/zh-TW/model-config.md#fallback-model-chains) | 模型與回應 | Any file |107| [`fallbackModel`](#fallbackmodel) | 指定主要模型過載時使用的[備用模型](https://code.claude.com/docs/zh-TW/model-config.md#fallback-model-chains) | 模型與回應 | Any file |

108| [`fastMode`](#fastmode) | 在可用的工作階段中開啟[快速模式](https://code.claude.com/docs/zh-TW/fast-mode.md) | 模型與回應 | Any file |108| [`fastMode`](#fastmode) | 在可使用[快速模式](https://code.claude.com/docs/zh-TW/fast-mode.md)的工作階段中將其開啟 | 模型與回應 | Any file |

109| [`fastModePerSessionOptIn`](#fastmodepersessionoptin) | 要求使用者在每個工作階段自行開啟[快速模式](https://code.claude.com/docs/zh-TW/fast-mode.md) | 模型與回應 | Any file |109| [`fastModePerSessionOptIn`](#fastmodepersessionoptin) | 要求使用者在每個工作階段自行開啟[快速模式](https://code.claude.com/docs/zh-TW/fast-mode.md) | 模型與回應 | Any file |

110| [`feedbackDrafts`](#feedbackdrafts) | 控制 Claude 是否將[意見回饋草稿](https://code.claude.com/docs/zh-TW/tools-reference.md#sendfeedback-tool-behavior)排入佇列供您審閱 | 隱私與遙測 | User or managed |110| [`feedbackDrafts`](#feedbackdrafts) | 控制 Claude 是否將[意見回饋草稿](https://code.claude.com/docs/zh-TW/tools-reference.md#sendfeedback-tool-behavior)排入佇列供您檢閱 | 隱私與遙測 | User or managed |

111| [`feedbackSurveyRate`](#feedbacksurveyrate) | 變更[工作階段品質問卷](https://code.claude.com/docs/zh-TW/data-usage.md#session-quality-surveys)出現的頻率 | 隱私與遙測 | Any file |111| [`feedbackSurveyRate`](#feedbacksurveyrate) | 變更[工作階段品質問卷](https://code.claude.com/docs/zh-TW/data-usage.md#session-quality-surveys)出現的頻率 | 隱私與遙測 | Any file |

112| [`fileCheckpointingEnabled`](#filecheckpointingenabled) | 關閉或開啟 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 所還原的檔案快照 | 記憶與上下文 | Any file |112| [`fileCheckpointingEnabled`](#filecheckpointingenabled) | 關閉或開啟 [`/rewind`](https://code.claude.com/docs/zh-TW/checkpointing) 所還原的檔案快照 | 記憶與上下文 | Any file |

113| [`fileSuggestion`](#filesuggestion) | 由您自己的命令提供 [`@` 檔案自動完成](https://code.claude.com/docs/zh-TW/interactive-mode#quick-commands) | 介面與終端機 | Any file |113| [`fileSuggestion`](#filesuggestion) | 以您自己的命令提供 [`@` 檔案自動完成](https://code.claude.com/docs/zh-TW/interactive-mode#quick-commands) | 介面與終端機 | Any file |

114| [`footerLinksRegexes`](#footerlinksregexes) | 將輸出中的 issue 或審查 ID 轉為輸入框下方的[可點擊連結](https://code.claude.com/docs/zh-TW/statusline.md#clickable-links) | 介面與終端機 | User or managed |114| [`footerLinksRegexes`](#footerlinksregexes) | 將輸出中的 issue 或審查 ID 轉為輸入框下方的[可點擊連結](https://code.claude.com/docs/zh-TW/statusline.md#clickable-links) | 介面與終端機 | User or managed |

115| [`forceLoginGatewayUrl`](#forcelogingatewayurl) | 設定登入畫面所連線的[閘道 URL](https://code.claude.com/docs/zh-TW/claude-apps-gateway#set-the-gateway-url) | 身分驗證與供應商 | User or managed |115| [`forceLoginGatewayUrl`](#forcelogingatewayurl) | 設定登入畫面所連線的[閘道 URL](https://code.claude.com/docs/zh-TW/claude-apps-gateway#set-the-gateway-url) | 身分驗證與供應商 | User or managed |

116| [`forceLoginMethod`](#forceloginmethod) | 將[登入限制](https://code.claude.com/docs/zh-TW/authentication.md#restrict-login-to-your-organization)為 claude.ai、Claude Console 或[雲端閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway) | 身分驗證與供應商 | Any file |116| [`forceLoginMethod`](#forceloginmethod) | 將[登入限制](https://code.claude.com/docs/zh-TW/authentication.md#restrict-login-to-your-organization)為 claude.ai、Claude Console 或[雲端閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway) | 身分驗證與供應商 | Any file |

117| [`forceLoginOrgUUID`](#forceloginorguuid) | [將 claude.ai 登入固定至您的組織](https://code.claude.com/docs/zh-TW/authentication.md#restrict-login-to-your-organization);僅受管設定會強制執行此項 | 身分驗證與供應商 | Any file |117| [`forceLoginOrgUUID`](#forceloginorguuid) | [將 claude.ai 登入固定至您的組織](https://code.claude.com/docs/zh-TW/authentication.md#restrict-login-to-your-organization);僅受管設定會強制執行此設定 | 身分驗證與供應商 | Any file |

118| [`forceRemoteSettingsRefresh`](#forceremotesettingsrefresh) | 阻擋啟動,直到已重新擷取到最新的[伺服器受管設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)為止 | 企業與受管設定 | Managed |118| [`forceRemoteSettingsRefresh`](#forceremotesettingsrefresh) | 封鎖啟動,直到已重新擷取最新的[伺服器管理設定](https://code.claude.com/docs/zh-TW/server-managed-settings.md)為止 | 企業與受管設定 | Managed |

119| [`gatewayInternalNetworks`](#gatewayinternalnetworks) | 讓 `/login` 能連線到位於您組織內部使用之公用 IPv4 位址空間上的[雲端閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own) | 身分驗證與供應商 | Managed |119| [`gatewayInternalNetworks`](#gatewayinternalnetworks) | 讓 `/login` 能連線至位於您組織內部使用之公用 IPv4 空間上的[雲端閘道](https://code.claude.com/docs/zh-TW/claude-apps-gateway#allow-a-gateway-on-public-address-space-you-own) | 身分驗證與供應商 | Managed |

120| [`gcpAuthRefresh`](#gcpauthrefresh) | 使用您自己的命令重新整理 [Google Cloud 憑證](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#advanced-credential-configuration) | 身分驗證與供應商 | Any file |120| [`gcpAuthRefresh`](#gcpauthrefresh) | 以您自己的命令重新整理 [Google Cloud 憑證](https://code.claude.com/docs/zh-TW/google-vertex-ai.md#advanced-credential-configuration) | 身分驗證與供應商 | Any file |

121| [`hooks`](#hooks) | 在 Claude Code 生命週期的特定時間點,以 [hook](https://code.claude.com/docs/zh-TW/hooks.md) 執行您自己的命令 | hook 與自動化 | Any file |121| [`hooks`](#hooks) | 在 Claude Code 生命週期的各個時間點,以 [hook](https://code.claude.com/docs/zh-TW/hooks.md) 形式執行您自己的命令 | hook 與自動化 | Any file |

122| [`httpHookAllowedEnvVars`](#httphookallowedenvvars) | 限制 [HTTP hook](https://code.claude.com/docs/zh-TW/hooks.md) 可放入標頭中的環境變數 | hook 與自動化 | Any file |122| [`httpHookAllowedEnvVars`](#httphookallowedenvvars) | 限制 [HTTP hook](https://code.claude.com/docs/zh-TW/hooks.md) 可放入標頭的環境變數 | hook 與自動化 | Any file |

123| [`idleCompaction`](#idlecompaction) | 阻止 Claude Code 壓縮您暫時離開的長對話 | 記憶與上下文 | Any file |123| [`idleCompaction`](#idlecompaction) | 阻止 Claude Code 壓縮您離開期間的長對話 | 記憶與上下文 | Any file |

124| [`includeCoAuthoredBy`](#includecoauthoredby) | 已棄用;請使用 `attribution` 隱藏或變更提交與 PR 署名 | Git 與署名 | Any file |124| [`includeCoAuthoredBy`](#includecoauthoredby) | 已棄用;請使用 `attribution` 隱藏或變更提交與 PR 署名 | Git 與署名 | Any file |

125| [`includeGitInstructions`](#includegitinstructions) | 從 Claude 的上下文中移除內建的提交與 PR 指令 | Git 與署名 | Any file |125| [`includeGitInstructions`](#includegitinstructions) | 從 Claude 的上下文中移除內建的提交與 PR 指令 | Git 與署名 | Any file |

126| [`inputNeededNotifEnabled`](#inputneedednotifenabled) | 在 Claude 等待您時收到[推播通知](https://code.claude.com/docs/zh-TW/remote-control.md#mobile-push-notifications) | 遠端、桌面與通知 | Any file |126| [`inputNeededNotifEnabled`](#inputneedednotifenabled) | 在 Claude 等待您回應時收到[推播通知](https://code.claude.com/docs/zh-TW/remote-control.md#mobile-push-notifications) | 遠端、桌面與通知 | Any file |

127| [`isolatePeerMachines`](#isolatepeermachines) | 在 Claude [傳送訊息給您在另一台機器上的工作階段](https://code.claude.com/docs/zh-TW/cross-session-messaging.md#require-approval-for-cross-machine-messages)之前先詢問您 | Agent、工作階段與 worktree | Any file |127| [`isolatePeerMachines`](#isolatepeermachines) | 在 Claude [傳送訊息給您在另一台機器上的工作階段](https://code.claude.com/docs/zh-TW/cross-session-messaging.md#require-approval-for-cross-machine-messages)之前先詢問您 | Agent、工作階段與 worktree | Any file |

128| [`keybindingFlavor`](#keybindingflavor) | 已棄用且沒有作用;文字編輯快捷鍵一律[遵循 readline 慣例](https://code.claude.com/docs/zh-TW/interactive-mode.md#make-ctrl-w-delete-back-to-whitespace) | 介面與終端機 | Any file |128| [`keybindingFlavor`](#keybindingflavor) | 已棄用且無作用;文字編輯快捷鍵一律[遵循 readline 慣例](https://code.claude.com/docs/zh-TW/interactive-mode.md#make-ctrl-w-delete-back-to-whitespace) | 介面與終端機 | Any file |

129| [`language`](#language) | 讓 Claude 以英文以外的語言回應 | 模型與回應 | Any file |129| [`language`](#language) | 讓 Claude 以英文以外的語言回應 | 模型與回應 | Any file |

130| [`leftArrowOpensAgents`](#leftarrowopensagents) | 關閉可[將工作階段移至背景並開啟 agent view](https://code.claude.com/docs/zh-TW/agent-view.md#switch-sessions-without-leaving-the-terminal) 的 `←` 快捷鍵 | 全域設定 | Global config |130| [`leftArrowOpensAgents`](#leftarrowopensagents) | 關閉可[將工作階段移至背景並開啟 agent view](https://code.claude.com/docs/zh-TW/agent-view.md#switch-sessions-without-leaving-the-terminal) 的 `←` 快捷鍵 | 全域設定 | Global config |

131| [`managedMcpServers`](#managedmcpservers) | 在使用者自行新增的伺服器之外,為每位使用者提供遠端 [MCP 伺服器](https://code.claude.com/docs/zh-TW/managed-mcp.md#provide-servers-through-managed-settings) | MCP | Managed |131| [`managedMcpServers`](#managedmcpservers) | 在使用者自行新增的伺服器之外,為每位使用者提供遠端 [MCP 伺服器](https://code.claude.com/docs/zh-TW/managed-mcp.md#provide-servers-through-managed-settings) | MCP | Managed |

132| [`managedSourcesBehavior`](#managedsourcesbehavior) | 組合您部署的每個[受管來源](https://code.claude.com/docs/zh-TW/managed-settings.md#how-claude-code-combines-managed-sources),而非僅使用優先順序最高的那一個 | 企業與受管設定 | Managed |132| [`managedSourcesBehavior`](#managedsourcesbehavior) | 組合您部署的每個[受管來源](https://code.claude.com/docs/zh-TW/managed-settings.md#how-claude-code-combines-managed-sources),而非僅使用優先順序最高的來源 | 企業與受管設定 | Managed |

133| [`maxEffortLevel`](#maxeffortlevel) | 在每個供應商上,為所有模型或個別模型設定 [effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)上限 | 模型與回應 | Any file |133| [`maxEffortLevel`](#maxeffortlevel) | 在每個供應商上,為所有模型或個別模型設定 [effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)上限 | 模型與回應 | Any file |

134| [`maxProseWidth`](#maxprosewidth) | 在寬終端機中限制 Claude 回應中文字段落的寬度 | 介面與終端機 | Any file |134| [`maxProseWidth`](#maxprosewidth) | 限制寬終端機中 Claude 回應文字的最大寬度 | 介面與終端機 | Any file |

135| [`minimumVersion`](#minimumversion) | 防止[自動更新](https://code.claude.com/docs/zh-TW/setup.md#pin-a-minimum-version)安裝低於某個版本的任何版本 | 更新與版本控制 | Any file |135| [`minimumVersion`](#minimumversion) | 防止[自動更新](https://code.claude.com/docs/zh-TW/setup.md#pin-a-minimum-version)安裝低於某個版本的任何版本 | 更新與版本控制 | Any file |

136| [`model`](#model) | 變更 Claude Code 啟動時使用的[模型](https://code.claude.com/docs/zh-TW/model-config.md#set-a-default-model-for-new-sessions) | 模型與回應 | Any file |136| [`model`](#model) | 變更 Claude Code 啟動時使用的[模型](https://code.claude.com/docs/zh-TW/model-config.md#set-a-default-model-for-new-sessions) | 模型與回應 | Any file |

137| [`modelOverrides`](#modeloverrides) | 將[模型 ID 對應](https://code.claude.com/docs/zh-TW/model-config.md#override-model-ids-per-version)至您供應商的 ID,例如 Bedrock ARN | 模型與回應 | Any file |137| [`modelOverrides`](#modeloverrides) | [將模型 ID 對應](https://code.claude.com/docs/zh-TW/model-config.md#override-model-ids-per-version)至您供應商的 ID,例如 Bedrock ARN | 模型與回應 | Any file |

138| [`modelPicker`](#modelpicker) | 選擇 [`/model` 選擇器](https://code.claude.com/docs/zh-TW/model-config#available-models)列出哪些模型,並使用您自己的順序與標籤 | 模型與回應 | User or managed |138| [`modelPicker`](#modelpicker) | 選擇 [`/model` 選擇器](https://code.claude.com/docs/zh-TW/model-config#available-models)列出哪些模型,並使用您自己的順序與標籤 | 模型與回應 | User or managed |

139| [`modelPricing`](#modelpricing) | 以您組織的合約費率而非牌價回報支出 | 模型與回應 | Managed |139| [`modelPricing`](#modelpricing) | 以您組織的合約費率而非定價回報支出 | 模型與回應 | Managed |

140| [`modelSettings`](#modelsettings) | 依模型保留已儲存的 [effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)或[自動壓縮視窗](https://code.claude.com/docs/zh-TW/model-config.md#set-the-auto-compact-window),或限制單一模型的 effort 上限 | 模型與回應 | Any file |140| [`modelSettings`](#modelsettings) | 為每個模型保留已儲存的 [effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)或[自動壓縮視窗](https://code.claude.com/docs/zh-TW/model-config.md#set-the-auto-compact-window),或為單一模型的 effort 設定上限 | 模型與回應 | Any file |

141| [`otelHeadersHelper`](#otelheadershelper) | 使用您自己的命令產生輪替的 [OpenTelemetry](https://code.claude.com/docs/zh-TW/monitoring-usage.md#dynamic-headers) 標頭 | 身分驗證與供應商 | Any file |141| [`otelHeadersHelper`](#otelheadershelper) | 以您自己的命令產生輪替的 [OpenTelemetry](https://code.claude.com/docs/zh-TW/monitoring-usage.md#dynamic-headers) 標頭 | 身分驗證與供應商 | Any file |

142| [`outputStyle`](#outputstyle) | 以[輸出風格](https://code.claude.com/docs/zh-TW/output-styles.md)變更 Claude 的角色、語氣與輸出格式 | 模型與回應 | Any file |142| [`outputStyle`](#outputstyle) | 以[輸出風格](https://code.claude.com/docs/zh-TW/output-styles.md)變更 Claude 的角色、語氣與輸出格式 | 模型與回應 | Any file |

143| [`parentSettingsBehavior`](#parentsettingsbehavior) | 在您部署[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)時,套用或捨棄 [SDK 或 IDE 主機](https://code.claude.com/docs/zh-TW/managed-settings.md#let-an-embedding-host-add-policy)傳入的限制 | 企業與受管設定 | Managed |143| [`parentSettingsBehavior`](#parentsettingsbehavior) | 部署[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)時,套用或捨棄 [SDK 或 IDE 主機](https://code.claude.com/docs/zh-TW/managed-settings.md#let-an-embedding-host-add-policy)傳入的限制 | 企業與受管設定 | Managed |

144| [`permissionExplainerEnabled`](#permissionexplainerenabled) | 已於 v2.1.257 移除,連同 shell 權限提示上的 `Ctrl+E` 命令說明一併移除 | 全域設定 | Global config |144| [`permissionExplainerEnabled`](#permissionexplainerenabled) | 已於 v2.1.257 移除,連同 shell 權限提示上的 `Ctrl+E` 命令說明一併移除 | 全域設定 | Global config |

145| [`permissions`](#permissions) | 設定允許、詢問與拒絕規則,以及預設[權限模式](https://code.claude.com/docs/zh-TW/permission-modes.md) | 權限設定 | Any file |145| [`permissions`](#permissions) | 設定允許、詢問與拒絕規則,以及預設[權限模式](https://code.claude.com/docs/zh-TW/permission-modes.md) | 權限設定 | Any file |

146| [`permissions.additionalDirectories`](#permissions-additionaldirectories) | 讓 Claude 能存取[目前目錄以外之目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)中的檔案 | 權限設定 | Any file |146| [`permissions.additionalDirectories`](#permissions-additionaldirectories) | 讓 Claude 能存取[目前目錄以外之目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)中的檔案 | 權限設定 | Any file |

147| [`permissions.allow`](#permissions-allow) | 無需提示即核准列出的[工具使用](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax) | 權限設定 | Any file |147| [`permissions.allow`](#permissions-allow) | 不經提示即核准列出的[工具使用](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax) | 權限設定 | Any file |

148| [`permissions.ask`](#permissions-ask) | 在列出的[工具使用](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax)之前先提示 | 權限設定 | Any file |148| [`permissions.ask`](#permissions-ask) | 在列出的[工具使用](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax)之前提示 | 權限設定 | Any file |

149| [`permissions.blockReadsOutsideWorkingDirectories`](#permissions-blockreadsoutsideworkingdirectories) | 讓檔案工具在每種權限模式中拒絕讀取[工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)以外的內容 | 權限設定 | Any file |149| [`permissions.blockReadsOutsideWorkingDirectories`](#permissions-blockreadsoutsideworkingdirectories) | 在每種權限模式下,讓檔案工具拒絕讀取[工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)以外的內容 | 權限設定 | Any file |

150| [`permissions.blockWritesOutsideWorkingDirectories`](#permissions-blockwritesoutsideworkingdirectories) | 讓 `Write`、`Edit` 與 `NotebookEdit` 工具在每種權限模式中拒絕[工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)以外的路徑,但 [Claude Code 自身的部分檔案](#what-the-write-block-refuses-and-what-stays-writable)除外 | 權限設定 | Any file |150| [`permissions.blockWritesOutsideWorkingDirectories`](#permissions-blockwritesoutsideworkingdirectories) | 在每種權限模式下,讓 `Write`、`Edit` 與 `NotebookEdit` 工具拒絕[工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)以外的路徑,[部分 Claude Code 自身的檔案](#what-the-write-block-refuses-and-what-stays-writable)除外 | 權限設定 | Any file |

151| [`permissions.defaultMode`](#permissions-defaultmode) | 為新工作階段設定預設[權限模式](https://code.claude.com/docs/zh-TW/permission-modes.md#which-mode-a-session-starts-in) | 權限設定 | Any file |151| [`permissions.defaultMode`](#permissions-defaultmode) | 設定新工作階段的預設[權限模式](https://code.claude.com/docs/zh-TW/permission-modes.md#which-mode-a-session-starts-in) | 權限設定 | Any file |

152| [`permissions.deny`](#permissions-deny) | 封鎖列出的[工具使用](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax),包括讀取含有機密的檔案 | 權限設定 | Any file |152| [`permissions.deny`](#permissions-deny) | 封鎖列出的[工具使用](https://code.claude.com/docs/zh-TW/permissions.md#permission-rule-syntax),包括讀取存放機密的檔案 | 權限設定 | Any file |

153| [`permissions.denyInsteadOfPrompting`](#permissions-denyinsteadofprompting) | 拒絕會等待[權限提示](https://code.claude.com/docs/zh-TW/permissions.md#permission-system)的工具呼叫,讓無人看管的工作階段能持續運作 | 權限設定 | User or managed |153| [`permissions.denyInsteadOfPrompting`](#permissions-denyinsteadofprompting) | 拒絕會等待[權限提示](https://code.claude.com/docs/zh-TW/permissions.md#permission-system)的工具呼叫,讓無人看管的工作階段持續運作 | 權限設定 | User or managed |

154| [`permissions.disableBypassPermissionsMode`](#permissions-disablebypasspermissionsmode) | 防止任何人進入 [bypassPermissions 模式](https://code.claude.com/docs/zh-TW/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) | 權限設定 | Any file |154| [`permissions.disableBypassPermissionsMode`](#permissions-disablebypasspermissionsmode) | 防止任何人進入 [bypassPermissions 模式](https://code.claude.com/docs/zh-TW/permission-modes.md#skip-all-checks-with-bypasspermissions-mode) | 權限設定 | Any file |

155| [`plansDirectory`](#plansdirectory) | 選擇 [plan mode](https://code.claude.com/docs/zh-TW/permission-modes.md#analyze-before-you-edit-with-plan-mode) 寫入計畫檔案的位置 | 記憶與上下文 | Any file |155| [`plansDirectory`](#plansdirectory) | 選擇 [plan mode](https://code.claude.com/docs/zh-TW/permission-modes.md#analyze-before-you-edit-with-plan-mode) 寫入計畫檔的位置 | 記憶與上下文 | Any file |

156| [`pluginConfigs`](#pluginconfigs) | 儲存您在[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)設定對話框中提供的答案 | 外掛與 skill | User or managed |156| [`pluginConfigs`](#pluginconfigs) | 儲存您在[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)設定對話框中填寫的答案 | 外掛與 skill | User or managed |

157| [`pluginSuggestionMarketplaces`](#pluginsuggestionmarketplaces) | 選擇哪些[市集](https://code.claude.com/docs/zh-TW/plugins/org.md#restrict-what-users-can-install)可在 `/plugin` 中顯示外掛安裝建議 | 外掛與 skill | Managed |157| [`pluginSuggestionMarketplaces`](#pluginsuggestionmarketplaces) | 選擇哪些[市集](https://code.claude.com/docs/zh-TW/plugins/org.md#restrict-what-users-can-install)可在 `/plugin` 中顯示外掛安裝建議 | 外掛與 skill | Managed |

158| [`pluginTrustMessage`](#plugintrustmessage) | 在[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)信任警告中加入您自己的文字 | 外掛與 skill | Managed |158| [`pluginTrustMessage`](#plugintrustmessage) | 在[外掛](https://code.claude.com/docs/zh-TW/plugins/overview.md)信任警告中加入您自己的文字 | 外掛與 skill | Managed |

159| [`policyHelper`](#policyhelper) | 在啟動時執行用於計算[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program)的可執行檔 | 企業與受管設定 | Managed |159| [`policyHelper`](#policyhelper) | 執行一個在啟動時計算[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program)的可執行檔 | 企業與受管設定 | Managed |

160| [`policyHelper.path`](#policyhelper-path) | 指定 Claude Code 執行的[輔助可執行檔](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program) | 企業與受管設定 | Managed |160| [`policyHelper.path`](#policyhelper-path) | 指定 Claude Code 執行的[輔助可執行檔](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program) | 企業與受管設定 | Managed |

161| [`policyHelper.refreshIntervalMs`](#policyhelper-refreshintervalms) | 依固定間隔在背景重新執行[輔助程式](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program) | 企業與受管設定 | Managed |161| [`policyHelper.refreshIntervalMs`](#policyhelper-refreshintervalms) | 依固定間隔在背景重新執行[輔助程式](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program) | 企業與受管設定 | Managed |

162| [`policyHelper.timeoutMs`](#policyhelper-timeoutms) | 設定 Claude Code 等待[輔助程式](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program)的時間 | 企業與受管設定 | Managed |162| [`policyHelper.timeoutMs`](#policyhelper-timeoutms) | 設定 Claude Code 等待[輔助程式](https://code.claude.com/docs/zh-TW/managed-settings.md#compute-the-policy-with-a-helper-program)的時間 | 企業與受管設定 | Managed |

163| [`preferredNotifChannel`](#preferrednotifchannel) | 選擇以[終端機響鈴或桌面通知](https://code.claude.com/docs/zh-TW/terminal-config.md#get-a-terminal-bell-or-notification)提示任務完成 | 遠端、桌面與通知 | Any file |163| [`preferredNotifChannel`](#preferrednotifchannel) | 為任務完成選擇[終端機響鈴或桌面通知](https://code.claude.com/docs/zh-TW/terminal-config.md#get-a-terminal-bell-or-notification) | 遠端、桌面與通知 | Any file |

164| [`prefersReducedMotion`](#prefersreducedmotion) | [減少或關閉](https://code.claude.com/docs/zh-TW/accessibility.md#accessibility-settings)旋轉指示器、光澤與閃光動畫 | 介面與終端機 | Any file |164| [`prefersReducedMotion`](#prefersreducedmotion) | [減少或關閉](https://code.claude.com/docs/zh-TW/accessibility.md#accessibility-settings)旋轉圖示、微光與閃爍動畫 | 介面與終端機 | Any file |

165| [`prependPlugins`](#prependplugins) | 在使用者安裝的每個 mod 之前,執行您組織的 [mod](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md) | 外掛與 skill | User or managed |165| [`prependPlugins`](#prependplugins) | 在使用者安裝的每個 mod 之前執行您組織的 [mod](https://code.claude.com/docs/zh-TW/plugins/mods/admin.md) | 外掛與 skill | User or managed |

166| [`processWrapper`](#processwrapper) | 在 macOS 與 Linux 上透過[企業啟動器](https://code.claude.com/docs/zh-TW/corporate-launcher.md)執行 Claude Code 的背景程序 | Agent、工作階段與 worktree | User or managed |166| [`processWrapper`](#processwrapper) | 在 macOS 與 Linux 上透過[企業啟動器](https://code.claude.com/docs/zh-TW/corporate-launcher.md)執行 Claude Code 的背景程序 | Agent、工作階段與 worktree | User or managed |

167| [`promptCacheTtl`](#promptcachettl) | 選擇主要對話的[提示快取存留時間](https://code.claude.com/docs/zh-TW/prompt-caching.md#cache-lifetime) | 模型與回應 | Any file |167| [`promptCacheTtl`](#promptcachettl) | 選擇主要對話的[提示快取存留期](https://code.claude.com/docs/zh-TW/prompt-caching.md#cache-lifetime) | 模型與回應 | Any file |

168| [`promptSuggestionEnabled`](#promptsuggestionenabled) | 隱藏輸入框中以灰色顯示的[提示詞建議](https://code.claude.com/docs/zh-TW/interactive-mode.md#prompt-suggestions) | 介面與終端機 | Any file |168| [`promptSuggestionEnabled`](#promptsuggestionenabled) | 隱藏輸入框中以灰色顯示的[提示詞建議](https://code.claude.com/docs/zh-TW/interactive-mode.md#prompt-suggestions) | 介面與終端機 | Any file |

169| [`prStatusFooterEnabled`](#prstatusfooterenabled) | 關閉提示詞頁尾的 [PR 審查狀態](https://code.claude.com/docs/zh-TW/interactive-mode.md#pr-review-status)徽章及其背後的 pull request 檢查 | 全域設定 | Global config |169| [`prStatusFooterEnabled`](#prstatusfooterenabled) | 關閉提示字元頁尾的 [PR 審查狀態](https://code.claude.com/docs/zh-TW/interactive-mode.md#pr-review-status)徽章及其背後的 pull request 檢查 | 全域設定 | Global config |

170| [`prUrlTemplate`](#prurltemplate) | 將 PR 連結指向內部程式碼審查工具,而非 github.com | Git 與署名 | Any file |170| [`prUrlTemplate`](#prurltemplate) | 將 PR 連結指向內部程式碼審查工具而非 github.com | Git 與署名 | Any file |

171| [`remote.defaultEnvironmentId`](#remote-defaultenvironmentid) | 為 `claude --cloud` 選擇預設的[雲端環境](https://code.claude.com/docs/zh-TW/cloud-environments.md);自行託管的 `ccpool_` ID 僅會從使用者與受管設定以及 `--settings` 讀取 | 遠端、桌面與通知 | Any file |171| [`remote.defaultEnvironmentId`](#remote-defaultenvironmentid) | 為 `claude --cloud` 選擇預設[雲端環境](https://code.claude.com/docs/zh-TW/cloud-environments.md);自行託管的 `ccpool_` ID 僅會從使用者與受管設定以及 `--settings` 讀取 | 遠端、桌面與通知 | Any file |

172| [`remoteControlAtStartup`](#remotecontrolatstartup) | 在工作階段開始時自動連線 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#enable-remote-control-for-all-sessions) | 遠端、桌面與通知 | Any file |172| [`remoteControlAtStartup`](#remotecontrolatstartup) | 在工作階段開始時自動連線 [Remote Control](https://code.claude.com/docs/zh-TW/remote-control.md#enable-remote-control-for-all-sessions) | 遠端、桌面與通知 | Any file |

173| [`requiredMaximumVersion`](#requiredmaximumversion) | 當版本比您組織允許的版本還新時[拒絕啟動](https://code.claude.com/docs/zh-TW/setup.md#pin-a-minimum-version) | 更新與版本控制 | Managed |173| [`requiredMaximumVersion`](#requiredmaximumversion) | 當版本比您組織允許的版本更新時[拒絕啟動](https://code.claude.com/docs/zh-TW/setup.md#pin-a-minimum-version) | 更新與版本控制 | Managed |

174| [`requiredMinimumVersion`](#requiredminimumversion) | 當版本比您組織要求的版本還舊時[拒絕啟動](https://code.claude.com/docs/zh-TW/setup.md#pin-a-minimum-version) | 更新與版本控制 | Managed |174| [`requiredMinimumVersion`](#requiredminimumversion) | 當版本比您組織要求的版本更舊時[拒絕啟動](https://code.claude.com/docs/zh-TW/setup.md#pin-a-minimum-version) | 更新與版本控制 | Managed |

175| [`respectGitignore`](#respectgitignore) | 讓被 gitignore 的檔案不出現在 [`@` 檔案選擇器](https://code.claude.com/docs/zh-TW/interactive-mode#quick-commands)中 | 介面與終端機 | Any file |175| [`respectGitignore`](#respectgitignore) | 讓被 gitignore 忽略的檔案不出現在 [`@` 檔案選擇器](https://code.claude.com/docs/zh-TW/interactive-mode#quick-commands)中 | 介面與終端機 | Any file |

176| [`respondToBashCommands`](#respondtobashcommands) | 阻止 Claude 在 [`!` shell 命令](https://code.claude.com/docs/zh-TW/interactive-mode#shell-mode-with-prefix)執行後回應 | 介面與終端機 | Any file |176| [`respondToBashCommands`](#respondtobashcommands) | 阻止 Claude 在 [`!` shell 命令](https://code.claude.com/docs/zh-TW/interactive-mode#shell-mode-with-prefix)執行後回應 | 介面與終端機 | Any file |

177| [`sandbox`](#sandbox) | 在 macOS、Linux 與 WSL2 上將 [Bash 命令與您的檔案系統及網路隔離](https://code.claude.com/docs/zh-TW/sandboxing.md) | 沙箱設定 | Any file |177| [`sandbox`](#sandbox) | 在 macOS、Linux 與 WSL2 上[將 Bash 命令](https://code.claude.com/docs/zh-TW/sandboxing.md)與您的檔案系統及網路隔離 | 沙箱設定 | Any file |

178| [`sandbox.allowAppleEvents`](#sandbox-allowappleevents) | 讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令在 macOS 上傳送 Apple Events | 沙箱設定 | User or managed |178| [`sandbox.allowAppleEvents`](#sandbox-allowappleevents) | 讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令在 macOS 上傳送 Apple Events | 沙箱設定 | User or managed |

179| [`sandbox.allowNestedUserNamespaces`](#sandbox-allownestedusernamespaces) | 讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#chromium-or-rootless-podman-fails-inside-the-sandbox-on-linux)的命令在 Linux 與 WSL2 上建立使用者命名空間 | 沙箱設定 | User or managed |179| [`sandbox.allowNestedUserNamespaces`](#sandbox-allownestedusernamespaces) | 讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#chromium-or-rootless-podman-fails-inside-the-sandbox-on-linux)命令在 Linux 與 WSL2 上建立 user namespace | 沙箱設定 | User or managed |

180| [`sandbox.allowUnsandboxedCommands`](#sandbox-allowunsandboxedcommands) | 讓 Claude 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#the-unsandboxed-retry-escape-hatch)外重試被封鎖的命令,或禁止此行為 | 沙箱設定 | Any file |180| [`sandbox.allowUnsandboxedCommands`](#sandbox-allowunsandboxedcommands) | 讓 Claude 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#the-unsandboxed-retry-escape-hatch)外重試被封鎖的命令,或禁止此行為 | 沙箱設定 | Any file |

181| [`sandbox.autoAllowBashIfSandboxed`](#sandbox-autoallowbashifsandboxed) | 無需權限提示即執行[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#auto-allow-mode)的命令 | 沙箱設定 | Any file |181| [`sandbox.autoAllowBashIfSandboxed`](#sandbox-autoallowbashifsandboxed) | 不經權限提示即執行[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#auto-allow-mode)命令 | 沙箱設定 | Any file |

182| [`sandbox.bwrapPath`](#sandbox-bwrappath) | 將[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)指向位於 `PATH` 以外的 bubblewrap 執行檔 | 沙箱設定 | Managed |182| [`sandbox.bwrapPath`](#sandbox-bwrappath) | 將[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)指向 `PATH` 以外的 bubblewrap 二進位檔 | 沙箱設定 | Managed |

183| [`sandbox.credentials`](#sandbox-credentials) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#protect-credentials)內隱藏或遮蔽憑證檔案與變數 | 沙箱設定 | Any file |183| [`sandbox.credentials`](#sandbox-credentials) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#protect-credentials)內隱藏或遮罩憑證檔案與變數 | 沙箱設定 | Any file |

184| [`sandbox.credentials.allowPlaintextInject`](#sandbox-credentials-allowplaintextinject) | 讓[已遮蔽的憑證](https://code.claude.com/docs/zh-TW/sandboxing.md#mask-credentials)能在受信任的測試網路上送達純 HTTP 服務 | 沙箱設定 | User or managed |184| [`sandbox.credentials.allowPlaintextInject`](#sandbox-credentials-allowplaintextinject) | 讓[遮罩的憑證](https://code.claude.com/docs/zh-TW/sandboxing.md#mask-credentials)在受信任的測試網路上送達純 HTTP 服務 | 沙箱設定 | User or managed |

185| [`sandbox.credentials.awsPairs`](#sandbox-credentials-awspairs) | 將自訂名稱的 AWS 金鑰變數連結為單一憑證,以進行[重新簽署](https://code.claude.com/docs/zh-TW/sandboxing.md#re-sign-aws-requests) | 沙箱設定 | User or managed |185| [`sandbox.credentials.awsPairs`](#sandbox-credentials-awspairs) | 將自訂名稱的 AWS 金鑰變數連結為單一憑證以供[重新簽署](https://code.claude.com/docs/zh-TW/sandboxing.md#re-sign-aws-requests) | 沙箱設定 | User or managed |

186| [`sandbox.credentials.envVars`](#sandbox-credentials-envvars) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#mask-environment-variables)內取消設定或遮蔽環境變數 | 沙箱設定 | Any file |186| [`sandbox.credentials.envVars`](#sandbox-credentials-envvars) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#mask-environment-variables)內取消設定或遮罩環境變數 | 沙箱設定 | Any file |

187| [`sandbox.credentials.files`](#sandbox-credentials-files) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#mask-credential-files)內封鎖或遮蔽對憑證檔案的讀取 | 沙箱設定 | Any file |187| [`sandbox.credentials.files`](#sandbox-credentials-files) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#mask-credential-files)內封鎖或遮罩對憑證檔案的讀取 | 沙箱設定 | Any file |

188| [`sandbox.credentials.sigv4`](#sandbox-credentials-sigv4) | 選擇串流、預先簽署或 [SigV4A AWS 請求](https://code.claude.com/docs/zh-TW/sandboxing.md#re-sign-aws-requests)要失敗還是直接通過 | 沙箱設定 | User or managed |188| [`sandbox.credentials.sigv4`](#sandbox-credentials-sigv4) | 選擇串流、預先簽署或 [SigV4A AWS 請求](https://code.claude.com/docs/zh-TW/sandboxing.md#re-sign-aws-requests)要失敗或直接通過 | 沙箱設定 | User or managed |

189| [`sandbox.enabled`](#sandbox-enabled) | 在 macOS、Linux 與 WSL2 上開啟 [Bash 沙箱機制](https://code.claude.com/docs/zh-TW/sandboxing.md#get-started) | 沙箱設定 | Any file |189| [`sandbox.enabled`](#sandbox-enabled) | 在 macOS、Linux 與 WSL2 上開啟 [Bash 沙箱機制](https://code.claude.com/docs/zh-TW/sandboxing.md#get-started) | 沙箱設定 | Any file |

190| [`sandbox.enableWeakerNestedSandbox`](#sandbox-enableweakernestedsandbox) | 在無特權容器內執行 Linux [沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md) | 沙箱設定 | Any file |190| [`sandbox.enableWeakerNestedSandbox`](#sandbox-enableweakernestedsandbox) | 在非特權容器內執行 Linux [沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md) | 沙箱設定 | Any file |

191| [`sandbox.enableWeakerNetworkIsolation`](#sandbox-enableweakernetworkisolation) | 在 macOS 上讓 `gh`、`gcloud` 與 `terraform` 能在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#go-based-clis-fail-tls-verification-on-macos)內的 MITM 代理伺服器後方驗證 TLS | 沙箱設定 | Any file |191| [`sandbox.enableWeakerNetworkIsolation`](#sandbox-enableweakernetworkisolation) | 在 macOS 上讓 `gh`、`gcloud` 與 `terraform` 能在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#go-based-clis-fail-tls-verification-on-macos)內的 MITM 代理伺服器後方驗證 TLS | 沙箱設定 | Any file |

192| [`sandbox.excludedCommands`](#sandbox-excludedcommands) | 指定 Claude Code 可在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)外執行的命令 | 沙箱設定 | Any file |192| [`sandbox.excludedCommands`](#sandbox-excludedcommands) | 指定 Claude Code 可在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)外執行的命令 | 沙箱設定 | Any file |

193| [`sandbox.failIfUnavailable`](#sandbox-failifunavailable) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)無法啟動時拒絕啟動,而不是在沒有沙箱的情況下執行;但在 Anthropic 託管的環境中除外 | 沙箱設定 | Any file |193| [`sandbox.failIfUnavailable`](#sandbox-failifunavailable) | 當[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)無法啟動時拒絕啟動,而非以無沙箱方式執行;Anthropic 託管的環境除外 | 沙箱設定 | Any file |

194| [`sandbox.filesystem`](#sandbox-filesystem) | 控制[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#filesystem-isolation)的命令可以讀寫哪些路徑 | 沙箱設定 | Any file |194| [`sandbox.filesystem`](#sandbox-filesystem) | 控制[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#filesystem-isolation)命令可讀取與寫入哪些路徑 | 沙箱設定 | Any file |

195| [`sandbox.filesystem.allowManagedReadPathsOnly`](#sandbox-filesystem-allowmanagedreadpathsonly) | 阻止開發人員重新開放[您組織已封鎖的讀取路徑](https://code.claude.com/docs/zh-TW/sandboxing.md#keep-developers-from-widening-the-policy) | 沙箱設定 | Managed |195| [`sandbox.filesystem.allowManagedReadPathsOnly`](#sandbox-filesystem-allowmanagedreadpathsonly) | 阻止開發者重新開放[您組織已封鎖的讀取路徑](https://code.claude.com/docs/zh-TW/sandboxing.md#keep-developers-from-widening-the-policy) | 沙箱設定 | Managed |

196| [`sandbox.filesystem.allowRead`](#sandbox-filesystem-allowread) | 在 [`denyRead`](#sandbox-filesystem-denyread) 封鎖的區域內重新開放讀取 | 沙箱設定 | Any file |196| [`sandbox.filesystem.allowRead`](#sandbox-filesystem-allowread) | 在 [`denyRead`](#sandbox-filesystem-denyread) 封鎖的區域內重新開放讀取 | 沙箱設定 | Any file |

197| [`sandbox.filesystem.allowWrite`](#sandbox-filesystem-allowwrite) | 新增[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令可寫入的路徑 | 沙箱設定 | Any file |197| [`sandbox.filesystem.allowWrite`](#sandbox-filesystem-allowwrite) | 新增[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令可寫入的路徑 | 沙箱設定 | Any file |

198| [`sandbox.filesystem.denyRead`](#sandbox-filesystem-denyread) | 封鎖[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令讀取特定路徑 | 沙箱設定 | Any file |198| [`sandbox.filesystem.denyRead`](#sandbox-filesystem-denyread) | 封鎖[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令讀取特定路徑 | 沙箱設定 | Any file |

199| [`sandbox.filesystem.denyWrite`](#sandbox-filesystem-denywrite) | 封鎖[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令寫入特定路徑 | 沙箱設定 | Any file |199| [`sandbox.filesystem.denyWrite`](#sandbox-filesystem-denywrite) | 封鎖[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令寫入特定路徑 | 沙箱設定 | Any file |

200| [`sandbox.filesystem.disabled`](#sandbox-filesystem-disabled) | [關閉檔案系統隔離](https://code.claude.com/docs/zh-TW/sandboxing.md#disable-filesystem-isolation),同時保留網路隔離 | 沙箱設定 | User or managed |200| [`sandbox.filesystem.disabled`](#sandbox-filesystem-disabled) | [關閉檔案系統隔離](https://code.claude.com/docs/zh-TW/sandboxing.md#disable-filesystem-isolation),同時保留網路隔離 | 沙箱設定 | User or managed |

201| [`sandbox.ignoreViolations`](#sandbox-ignoreviolations) | 對命令預期會探查的路徑停止回報違規 | 沙箱設定 | Any file |201| [`sandbox.ignoreViolations`](#sandbox-ignoreviolations) | 隱藏命令預期會探查之路徑的違規報告 | 沙箱設定 | Any file |

202| [`sandbox.network`](#sandbox-network) | 控制[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#network-isolation)的命令可連線到哪些主機、連接埠與 socket | 沙箱設定 | Any file |202| [`sandbox.network`](#sandbox-network) | 控制[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md#network-isolation)命令可連線至哪些主機、連接埠與 socket | 沙箱設定 | Any file |

203| [`sandbox.network.allowAllUnixSockets`](#sandbox-network-allowallunixsockets) | 讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令能連線到每個 Unix socket | 沙箱設定 | Any file |203| [`sandbox.network.allowAllUnixSockets`](#sandbox-network-allowallunixsockets) | 讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令連線至所有 Unix socket | 沙箱設定 | Any file |

204| [`sandbox.network.allowedDomains`](#sandbox-network-alloweddomains) | 預先允許網域,讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令不會為這些網域發出提示 | 沙箱設定 | Any file |204| [`sandbox.network.allowedDomains`](#sandbox-network-alloweddomains) | 預先允許網域,讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令不需為其提示 | 沙箱設定 | Any file |

205| [`sandbox.network.allowLocalBinding`](#sandbox-network-allowlocalbinding) | 在 macOS 上讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令監聽網路連接埠並連線到 localhost | 沙箱設定 | Any file |205| [`sandbox.network.allowLocalBinding`](#sandbox-network-allowlocalbinding) | 在 macOS 上讓[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令監聽網路連接埠並連線至 localhost | 沙箱設定 | Any file |

206| [`sandbox.network.allowMachLookup`](#sandbox-network-allowmachlookup) | 讓 macOS 上[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的工具(例如 iOS Simulator 或 Playwright)能存取其 XPC 服務 | 沙箱設定 | Any file |206| [`sandbox.network.allowMachLookup`](#sandbox-network-allowmachlookup) | 讓 macOS 上 iOS Simulator 或 Playwright 等[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)工具連線至其 XPC 服務 | 沙箱設定 | Any file |

207| [`sandbox.network.allowManagedDomainsOnly`](#sandbox-network-allowmanageddomainsonly) | 將網路允許清單鎖定為[受管設定](https://code.claude.com/docs/zh-TW/sandboxing.md#keep-developers-from-widening-the-policy) | 沙箱設定 | Managed |207| [`sandbox.network.allowManagedDomainsOnly`](#sandbox-network-allowmanageddomainsonly) | 將網路允許清單鎖定為[受管設定](https://code.claude.com/docs/zh-TW/sandboxing.md#keep-developers-from-widening-the-policy) | 沙箱設定 | Managed |

208| [`sandbox.network.allowUnixSockets`](#sandbox-network-allowunixsockets) | 列出[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令在 macOS 上可使用的 Unix socket 路徑 | 沙箱設定 | Any file |208| [`sandbox.network.allowUnixSockets`](#sandbox-network-allowunixsockets) | 列出 macOS 上[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令可使用的 Unix socket 路徑 | 沙箱設定 | Any file |

209| [`sandbox.network.deniedDomains`](#sandbox-network-denieddomains) | 為[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)的命令封鎖網域,即使這些網域位於允許的萬用字元範圍內 | 沙箱設定 | Any file |209| [`sandbox.network.deniedDomains`](#sandbox-network-denieddomains) | 為[沙箱化](https://code.claude.com/docs/zh-TW/sandboxing.md)命令封鎖網域,即使其位於允許的萬用字元範圍內 | 沙箱設定 | Any file |

210| [`sandbox.network.httpProxyPort`](#sandbox-network-httpproxyport) | 透過您自己的代理伺服器轉送[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#custom-proxy-configuration) HTTP 流量 | 沙箱設定 | Any file |210| [`sandbox.network.httpProxyPort`](#sandbox-network-httpproxyport) | 透過您自己的代理伺服器路由[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#custom-proxy-configuration) HTTP 流量 | 沙箱設定 | Any file |

211| [`sandbox.network.socksProxyPort`](#sandbox-network-socksproxyport) | 透過您自己的代理伺服器轉送[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#custom-proxy-configuration) SOCKS 流量 | 沙箱設定 | Any file |211| [`sandbox.network.socksProxyPort`](#sandbox-network-socksproxyport) | 透過您自己的代理伺服器路由[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#custom-proxy-configuration) SOCKS 流量 | 沙箱設定 | Any file |

212| [`sandbox.network.strictAllowlist`](#sandbox-network-strictallowlist) | 直接拒絕[允許清單](https://code.claude.com/docs/zh-TW/sandboxing.md#network-isolation)以外的主機,而非發出提示 | 沙箱設定 | User or managed |212| [`sandbox.network.strictAllowlist`](#sandbox-network-strictallowlist) | 拒絕[允許清單](https://code.claude.com/docs/zh-TW/sandboxing.md#network-isolation)以外的主機,而非提示 | 沙箱設定 | User or managed |

213| [`sandbox.network.tlsTerminate`](#sandbox-network-tlsterminate) | 讓[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#network-isolation)代理伺服器終止 TLS,以便讀取 HTTPS 請求 | 沙箱設定 | User or managed |213| [`sandbox.network.tlsTerminate`](#sandbox-network-tlsterminate) | 讓[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md#network-isolation)代理伺服器終止 TLS,以便讀取 HTTPS 請求 | 沙箱設定 | User or managed |

214| [`sandbox.ripgrep`](#sandbox-ripgrep) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)內使用您自己的 ripgrep 執行檔 | 沙箱設定 | User or managed |214| [`sandbox.ripgrep`](#sandbox-ripgrep) | 在[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)內使用您自己的 ripgrep 二進位檔 | 沙箱設定 | User or managed |

215| [`sandbox.socatPath`](#sandbox-socatpath) | 將[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)代理伺服器指向位於 `PATH` 以外的 `socat` 執行檔 | 沙箱設定 | Managed |215| [`sandbox.socatPath`](#sandbox-socatpath) | 將[沙箱](https://code.claude.com/docs/zh-TW/sandboxing.md)代理伺服器指向 `PATH` 以外的 `socat` 二進位檔 | 沙箱設定 | Managed |

216| [`showClearContextOnPlanAccept`](#showclearcontextonplanaccept) | 在[計畫接受畫面](https://code.claude.com/docs/zh-TW/permission-modes.md#review-and-approve-a-plan)上顯示「clear context」選項 | 介面與終端機 | Any file |216| [`showClearContextOnPlanAccept`](#showclearcontextonplanaccept) | 在[計畫接受畫面](https://code.claude.com/docs/zh-TW/permission-modes.md#review-and-approve-a-plan)上顯示「clear context」選項 | 介面與終端機 | Any file |

217| [`showThinkingSummaries`](#showthinkingsummaries) | 查看 Claude [思考](https://code.claude.com/docs/zh-TW/model-config.md#extended-thinking)的摘要,而非摺疊起來的簡短標示 | 模型與回應 | Any file |217| [`showThinkingSummaries`](#showthinkingsummaries) | 查看 Claude [思考](https://code.claude.com/docs/zh-TW/model-config.md#extended-thinking)的摘要,而非收合的片段 | 模型與回應 | Any file |

218| [`showTurnDuration`](#showturnduration) | 隱藏每則回應後顯示的「Cooked for」持續時間 | 介面與終端機 | Any file |218| [`showTurnDuration`](#showturnduration) | 隱藏每則回應後的「Cooked for」時長 | 介面與終端機 | Any file |

219| [`skillListingBudgetFraction`](#skilllistingbudgetfraction) | 為 [skill 清單](https://code.claude.com/docs/zh-TW/skills.md#skill-descriptions-are-cut-short)保留更多或更少的上下文 | 記憶與上下文 | Any file |219| [`skillListingBudgetFraction`](#skilllistingbudgetfraction) | 為 [skill 清單](https://code.claude.com/docs/zh-TW/skills.md#skill-descriptions-are-cut-short)保留更多或更少的上下文 | 記憶與上下文 | Any file |

220| [`skillListingMaxDescChars`](#skilllistingmaxdescchars) | 限制 [skill 清單](https://code.claude.com/docs/zh-TW/skills.md#skill-descriptions-are-cut-short)中每個 skill 的描述長度 | 記憶與上下文 | Any file |220| [`skillListingMaxDescChars`](#skilllistingmaxdescchars) | 限制 [skill 清單](https://code.claude.com/docs/zh-TW/skills.md#skill-descriptions-are-cut-short)中每個 skill 描述的長度上限 | 記憶與上下文 | Any file |

221| [`skillOverrides`](#skilloverrides) | 無需編輯 SKILL.md 即可[隱藏或摺疊 skill](https://code.claude.com/docs/zh-TW/skills.md#override-skill-visibility-from-settings) | 外掛與 skill | Any file |221| [`skillOverrides`](#skilloverrides) | [隱藏或收合 skill](https://code.claude.com/docs/zh-TW/skills.md#override-skill-visibility-from-settings),無需編輯其 SKILL.md | 外掛與 skill | Any file |

222| [`skipAutoPermissionPrompt`](#skipautopermissionprompt) | 略過您首次自行進入[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)(而非透過內建預設值進入)時 Claude Code 顯示的一次性通知 | 權限設定 | User or managed |222| [`skipAutoPermissionPrompt`](#skipautopermissionprompt) | 略過您首次自行進入[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)(而非透過內建預設值進入)時 Claude Code 顯示的一次性通知 | 權限設定 | User or managed |

223| [`skipDangerousModePermissionPrompt`](#skipdangerousmodepermissionprompt) | 略過進入 [bypassPermissions 模式](https://code.claude.com/docs/zh-TW/permission-modes.md#skip-all-checks-with-bypasspermissions-mode)前的確認對話框 | 權限設定 | User, local, or managed |223| [`skipDangerousModePermissionPrompt`](#skipdangerousmodepermissionprompt) | 略過進入 [bypassPermissions 模式](https://code.claude.com/docs/zh-TW/permission-modes.md#skip-all-checks-with-bypasspermissions-mode)前的確認對話框 | 權限設定 | User, local, or managed |

224| [`skipWebFetchPreflight`](#skipwebfetchpreflight) | 在無法連線到 Anthropic 時略過 [WebFetch 主機名稱檢查](https://code.claude.com/docs/zh-TW/tools-reference.md#webfetch-tool-behavior) | 隱私與遙測 | Any file |224| [`skipWebFetchPreflight`](#skipwebfetchpreflight) | 在無法連線至 Anthropic 時略過 [WebFetch 主機名稱檢查](https://code.claude.com/docs/zh-TW/tools-reference.md#webfetch-tool-behavior) | 隱私與遙測 | Any file |

225| [`spellcheck`](#spellcheck) | 使用您安裝的[拼字檢查器](https://code.claude.com/docs/zh-TW/interactive-mode.md#check-spelling-as-you-type),為提示詞輸入框中拼錯的字加上底線 | 介面與終端機 | User or managed |225| [`spellcheck`](#spellcheck) | 以您安裝的[拼字檢查工具](https://code.claude.com/docs/zh-TW/interactive-mode.md#check-spelling-as-you-type)為提示詞輸入中拼錯的字加上底線 | 介面與終端機 | User or managed |

226| [`spinnerTipsEnabled`](#spinnertipsenabled) | 在 Claude 工作時隱藏旋轉指示器中的提示 | 介面與終端機 | Any file |226| [`spinnerTipsEnabled`](#spinnertipsenabled) | 隱藏 Claude 工作時旋轉圖示中的提示 | 介面與終端機 | Any file |

227| [`spinnerTipsOverride`](#spinnertipsoverride) | 將您自己的提示加入旋轉指示器的輪播,或取代內建提示 | 介面與終端機 | Any file |227| [`spinnerTipsOverride`](#spinnertipsoverride) | 將您自己的提示加入旋轉圖示的輪播,或取代內建提示 | 介面與終端機 | Any file |

228| [`spinnerVerbs`](#spinnerverbs) | 新增或取代回合執行期間顯示的動詞 | 介面與終端機 | Any file |228| [`spinnerVerbs`](#spinnerverbs) | 新增或取代回合執行期間顯示的動詞 | 介面與終端機 | Any file |

229| [`sshConfigs`](#sshconfigs) | 將 [SSH 連線](https://code.claude.com/docs/zh-TW/desktop.md#pre-configure-ssh-connections-for-your-team)加入 Desktop 環境選擇器 | 遠端、桌面與通知 | User or managed |229| [`sshConfigs`](#sshconfigs) | 將 [SSH 連線](https://code.claude.com/docs/zh-TW/desktop.md#pre-configure-ssh-connections-for-your-team)新增至 Desktop 環境選擇器 | 遠端、桌面與通知 | User or managed |

230| [`sshHostAllowlist`](#sshhostallowlist) | 限制 [Desktop SSH 工作階段](https://code.claude.com/docs/zh-TW/desktop.md#restrict-which-ssh-hosts-users-can-connect-to)可連線到哪些主機 | 遠端、桌面與通知 | Managed |230| [`sshHostAllowlist`](#sshhostallowlist) | 限制 [Desktop SSH 工作階段](https://code.claude.com/docs/zh-TW/desktop.md#restrict-which-ssh-hosts-users-can-connect-to)可連線的主機 | 遠端、桌面與通知 | Managed |

231| [`sshHostCommands`](#sshhostcommands) | 將[主機來自命令的 SSH 連線](https://code.claude.com/docs/zh-TW/desktop.md#create-an-ssh-connection-from-a-command)加入 Desktop 環境選擇器 | 遠端、桌面與通知 | User or managed |231| [`sshHostCommands`](#sshhostcommands) | 將[主機由命令產生的 SSH 連線](https://code.claude.com/docs/zh-TW/desktop.md#create-an-ssh-connection-from-a-command)新增至 Desktop 環境選擇器 | 遠端、桌面與通知 | User or managed |

232| [`statusLine`](#statusline) | 執行您自己的命令,在提示詞下方渲染[狀態列](https://code.claude.com/docs/zh-TW/statusline.md) | 介面與終端機 | Any file |232| [`statusLine`](#statusline) | 執行您自己的命令,在提示字元下方渲染[狀態列](https://code.claude.com/docs/zh-TW/statusline.md) | 介面與終端機 | Any file |

233| [`strictKnownMarketplaces`](#strictknownmarketplaces) | 設定使用者可新增及安裝的[市集](https://code.claude.com/docs/zh-TW/plugins/overview.md)來源允許清單 | 外掛與 skill | Managed |233| [`strictKnownMarketplaces`](#strictknownmarketplaces) | 為使用者可新增並從中安裝的[市集](https://code.claude.com/docs/zh-TW/plugins/overview.md)來源設定允許清單 | 外掛與 skill | Managed |

234| [`strictPluginOnlyCustomization`](#strictpluginonlycustomization) | 封鎖來自使用者與專案來源的 [skill](https://code.claude.com/docs/zh-TW/skills.md)、[agent](https://code.claude.com/docs/zh-TW/sub-agents.md)、[hook](https://code.claude.com/docs/zh-TW/hooks.md) 與 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | 外掛與 skill | Managed |234| [`strictPluginOnlyCustomization`](#strictpluginonlycustomization) | 封鎖來自使用者與專案來源的 [skill](https://code.claude.com/docs/zh-TW/skills.md)、[agent](https://code.claude.com/docs/zh-TW/sub-agents.md)、[hook](https://code.claude.com/docs/zh-TW/hooks.md) 與 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | 外掛與 skill | Managed |

235| [`strictPluginOnlyCustomization.agents`](#strictpluginonlycustomization-agents) | 封鎖來自使用者與專案來源的 [agent](https://code.claude.com/docs/zh-TW/sub-agents.md) | 外掛與 skill | Managed |235| [`strictPluginOnlyCustomization.agents`](#strictpluginonlycustomization-agents) | 封鎖來自使用者與專案來源的 [agent](https://code.claude.com/docs/zh-TW/sub-agents.md) | 外掛與 skill | Managed |

236| [`strictPluginOnlyCustomization.hooks`](#strictpluginonlycustomization-hooks) | 封鎖來自使用者與專案來源的 [hook](https://code.claude.com/docs/zh-TW/hooks.md) | 外掛與 skill | Managed |236| [`strictPluginOnlyCustomization.hooks`](#strictpluginonlycustomization-hooks) | 封鎖來自使用者與專案來源的 [hook](https://code.claude.com/docs/zh-TW/hooks.md) | 外掛與 skill | Managed |

237| [`strictPluginOnlyCustomization.mcp`](#strictpluginonlycustomization-mcp) | 封鎖來自使用者與專案來源的 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | 外掛與 skill | Managed |237| [`strictPluginOnlyCustomization.mcp`](#strictpluginonlycustomization-mcp) | 封鎖來自使用者與專案來源的 [MCP 伺服器](https://code.claude.com/docs/zh-TW/mcp.md) | 外掛與 skill | Managed |

238| [`strictPluginOnlyCustomization.skills`](#strictpluginonlycustomization-skills) | 封鎖來自使用者與專案來源的 [skill](https://code.claude.com/docs/zh-TW/skills.md) | 外掛與 skill | Managed |238| [`strictPluginOnlyCustomization.skills`](#strictpluginonlycustomization-skills) | 封鎖來自使用者與專案來源的 [skill](https://code.claude.com/docs/zh-TW/skills.md) | 外掛與 skill | Managed |

239| [`subagentPromptCacheTtl`](#subagentpromptcachettl) | 為 subagent 及主要對話以外的其他請求選擇[提示快取存留時間](https://code.claude.com/docs/zh-TW/prompt-caching.md#cache-lifetime) | 模型與回應 | Any file |239| [`subagentPromptCacheTtl`](#subagentpromptcachettl) | 為 subagent 及主要對話以外的其他請求選擇[提示快取存留期](https://code.claude.com/docs/zh-TW/prompt-caching.md#cache-lifetime) | 模型與回應 | Any file |

240| [`switchModelsOnFlag`](#switchmodelsonflag) | 在[安全分類器](https://code.claude.com/docs/zh-TW/model-config.md#ask-before-switching)標記請求時自動切換模型或暫停 | 模型與回應 | Any file |240| [`switchModelsOnFlag`](#switchmodelsonflag) | 當[安全分類器](https://code.claude.com/docs/zh-TW/model-config.md#ask-before-switching)標記請求時,自動切換模型或暫停 | 模型與回應 | Any file |

241| [`syncClaudeAiPlugins`](#syncclaudeaiplugins) | 停止載入[您 claude.ai 帳戶上已啟用的外掛](https://code.claude.com/docs/zh-TW/plugins/loading.md#synced-plugins),並停止下載新的外掛 | 外掛與 skill | User, local, or managed |241| [`syncClaudeAiPlugins`](#syncclaudeaiplugins) | 停止載入[您 claude.ai 帳戶上啟用的外掛](https://code.claude.com/docs/zh-TW/plugins/loading.md#synced-plugins),並停止下載新外掛 | 外掛與 skill | User, local, or managed |

242| [`syncClaudeAiSkills`](#syncclaudeaiskills) | 停止載入[您 claude.ai 帳戶上已啟用的 skill](https://code.claude.com/docs/zh-TW/skills.md#how-synced-skills-behave),並停止下載新的 skill | 外掛與 skill | User, local, or managed |242| [`syncClaudeAiSkills`](#syncclaudeaiskills) | 停止載入[您 claude.ai 帳戶上啟用的 skill](https://code.claude.com/docs/zh-TW/skills.md#how-synced-skills-behave),並停止下載新的 skill | 外掛與 skill | User, local, or managed |

243| [`syntaxHighlightingDisabled`](#syntaxhighlightingdisabled) | 關閉差異與程式碼區塊中的語法醒目提示 | 介面與終端機 | Any file |243| [`syntaxHighlightingDisabled`](#syntaxhighlightingdisabled) | 關閉差異與程式碼區塊中的語法醒目提示 | 介面與終端機 | Any file |

244| [`taskOutputMaxChars`](#taskoutputmaxchars) | 已於 v2.1.277 移除,連同其所設定大小的 `TaskOutput` 工具一併移除 | 記憶與上下文 | Any file |244| [`taskOutputMaxChars`](#taskoutputmaxchars) | 已於 v2.1.277 移除,連同其所設定大小的 `TaskOutput` 工具一併移除 | 記憶與上下文 | Any file |

245| [`teammateDefaultModel`](#teammatedefaultmodel) | 已於 v2.1.234 移除;關於 Claude Code 如何為隊員挑選模型,請參閱[指定隊員與模型](https://code.claude.com/docs/zh-TW/agent-teams.md#specify-teammates-and-models) | 全域設定 | Global config |245| [`teammateDefaultModel`](#teammatedefaultmodel) | 已於 v2.1.234 移除;關於 Claude Code 如何選擇隊員的模型,請參閱[指定隊員與模型](https://code.claude.com/docs/zh-TW/agent-teams.md#specify-teammates-and-models) | 全域設定 | Global config |

246| [`teammateMode`](#teammatemode) | 選擇 [agent team 隊員的顯示方式](https://code.claude.com/docs/zh-TW/agent-teams.md#choose-a-display-mode) | Agent、工作階段與 worktree | Any file |246| [`teammateMode`](#teammatemode) | 選擇 [agent team 隊員的顯示方式](https://code.claude.com/docs/zh-TW/agent-teams.md#choose-a-display-mode) | Agent、工作階段與 worktree | Any file |

247| [`terminalProgressBarEnabled`](#terminalprogressbarenabled) | 在支援終端機進度列的終端機中將其隱藏 | 介面與終端機 | Any file |247| [`terminalProgressBarEnabled`](#terminalprogressbarenabled) | 在支援終端機進度列的終端機中將其隱藏 | 介面與終端機 | Any file |

248| [`terminalTitleFromRename`](#terminaltitlefromrename) | 阻止 [`/rename`](https://code.claude.com/docs/zh-TW/sessions#name-your-sessions) 與 `--name` 變更終端機分頁標題 | 介面與終端機 | Any file |248| [`terminalTitleFromRename`](#terminaltitlefromrename) | 阻止 [`/rename`](https://code.claude.com/docs/zh-TW/sessions#name-your-sessions) 與 `--name` 變更終端機分頁標題 | 介面與終端機 | Any file |

249| [`theme`](#theme) | 選擇內建或自訂的介面[色彩主題](https://code.claude.com/docs/zh-TW/terminal-config.md#match-the-color-theme) | 介面與終端機 | Any file |249| [`theme`](#theme) | 選擇介面的[色彩主題](https://code.claude.com/docs/zh-TW/terminal-config.md#match-the-color-theme),內建或自訂皆可 | 介面與終端機 | Any file |

250| [`timeFormat`](#timeformat) | 以 12 小時制或 24 小時制、UTC,或 strftime 模式顯示介面中的時間 | 介面與終端機 | Any file |250| [`timeFormat`](#timeformat) | 以 12 小時制或 24 小時制、UTC 或 strftime 格式顯示介面中的時間 | 介面與終端機 | Any file |

251| [`timeZone`](#timezone) | 以系統時區以外的時區顯示介面中的時間 | 介面與終端機 | Any file |251| [`timeZone`](#timezone) | 以系統時區以外的時區顯示介面中的時間 | 介面與終端機 | Any file |

252| [`tui`](#tui) | 選擇[全螢幕](https://code.claude.com/docs/zh-TW/fullscreen.md)或傳統終端機渲染器 | 介面與終端機 | Any file |252| [`tui`](#tui) | 選擇[全螢幕](https://code.claude.com/docs/zh-TW/fullscreen.md)或傳統終端機渲染器 | 介面與終端機 | Any file |

253| [`ultracode`](#ultracode) | 讓 Claude 在未經要求的情況下,為每個實質性任務規劃[工作流程](https://code.claude.com/docs/zh-TW/workflows.md#let-claude-decide-with-ultracode) | 模型與回應 | Any file |253| [`ultracode`](#ultracode) | 讓 Claude 在未經要求的情況下,為每個實質任務規劃[工作流程](https://code.claude.com/docs/zh-TW/workflows.md#let-claude-decide-with-ultracode) | 模型與回應 | Any file |

254| [`useAutoModeDuringPlan`](#useautomodeduringplan) | 讓[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)分類器在 [plan mode](https://code.claude.com/docs/zh-TW/permission-modes.md#analyze-before-you-edit-with-plan-mode) 中審查 shell 命令;設為 `false` 則改為顯示提示 | 權限設定 | User, local, or managed |254| [`useAutoModeDuringPlan`](#useautomodeduringplan) | 讓[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)分類器在 [plan mode](https://code.claude.com/docs/zh-TW/permission-modes.md#analyze-before-you-edit-with-plan-mode) 中審查 shell 命令;設為 `false` 則改為顯示提示 | 權限設定 | User, local, or managed |

255| [`verbose`](#verbose) | 顯示[完整的工具輸出](https://code.claude.com/docs/zh-TW/cli-reference.md#cli-flags)而非截斷的摘要;兩者皆有設定時,`viewMode` 優先 | 介面與終端機 | Any file |255| [`verbose`](#verbose) | 顯示[完整工具輸出](https://code.claude.com/docs/zh-TW/cli-reference.md#cli-flags)而非截斷的摘要;兩者皆設定時以 `viewMode` 為優先 | 介面與終端機 | Any file |

256| [`viewMode`](#viewmode) | 以[預設、詳細或專注檢視](https://code.claude.com/docs/zh-TW/cli-reference.md#cli-flags)啟動每個工作階段 | 介面與終端機 | Any file |256| [`viewMode`](#viewmode) | 以 [default、verbose 或 focus 檢視](https://code.claude.com/docs/zh-TW/cli-reference.md#cli-flags)啟動每個工作階段 | 介面與終端機 | Any file |

257| [`vimInsertModeRemaps`](#viminsertmoderemaps) | 將雙鍵 [INSERT 模式序列](https://code.claude.com/docs/zh-TW/interactive-mode.md#remap-insert-mode-key-sequences)(例如 `jj`)對應至 Escape | 介面與終端機 | User or managed |257| [`vimInsertModeRemaps`](#viminsertmoderemaps) | 將兩鍵 [INSERT 模式序列](https://code.claude.com/docs/zh-TW/interactive-mode.md#remap-insert-mode-key-sequences)(例如 `jj`)對應至 Escape | 介面與終端機 | User or managed |

258| [`voice`](#voice) | 開啟[語音聽寫](https://code.claude.com/docs/zh-TW/voice-dictation.md)並選擇按住或點按模式 | 介面與終端機 | Any file |258| [`voice`](#voice) | 開啟[語音聽寫](https://code.claude.com/docs/zh-TW/voice-dictation.md)並選擇按住或點按模式 | 介面與終端機 | Any file |

259| [`voiceEnabled`](#voiceenabled) | 以較舊的單鍵形式開啟[語音聽寫](https://code.claude.com/docs/zh-TW/voice-dictation.md) | 介面與終端機 | Any file |259| [`voiceEnabled`](#voiceenabled) | 以較舊的單鍵形式開啟[語音聽寫](https://code.claude.com/docs/zh-TW/voice-dictation.md) | 介面與終端機 | Any file |

260| [`wheelScrollAccelerationEnabled`](#wheelscrollaccelerationenabled) | 在全螢幕渲染中關閉[滑鼠滾輪加速](https://code.claude.com/docs/zh-TW/fullscreen.md#mouse-wheel-scrolling) | 介面與終端機 | Any file |260| [`wheelScrollAccelerationEnabled`](#wheelscrollaccelerationenabled) | 在全螢幕渲染中關閉[滑鼠滾輪加速](https://code.claude.com/docs/zh-TW/fullscreen.md#mouse-wheel-scrolling) | 介面與終端機 | Any file |

261| [`workflowKeywordTriggerEnabled`](#workflowkeywordtriggerenabled) | 讓提示詞中的 `ultracode` 一詞啟動[工作流程](https://code.claude.com/docs/zh-TW/workflows.md);設為 `false` 則可輸入該詞而不會啟動工作流程 | hook 與自動化 | Any file |261| [`workflowKeywordTriggerEnabled`](#workflowkeywordtriggerenabled) | 讓提示詞中的 `ultracode` 一詞啟動[工作流程](https://code.claude.com/docs/zh-TW/workflows.md);設為 `false` 即可輸入該詞而不啟動工作流程 | hook 與自動化 | Any file |

262| [`workflowSizeGuideline`](#workflowsizeguideline) | 設定 Claude 在[動態工作流程](https://code.claude.com/docs/zh-TW/workflows.md)中目標的 agent 數量 | hook 與自動化 | Any file |262| [`workflowSizeGuideline`](#workflowsizeguideline) | 設定 Claude 在[動態工作流程](https://code.claude.com/docs/zh-TW/workflows.md)中的目標 agent 數量 | hook 與自動化 | Any file |

263| [`worktree`](#worktree) | 設定 Claude Code 如何建立 git [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) | Agent、工作階段與 worktree | Any file |263| [`worktree`](#worktree) | 設定 Claude Code 建立 git [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 的方式 | Agent、工作階段與 worktree | Any file |

264| [`worktree.baseRef`](#worktree-baseref) | 從遠端預設分支或您的本機 HEAD 建立新 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 的分支 | Agent、工作階段與 worktree | Any file |264| [`worktree.baseRef`](#worktree-baseref) | 從遠端預設分支或您的本機 HEAD 建立新 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 的分支 | Agent、工作階段與 worktree | Any file |

265| [`worktree.bgIsolation`](#worktree-bgisolation) | 讓背景工作階段無需 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 即可編輯工作副本 | Agent、工作階段與 worktree | Any file |265| [`worktree.bgIsolation`](#worktree-bgisolation) | 讓背景工作階段不使用 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 即可編輯工作副本 | Agent、工作階段與 worktree | Any file |

266| [`worktree.location`](#worktree-location) | 選擇 [Desktop SSH 工作階段](https://code.claude.com/docs/zh-TW/desktop.md#ssh-sessions)在遠端機器上建立 worktree 的位置 | Agent、工作階段與 worktree | User |266| [`worktree.location`](#worktree-location) | 選擇 [Desktop SSH 工作階段](https://code.claude.com/docs/zh-TW/desktop.md#ssh-sessions)在遠端機器上建立 worktree 的位置 | Agent、工作階段與 worktree | User |

267| [`worktree.sparsePaths`](#worktree-sparsepaths) | 在每個 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 中只簽出您需要的目錄 | Agent、工作階段與 worktree | Any file |267| [`worktree.sparsePaths`](#worktree-sparsepaths) | 在每個 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 中僅簽出您需要的目錄 | Agent、工作階段與 worktree | Any file |

268| [`worktree.symlinkDirectories`](#worktree-symlinkdirectories) | 將大型目錄以符號連結放入每個 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md),而非複製這些目錄 | Agent、工作階段與 worktree | Any file |268| [`worktree.symlinkDirectories`](#worktree-symlinkdirectories) | 以符號連結方式將大型目錄連入每個 [worktree](https://code.claude.com/docs/zh-TW/worktrees.md),而非複製這些目錄 | Agent、工作階段與 worktree | Any file |

269| [`wslInheritsWindowsSettings`](#wslinheritswindowssettings) | 讓 WSL 從 Windows 原則鏈讀取[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md) | 企業與受管設定 | Managed |269| [`wslInheritsWindowsSettings`](#wslinheritswindowssettings) | 讓 WSL 從 Windows 原則鏈讀取[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md) | 企業與受管設定 | Managed |

270 270 

271## 模型與回應271## 模型與回應


2527}2527}

2528```2528```

2529 2529 

2530在 `-p` 執行或 Agent SDK 工作階段中,Claude Code 忽略此鍵。SDK 使用其 `enableFileCheckpointing` 選項開啟檢查點,裸 `-p` 執行需要 `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true`。請參閱 [Agent SDK 中的檔案檢查點](https://code.claude.com/docs/zh-TW/agent-sdk/file-checkpointing.md)。2530在 `-p` 執行或 Agent SDK 工作階段中,Claude Code 會忽略此鍵,除非您組織的[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)將其設定為 `false`,此時檢查點功能會保持關閉。此例外需要 Claude Code v2.1.331 或更高版本。若沒有該 `false`,請使用 SDK 的 `enableFileCheckpointing` 選項開啟檢查點功能,或在裸 `-p` 執行中使用 `CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING=true` 開啟。請參閱 [Agent SDK 中的檔案檢查點](https://code.claude.com/docs/zh-TW/agent-sdk/file-checkpointing.md)。

2531 2531 

2532### `idleCompaction`2532### `idleCompaction`

2533 2533 

Details

92如果接收者無法開啟連結,請檢查以下原因:92如果接收者無法開啟連結,請檢查以下原因:

93 93 

94* **可見性**:工作階段為 **Private**,或者接收者未登入 claude.ai,或在 **Team** 連結的情況下不屬於您的組織。請確認[誰可以開啟連結](#share-a-session)。94* **可見性**:工作階段為 **Private**,或者接收者未登入 claude.ai,或在 **Team** 連結的情況下不屬於您的組織。請確認[誰可以開啟連結](#share-a-session)。

95* **Free 方案**:接收者以 Free 帳戶登入,並被導向升級頁面。請要求對方以具有[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)的帳戶登入。

96* **儲存庫存取權**:連結[需要儲存庫存取權](#share-a-session),而接收者的 GitHub 帳戶無法讀取該儲存庫。請要求對方[連結一個](https://code.claude.com/docs/zh-TW/web-quickstart.md#connect-github)具有讀取權限的帳戶。95* **儲存庫存取權**:連結[需要儲存庫存取權](#share-a-session),而接收者的 GitHub 帳戶無法讀取該儲存庫。請要求對方[連結一個](https://code.claude.com/docs/zh-TW/web-quickstart.md#connect-github)具有讀取權限的帳戶。

97* **上傳或非 GitHub 的程式碼**:連結需要儲存庫存取權,而程式碼是[上傳的](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#send-local-repositories-without-github),或位於 GitLab 或 Bitbucket 等 Git 主機上。請從儲存庫位於 github.com 上且並非上傳而來的工作階段進行分享。96* **上傳或非 GitHub 的程式碼**:連結需要儲存庫存取權,而程式碼是[上傳的](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#send-local-repositories-without-github),或位於 GitLab 或 Bitbucket 等 Git 主機上。請從儲存庫位於 github.com 上且並非上傳而來的工作階段進行分享。

98* **無效的連結**:分享連結可能與您瀏覽器中的網址不符,而且 **Public** 連結在您停止分享後再次分享時會變更。請從 **Share** 複製目前的連結並傳送。97* **無效的連結**:分享連結可能與您瀏覽器中的網址不符,而且 **Public** 連結在您停止分享後再次分享時會變更。請從 **Share** 複製目前的連結並傳送。

99* **組織設定**:組織的 [**Share cloud sessions** 已關閉](#sharing-is-turned-off-for-your-organization)。請要求 Owner 重新開啟。98* **組織設定**:組織的 [**Share cloud sessions** 已關閉](#sharing-is-turned-off-for-your-organization)。請要求 Owner 重新開啟。

100* **已升級的方案**:您分享了 **Public** 連結,之後將方案升級為 Team 或 Enterprise。該連結將遵循 [Enterprise 和 Team 帳戶](#share-from-an-enterprise-or-team-account)的規則。99* **已升級的方案**:您分享了 **Public** 連結,之後將方案升級為 Team 或 Enterprise。該連結將遵循 [Enterprise 和 Team 帳戶](#share-from-an-enterprise-or-team-account)的規則。

100* **已降級的方案**:您分享了 **Public** 連結,之後改用 Free 方案。[升級](https://claude.ai/upgrade)至 Max、Ultra 或 Pro 方案後,同一個連結即可開啟,無需其他步驟。

101 101 

102在以下情況下,您無法恢復連結:102在以下情況下,您無法恢復連結:

103 103 

ship-command.md +3 −3

Details

56* **只保留您想放入 pull request 的檔案(適用於 `/ship`)**:`/ship` 可能會提交您所有未提交的變更,包括新檔案。請在您的 shell 中執行 `git status`。刪除每個您不想放入 pull request 的新檔案,或使用 `git stash push -u -- <file>` 暫存該檔案56* **只保留您想放入 pull request 的檔案(適用於 `/ship`)**:`/ship` 可能會提交您所有未提交的變更,包括新檔案。請在您的 shell 中執行 `git status`。刪除每個您不想放入 pull request 的新檔案,或使用 `git stash push -u -- <file>` 暫存該檔案

57* **這些檔案中沒有機密(適用於 `/ship`)**:`/ship` 是依檔案名稱(例如 `.env`)尋找機密,因此請自行檢查檔案內容。像 `Read(./notes.txt)` 這樣的拒絕規則並不會讓檔案排除在提交之外57* **這些檔案中沒有機密(適用於 `/ship`)**:`/ship` 是依檔案名稱(例如 `.env`)尋找機密,因此請自行檢查檔案內容。像 `Read(./notes.txt)` 這樣的拒絕規則並不會讓檔案排除在提交之外

58* **GitHub 上已開啟的 pull request(適用於 `/steward`)**:它必須是您自己的 pull request,且其分支已在您的本機複本中簽出。若使用 GitHub 以外的主機,請參閱[監看其他主機上的分支](#watch-a-branch-on-another-host)58* **GitHub 上已開啟的 pull request(適用於 `/steward`)**:它必須是您自己的 pull request,且其分支已在您的本機複本中簽出。若使用 GitHub 以外的主機,請參閱[監看其他主機上的分支](#watch-a-branch-on-another-host)

59* **權限模式**:如果您希望 Claude 在無人看管的情況下處理 pull request,請選擇[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)。在其他大多數權限模式中,Claude 會在每個權限提示處等待。在 `bypassPermissions` 模式中,不會開始任何監看。在 plan mode 中,`/ship` 不會啟動59* **權限模式**:如果您希望 Claude 在無人看管的情況下處理 pull request,請選擇[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)。在[手動模式與 `acceptEdits` 模式](https://code.claude.com/docs/zh-TW/permission-modes#available-modes)中,Claude 會在每個權限提示處等待。在 `bypassPermissions` 模式中,不會開始任何監看。在 v2.1.331 或更新版本中,`/ship` 不會在 plan mode 中啟動

60 60 

61在原生 Windows 上,[不會開始任何監看](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#cases-where-no-watch-can-start)。在[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md)中,同樣[不會開始任何監看](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#a-session-setting-blocks-a-watch)。在 v2.1.331 之前,監看可以在該處開始。61在原生 Windows 上,[不會開始任何監看](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#cases-where-no-watch-can-start)。在[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md)中,同樣[不會開始任何監看](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#a-session-setting-blocks-a-watch)。在 v2.1.331 之前,監看可以在該處開始。

62 62 


86 86 

87* **該分支已有他人開啟的 pull request**:`/ship` 不會提交或推送您的工作,也不會開始監看87* **該分支已有他人開啟的 pull request**:`/ship` 不會提交或推送您的工作,也不會開始監看

88* **某個未提交檔案的名稱暗示其為機密,例如 `.env`**:在非公開的儲存庫中,`/ship` 不會提交或推送任何內容。請參閱 [/ship committed or pushed nothing](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#%2Fship-committed-or-pushed-nothing)88* **某個未提交檔案的名稱暗示其為機密,例如 `.env`**:在非公開的儲存庫中,`/ship` 不會提交或推送任何內容。請參閱 [/ship committed or pushed nothing](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#%2Fship-committed-or-pushed-nothing)

89* **該分支已有您自己開啟的 pull request**:在可以開始監看且儲存庫非公開的情況下,`/ship` 可以提交您未提交的變更,然後將這些變更與您尚未推送的提交推送到該 pull request。[在其他情況下](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#your-pull-request-is-already-open),它會略過其中部分工作。如果之後開始監看,您尚未推送的提交[可能會隨 Claude 的下一次推送一起上傳](#keep-working-while-a-watch-runs)。在 v2.1.331 之前,`/ship` 在此情況下不會提交或推送89* **該分支已有您自己開啟的 pull request**:`/ship` 可以提交您未提交的變更,然後將這些變更與您尚未推送的提交推送到該 pull request。[在某些情況下](https://code.claude.com/docs/zh-TW/ship-command-troubleshooting.md#your-pull-request-is-already-open),例如儲存庫是公開的或已開啟自動合併,它不會提交您的變更。如果之後開始監看,您尚未推送的提交[可能會隨 Claude 的下一次推送一起上傳](#keep-working-while-a-watch-runs)。在 v2.1.331 之前,`/ship` 在此情況下不會提交或推送

90* **儲存庫是公開的**:`/ship` 不會提交您未提交的變更。如果您位於預設分支以外的分支,且該分支有自己的提交,`/ship` 會推送這些提交並開啟 pull request,但不包含您未提交的變更。否則,請在預設分支以外的分支上提交您的工作,然後再次執行 `/ship`90* **儲存庫是公開的**:`/ship` 不會提交您未提交的變更。如果您位於預設分支以外的分支,且該分支有自己的提交,`/ship` 會推送這些提交並開啟 pull request,但不包含您未提交的變更。否則,請在預設分支以外的分支上提交您的工作,然後再次執行 `/ship`

91* **您的提交位於預設分支上,且沒有未提交的內容**:在非公開的儲存庫中,`/ship` 會為這些提交建立新分支、推送該分支、開啟 pull request,並將您的簽出切換到新分支。在 v2.1.331 之前,`/ship` 不會推送任何內容,因此請將這些提交放到預設分支以外的分支上,然後再次執行 `/ship`91* **您的提交位於預設分支上,且沒有未提交的內容**:在非公開的儲存庫中,`/ship` 會為這些提交建立新分支、推送該分支、開啟 pull request,並將您的簽出切換到新分支。在 v2.1.331 之前,`/ship` 不會推送任何內容,因此請將這些提交放到預設分支以外的分支上,然後再次執行 `/ship`

92 92 


254| 情況 | 會發生什麼 |254| 情況 | 會發生什麼 |

255| :- | :- |255| :- | :- |

256| 該 pull request 已開啟自動合併 | 一旦檢查與審查允許,託管平台就會合併。Claude 在監看期間所做的事,例如推送修正,可能促成這一點。若要在 GitHub 上關閉它,請在您的 shell 中執行 `gh pr merge --disable-auto <number>` |256| 該 pull request 已開啟自動合併 | 一旦檢查與審查允許,託管平台就會合併。Claude 在監看期間所做的事,例如推送修正,可能促成這一點。若要在 GitHub 上關閉它,請在您的 shell 中執行 `gh pr merge --disable-auto <number>` |

257| 在終端機工作階段中,您在 Claude 閒置時輸入訊息 | 在 Claude 回答您的訊息時,[Claude Code 的限制](#what-claude-code-blocks-during-a-watch)會關閉。在這段期間,Claude 處理抵達的背景任務結果時,這些限制也會關閉。在自動模式中,Claude 此時可能被允許進行合併 |257| 在終端機工作階段中,您在 Claude 閒置時輸入訊息 | 在 Claude 回答您的訊息時,[Claude Code 的限制](#what-claude-code-blocks-during-a-watch)會關閉。Claude 處理在這段期間抵達的背景任務結果時,這些限制也會關閉。在自動模式中,Claude 此時可能被允許進行合併 |

258| 在 v2.1.331 之前,您在審查或監看期間,將在終端機中啟動的工作階段送到背景,例如按下 `←` | 監看會結束。進行中的工作可能會在那裡繼續,且不受這些限制約束。若要結束該工作,請[停止該工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#manage-sessions-from-the-shell) |258| 在 v2.1.331 之前,您在審查或監看期間,將在終端機中啟動的工作階段送到背景,例如按下 `←` | 監看會結束。進行中的工作可能會在那裡繼續,且不受這些限制約束。若要結束該工作,請[停止該工作階段](https://code.claude.com/docs/zh-TW/agent-view.md#manage-sessions-from-the-shell) |

259 259 

260### 適用於 /ship 和 /steward 的權限規則與 hook260### 適用於 /ship 和 /steward 的權限規則與 hook

Details

107 107 

108| 訊息 | 代表意義 | 處理方式 |108| 訊息 | 代表意義 | 處理方式 |

109| :- | :- | :- |109| :- | :- | :- |

110| `/ship didn't commit your uncommitted work` | 在可以啟動 watch 的情況下,審查與 watch 會在不包含該工作的情況下繼續進行,而您尚未推送的提交[可能會隨 Claude 的下一次推送一併送出](https://code.claude.com/docs/zh-TW/ship-command.md#keep-working-while-a-watch-runs)。導致此情況的例子包括:公開儲存庫、已開啟自動合併、正在進行合併或 rebase,或是[無法啟動 watch](#no-watch-started) 的工作階段 | 如果訊息提供了 `git push` 這一行,請自行提交該工作,然後執行那一行。否則,請在訊息指示時再次執行 `/ship` |110| `/ship didn't commit your uncommitted work` | 導致此情況的原因包括:公開儲存庫、已開啟自動合併,以及正在進行合併或 cherry-pick。如果[無法啟動 watch](#no-watch-started),審查會涵蓋您未提交的工作。否則,審查不會涵蓋該工作,而您尚未推送的提交[可能會隨 Claude 的下一次推送一併送出](https://code.claude.com/docs/zh-TW/ship-command.md#keep-working-while-a-watch-runs) | 如果訊息提供了 `git push` 這一行,請自行提交該工作,然後執行那一行。否則,請在訊息指示時再次執行 `/ship` |

111| `Nothing pushed` 或 `Nothing committed or pushed`,並附有一句關於您尚未推送之提交的說明 | `/ship` 保留了這些提交而未推送。不會啟動任何審查或 watch,而該 pull request 上正在執行的 watch 也會結束。其中一個原因是這些提交中含有名稱如 `password.txt` 的檔案 | 如果這些提交應該推送,請執行訊息中的 `git push` 這一行。如果不應推送,請從每個尚未推送的提交中移除該檔案。然後再次執行 `/ship` |111| `Nothing pushed` 或 `Nothing committed or pushed`,並附有一句關於您尚未推送之提交的說明 | `/ship` 保留了這些提交而未推送。不會啟動任何審查或 watch,而該 pull request 上正在執行的 watch 也會結束。其中一個原因是這些提交中含有名稱如 `password.txt` 的檔案 | 如果這些提交應該推送,請執行訊息中的 `git push` 這一行。如果不應推送,請從每個尚未推送的提交中移除該檔案。然後再次執行 `/ship` |

112 112 

113在 v2.1.331 之前,`/ship` 不會顯示上述任何一則訊息。一旦 pull request 已開啟,它就不會提交您未提交的工作,因此請自行提交,然後推送,例如在 shell 中執行 `git push origin <branch>`。它不會保留您尚未推送的提交,這些提交[可能會隨 Claude 的下一次推送一併送出](https://code.claude.com/docs/zh-TW/ship-command.md#keep-working-while-a-watch-runs)。113在 v2.1.331 之前,`/ship` 不會顯示上述任何一則訊息。一旦 pull request 已開啟,它就不會提交您未提交的工作,因此請自行提交,然後推送,例如在 shell 中執行 `git push origin <branch>`。它不會保留您尚未推送的提交,這些提交[可能會隨 Claude 的下一次推送一併送出](https://code.claude.com/docs/zh-TW/ship-command.md#keep-working-while-a-watch-runs)。


239 239 

240請保留儲存庫中的 `.claude/skills/steward/SKILL.md` 原樣,因為 PR Steward 和 watch 會將其作為指令讀取。這兩則訊息都不會將此檔案計算在內,因此提到 `/steward` 的訊息是關於其他 skill 或命令。240請保留儲存庫中的 `.claude/skills/steward/SKILL.md` 原樣,因為 PR Steward 和 watch 會將其作為指令讀取。這兩則訊息都不會將此檔案計算在內,因此提到 `/steward` 的訊息是關於其他 skill 或命令。

241 241 

242### 保留自訂的 /ship 或 /steward 而不重新命名

243 

244如果您已建立名為 `/ship` 或 `/steward` 的自訂 skill 或命令,且不希望內建版本覆寫它,可以將內建版本關閉。若要這麼做,請使用 `CLAUDE_CODE_DISABLE_SHIP` 環境變數,它會同時關閉這兩個命令,且需要 Claude Code v2.1.331 或更新版本。在設定它之前,請先[移除 `skillOverrides` 下針對您命令的任何 `"off"` 項目](#a-skilloverrides-entry-turns-off-%2Fship-or-%2Fsteward)。

245 

246將此 [`env`](https://code.claude.com/docs/zh-TW/settings-reference#env) 項目新增至您的[使用者設定檔](https://code.claude.com/docs/zh-TW/settings.md#settings-files-and-who-they-affect),或新增至專案的 `.claude/settings.json`(適用於所有在其頂層資料夾中啟動工作階段的人),然後重新啟動 Claude Code:

247 

248```json theme={null}

249{

250 "env": {

251 "CLAUDE_CODE_DISABLE_SHIP": "1"

252 }

253}

254```

255 

256若要確認您的命令已載入,請在 Claude Code 提示字元中輸入 `/`,並尋找其描述或第一行。

257 

258如果您的命令名為 `steward`,且儲存庫中有 `.claude/skills/steward/SKILL.md` 檔案,請查看[實際執行的是哪一個](https://code.claude.com/docs/zh-TW/skills.md#resolve-skills-that-share-a-name)。

259 

242## 相關資源260## 相關資源

243 261 

244* [`/ship` 和 `/steward`](https://code.claude.com/docs/zh-TW/ship-command):這些命令的作用、如何執行它們,以及 watch 期間對 Claude 的限制262* [`/ship` 和 `/steward`](https://code.claude.com/docs/zh-TW/ship-command):這些命令的作用、如何執行它們,以及 watch 期間對 Claude 的限制

skills.md +4 −2

Details

258* 不使用 `/login` 儲存的登入的工作階段,例如使用 API 金鑰進行驗證的工作階段,或 `ANTHROPIC_AUTH_TOKEN`、`CLAUDE_CODE_OAUTH_TOKEN` 或 `apiKeyHelper` 指令碼提供認證的工作階段258* 不使用 `/login` 儲存的登入的工作階段,例如使用 API 金鑰進行驗證的工作階段,或 `ANTHROPIC_AUTH_TOKEN`、`CLAUDE_CODE_OAUTH_TOKEN` 或 `apiKeyHelper` 指令碼提供認證的工作階段

259* 不擷取功能旗標的工作階段,例如 Amazon Bedrock 上的工作階段或您設定 `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` 的工作階段259* 不擷取功能旗標的工作階段,例如 Amazon Bedrock 上的工作階段或您設定 `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` 的工作階段

260* [裸機模式](https://code.claude.com/docs/zh-TW/headless.md#start-faster-with-bare-mode)中的工作階段或您使用 `--safe-mode` 啟動的工作階段260* [裸機模式](https://code.claude.com/docs/zh-TW/headless.md#start-faster-with-bare-mode)中的工作階段或您使用 `--safe-mode` 啟動的工作階段

261* 您的組織的受管設定[將技能鎖定到外掛程式來源](https://code.claude.com/docs/zh-TW/settings-reference.md#strictpluginonlycustomization-skills)的工作階段,或您使用省略 `user` 的 [`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 清單啟動的工作階段261* 受管設定[將 skill 鎖定到外掛來源](https://code.claude.com/docs/zh-TW/settings-reference.md#strictpluginonlycustomization-skills)的工作階段,或您使用省略 `user` 的 [`--setting-sources`](https://code.claude.com/docs/zh-TW/cli-reference#cli-flags) 清單啟動的工作階段

262 262 

263如果您在工作階段期間使用 `/login` 登入,請重新啟動 Claude Code 以開始同步。263如果您在工作階段期間使用 `/login` 登入,請重新啟動 Claude Code 以開始同步。

264 264 


425| `user-invocable` | 否 | 當只有 Claude 應調用 skill 時設定為 `false`:Claude Code 將其從 `/` 菜單中隱藏,當您鍵入 `/name` 時不運行它。用於使用者不應直接調用的背景知識。預設值:`true`。 |425| `user-invocable` | 否 | 當只有 Claude 應調用 skill 時設定為 `false`:Claude Code 將其從 `/` 菜單中隱藏,當您鍵入 `/name` 時不運行它。用於使用者不應直接調用的背景知識。預設值:`true`。 |

426| `allowed-tools` | 否 | Claude 在調用此 skill 的回合中可以使用而無需請求許可的工具。當您發送下一條訊息時,授予清除。接受以空格或逗號分隔的字串或 YAML 列表。請參閱[為 skill 預先批准工具](#pre-approve-tools-for-a-skill)。 |426| `allowed-tools` | 否 | Claude 在調用此 skill 的回合中可以使用而無需請求許可的工具。當您發送下一條訊息時,授予清除。接受以空格或逗號分隔的字串或 YAML 列表。請參閱[為 skill 預先批准工具](#pre-approve-tools-for-a-skill)。 |

427| `disallowed-tools` | 否 | 此 skill 處於活動狀態時從 Claude 的可用工具池中移除的工具。用於不應呼叫某些工具的自主 skills,例如背景迴圈的 `AskUserQuestion`。接受以空格或逗號分隔的字串或 YAML 列表。當您發送下一條訊息時,限制清除。與拒絕規則一樣,當任何其他工具保持時,該欄位無法移除[`EndConversation`](https://code.claude.com/docs/zh-TW/tools-reference#endconversation-tool-behavior)。 |427| `disallowed-tools` | 否 | 此 skill 處於活動狀態時從 Claude 的可用工具池中移除的工具。用於不應呼叫某些工具的自主 skills,例如背景迴圈的 `AskUserQuestion`。接受以空格或逗號分隔的字串或 YAML 列表。當您發送下一條訊息時,限制清除。與拒絕規則一樣,當任何其他工具保持時,該欄位無法移除[`EndConversation`](https://code.claude.com/docs/zh-TW/tools-reference#endconversation-tool-behavior)。 |

428| `model` | 否 | 此 skill 處於活動狀態時要使用的模型。覆蓋適用於目前回合的其餘部分,不會保存到設定。當您發送下一個提示時,工作階段模型恢復。接受與[`/model`](https://code.claude.com/docs/zh-TW/model-config)相同的值,或 `inherit` 以保持活動模型。您組織的[`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection)允許清單排除的值不被使用,工作階段保持其目前模型。在[自動模式](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)中,以及在[計畫模式中,當分類器檢查命令時](https://code.claude.com/docs/zh-TW/permission-modes.md#analyze-before-you-edit-with-plan-mode),自動模式不支援的模型也不被使用,工作階段保持其目前模型。使用 `context: fork` 時,該值設定[分叉子代理的模型](#run-skills-in-a-subagent),排除的值遵循[與子代理模型覆蓋相同的規則](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)。 |428| `model` | 否 | 當您[以 `/name` 執行此 skill](#where-you-write-the-skills-name)時,該回合使用的模型。接受 [`/model`](https://code.claude.com/docs/zh-TW/model-config) 的值,或 `inherit` 以使用目前使用中的模型。當 Claude 執行此 skill 時,工作階段保留其模型。當您的[組織封鎖該值](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)、[plan mode 升級](https://code.claude.com/docs/zh-TW/model-config.md#opusplan-model-setting)生效中,或[自動模式的分類器已開啟](https://code.claude.com/docs/zh-TW/permission-modes.md#eliminate-prompts-with-auto-mode)且不支援該值時,也是如此。使用 `context: fork` 時,該值為分叉 subagent 的[每次調用模型](https://code.claude.com/docs/zh-TW/sub-agents.md#choose-a-model)。 |

429| `effort` | 否 | 目前回合其餘部分的[effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)。覆寫工作階段 effort 等級,但不覆寫 [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/zh-TW/env-vars#variables) 環境變數。使用 `context: fork` 時,該值改為設定分叉 subagent 的 effort 等級。省略時,等級依[effort 解析順序](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)決定。若分叉使用其他模型,請參閱[subagents 和 teammates 的 effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#effort-level-of-subagents-and-teammates)。選項:`low`、`medium`、`high`、`xhigh`、`max`;可用等級取決於模型。 |429| `effort` | 否 | 目前回合其餘部分的[effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)。覆寫工作階段 effort 等級,但不覆寫 [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/zh-TW/env-vars#variables) 環境變數。使用 `context: fork` 時,該值改為設定分叉 subagent 的 effort 等級。省略時,等級依[effort 解析順序](https://code.claude.com/docs/zh-TW/model-config.md#adjust-effort-level)決定。若分叉使用其他模型,請參閱[subagents 和 teammates 的 effort 等級](https://code.claude.com/docs/zh-TW/model-config.md#effort-level-of-subagents-and-teammates)。選項:`low`、`medium`、`high`、`xhigh`、`max`;可用等級取決於模型。 |

430| `context` | 否 | 設定為 `fork` 以在分叉子代理上下文中運行。請參閱[在子代理中運行 skills](#run-skills-in-a-subagent)。 |430| `context` | 否 | 設定為 `fork` 以在分叉子代理上下文中運行。請參閱[在子代理中運行 skills](#run-skills-in-a-subagent)。 |

431| `agent` | 否 | 設定 `context: fork` 時要使用的子代理類型。 |431| `agent` | 否 | 設定 `context: fork` 時要使用的子代理類型。 |


821 821 

822在自動模式中,原本需要您批准的命令不會中止呼叫。技能會載入一個指示,告訴 Claude 先執行命令,然後 Claude 自己的呼叫會通過[自動模式的常規檢查](https://code.claude.com/docs/zh-TW/permission-modes.md#how-the-classifier-evaluates-actions)。在設定 `agent` 的[分叉技能](#run-skills-in-a-subagent)中,以及在 Claude 沒有[執行注入命令的 shell 工具](#how-injected-commands-run)的工作階段中,呼叫仍會中止。822在自動模式中,原本需要您批准的命令不會中止呼叫。技能會載入一個指示,告訴 Claude 先執行命令,然後 Claude 自己的呼叫會通過[自動模式的常規檢查](https://code.claude.com/docs/zh-TW/permission-modes.md#how-the-classifier-evaluates-actions)。在設定 `agent` 的[分叉技能](#run-skills-in-a-subagent)中,以及在 Claude 沒有[執行注入命令的 shell 工具](#how-injected-commands-run)的工作階段中,呼叫仍會中止。

823 823 

824`PreToolUse` hook 不會針對在 skill 載入時執行的注入命令觸發。若要記錄或封鎖通過權限檢查的命令,請使用 [`PreSkillShellCommand` hook](https://code.claude.com/docs/zh-TW/hooks#preskillshellcommand)。

825 

824### 在子代理中執行技能826### 在子代理中執行技能

825 827 

826當您希望技能在隔離環境中執行時,請在 frontmatter 中新增 `context: fork`。Claude Code 會啟動在 `agent` 欄位中設定的類型的新子代理,並將技能內容作為其提示提供。子代理看不到您的對話歷史記錄,所以技能的指示必須獨立存在。828當您希望技能在隔離環境中執行時,請在 frontmatter 中新增 `context: fork`。Claude Code 會啟動在 `agent` 欄位中設定的類型的新子代理,並將技能內容作為其提示提供。子代理看不到您的對話歷史記錄,所以技能的指示必須獨立存在。

slack.md +4 −243

Details

4 4 

5# Slack 中的 Claude Code5# Slack 中的 Claude Code

6 6 

7> 從 Slack 委派編碼任務。此較早版本僅在未連接 Claude Tag 的工作區中,回應來自 Pro、Max 和 Ultra 帳戶的提及。7> 在 Team、Enterprise、Pro、Max 和 Ultra 方案上,可用來取代較早版本 Slack 中的 Claude Code 的選項。

8 8 

9> [!WARNING]9較早版本的 Slack 中的 Claude Code 已停用。在未連接 Claude Tag 的工作區中,`@Claude` 會回覆該工作區尚未設定 Claude Tag。

10>

11> 此較早的 Slack 中的 Claude Code 僅回應來自 Pro、Max 和 Ultra 帳戶的頻道 @提及,且僅限於沒有任何組織將其連接到 [Claude Tag](https://claude.com/product/tag) 的 Slack 工作區。每個工作階段都以個別使用者的帳戶運行。Claude Tag 以 @Claude 身份作為您組織的共享身份運行,具有管理員設定的存取權限。

12>

13> * **Pro、Max 和 Ultra 方案:** Claude Tag 在個人方案上不可用,因此請在未連接 Claude Tag 的工作區中[設定此版本](#setting-up-claude-code-in-slack)。

14> * **Team 和 Enterprise 方案:** 您現有的 Slack 應用程式和 @Claude 控制代碼保持不變。[設定 Claude Tag](https://claude.com/docs/claude-tag/overview) 以建立新工作區;若要移動已使用此版本的工作區,請參閱[從較早的 Slack 中的 Claude 遷移](https://claude.com/docs/claude-tag/admins/migrate-from-earlier)。

15> * **收到通知而非回答:** 請查閱 @Claude 回覆的[設定通知](#this-workspace-isnt-set-up-for-claude-tag-yet)或[停用通知](#the-legacy-claude-in-slack-bot-is-retired)。

16 10 

17Slack 中的 Claude Code 將 Claude Code 的強大功能直接帶入您的 Slack 工作區。當您提及 `@Claude` 並附帶編碼任務時,Claude 會自動檢測意圖並在雲端建立 Claude Code 工作階段,讓您無需離開團隊對話即可委派開發工作。11* **Team 和 Enterprise 方案:** 如果您的頻道中有 [Claude Tag](https://claude.com/docs/claude-tag/overview),請使用它。如果沒有,請參閱[如何設定](https://claude.com/docs/claude-tag/admins/setup-overview)。若要從較早版本移動工作區,請參閱[遷移指南](https://claude.com/docs/claude-tag/admins/migrate-from-earlier)。

18 12* **Pro、Max 和 Ultra 方案:** Claude Tag 在個人方案上不可用。如果您的帳戶有 [Projects](https://code.claude.com/docs/zh-TW/claude-projects.md),請在其中啟動任務,或在[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)中啟動。

19此整合建立在現有的 Claude for Slack 應用程式基礎上,但為編碼相關請求添加了智能路由到雲端的 Claude Code。每個工作階段在您自己的 Claude 帳戶下運行,使用您連接的儲存庫和您的方案限制。

20 

21## 使用案例

22 

23* **錯誤調查和修復**:描述錯誤並要求 Claude 調查和修復。

24* **快速程式碼審查和修改**:讓 Claude 實作小功能或重構程式碼。

25* **並行任務執行**:在 Slack 中啟動編碼任務,同時繼續其他工作,完成時接收通知。

26 

27## 先決條件

28 

29在使用 Slack 中的 Claude Code 之前,請確保您具有以下條件:

30 

31| 要求 | 詳情 |

32| :- | :- |

33| Claude 計畫 | Pro、Max 或 Ultra |

34| Slack 工作區 | 未被任何組織連接到 [Claude Tag](https://claude.com/docs/claude-tag/overview)。如果 @Claude 回覆[停用通知](#the-legacy-claude-in-slack-bot-is-retired),表示該工作區已連接 |

35| 雲端工作階段 | [雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)已為您的帳戶啟用 |

36| GitHub 帳戶 | 在 [claude.ai/code](https://claude.ai/code) 連接,至少有一個存儲庫已驗證 |

37| Slack 驗證 | 您的 Slack 帳戶通過 Claude 應用程式連接到您的 Claude 帳戶 |

38 

39## 在 Slack 中設定 Claude Code

40 

41**1. 在 Slack 中安裝 Claude 應用程式**

42 

43工作區管理員必須從 Slack 應用程式市場安裝 Claude 應用程式。訪問 [Slack 應用程式市場](https://slack.com/marketplace/A08SF47R6P4) 並點擊「Add to Slack」以開始安裝程序。

44 

45**2. 連接您的 Claude 帳戶**

46 

47應用程式安裝後,驗證您的個人 Claude 帳戶:

48 

491. 通過點擊您的應用程式部分中的「Claude」在 Slack 中開啟 Claude 應用程式

502. 開啟應用程式首頁標籤

513. 點擊 **Connect Claude account** 以將您的 Slack 帳戶與您的 Claude 帳戶連接

524. 在您的瀏覽器中完成驗證流程

53 

54**3. 設定雲端工作階段**

55 

56確保雲端工作階段已為您的帳戶正確設定:

57 

58* 訪問 [claude.ai/code](https://claude.ai/code) 並使用您連接到 Slack 的同一帳戶登入

59* 如果尚未連接,請連接您的 GitHub 帳戶

60* 驗證至少一個您希望 Claude 使用的存儲庫

61 

62**4. 選擇您的路由模式**

63 

64連接帳戶後,設定 Claude 如何在 Slack 中處理您的訊息。開啟 Slack 中的 Claude 應用程式首頁以找到**路由模式**設定。

65 

66| 模式 | 行為 |

67| :- | :- |

68| **僅代碼** | Claude 將所有 @mentions 路由到 Claude Code 工作階段。最適合使用 Claude in Slack 專門用於開發任務的團隊。 |

69| **代碼 + 聊天** | Claude 分析每條訊息並智能地在 Claude Code(用於編碼任務)和 Claude Chat(用於寫作、分析和一般問題)之間路由。最適合希望為所有類型工作提供單一 @Claude 入口點的團隊。 |

70 

71> [!NOTE]

72>

73> 在代碼 + 聊天模式中,如果 Claude 在 Chat 中回答但您想要的是編碼工作階段,請在該回覆上點擊 **Switch to code repo...** 並選擇一個儲存庫。Claude 隨後會改以您的訊息啟動 Claude Code 工作階段。

74 

75**5. 將 Claude 新增到頻道**

76 

77Claude 在安裝後不會自動新增到任何頻道。要在頻道中使用 Claude,請通過在該頻道中輸入 `/invite @Claude` 來邀請它。Claude 只能在已新增它的頻道中回應 @mentions。

78 

79## 工作原理

80 

81### 自動檢測

82 

83在 Code + Chat 路由模式中,當您在 Slack 頻道或執行緒中提及 @Claude 時,Claude 會自動偵測您的訊息是否為編碼任務。編碼任務會被路由到 Claude Code 雲端工作階段。其他任何內容都會收到常規聊天回覆。在 Code 專用模式中,每個 @mention 都會進入 Claude Code。

84 

85您也可以明確告訴 Claude 將請求作為編碼任務處理,即使它沒有自動檢測到。

86 

87> [!NOTE]

88>

89> Slack 中的 Claude Code 僅在頻道(公開或私人)中工作。它在直接訊息 (DM) 中不起作用。

90 

91### 背景資訊收集

92 

93* **來自執行緒**:當您首次在執行緒中 @mention Claude 時,它會從該執行緒中您的訊息及其自身的訊息收集背景資訊。

94* **來自頻道**:當您直接在頻道中 @mention Claude 時,它會查看您在該頻道中的最近訊息及其自身的訊息,以及該頻道的名稱、主題和描述。

95 

96此背景資訊幫助 Claude 理解問題、選擇適當的儲存庫並指導其任務方法。若要將隊友撰寫的內容(例如錯誤報告)提供給 Claude,請將其文字貼到您 @mention Claude 的訊息中。

97 

98> [!WARNING]

99>

100> 當在 Slack 中調用 @Claude 時,Claude 會獲得對對話背景資訊的存取權限以更好地理解您的請求。Claude 可能會遵循背景資訊中其他訊息的指示,因此使用者應確保僅在受信任的 Slack 對話中使用 Claude。

101 

102### 工作階段流程

103 

1041. **啟動**:您 @mention Claude 並提出編碼請求

1052. **檢測**:Claude 分析您的訊息並檢測編碼意圖

1063. **工作階段建立**:在 claude.ai/code 上建立新的 Claude Code 工作階段

1074. **進度更新**:Claude 在工作進行時向您的 Slack 執行緒發佈狀態更新

1085. **完成**:完成後,Claude 會更新其在執行緒中的訊息,附上最終回應和操作按鈕,並向您傳送一則連結至該訊息的直接訊息

1096. **審查**:點擊 **View session** 以查看完整逐字稿,或點擊 **Create PR** 以開啟 pull request

110 

111## 用戶介面元素

112 

113### 訊息操作

114 

115* **View session**:在您的瀏覽器中打開完整的 Claude Code 工作階段,您可以在其中查看所有執行的工作、繼續工作階段或提出其他請求。

116* **Create PR**:開啟該工作階段分支的 GitHub 比較頁面,您可以在該頁面建立 pull request。此按鈕會在工作階段完成後,出現在 Claude 於工作階段開始時發布的狀態訊息上。

117* **Switch to code repo...**:如果 Claude 在 Chat 中回應,但您想要的是編碼工作階段,請點擊此按鈕並選擇一個儲存庫,Claude 便會以您的原始請求啟動 Claude Code 工作階段。

118 

119### 存儲庫選擇

120 

121Claude 根據您的 Slack 對話中的背景資訊自動選擇儲存庫。如果 Claude 無法判斷您指的是哪個儲存庫,它會請您選擇:點擊 **Select repository** 並從清單中選擇一個。

122 

123## 存取和權限

124 

125### 用戶級別存取

126 

127| 存取類型 | 要求 |

128| :- | :- |

129| Claude Code 工作階段 | 每個用戶在其自己的 Claude 帳戶下運行工作階段 |

130| 使用情況和速率限制 | 工作階段計入個人用戶的計畫限制 |

131| 存儲庫存取 | 用戶只能存取他們個人連接的存儲庫 |

132| 工作階段歷史記錄 | 工作階段出現在您的 Claude Code 歷史記錄中,位於 claude.ai/code |

133 

134### 工作區級別存取

135 

136Slack 工作區管理員控制 Claude 應用程式是否可在其工作區中使用:

137 

138| 控制 | 描述 |

139| :- | :- |

140| 應用程式安裝 | 工作區管理員決定是否從 Slack 應用程式市場安裝 Claude 應用程式 |

141| Enterprise Grid 分發 | 對於 Enterprise Grid 組織,組織管理員可以控制哪些工作區有權存取 Claude 應用程式 |

142| 應用程式移除 | 從工作區移除應用程式會立即撤銷該工作區中所有用戶的存取權限 |

143 

144### 基於頻道的存取控制

145 

146安裝應用程式不會將 Claude 添加到任何頻道。Claude 只在已添加它的頻道中回應 @mentions;使用 `/invite @Claude` 邀請它。它在公開和私人頻道中都可以工作。管理員可以通過管理 Claude 被邀請到哪些頻道以及誰有權存取這些頻道來控制誰使用 Claude Code。這在工作區級別權限之外增加了一層存取控制。

147 

148## 在何處可以存取什麼

149 

150**在 Slack 中**:您將看到狀態更新、完成摘要和操作按鈕。完整記錄被保留並始終可存取。

151 

152**在 claude.ai/code**:完整的 Claude Code 工作階段,包含完整對話歷史記錄、所有代碼更改和檔案操作。工作階段保存在您的 Claude Code 歷史記錄中,位於 [claude.ai/code](https://claude.ai/code),您可以在其中繼續過去的工作階段、參考它們或建立拉取請求。

153 

154對於 Enterprise 和 Team 帳戶,從 Slack 中的 Claude 建立的工作階段會自動對組織可見。有關更多詳情,請參閱 [雲端工作階段共享](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md#share-sessions)。

155 

156## 最佳實踐

157 

158### 撰寫有效的請求

159 

160* **具體明確**:在相關時提供檔案名稱、函式名稱或錯誤訊息。

161* **提供背景資訊**:請提及儲存庫或專案。

162* **定義成功**:解釋「完成」的樣子。Claude 應該撰寫測試嗎?更新文件?建立 PR?

163 

164### 何時使用 Slack 與網頁

165 

166**使用 Slack 的時機**:您想非同步啟動任務,或您正在與需要可見性的隊友協作。

167 

168**直接使用網頁的時機**:您需要上傳檔案、想要在開發期間進行即時互動,或正在處理更長、更複雜的任務。

169 

170## 故障排除

171 

172### "This workspace isn't set up for Claude Tag yet"

173 

174當以下兩項條件皆成立時,@Claude 會在討論串中回覆此通知,而非提供答案:

175 

176* 沒有任何組織已將您的 Slack 工作區連接到 [Claude Tag](https://claude.com/docs/claude-tag/overview)。

177* 您在 Slack 中連結的 Claude 帳戶不是 Pro、Max 或 Ultra 方案。

178 

179Claude Tag 適用於 Team 和 Enterprise 方案。若要連接工作區,請從通知中提到的 `@Claude connect` 命令開始,然後依照[設定 Claude Tag](https://claude.com/docs/claude-tag/overview) 進行。

180 

181### "The legacy Claude in Slack bot is retired"

182 

183此通知的開頭為 `The legacy Claude in Slack bot is retired effective October 5, 2026 and no longer responds in channels.`。您的 Slack 工作區已連接到某個 Claude 組織,但在該組織的 Claude Tag 設定中,頻道、工作區或組織預設值仍選擇了舊版本。此通知與您自己的方案無關,因此 Pro、Max 和 Ultra 帳戶也會收到。

184 

185如果您是該組織的擁有者,請開啟 [Claude 管理設定](https://claude.ai/admin-settings/claude-tag),並為該頻道開啟 Claude Tag。若要修正所有繼承此設定的頻道,請改為在工作區或組織預設值上變更設定。如需完整的遷移說明,請參閱[從舊版 Claude in Slack 遷移](https://claude.com/docs/claude-tag/admins/migrate-from-earlier)。如果您不是擁有者,請將此項目傳送給擁有者。

186 

187### "Claude Code 未為您的帳戶啟用"

188 

189此錯誤表示您的 Claude 帳戶尚未有雲端環境。使用您連接到 Slack 的同一帳戶登入 [claude.ai/code](https://claude.ai/code) 一次,並完成[網路快速入門](https://code.claude.com/docs/zh-TW/web-quickstart.md#connect-github),這會建立您的預設雲端環境或要求您建立它。錯誤會在您下次提及時清除。每位使用者必須個別執行此操作。

190 

191### 工作階段未啟動

192 

1931. 驗證您的 Claude 帳戶已在 Claude 應用程式首頁中連接

1942. 檢查您的帳戶是否已啟用雲端工作階段

1953. 確保您至少有一個 GitHub 存儲庫連接到 Claude Code

196 

197### 來自 Claude Tag 頻道的工作階段無法啟動

198 

199此項目適用於使用 [Claude Tag](https://claude.com/docs/claude-tag/overview) 的工作區。如果您在 [claude.ai/code](https://claude.ai/code) 建立了頻道的雲端環境,它屬於您的個人帳戶,Claude 無法在個人環境中啟動頻道工作階段。Claude Code 會立即使工作階段失敗,重試也無法幫助。

200 

201如果您是擁有者且環境是您自己的,請從環境選擇器[與組織共享](https://code.claude.com/docs/zh-TW/cloud-environments.md#organization-shared-environments)。否則,擁有者應從[管理設定](https://claude.ai/admin-settings)中的**雲端環境**頁面將其重新建立為組織共享環境。

202 

203您可以透過兩種方式應用它:

204 

205* 在 [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code) 將其設定為組織預設值。

206* [在 Claude Tag 管理設定中的頻道上設定它](https://claude.com/docs/claude-tag/admins/troubleshooting#channel-sessions-use-the-wrong-environment-or-can%E2%80%99t-find-one)。

207 

208如果您不是擁有者,請將此項目傳送給擁有者。

209 

210### 存儲庫未顯示

211 

2121. 在 [claude.ai/code](https://claude.ai/code) 連接存儲庫

2132. 驗證您對該存儲庫的 GitHub 權限

2143. 嘗試斷開並重新連接您的 GitHub 帳戶

215 

216### 選擇了錯誤的存儲庫

217 

218在您的請求中包括儲存庫名稱以獲得更準確的選擇。

219 

220### 驗證錯誤

221 

2221. 在應用程式首頁中斷開並重新連接您的 Claude 帳戶

2232. 確保您在瀏覽器中登入正確的 Claude 帳戶

224 

225## 目前限制

226 

227* **僅 GitHub**:存儲庫必須在 GitHub 上。

228* **一次一個拉取請求**:每個工作階段可以建立一個拉取請求。

229* **需要雲端工作階段存取**:使用者需要存取[雲端工作階段](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)。

230 

231## 相關資源

232 

233> [card] [雲端上的 Claude Code](https://code.claude.com/docs/zh-TW/claude-code-on-the-web.md)

234>

235> 深入瞭解雲端工作階段

236 

237> [card] [Claude for Slack](https://claude.com/claude-and-slack)

238>

239> Claude for Slack 的一般文件

240 

241> [card] [Claude Tag](https://claude.com/docs/claude-tag/overview)

242>

243> 在 Slack 中由組織管理的 @Claude,具有管理員設定的存取權限

244 

245> [card] [Slack App Marketplace](https://slack.com/marketplace/A08SF47R6P4)

246>

247> 從 Slack Marketplace 安裝 Claude 應用程式

248 

249> [card] [Claude 說明中心](https://support.claude.com)

250>

251> 取得額外支援

sub-agents.md +6 −6

Details

310| `background` | 否 | 設為 `true` 可讓此 subagent 即使在 Claude 要求等待它時仍保持在背景中。預設情況下,Claude 從主對話產生的自訂 subagent 本來就會[在背景中啟動](#run-subagents-in-foreground-or-background) |310| `background` | 否 | 設為 `true` 可讓此 subagent 即使在 Claude 要求等待它時仍保持在背景中。預設情況下,Claude 從主對話產生的自訂 subagent 本來就會[在背景中啟動](#run-subagents-in-foreground-or-background) |

311| `omitClaudeMd` | 否 | 設為 `true` 可讓此 subagent 啟動時,其[初始上下文](#what-loads-at-startup)中不含使用者、專案和本機 CLAUDE.md 檔案;[受管原則檔案](https://code.claude.com/docs/zh-TW/memory.md#how-claude-md-files-load)仍會載入,但[受管 subagent](#choose-the-subagent-scope) 除外。適用於從委派提示詞取得所需一切的 subagent。當 agent 透過 `--agent` 或 `agent` 設定作為主工作階段 agent 執行時會被忽略。需要 Claude Code v2.1.271 或更新版本 |311| `omitClaudeMd` | 否 | 設為 `true` 可讓此 subagent 啟動時,其[初始上下文](#what-loads-at-startup)中不含使用者、專案和本機 CLAUDE.md 檔案;[受管原則檔案](https://code.claude.com/docs/zh-TW/memory.md#how-claude-md-files-load)仍會載入,但[受管 subagent](#choose-the-subagent-scope) 除外。適用於從委派提示詞取得所需一切的 subagent。當 agent 透過 `--agent` 或 `agent` 設定作為主工作階段 agent 執行時會被忽略。需要 Claude Code v2.1.271 或更新版本 |

312| `effort` | 否 | 此 subagent 執行時的 effort 等級。會覆寫工作階段的 effort 等級,但不會覆寫 [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/zh-TW/env-vars#variables) 環境變數。選項:`low`、`medium`、`high`、`xhigh`、`max`;可用等級取決於模型。請參閱[選擇 effort 等級](#choose-an-effort-level) |312| `effort` | 否 | 此 subagent 執行時的 effort 等級。會覆寫工作階段的 effort 等級,但不會覆寫 [`CLAUDE_CODE_EFFORT_LEVEL`](https://code.claude.com/docs/zh-TW/env-vars#variables) 環境變數。選項:`low`、`medium`、`high`、`xhigh`、`max`;可用等級取決於模型。請參閱[選擇 effort 等級](#choose-an-effort-level) |

313| `isolation` | 否 | 設定為 `worktree` 以在臨時 [git worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 中執行子代理,給它儲存庫的隔離副本,預設從您的[預設分支](https://code.claude.com/docs/zh-TW/worktrees.md#choose-the-base-branch)分支,而不是父工作階段的 `HEAD`。如果子代理不進行任何變更,worktree 會自動清理 |313| `isolation` | 否 | 設定為 `worktree` 以在臨時 [git worktree](https://code.claude.com/docs/zh-TW/worktrees.md) 中執行 subagent,給它儲存庫的隔離副本。預設情況下,該副本會從您的[預設分支](https://code.claude.com/docs/zh-TW/worktrees.md#choose-the-base-branch)分出,而不是父工作階段的 `HEAD`。如果 subagent 未進行任何變更,Claude Code [可以移除該 worktree](https://code.claude.com/docs/zh-TW/worktrees.md#isolate-subagents-with-worktrees) |

314| `color` | 否 | 子代理在任務列表和文字記錄中的顯示顏色。接受 `red`、`blue`、`green`、`yellow`、`purple`、`orange`、`pink` 或 `cyan` |314| `color` | 否 | 子代理在任務列表和文字記錄中的顯示顏色。接受 `red`、`blue`、`green`、`yellow`、`purple`、`orange`、`pink` 或 `cyan` |

315| `initialPrompt` | 否 | 當此代理作為主工作階段代理執行時(透過 `--agent` 或 `agent` 設定),自動提交為第一個使用者轉。[命令](https://code.claude.com/docs/zh-TW/commands.md)和[技能](https://code.claude.com/docs/zh-TW/skills.md)被處理。前置任何使用者提供的提示。對於 [plugin 子代理](#choose-the-subagent-scope)被忽略 |315| `initialPrompt` | 否 | 當此代理作為主工作階段代理執行時(透過 `--agent` 或 `agent` 設定),自動提交為第一個使用者轉。[命令](https://code.claude.com/docs/zh-TW/commands.md)和[技能](https://code.claude.com/docs/zh-TW/skills.md)被處理。前置任何使用者提供的提示。對於 [plugin 子代理](#choose-the-subagent-scope)被忽略 |

316| `experimental` | 否 | 實驗選項的對應。將其 `cacheTtl` 鍵設定為 `5m` 或 `1h` 以選擇此子代理請求的[提示快取生命週期](https://code.claude.com/docs/zh-TW/prompt-caching.md#choose-the-ttl-yourself)。此值套用於 frontmatter 在[快取生命週期優先順序](https://code.claude.com/docs/zh-TW/prompt-caching.md#choose-the-ttl-yourself)中所處的位置。Claude Code 忽略任何其他值,在您的 Claude 訂閱使用使用額度時忽略 `1h`,並僅從子代理檔案讀取欄位。需要 Claude Code v2.1.248 或更新版本 |316| `experimental` | 否 | 實驗選項的對應。將其 `cacheTtl` 鍵設定為 `5m` 或 `1h` 以選擇此子代理請求的[提示快取生命週期](https://code.claude.com/docs/zh-TW/prompt-caching.md#choose-the-ttl-yourself)。此值套用於 frontmatter 在[快取生命週期優先順序](https://code.claude.com/docs/zh-TW/prompt-caching.md#choose-the-ttl-yourself)中所處的位置。Claude Code 忽略任何其他值,在您的 Claude 訂閱使用使用額度時忽略 `1h`,並僅從子代理檔案讀取欄位。需要 Claude Code v2.1.248 或更新版本 |


410 410 

411#### 當允許清單封鎖 subagent 模型時411#### 當允許清單封鎖 subagent 模型時

412 412 

413如果您組織的 [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單封鎖了為 [`web-fetch`](https://code.claude.com/docs/zh-TW/tools-reference#which-model-the-web-fetch-subagent-runs-on) 以外之 subagent 設定的模型,subagent 會在下列第一個適用的模型上執行:413如果您設定中的 [`availableModels`](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection) 允許清單封鎖了為 [`web-fetch`](https://code.claude.com/docs/zh-TW/tools-reference#which-model-the-web-fetch-subagent-runs-on) 以外之 subagent 設定的模型,subagent 會在下列第一個適用的模型上執行:

414 414 

4151. 對於被封鎖的家族別名,在[支援此替換的提供者](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)上,該家族中允許的最新版本4151. 對於被封鎖的家族別名,在[支援此替換的提供者](https://code.claude.com/docs/zh-TW/model-config.md#restrict-model-selection)上,該家族中允許的最新版本

4162. `CLAUDE_CODE_SUBAGENT_MODEL` 中的模型(如果您有設定),並適用相同的規則4162. `CLAUDE_CODE_SUBAGENT_MODEL` 中的模型(如果您有設定),並適用相同的規則


458* `WaitForMcpServers`458* `WaitForMcpServers`

459* `Workflow`459* `Workflow`

460 460 

461第二個篩選器適用於在背景中執行的 subagent。無論 subagent 在哪裡執行,`Agent` 和 `ExitPlanMode` 都遵循第一個篩選器的條件。背景 subagent 會保留每個 MCP 工具,以及 [`SubagentHandback`](https://code.claude.com/docs/zh-TW/tools-reference)(如果它透過該工具回報)。它也會保留 `Read`、`Grep`、`Glob`、`LSP`、`Bash`、`PowerShell`、`Edit`、`Write`、`NotebookEdit`、`WebFetch`、`WebSearch`、`TodoWrite`、`Skill`、`ToolSearch`、`EnterWorktree`、`ExitWorktree`、`Monitor`、`TaskStop`、`SendMessage`、`Artifact`、`ListPlugins`、`ListSkills`、`SearchPlugins` 和 `SearchSkills`。461第二個篩選器適用於在背景中執行的 subagent。無論 subagent 在哪裡執行,`Agent` 和 `ExitPlanMode` 都遵循第一個篩選器的條件。背景 subagent 會保留每個 MCP 工具,以及 [`SubagentHandback`](https://code.claude.com/docs/zh-TW/tools-reference)(如果它透過該工具回報)。它也會保留 `Read`、`Grep`、`Glob`、`LSP`、`Bash`、`PowerShell`、`Edit`、`Write`、`NotebookEdit`、`WebFetch`、`WebSearch`、`TodoWrite`、`Skill`、`ToolSearch`、`EnterWorktree`、`ExitWorktree`、`Monitor`、`TaskStop`、`SendMessage`、`Artifact`、`ListPlugins`、`ListSkills`、`SearchPlugins`、`SearchSkills` 和 `REPL`。

462 462 

463請勿在背景 subagent 中依賴其他內建工具:無論是繼承的還是列在 `tools` 欄位中的,Claude Code 都會移除其中大部分。除非移除後使 `tools` 清單[解析為空](https://code.claude.com/docs/zh-TW/errors.md#agent-would-be-spawned-with-zero-tools),否則移除不會報告錯誤。463請勿在背景 subagent 中依賴其他內建工具:無論是繼承的還是列在 `tools` 欄位中的,Claude Code 都會移除其中大部分。除非移除後使 `tools` 清單[解析為空](https://code.claude.com/docs/zh-TW/errors.md#agent-would-be-spawned-with-zero-tools),否則移除不會報告錯誤。

464 464 


555 555 

556#### 將 MCP 伺服器範圍限於子代理556#### 將 MCP 伺服器範圍限於子代理

557 557 

558使用 `mcpServers` 欄位給子代理存取在主對話中不可用的 [MCP](https://code.claude.com/docs/zh-TW/mcp.md) 伺服器。此處定義的內聯伺服器在子代理啟動時連接,受[代理檔案資料夾的信任規則](#inline-server-trust)約束,並在完成時斷開連接。字串參考共享父工作階段的連接。558使用 `mcpServers` 欄位讓 subagent 存取在主對話中不可用的 [MCP](https://code.claude.com/docs/zh-TW/mcp.md) 伺服器。此處定義的內聯伺服器會在 subagent 啟動時連接(受[agent 檔案資料夾的信任規則](#inline-server-trust)約束),並在最後一個使用它們的 agent 完成時中斷連接。字串參考會共享父工作階段的連接。

559 559 

560> [!NOTE]560> [!NOTE]

561>561>


714 714 

715為了更動態地控制工具使用,使用 `PreToolUse` hooks 在執行前驗證操作。當您需要允許工具的某些操作同時阻止其他操作時,這很有用。715為了更動態地控制工具使用,使用 `PreToolUse` hooks 在執行前驗證操作。當您需要允許工具的某些操作同時阻止其他操作時,這很有用。

716 716 

717此範例建立一個僅允許唯讀資料庫查詢的子代理。`PreToolUse` hook 在每個 Bash 命令執行前執行 `command` 中指定的指令碼:717此範例建立一個僅允許唯讀資料庫查詢的 subagent。`PreToolUse` hook 會在每個 Bash 工具呼叫執行前,執行 `command` 中指定的指令碼:

718 718 

719```yaml theme={null}719```yaml theme={null}

720---720---


927 927 

928如果外掛將 agent 放在其 `agents/` 目錄的子資料夾中,請在限定名稱中包括子資料夾,例如 `claude --agent my-plugin:review:security`。928如果外掛將 agent 放在其 `agents/` 目錄的子資料夾中,請在限定名稱中包括子資料夾,例如 `claude --agent my-plugin:review:security`。

929 929 

930若要使其成為專案中每個工作階段的預設值,請在 `.claude/settings.json` 中設定 `agent`:930若要將某個 subagent 設為專案中工作階段的預設值,請在 `.claude/settings.json` 中設定 `agent`:

931 931 

932```json theme={null}932```json theme={null}

933{933{

tools-reference.md +45 −19

Details

48| `Read` | 讀取檔案的內容。請參閱 [Read 工具行為](#read-tool-behavior) | 否 |48| `Read` | 讀取檔案的內容。請參閱 [Read 工具行為](#read-tool-behavior) | 否 |

49| `ReadMcpResourceTool` | 按 URI 讀取特定 MCP 資源 | 否 |49| `ReadMcpResourceTool` | 按 URI 讀取特定 MCP 資源 | 否 |

50| `RemoteTrigger` | 在 claude.ai 上建立、更新、執行和列出[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)(前身為 routine)。支援 `/schedule` 命令。[`RemoteTrigger` 輸入參考](https://code.claude.com/docs/zh-TW/agent-sdk/typescript#remotetrigger)記錄每個動作和移除工具的組織政策。雲端排程任務位於 claude.ai 上並需要 Pro、Max、Ultra、Team 或 Enterprise 方案,因此此工具無法從 Amazon Bedrock、Claude Platform on AWS、Google Cloud 的 Agent Platform 或 Microsoft Foundry 存取 | 否 |50| `RemoteTrigger` | 在 claude.ai 上建立、更新、執行和列出[雲端排程任務](https://code.claude.com/docs/zh-TW/routines.md)(前身為 routine)。支援 `/schedule` 命令。[`RemoteTrigger` 輸入參考](https://code.claude.com/docs/zh-TW/agent-sdk/typescript#remotetrigger)記錄每個動作和移除工具的組織政策。雲端排程任務位於 claude.ai 上並需要 Pro、Max、Ultra、Team 或 Enterprise 方案,因此此工具無法從 Amazon Bedrock、Claude Platform on AWS、Google Cloud 的 Agent Platform 或 Microsoft Foundry 存取 | 否 |

51| `REPL` | 執行 Claude 在 [Code Mode](https://code.claude.com/docs/zh-TW/code-mode.md) 中撰寫的 JavaScript。僅在 Code Mode 開啟時可用。若要了解 Claude Code 如何檢查該程式碼中的工具呼叫,請參閱[權限檢查](https://code.claude.com/docs/zh-TW/code-mode.md#permission-checks) | 否 |

51| `ReportFindings` | 將程式碼審查發現報告為結構化清單,每個發現都有檔案、摘要和失敗情景,以便 Claude Code 可以呈現它們而不是將其列印為文字。當有效的程式碼審查指示要求時,Claude 會呼叫它。發現也可以帶有選用的 `category` slug,例如 `correctness` 或 `test-coverage`,顯示在呈現清單中的檔案位置旁邊 | 否 |52| `ReportFindings` | 將程式碼審查發現報告為結構化清單,每個發現都有檔案、摘要和失敗情景,以便 Claude Code 可以呈現它們而不是將其列印為文字。當有效的程式碼審查指示要求時,Claude 會呼叫它。發現也可以帶有選用的 `category` slug,例如 `correctness` 或 `test-coverage`,顯示在呈現清單中的檔案位置旁邊 | 否 |

52| `ScheduleWakeup` | 重新排程[自我調整 `/loop`](https://code.claude.com/docs/zh-TW/scheduled-tasks#let-claude-choose-the-interval) 的下一次迭代。Claude 在每次迭代結束時呼叫此工具以選擇下一次執行的時間,介於一分鐘到一小時之間;您不直接呼叫它。若要改為結束迴圈,Claude 使用 `stop: true` 呼叫它,這會取消待處理的喚醒。待處理的喚醒出現在 [Stop hook 輸入](https://code.claude.com/docs/zh-TW/hooks.md#stop-input)中的 `session_crons` 中 | 否 |53| `ScheduleWakeup` | 重新排程[自我調整 `/loop`](https://code.claude.com/docs/zh-TW/scheduled-tasks#let-claude-choose-the-interval) 的下一次迭代。Claude 在每次迭代結束時呼叫此工具以選擇下一次執行的時間,介於一分鐘到一小時之間;您不直接呼叫它。若要改為結束迴圈,Claude 使用 `stop: true` 呼叫它,這會取消待處理的喚醒。待處理的喚醒出現在 [Stop hook 輸入](https://code.claude.com/docs/zh-TW/hooks.md#stop-input)中的 `session_crons` 中 | 否 |

53| `SearchPlugins` | 搜尋您的 claude.ai 外掛目錄。可在與 `ListPlugins` 相同的工作階段中使用 | 否 |54| `SearchPlugins` | 搜尋您的 claude.ai 外掛目錄。可在與 `ListPlugins` 相同的工作階段中使用 | 否 |


150 151 

151### 命令之間保留的內容152### 命令之間保留的內容

152 153 

153* 當 Claude 在主工作階段中執行 `cd` 時,新的工作目錄會延續到後續的 Bash 命令,只要它保持在專案目錄或您使用 `--add-dir`、`/add-dir` 或設定中的 `additionalDirectories` 新增的[額外工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)內。這包括 Claude 為回應您後續訊息而執行的命令。154* 在主工作階段中,Claude 的 `cd` 只有來自以退出碼 0 結束的前景命令時,才會延續到後續的 Bash 命令。該命令也必須在專案目錄或[額外工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)內結束,例如您使用 `--add-dir`、`/add-dir` 或設定中的 `additionalDirectories` 新增的目錄。

155 * 預設情況下,如果該命令在這些目錄之外結束,Claude Code 會重設為專案目錄,並在工具結果中附加 `Shell cwd was reset to <dir>`。

156 * 若要停用此延續功能,請設定 `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1`。

154 * subagent 工作階段永遠不會延續工作目錄變更。157 * subagent 工作階段永遠不會延續工作目錄變更。

155 * 如果 `cd` 落在這些目錄之外,Claude Code 會重設為專案目錄,並在工具結果中附加 `Shell cwd was reset to <dir>`。

156 * 若要停用此延續功能,使每個 Bash 命令都在專案目錄中啟動,請設定 `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1`。

157* 環境變數不會保留。一個命令中的 `export` 在下一個命令中將無法使用。158* 環境變數不會保留。一個命令中的 `export` 在下一個命令中將無法使用。

158* Claude Code 會啟動一個非互動式 shell,針對 Zsh 載入 `~/.zshrc`、針對 Bash 載入 `~/.bashrc`,並將其擷取到的別名、函式和 shell 選項套用到 Bash 命令。159* Claude Code 會啟動一個非互動式 shell,針對 Zsh 載入 `~/.zshrc`、針對 Bash 載入 `~/.bashrc`,並將其擷取到的別名、函式和 shell 選項套用到 Bash 命令。

159 160 


511* 個別 [command hooks](https://code.claude.com/docs/zh-TW/hooks.md#command-hook-fields) 上的 `"shell": "powershell"`:在 PowerShell 中執行該 hook。Hooks 直接啟動 PowerShell,因此無論 `CLAUDE_CODE_USE_POWERSHELL_TOOL` 為何都能運作。512* 個別 [command hooks](https://code.claude.com/docs/zh-TW/hooks.md#command-hook-fields) 上的 `"shell": "powershell"`:在 PowerShell 中執行該 hook。Hooks 直接啟動 PowerShell,因此無論 `CLAUDE_CODE_USE_POWERSHELL_TOOL` 為何都能運作。

512* [skill frontmatter](https://code.claude.com/docs/zh-TW/skills.md#frontmatter-reference) 中的 `shell: powershell`:在 PowerShell 中執行 `` !`command` `` 區塊。需要啟用 PowerShell 工具。513* [skill frontmatter](https://code.claude.com/docs/zh-TW/skills.md#frontmatter-reference) 中的 `shell: powershell`:在 PowerShell 中執行 `` !`command` `` 區塊。需要啟用 PowerShell 工具。

513 514 

514PowerShell 命令遵循與 Bash 命令[相同的主工作階段工作目錄重設行為](#what-persists-between-commands),包括 `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` 環境變數。515### PowerShell 命令中的工作目錄和變數

515 516 

516PowerShell 命令也會接收 hook 透過 `CLAUDE_ENV_FILE` 保存的變數,條件如 [PowerShell 命令中的保存變數](https://code.claude.com/docs/zh-TW/hooks.md#persisted-variables-in-powershell-commands)所述。需要 Claude Code v2.1.296 或更新版本。517根據預設,當主工作階段中的前景 PowerShell 命令結束於您的[工作目錄](https://code.claude.com/docs/zh-TW/permissions.md#working-directories)之外時,Claude Code 會重設至專案目錄。若要在每個命令之後都重設,請設定 `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1`。

518 

519PowerShell 命令會接收 hook 透過 `CLAUDE_ENV_FILE` 保存的變數,條件如 [PowerShell 命令中的保存變數](https://code.claude.com/docs/zh-TW/hooks.md#persisted-variables-in-powershell-commands)所述。需要 Claude Code v2.1.296 或更新版本。

517 520 

518### PowerShell 中來自搜尋和 `git diff` 的結束代碼 1521### PowerShell 中來自搜尋和 `git diff` 的結束代碼 1

519 522 


689| 封鎖網域 | 將該網域的 `WebFetch(domain:...)` 規則新增至 `deny` |692| 封鎖網域 | 將該網域的 `WebFetch(domain:...)` 規則新增至 `deny` |

690| 要求對某個網域顯示提示 | 將該網域的 `WebFetch(domain:...)` 規則新增至 `ask` |693| 要求對某個網域顯示提示 | 將該網域的 `WebFetch(domain:...)` 規則新增至 `ask` |

691| 關閉 WebFetch | 將 `WebFetch` 新增至 `deny`,或將 [`CLAUDE_CODE_DISABLE_WEB_FETCH`](https://code.claude.com/docs/zh-TW/env-vars#variables) 設為 `1` |694| 關閉 WebFetch | 將 `WebFetch` 新增至 `deny`,或將 [`CLAUDE_CODE_DISABLE_WEB_FETCH`](https://code.claude.com/docs/zh-TW/env-vars#variables) 設為 `1` |

692| 為您的組織執行上述任一項 | 將規則放在[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)中 |

693 695 

694在沙箱之外,若允許 Bash,Claude 仍可使用 `curl`、`wget` 或其他工具存取任何 URL。請參閱[特定工具的權限規則](https://code.claude.com/docs/zh-TW/permissions.md#tool-specific-permission-rules)。696在沙箱之外,若允許 Bash,Claude 仍可使用 `curl`、`wget` 或其他工具存取任何 URL。請參閱[特定工具的權限規則](https://code.claude.com/docs/zh-TW/permissions.md#tool-specific-permission-rules)。

695 697 

696### 擷取顯示提示、失敗或缺少 WebFetch 時698若要將 `WebFetch` 規則套用至您的組織,請將其放在[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)中。

697 699 

698Claude 的回覆可能會遺漏頁面上 Claude 未詢問的任何內容。在終端機中,按 `Ctrl+O` 即可查看 Claude 詢問了什麼以及它收到的答案。700### 修正非預期的 WebFetch 提示與拒絕

699 701 

700| 您注意到的情況 | 處理方式 |702若擷取遭到封鎖或拒絕,或您看到了非預期的權限提示,或完全沒有看到提示,請在第一欄中找出您看到的情況。

703 

704| 症狀 | 修正方式 |

701| :- | :- |705| :- | :- |

702| Claude 表示頁面未涵蓋某項您確知存在的內容 | 要求 Claude 再次擷取該頁面,並告訴它要尋找什麼。若要取得未經處理的頁面,請要求它透過 Bash 工具對該 URL 執行 `curl`。 |706| 您已允許的網域擷取失敗 | URL 還必須通過 [WebFetch 網域安全性檢查](https://code.claude.com/docs/zh-TW/data-usage.md#webfetch-domain-safety-check),除非您使用 [`skipWebFetchPreflight`](https://code.claude.com/docs/zh-TW/settings-reference#skipwebfetchpreflight) 關閉該檢查。請參閱 [WebFetch domain safety check failed](https://code.claude.com/docs/zh-TW/errors.md#webfetch-domain-safety-check-failed)。 |

703| Claude 遺漏長頁面的結尾,或表示部分內容未被讀取 | 要求 Claude 擷取頁面的下一部分。這需要 Claude Code v2.1.290 或更新版本。[`web-fetch` subagent](#web-fetch-subagent) 會完整讀取約 48,000 個字元以內的頁面,而當 Claude 呼叫 WebFetch 時,WebFetch 會讀取前 100,000 個字元。 |

704| Claude 描述的頁面是最近變更之前的樣子 | WebFetch 會在 15 分鐘內重複使用其頁面副本。若要變更時間長度,請設定 [`CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables)。 |

705| Claude 表示下載逾時 | 下載會在五分鐘後失敗。若要變更此限制,請設定 [`CLAUDE_CODE_WEBFETCH_DEADLINE_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables)。 |

706| Claude 回報重新導向並停在該處 | 要求 Claude 擷取新的 URL。當重新導向對主機的變更不只是加上或移除 `www.` 時,WebFetch 會傳回新的 URL,而不傳回頁面內容。 |

707| Claude 無法擷取本機或內部網路伺服器 | WebFetch [會拒絕 `localhost`](https://code.claude.com/docs/zh-TW/errors#webfetch-cannot-fetch-localhost) 以及任何其他不含點的主機名稱。請要求 Claude 透過 Bash 工具使用 `curl` 存取該伺服器。 |

708| 在雲端工作階段中,Claude 表示網路封鎖了該網域 | 在該處僅有允許規則並不足夠。還需要將該網域[新增](https://code.claude.com/docs/zh-TW/cloud-environments.md#allow-specific-domains)至雲端環境的網路存取設定。 |

709| 在自動模式下,擷取遭到封鎖且您未看到提示 | 為該網域新增允許規則。若是分類器封鎖了擷取,您也可以在終端機中開啟 `/permissions`,並在 **Recently blocked** 分頁下[核准該擷取](https://code.claude.com/docs/zh-TW/auto-mode-config.md#review-denials),讓 Claude 可以重試。 |707| 在自動模式下,擷取遭到封鎖且您未看到提示 | 為該網域新增允許規則。若是分類器封鎖了擷取,您也可以在終端機中開啟 `/permissions`,並在 **Recently blocked** 分頁下[核准該擷取](https://code.claude.com/docs/zh-TW/auto-mode-config.md#review-denials),讓 Claude 可以重試。 |

710| 在 `claude -p` 或 Agent SDK 中,擷取遭到拒絕 | 這些執行[以 Manual 模式啟動](https://code.claude.com/docs/zh-TW/permission-modes.md#which-mode-a-non-interactive-run-starts-in),需要核准的呼叫會遭到拒絕。請新增允許規則或以自動模式啟動。 |708| 在 `claude -p` 或 Agent SDK 中,擷取遭到拒絕 | 這些執行[以 Manual 模式啟動](https://code.claude.com/docs/zh-TW/permission-modes.md#which-mode-a-non-interactive-run-starts-in),需要核准的呼叫會遭到拒絕。請新增允許規則或以自動模式啟動。 |

711| 您已允許的網域擷取失敗 | URL 還必須通過 [WebFetch 網域安全性檢查](https://code.claude.com/docs/zh-TW/data-usage.md#webfetch-domain-safety-check),除非您使用 [`skipWebFetchPreflight`](https://code.claude.com/docs/zh-TW/settings-reference#skipwebfetchpreflight) 關閉該檢查。請參閱 [WebFetch domain safety check failed](https://code.claude.com/docs/zh-TW/errors.md#webfetch-domain-safety-check-failed)。 |

712| 您自己設定檔中的規則沒有作用 | 若您的組織設定了 [`allowManagedPermissionRulesOnly`](https://code.claude.com/docs/zh-TW/settings-reference#allowmanagedpermissionrulesonly),Claude Code 會忽略該規則。請要求您的管理員將其新增至受管設定。 |709| 您自己設定檔中的規則沒有作用 | 若您的組織設定了 [`allowManagedPermissionRulesOnly`](https://code.claude.com/docs/zh-TW/settings-reference#allowmanagedpermissionrulesonly),Claude Code 會忽略該規則。請要求您的管理員將其新增至受管設定。 |

713| 將網域新增至沙箱的 [`allowedDomains`](https://code.claude.com/docs/zh-TW/settings-reference#sandbox-network-alloweddomains) 後仍持續顯示提示 | WebFetch 不會讀取該清單,因此請新增 WebFetch 允許規則 |710| 將網域新增至沙箱的 [`allowedDomains`](https://code.claude.com/docs/zh-TW/settings-reference#sandbox-network-alloweddomains) 後仍持續顯示提示 | WebFetch 不會讀取該清單,因此請新增 WebFetch 允許規則 |

714| 您未允許的網域沒有顯示提示 | Claude Code 會對一組內建的預先核准文件網域略過提示,在 `auto` 與 `bypassPermissions` 模式下也會略過提示。若仍要求顯示提示,請為該網域新增 `ask` 規則。沙箱化的 Bash 命令不會繼承預先核准的集合。 |711| 您未允許的網域沒有顯示提示 | Claude Code 會對一組內建的預先核准文件網域略過提示,在 `auto` 與 `bypassPermissions` 模式下也會略過提示。若仍要求顯示提示,請為該網域新增 `ask` 規則。沙箱化的 Bash 命令不會繼承預先核准的集合。 |

715| claude.ai artifact 連結帶來另一個提示 | 請參閱[讀取與您分享的 artifact](https://code.claude.com/docs/zh-TW/artifacts.md#read-an-artifact-shared-with-you) |712| claude.ai artifact 連結帶來另一個提示 | 請參閱[讀取與您分享的 artifact](https://code.claude.com/docs/zh-TW/artifacts.md#read-an-artifact-shared-with-you) |

716| Claude 無法擷取任何頁面 | 在工作階段中執行 `/status`。若 `Organization configuration` 行列出 `HIPAA`,表示 WebFetch 已關閉:請參閱 [開發人員在 Claude Code 中看到的內容](https://code.claude.com/docs/zh-TW/hipaa-setup.md#what-developers-see-in-claude-code)。若 `Organization policy` 行回報政策未載入並提及 web fetch,請依照該行指出的任何修正方式處理。一旦允許 WebFetch 的政策載入完成,WebFetch 就會恢復可用,無需重新啟動。 |713 

714### 修正失敗的 WebFetch 請求

715 

716若 Claude 表示無法擷取某個頁面,請在第一欄中找出發生的情況。

717 

718| 症狀 | 修正方式 |

719| :- | :- |

720| 在雲端工作階段中,Claude 表示網路封鎖了該網域 | 在該處僅有允許規則並不足夠。還需要將該網域[新增](https://code.claude.com/docs/zh-TW/cloud-environments.md#allow-specific-domains)至雲端環境的網路存取設定。 |

721| Claude 無法擷取本機或內部網路伺服器 | WebFetch [會拒絕 `localhost`](https://code.claude.com/docs/zh-TW/errors#webfetch-cannot-fetch-localhost) 以及任何其他不含點的主機名稱。請要求 Claude 透過 Bash 工具使用 `curl` 存取該伺服器。 |

722| Claude 回報重新導向並停在該處 | 要求 Claude 擷取新的 URL。當重新導向對主機的變更不只是加上或移除 `www.` 時,WebFetch 會傳回新的 URL,而不傳回頁面內容。 |

723| Claude 表示下載逾時 | 下載會在五分鐘後失敗。若要變更此限制,請設定 [`CLAUDE_CODE_WEBFETCH_DEADLINE_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables)。 |

724 

725### 修正遺漏或過時的頁面內容

726 

727Claude 的回覆可能會遺漏頁面上 Claude 未詢問的任何內容。在終端機中,按 `Ctrl+O` 即可查看 Claude 詢問了什麼以及它收到的答案。

728 

729| 症狀 | 修正方式 |

730| :- | :- |

731| Claude 表示頁面未涵蓋某項您確知存在的內容 | 要求 Claude 再次擷取該頁面,並告訴它要尋找什麼。若要取得未經處理的頁面,請要求它透過 Bash 工具對該 URL 執行 `curl`。 |

732| Claude 遺漏長頁面的結尾,或表示部分內容未被讀取 | 要求 Claude 擷取頁面的下一部分。這需要 Claude Code v2.1.290 或更新版本。[`web-fetch` subagent](#web-fetch-subagent) 會完整讀取約 48,000 個字元以內的頁面,而當 Claude 呼叫 WebFetch 時,WebFetch 會讀取前 100,000 個字元。 |

733| Claude 描述的頁面是最近變更之前的樣子 | WebFetch 會在 15 分鐘內重複使用其頁面副本。若要變更時間長度,請設定 [`CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS`](https://code.claude.com/docs/zh-TW/env-vars#variables)。 |

734 

735### 找出 WebFetch 無法使用的原因

736 

737若 Claude 無法擷取任何頁面,請在工作階段中執行 `/status`,並檢查 `Organization configuration` 與 `Organization policy` 這兩行:

738 

739* **`Organization configuration` 列出 `HIPAA`**:WebFetch 已關閉。請參閱[開發人員在 Claude Code 中看到的內容](https://code.claude.com/docs/zh-TW/hipaa-setup.md#what-developers-see-in-claude-code)。

740* **`Organization policy` 回報政策未載入並提及 web fetch**:請依照該行指出的任何修正方式處理。一旦允許 WebFetch 的政策載入完成,WebFetch 就會恢復可用,無需重新啟動。

741 

742若 `/status` 兩者皆未顯示,請在[設定檔](https://code.claude.com/docs/zh-TW/settings.md#find-or-create-your-settings-files)的 `deny` 下尋找 `WebFetch`,或檢查 `CLAUDE_CODE_DISABLE_WEB_FETCH` 是否設為 `1`。若要重新開啟 WebFetch,請移除該規則,或取消設定該變數並啟動新的工作階段。若規則位於[受管設定](https://code.claude.com/docs/zh-TW/settings.md#check-what-your-organization-enforces)中,請要求您的管理員將其移除。

717 743 

718### web-fetch subagent744### web-fetch subagent

719 745 


740 766 

741您的 `WebFetch` [權限規則](https://code.claude.com/docs/zh-TW/permissions.md#webfetch)適用於 `web-fetch` subagent 擷取的頁面,符合 `WebFetch` 的 `PreToolUse` 與 `PostToolUse` [hook](https://code.claude.com/docs/zh-TW/hooks.md) 也同樣適用。767您的 `WebFetch` [權限規則](https://code.claude.com/docs/zh-TW/permissions.md#webfetch)適用於 `web-fetch` subagent 擷取的頁面,符合 `WebFetch` 的 `PreToolUse` 與 `PostToolUse` [hook](https://code.claude.com/docs/zh-TW/hooks.md) 也同樣適用。

742 768 

743| 若您依賴 | 使用 subagent 時 | 處理方式 |769| 您的設定 | 使用 subagent 時的變化 | 處理方式 |

744| :- | :- | :- |770| :- | :- | :- |

745| 關於要擷取哪些頁面的 CLAUDE.md 指令 | subagent 啟動時不會載入您的 CLAUDE.md 檔案,包括您組織的受管 CLAUDE.md | 使用 `WebFetch` 權限規則限制擷取 |771| 關於要擷取哪些頁面的 CLAUDE.md 指令 | subagent 啟動時不會載入您的 CLAUDE.md 檔案,包括您組織的受管 CLAUDE.md | 使用 `WebFetch` 權限規則限制擷取 |

746| `SubagentStart` 或 `SubagentStop` hook | 對於此 subagent,只有在[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)中定義的 hook 會執行 | 在任何其他設定檔中,使用符合 `WebFetch` 的 `PreToolUse` 或 `PostToolUse` hook |772| `SubagentStart` 或 `SubagentStop` hook | 對於此 subagent,只有在[受管設定](https://code.claude.com/docs/zh-TW/managed-settings.md)中定義的 hook 會執行 | 在任何其他設定檔中,使用符合 `WebFetch` 的 `PreToolUse` 或 `PostToolUse` hook |

Details

58| `unable to get local issuer certificate` | [設定公司 CA 憑證](#tls-or-ssl-connection-errors) |58| `unable to get local issuer certificate` | [設定公司 CA 憑證](#tls-or-ssl-connection-errors) |

59| `OAuth error`、`That doesn't look like the full code` 或 `403 Forbidden` | [修復身分驗證](#login-and-authentication) |59| `OAuth error`、`That doesn't look like the full code` 或 `403 Forbidden` | [修復身分驗證](#login-and-authentication) |

60| `Claude Code access has not been granted for this account` | [取得包含 Claude Code 的角色](#claude-code-access-has-not-been-granted-for-this-account) |60| `Claude Code access has not been granted for this account` | [取得包含 Claude Code 的角色](#claude-code-access-has-not-been-granted-for-this-account) |

61| `That code wasn't accepted` | 重新登入並貼上新的代碼 |

61| 設定期間 `Unable to connect to Anthropic services` | 請參閱錯誤參考中的 [Unable to connect to Anthropic services](https://code.claude.com/docs/zh-TW/errors.md#unable-to-connect-to-anthropic-services) |62| 設定期間 `Unable to connect to Anthropic services` | 請參閱錯誤參考中的 [Unable to connect to Anthropic services](https://code.claude.com/docs/zh-TW/errors.md#unable-to-connect-to-anthropic-services) |

62| `Could not load the default credentials` 或 `Could not load credentials from any providers` | [Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 憑證](#bedrock-agent-platform-or-foundry-credentials-not-loading) |63| `Could not load the default credentials` 或 `Could not load credentials from any providers` | [Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 憑證](#bedrock-agent-platform-or-foundry-credentials-not-loading) |

63| `ChainedTokenCredential authentication failed` 或 `CredentialUnavailableError` | [Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 憑證](#bedrock-agent-platform-or-foundry-credentials-not-loading) |64| `ChainedTokenCredential authentication failed` 或 `CredentialUnavailableError` | [Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 憑證](#bedrock-agent-platform-or-foundry-credentials-not-loading) |


1244 1245 

1245**1. 檢查 Keychain 存取**1246**1. 檢查 Keychain 存取**

1246 1247 

1247執行 `claude doctor` 以檢查 Keychain 存取。當 Keychain 拒絕寫入時,報告會列出以 `macOS Keychain is not writable` 開頭的警告,後面跟著建議的修正。當報告未列出 Keychain 警告時,Keychain 可寫入,您可以跳到最後一步。1248在您執行 Claude Code 的 shell 中,執行 `claude doctor`,並尋找以 `macOS Keychain is not writable` 開頭的警告。報告顯示的內容決定您的下一步:

1249 

1250* **沒有此類警告**:跳到最後一步

1251* **修正說明為 `Unlocking the Keychain won't help` 的警告**:依照該修正操作。如果該 shell 位於沙箱中,請在沙箱外重新開始這些步驟,以將您的登入移回

1252* **具有其他修正的警告**:繼續下一步

1248 1253 

1249**2. 解鎖 Keychain**1254**2. 解鎖 Keychain**

1250 1255 

Details

79 79 

80預設情況下,鬆開鍵會插入轉錄並等待您按 `Enter`。在 `voice` 設定物件中設定 `"autoSubmit": true` 以在您鬆開鍵時自動發送提示,只要轉錄至少有三個單詞。80預設情況下,鬆開鍵會插入轉錄並等待您按 `Enter`。在 `voice` 設定物件中設定 `"autoSubmit": true` 以在您鬆開鍵時自動發送提示,只要轉錄至少有三個單詞。

81 81 

82按住或點擊 `Space` 只在按鍵原本會輸入到提示詞的地方開始聽寫。在[逐字稿檢視器](https://code.claude.com/docs/zh-TW/interactive-mode.md#transcript-viewer)中,`Space` 會翻頁瀏覽對話,而在[vim 模式](https://code.claude.com/docs/zh-TW/interactive-mode.md#vim-editor-mode)中 INSERT 以外的狀態下,它是一個命令。若要從這兩個地方聽寫,請[重新繫結到修飾符組合](#rebind-the-dictation-key),例如 `meta+k`。82按住或點擊 `Space` 只在按鍵原本會輸入到提示詞的地方開始聽寫。在[逐字稿檢視器](https://code.claude.com/docs/zh-TW/interactive-mode.md#transcript-viewer)中,`Space` 會翻頁瀏覽對話,而在[vim 模式](https://code.claude.com/docs/zh-TW/interactive-mode.md#vim-editor-mode)中 INSERT 以外的狀態下,它是一個命令。若要在 INSERT 以外的狀態下聽寫,或在逐字稿檢視器中以按住模式聽寫,請[重新繫結到修飾符組合](#rebind-the-dictation-key),例如 `meta+k`。

83 83 

84## 點擊錄音並發送84## 點擊錄音並發送

85 85 


87 87 

88使用 `/voice tap` 啟用點擊模式。當提示輸入為空時,點擊 `Space` 開始錄製。頁尾在錄製時顯示 `● REC · tap to send`。再次點擊 `Space` 停止。88使用 `/voice tap` 啟用點擊模式。當提示輸入為空時,點擊 `Space` 開始錄製。頁尾在錄製時顯示 `● REC · tap to send`。再次點擊 `Space` 停止。

89 89 

90Claude Code 插入轉錄,當轉錄至少有三個單詞時自動提交提示。較短的轉錄會被插入但不會被提交,因此意外點擊不會發送一個隨意的單詞。90第二次點擊後,Claude Code 會插入逐字稿,並在逐字稿夠長時提交提示詞:

91 

92* **三個單詞以上**:Claude Code 自動提交提示詞。

93* **較少的單詞**:逐字稿會被插入但不會被提交,因此意外點擊不會發送一個隨意的單詞。

91 94 

92三個單詞的閾值計算不使用空格書寫的語言中的單詞。日文、中文和泰文轉錄計算個別單詞,因此它們在點擊模式和使用 `autoSubmit` 的保持模式中自動提交。95三個單詞的閾值計算不使用空格書寫的語言中的單詞。日文、中文和泰文轉錄計算個別單詞,因此它們在點擊模式和使用 `autoSubmit` 的保持模式中自動提交。

93 96 

94第一次點擊只在提示輸入為空時開始錄製,因此您在撰寫訊息時仍然可以正常輸入空格。第二次點擊無論輸入內容如何都會停止錄製。錄製也會在 15 秒無聲或 2 分鐘總時間後自動停止。97點擊一次即可開始或繼續錄製,而錄製也可能不需第二次點擊就停止:

98 

99* **開始**:第一次點擊只在提示詞輸入為空時開始錄製,因此您在撰寫訊息時仍然可以正常輸入空格。若要在自行停止的錄製中新增內容,請[繼續錄製](#resume-a-recording-that-stopped-by-itself)。

100* **停止**:當您發送或編輯提示詞時,錄製也會停止。在 60 秒內沒有辨識到任何單詞,或總時間達 10 分鐘後,錄製會自行停止。

101 

102### 繼續自行停止的錄製

103 

104當點擊模式的錄製自行停止時,您說的內容會保留在提示詞中而不會發送,頁尾會說明停止原因。您可以發送這些內容,或者在尚未編輯的情況下繼續新增內容:

105 

106* **發送內容**:按下 `Enter`。

107* **新增內容**:將游標移到內容末尾,然後點擊 `Space` 再次錄製。當您再次點擊以停止時,如果您新增了至少三個單詞,Claude Code 會發送所有文字。

108 

109若要查看停止錄製的原因,請找出頁尾訊息中以 `dictation stopped` 開頭的部分:

110 

111| 訊息 | 停止錄製的原因 |

112| :- | :- |

113| `dictation stopped after 1m with no new words` | 60 秒內沒有辨識到任何單詞。如果您當時正在說話,請嘗試 [`No speech detected`](#troubleshooting) 的修正方法 |

114| `dictation stopped at its 10m limit` | 錄製時間達到 10 分鐘 |

115| `dictation stopped: lost the connection` | 與轉寫服務的連線已關閉,或連線失敗後無法重新開啟 |

116| `dictation stopped: lost the microphone` | 錄製麥克風的程式(例如 SoX 或 `arecord`)已結束或無法啟動 |

117| `dictation stopped: the prompt lost focus` | 開啟了面板(例如模型選擇器),或您開啟了[逐字稿檢視器](https://code.claude.com/docs/zh-TW/interactive-mode.md#transcript-viewer) |

118| `dictation stopped: the terminal detached` | 最後一個剩餘的終端機已從[背景工作階段](https://code.claude.com/docs/zh-TW/agent-view.md)中分離 |

119| `dictation stopped: the prompt changed` | 提示詞的文字已變更,例如因為您在其中輸入了內容。若要再次聽寫,請先發送或清除提示詞 |

95 120 

96## 取消錄音121## 取消錄音

97 122 

98按 `Esc` 或 `Ctrl+C` 來取消聽寫,而不是完成它。Claude Code 會停止麥克風、捨棄文字記錄,並將提示恢復到錄音開始前的狀態。123在沒有開啟任何面板、問題或權限提示時,按 `Esc` 或 `Ctrl+C` 來取消聽寫,而不是完成它。Claude Code 會停止麥克風、捨棄逐字稿,並將提示詞恢復到錄音開始前的狀態。

99 124 

100兩個按鍵也會在完成的錄音文字記錄仍在處理時取消。您在處理期間編輯或提交的提示會保持您留下的狀態。125在提示詞輸入處,當已完成錄音的逐字稿仍在處理時,這兩個按鍵也會取消。您在處理期間編輯或提交的提示詞會保持您留下的狀態。

101 126 

102這兩個按鍵在取消的按下中不會執行任何其他操作:`Esc` 不會中斷 Claude 的回應,`Ctrl+C` 不會清除提示或計為[退出 Claude Code 的兩次按下](https://code.claude.com/docs/zh-TW/interactive-mode.md#general-controls)中的第一次。127這兩個按鍵在取消的按下中不會執行任何其他操作:`Esc` 不會中斷 Claude 的回應,`Ctrl+C` 不會清除提示或計為[退出 Claude Code 的兩次按下](https://code.claude.com/docs/zh-TW/interactive-mode.md#general-controls)中的第一次。

103 128 


177* **`Voice mode could not find a working audio recorder in WSL`**:WSLg 透過 PulseAudio 而非 ALSA 裝置路由音頻,因此 SoX 需要明確安裝其 PulseAudio 後端。執行 `sudo apt install sox libsox-fmt-pulse`。單獨安裝 `sox` 會拉入 ALSA 後端,這在 WSL 上無法錄製,因為沒有 `/dev/snd` 裝置。202* **`Voice mode could not find a working audio recorder in WSL`**:WSLg 透過 PulseAudio 而非 ALSA 裝置路由音頻,因此 SoX 需要明確安裝其 PulseAudio 後端。執行 `sudo apt install sox libsox-fmt-pulse`。單獨安裝 `sox` 會拉入 ALSA 後端,這在 WSL 上無法錄製,因為沒有 `/dev/snd` 裝置。

178* **`Voice input is failing repeatedly and has been paused`**:語音聽寫在 10 秒內連續遇到三個擷取失敗。Claude Code 暫停聽寫,直到自這些失敗中的第一個以來已經過了 10 秒。這通常表示此主機上的麥克風或音頻堆疊無法捕獲音頻,例如無頭伺服器、沒有音頻傳遞的遠端 shell 或被拒絕的麥克風權限。確認工作輸入裝置,修復上述項目中的根本原因,然後再次觸發語音。在 v2.1.202 之前,只有啟動失敗計入暫停。203* **`Voice input is failing repeatedly and has been paused`**:語音聽寫在 10 秒內連續遇到三個擷取失敗。Claude Code 暫停聽寫,直到自這些失敗中的第一個以來已經過了 10 秒。這通常表示此主機上的麥克風或音頻堆疊無法捕獲音頻,例如無頭伺服器、沒有音頻傳遞的遠端 shell 或被拒絕的麥克風權限。確認工作輸入裝置,修復上述項目中的根本原因,然後再次觸發語音。在 v2.1.202 之前,只有啟動失敗計入暫停。

179* **在按住模式中按住 `Space` 時沒有任何反應**:在按住時監視提示輸入。如果空格不斷累積,語音聽寫可能已關閉;執行 `/voice hold` 啟用它。如果只出現一個或兩個空格然後沒有任何反應,語音聽寫已開啟但按住偵測未觸發。按住偵測需要您的終端機發送按鍵重複事件,因此如果在作業系統層級停用了按鍵重複,它無法偵測按住的鍵。使用 `/voice tap` 切換到點擊模式以避免按鍵重複要求。204* **在按住模式中按住 `Space` 時沒有任何反應**:在按住時監視提示輸入。如果空格不斷累積,語音聽寫可能已關閉;執行 `/voice hold` 啟用它。如果只出現一個或兩個空格然後沒有任何反應,語音聽寫已開啟但按住偵測未觸發。按住偵測需要您的終端機發送按鍵重複事件,因此如果在作業系統層級停用了按鍵重複,它無法偵測按住的鍵。使用 `/voice tap` 切換到點擊模式以避免按鍵重複要求。

180* **在點擊模式中點擊 `Space` 輸入空格而不是錄製**:第一次點擊只在提示輸入為空時開始錄製。先清除輸入,或通過執行 `/voice tap` 檢查您是否處於點擊模式。205* **在點擊模式中點擊 `Space` 輸入空格而不是錄製**:當提示詞中有文字且您並非在[繼續錄製](#resume-a-recording-that-stopped-by-itself)時,`Space` 會輸入空格。若要錄製,請先送出或清除提示詞。如果提示詞已經是空的,請執行 `/voice tap` 開啟點擊模式。

181* **`No audio detected from microphone`**:錄製已開始但捕獲了無聲。確認正確的輸入裝置設定為系統預設值,其輸入級別未靜音或接近零。在 Windows 上,開啟設定 → 系統 → 聲音 → 輸入並選擇您的麥克風。在 macOS 上,開啟系統設定 → 聲音 → 輸入。206* **`No audio detected from microphone`**:錄製已開始但捕獲了無聲。確認正確的輸入裝置設定為系統預設值,其輸入級別未靜音或接近零。在 Windows 上,開啟設定 → 系統 → 聲音 → 輸入並選擇您的麥克風。在 macOS 上,開啟系統設定 → 聲音 → 輸入。

182* **`Voice connection failed`**:您的錄製因為連線失敗而從未到達轉錄服務。檢查您的網路並重試。捕獲無音頻的錄製會報告 `No audio detected from microphone` 而不是此訊息。在 v2.1.200 之前,無聲麥克風可能會報告連線失敗,這暗示網路問題,而實際問題是輸入裝置。207* **`Voice connection failed`**:您的錄製因為連線失敗而從未到達轉錄服務。檢查您的網路並重試。捕獲無音頻的錄製會報告 `No audio detected from microphone` 而不是此訊息。在 v2.1.200 之前,無聲麥克風可能會報告連線失敗,這暗示網路問題,而實際問題是輸入裝置。

183* **`Dictation error: WebSocket error:` 後接憑證錯誤,例如 `unable to get local issuer certificate`**:請參閱 VS Code 頁面上的[聽寫或 Web 分頁在進行 TLS 檢查的代理伺服器後方失敗](https://code.claude.com/docs/zh-TW/vs-code.md#dictation-or-the-web-tab-fails-behind-a-tls-inspecting-proxy)。208* **`Dictation error: WebSocket error:` 後接憑證錯誤,例如 `unable to get local issuer certificate`**:請參閱 VS Code 頁面上的[聽寫或 Web 分頁在進行 TLS 檢查的代理伺服器後方失敗](https://code.claude.com/docs/zh-TW/vs-code.md#dictation-or-the-web-tab-fails-behind-a-tls-inspecting-proxy)。

184* **`Voice stream error: WebSocket upgrade rejected with HTTP <status>`**:伺服器以顯示的 HTTP 狀態拒絕了您的連線,因此這不是網路中斷。400 範圍內的狀態通常表示過期的登入、代理或機器人保護服務代替轉錄服務回應。執行 `/login` 以重新整理您的登入,如果狀態持續,請檢查您的網路路徑上是否有 VPN 或代理。如果拒絕到達時您仍在錄製,Claude Code 會在顯示此訊息之前重試 400 範圍外的狀態一次;它不會重試 400 範圍內的狀態。在 v2.1.229 至 v2.1.231 中,原生組建未顯示此訊息:Claude Code 繼續錄製,按住模式頁尾仍顯示 `listening…`,並在您停止錄製後報告 `Voice connection failed`。209* **`Voice stream error: WebSocket upgrade rejected with HTTP <status>`**:伺服器以顯示的 HTTP 狀態拒絕了您的連線,因此這不是網路中斷。400 範圍內的狀態通常表示過期的登入、代理或機器人保護服務代替轉錄服務回應。執行 `/login` 以重新整理您的登入,如果狀態持續,請檢查您的網路路徑上是否有 VPN 或代理。如果拒絕到達時您仍在錄製,Claude Code 會在顯示此訊息之前重試 400 範圍外的狀態一次;它不會重試 400 範圍內的狀態。在 v2.1.229 至 v2.1.231 中,原生組建未顯示此訊息:Claude Code 繼續錄製,按住模式頁尾仍顯示 `listening…`,並在您停止錄製後報告 `Voice connection failed`。

185* **`No speech detected`**:音頻到達轉錄服務但未識別任何單詞。靠近麥克風說話,減少背景噪音,並確認您的[聽寫語言](#change-the-dictation-language)與您說話的語言相符。210* **`No speech detected`**:音頻到達轉錄服務但未識別任何單詞。靠近麥克風說話,減少背景噪音,並確認您的[聽寫語言](#change-the-dictation-language)與您說話的語言相符。

186* **`Dictation stopped: no speech recognized for 15 seconds` 或 `Dictation stopped at its 2-minute limit`**:在 VS Code 擴充功能中,錄製會在 15 秒內未識別任何單詞時結束,或在開始後兩分鐘結束。如果您在這 15 秒內有說話,請嘗試 `No speech detected` 的修正方法。已識別的單詞會保留在提示輸入框中,且不會被送出。若要新增更多內容,請再次點擊麥克風按鈕。211* **終端機頁尾中出現 `text kept, Enter to send` 或 `dictation stopped`**:您的點擊模式錄製在沒有第二次點擊的情況下停止了。仍在提示詞中的文字尚未送出。按 `Enter` 將其送出,或[繼續新增內容](#resume-a-recording-that-stopped-by-itself)。在 v2.1.332 之前,錄製會在 15 秒內未識別任何單詞後或兩分鐘後停止,之後 Claude Code 會送出三個或更多單詞的逐字稿。

212* **`Dictation stopped: no speech recognized for 60 seconds`、`Dictation stopped at its 10-minute limit` 或 `Dictation stopped: this panel was hidden`**:VS Code 擴充功能停止了您的錄製。已識別的單詞會保留在提示輸入框中,且不會被送出。若要新增更多內容,請再次點擊麥克風按鈕。面板隱藏時,限制會較短:

213 

214 * **可見面板**:在連線與麥克風正常運作的情況下,錄製會在 60 秒內未識別任何單詞時結束,或在開始後 10 分鐘結束。如果您在這 60 秒內有說話,請嘗試 `No speech detected` 的修正方法。

215 * **隱藏面板**:隱藏面板後,錄製會在 15 秒內未識別任何單詞時結束,或在您隱藏面板兩分鐘後結束。聽寫時請保持面板可見。

216 

217 在 v2.1.332 之前,前兩則訊息為 `Dictation stopped: no speech recognized for 15 seconds` 與 `Dictation stopped at its 2-minute limit`。

218* **`Dictation error: The microphone stopped sending audio`**:已識別的單詞會保留在 VS Code 擴充功能的提示輸入框中,且不會被送出。若要重試,請點擊麥克風按鈕。

187* **轉錄是亂碼或使用了錯誤的語言**:聽寫預設為英文。如果您用另一種語言聽寫,請先在 `/config` 中設定它。請參閱[變更聽寫語言](#change-the-dictation-language)。219* **轉錄是亂碼或使用了錯誤的語言**:聽寫預設為英文。如果您用另一種語言聽寫,請先在 `/config` 中設定它。請參閱[變更聽寫語言](#change-the-dictation-language)。

188 220 

189### 終端機未列在 macOS 麥克風設定中221### 終端機未列在 macOS 麥克風設定中

vs-code.md +10 −6

Details

68 68 

69開啟 Claude Code 的其他方式:69開啟 Claude Code 的其他方式:

70 70 

71* **Activity Bar**:點選左側邊欄中的 Spark 圖示以開啟工作階段清單。點選任一工作階段即可在您[偏好的位置](#extension-settings)開啟,或開始新的工作階段。此圖示在 Activity Bar 中始終可見。71* **Activity Bar**:點擊左側邊欄中的 Spark 圖示以開啟工作階段清單。點擊任一工作階段即可在您的[偏好位置](#extension-settings)中開啟,或開始新的工作階段。此圖示始終顯示在 Activity Bar 中。

72* **Command Palette**:按下 `Cmd+Shift+P`(Mac)或 `Ctrl+Shift+P`(Windows/Linux),輸入「Claude Code」,然後選擇「Open in New Tab」等選項72* **Command Palette**:按下 `Cmd+Shift+P`(Mac)或 `Ctrl+Shift+P`(Windows/Linux),輸入「Claude Code」,然後選擇一個選項,例如「Open in New Tab」

73* **Status Bar**:點選視窗右下角的 **✻ Claude Code**。即使未開啟任何檔案,此方式也能使用。73* **Status Bar**:點擊視窗右下角的 **✻ Claude Code**。即使沒有開啟任何檔案,此方式也能使用。

74 74 

75您可以拖曳 Claude 面板,將其重新放置於 VS Code 中的任何位置。詳細資訊請參閱[自訂您的工作流程](#customize-your-workflow)。75您可以拖曳 Claude 面板,將其重新放置於 VS Code 中的任何位置。詳細資訊請參閱[自訂您的工作流程](#customize-your-workflow)。

76 76 


688| New Conversation | `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux) | 開始新對話。需要 Claude 處於聚焦狀態,且 `enableNewConversationShortcut` 設為 `true` |688| New Conversation | `Cmd+N` (Mac) / `Ctrl+N` (Windows/Linux) | 開始新對話。需要 Claude 處於聚焦狀態,且 `enableNewConversationShortcut` 設為 `true` |

689| Reopen Closed Session | `Cmd+Shift+T` (Mac) / `Ctrl+Shift+T` (Windows/Linux) | 重新開啟最近關閉的 Claude 工作階段分頁。若最後關閉的分頁不是 Claude 工作階段,則改為執行 VS Code 一般的重新開啟已關閉編輯器功能。可透過 `enableReopenClosedSessionShortcut` 停用 |689| Reopen Closed Session | `Cmd+Shift+T` (Mac) / `Ctrl+Shift+T` (Windows/Linux) | 重新開啟最近關閉的 Claude 工作階段分頁。若最後關閉的分頁不是 Claude 工作階段,則改為執行 VS Code 一般的重新開啟已關閉編輯器功能。可透過 `enableReopenClosedSessionShortcut` 停用 |

690| Insert @-Mention Reference | `Option+K` (Mac) / `Alt+K` (Windows/Linux) | 插入目前檔案與選取範圍的參照(需要編輯器處於聚焦狀態) |690| Insert @-Mention Reference | `Option+K` (Mac) / `Alt+K` (Windows/Linux) | 插入目前檔案與選取範圍的參照(需要編輯器處於聚焦狀態) |

691| Add Cell to Chat | - | 將筆記本儲存格、其文字輸出或錯誤,以及該筆記本的 @-mention 加入提示詞輸入框。需要 Claude Code v2.1.331 或更新版本 |

692| Resolve Merge Conflicts | - | 在提示詞輸入框中放入解決衝突的請求。請在有衝突的檔案的 **Editor Toolbar** 中,或在原始檔控制的 **Merge Changes** 上,按一下此命令的按鈕。需要 Claude Code v2.1.331 或更新版本 |

691| Accept Change at Cursor | - | 在逐一[檢閱提議的編輯](#get-started)時,接受游標所在處的變更。需要 Claude Code v2.1.275 或更新版本 |693| Accept Change at Cursor | - | 在逐一[檢閱提議的編輯](#get-started)時,接受游標所在處的變更。需要 Claude Code v2.1.275 或更新版本 |

692| Reject Change at Cursor | - | 在逐一檢閱提議的編輯時,還原游標所在處的變更。需要 Claude Code v2.1.275 或更新版本 |694| Reject Change at Cursor | - | 在逐一檢閱提議的編輯時,還原游標所在處的變更。需要 Claude Code v2.1.275 或更新版本 |

693| Toggle Focus view | `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux) | 隱藏或顯示對話中的工具活動。在 Claude 面板或側邊欄可見時有效。在 Windows/Linux 上,當焦點位於偵錯主控台或可搜尋的清單(例如檔案總管)時,`Ctrl+Alt+F` 會改為開啟 VS Code 的尋找功能。請將焦點移至編輯器或 Claude 面板後再按一次。需要 Claude Code v2.1.221 或更新版本 |695| Toggle Focus view | `Ctrl+Option+F` (Mac) / `Ctrl+Alt+F` (Windows/Linux) | 隱藏或顯示對話中的工具活動。在 Claude 面板或側邊欄可見時有效。在 Windows/Linux 上,當焦點位於偵錯主控台或可搜尋的清單(例如檔案總管)時,`Ctrl+Alt+F` 會改為開啟 VS Code 的尋找功能。請將焦點移至編輯器或 Claude 面板後再按一次。需要 Claude Code v2.1.221 或更新版本 |


771| `autosave` | `true` | 在 Read、Edit 和 Write 工具執行前自動儲存檔案 |773| `autosave` | `true` | 在 Read、Edit 和 Write 工具執行前自動儲存檔案 |

772| `attachOpenFile` | `true` | 將編輯器中開啟的檔案新增至您的訊息,並顯示在提示詞輸入框中。關閉時,只有在連同您選取的文字一起時才會新增該檔案。需要 Claude Code v2.1.271 或更新版本 |774| `attachOpenFile` | `true` | 將編輯器中開啟的檔案新增至您的訊息,並顯示在提示詞輸入框中。關閉時,只有在連同您選取的文字一起時才會新增該檔案。需要 Claude Code v2.1.271 或更新版本 |

773| `attachSelection` | `true` | 將您在編輯器中選取的文字新增至您的訊息,並顯示在提示詞輸入框中。關閉時,您仍可[將選取內容以 @-mention 形式新增](#automatic-context-from-your-selection-and-open-file)。需要 Claude Code v2.1.300 或更新版本 |775| `attachSelection` | `true` | 將您在編輯器中選取的文字新增至您的訊息,並顯示在提示詞輸入框中。關閉時,您仍可[將選取內容以 @-mention 形式新增](#automatic-context-from-your-selection-and-open-file)。需要 Claude Code v2.1.300 或更新版本 |

776| `showFixActions` | `true` | 在編輯器的錯誤、警告和失敗的測試上顯示 **Fix with Claude Code**。選取後會在提示詞輸入框中放入修正請求。需要 Claude Code v2.1.331 或更新版本 |

774| `useCtrlEnterToSend` | `false` | 使用 Ctrl/Cmd+Enter 而非 Enter 傳送提示詞 |777| `useCtrlEnterToSend` | `false` | 使用 Ctrl/Cmd+Enter 而非 Enter 傳送提示詞 |

775| `scrollToBottomOnSend` | `true` | 傳送訊息時將對話捲動至底部。關閉時,對話會停留在您離開時的位置。需要 Claude Code v2.1.275 或更新版本 |778| `scrollToBottomOnSend` | `true` | 傳送訊息時將對話捲動至底部。關閉時,對話會停留在您離開時的位置。需要 Claude Code v2.1.275 或更新版本 |

776| `pinPrompt` | `true` | 在您捲動瀏覽 Claude 的回覆時,將您的訊息固定在頂端。需要 Claude Code v2.1.330 或更新版本 |779| `pinPrompt` | `true` | 在您捲動瀏覽 Claude 的回覆時,將您的訊息固定在頂端。需要 Claude Code v2.1.330 或更新版本 |


793 796 

794## 使用第三方供應商797## 使用第三方供應商

795 798 

796預設情況下,Claude Code 會直接連線至 Anthropic 的 API。如果您的組織使用 Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 來存取 Claude,請將擴充功能設定為改用您的供應商:799預設情況下,Claude Code 會直接連線至 Anthropic 的 API。如果您使用 Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 來存取 Claude,請將擴充功能設定為改用您的供應商:

797 800 

798**1. 停用登入提示**801**1. 停用登入提示**

799 802 


996| `Could not locate the Claude CLI on PATH` | [Could not locate the Claude CLI on PATH](https://code.claude.com/docs/zh-TW/errors.md#could-not-locate-the-claude-cli-on-path) |999| `Could not locate the Claude CLI on PATH` | [Could not locate the Claude CLI on PATH](https://code.claude.com/docs/zh-TW/errors.md#could-not-locate-the-claude-cli-on-path) |

997| `The connection to Claude Code ended before this message completed` | [The connection to Claude Code ended before this message completed](https://code.claude.com/docs/zh-TW/errors.md#the-connection-to-claude-code-ended-before-this-message-completed) |1000| `The connection to Claude Code ended before this message completed` | [The connection to Claude Code ended before this message completed](https://code.claude.com/docs/zh-TW/errors.md#the-connection-to-claude-code-ended-before-this-message-completed) |

998| `The Claude Code program for this computer, the <build> build, could not be found` | [The Claude Code program for this computer could not be found](https://code.claude.com/docs/zh-TW/errors.md#the-claude-code-program-for-this-computer-could-not-be-found) |1001| `The Claude Code program for this computer, the <build> build, could not be found` | [The Claude Code program for this computer could not be found](https://code.claude.com/docs/zh-TW/errors.md#the-claude-code-program-for-this-computer-could-not-be-found) |

1002| `Failed to set model: Settings file is not valid JSON` | [修正損壞的設定檔](https://code.claude.com/docs/zh-TW/settings.md#fix-a-broken-settings-file) |

999| 在 VS Code 的整合式終端機中找不到 `claude` | [在 VS Code 中執行 CLI](#run-cli-in-vs-code) |1003| 在 VS Code 的整合式終端機中找不到 `claude` | [在 VS Code 中執行 CLI](#run-cli-in-vs-code) |

1000 1004 

1001### 擴充功能無法安裝1005### 擴充功能無法安裝


1008 1012 

1009當您開啟檔案時,Spark 圖示會出現在**編輯器工具列**(編輯器右上角)中。如果您沒有看到它:1013當您開啟檔案時,Spark 圖示會出現在**編輯器工具列**(編輯器右上角)中。如果您沒有看到它:

1010 1014 

10111. **開啟檔案**:此圖示需要開啟檔案。僅開啟資料夾是不夠的。10151. **開啟檔案**:此圖示需要開啟檔案。

10122. **檢查 VS Code 版本**:需要 1.94.0 或更新版本。請在 **Help > About** 中查看10162. **檢查 VS Code 版本**:需要 1.94.0 或更新版本。請在 **Help > About** 中查看

10133. **重新啟動 VS Code**:從命令選擇區執行「Developer: Reload Window」10173. **重新啟動 VS Code**:從命令選擇區執行「Developer: Reload Window」

10144. **停用衝突的擴充功能**:暫時停用其他 AI 擴充功能(Cline、Continue 等)10184. **停用衝突的擴充功能**:暫時停用其他 AI 擴充功能(Cline、Continue 等)

10155. **檢查工作區信任**:擴充功能在受限模式下無法運作10195. **檢查工作區信任**:擴充功能在受限模式下無法運作

1016 1020 

1017或者,點擊視窗右下角**狀態列**中的 **✻ Claude Code**。即使沒有開啟檔案,此方法也能運作。您也可以使用**命令選擇區**(`Cmd+Shift+P` / `Ctrl+Shift+P`)並輸入「Claude Code」。1021或者,按一下視窗右下角 **Status Bar** 中的 **✻ Claude Code**。即使沒有開啟檔案也能使用此方式。您也可以使用 **Command Palette**(`Cmd+Shift+P` / `Ctrl+Shift+P`)並輸入「Claude Code」。

1018 1022 

1019### 在 macOS 上按 Cmd+Esc 沒有反應1023### 在 macOS 上按 Cmd+Esc 沒有反應

1020 1024 

Details

323. **工作**:Claude 分析代碼、進行更改、執行測試並檢查其工作。您可以全程觀看和引導,或者離開並在完成時返回。323. **工作**:Claude 分析代碼、進行更改、執行測試並檢查其工作。您可以全程觀看和引導,或者離開並在完成時返回。

334. **推送分支**:當 Claude 達到停止點時,它會將其分支推送到 GitHub。您檢查差異、留下內聯評論、建立 PR 或發送另一條訊息以繼續。334. **推送分支**:當 Claude 達到停止點時,它會將其分支推送到 GitHub。您檢查差異、留下內聯評論、建立 PR 或發送另一條訊息以繼續。

34 34 

35推送分支時會話不會關閉。PR 建立和進一步編輯都在同一對話中進行。35PR 建立和進一步編輯都在同一對話中進行。

36 36 

37## 比較執行 Claude Code 的方式37## 比較執行 Claude Code 的方式

38 38 

workflows.md +1 −1

Details

466* 在大型執行前檢查 `/model`,如果您通常為日常工作切換到較小的模型466* 在大型執行前檢查 `/model`,如果您通常為日常工作切換到較小的模型

467* 當您描述任務時,要求 Claude 為不需要最強模型的階段使用較小的模型467* 當您描述任務時,要求 Claude 為不需要最強模型的階段使用較小的模型

468 468 

469當您組織的 [`availableModels` 允許清單](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection)封鎖指令碼為 agent 請求的模型時,該 agent 會改為在替代模型上執行,並遵循與 [subagent 相同的替代規則](https://code.claude.com/docs/zh-TW/sub-agents.md#when-an-allowlist-blocks-a-subagent-model)。469當 [`availableModels` 允許清單](https://code.claude.com/docs/zh-TW/model-config#restrict-model-selection)封鎖指令碼為 agent 請求的模型時,該 agent 會改為在替代模型上執行,並遵循與 [subagent 相同的替代規則](https://code.claude.com/docs/zh-TW/sub-agents.md#when-an-allowlist-blocks-a-subagent-model)。

470 470 

471### 設定大小指南471### 設定大小指南

472 472 

worktrees.md +2 −2

Details

141and report the results.141and report the results.

142```142```

143 143 

144每個 subagent 都會獲得一個臨時 worktree,當 subagent 完成而沒有變更時 Claude Code 會自動移除;具有變更的 worktree 會保留在磁碟上,直到下面的[定期掃描](#clean-up-subagent-and-background-session-worktrees)可以在不遺失工作的情況下移除它。對於由您的 [WorktreeCreate hook](https://code.claude.com/docs/zh-TW/hooks.md#worktreecreate) 建立的 worktree,請改為參閱 [WorktreeRemove](https://code.claude.com/docs/zh-TW/hooks.md#worktreeremove)。144subagent 完成時,如果 git 顯示該處有已變更的檔案、未追蹤的檔案或新的提交,Claude Code 會保留該 worktree。否則,Claude Code 可以立即移除該 worktree。保留的 worktree 會留在磁碟上,直到[定期掃描](#clean-up-subagent-and-background-session-worktrees)可以在不遺失工作的情況下移除它。對於由您的 [WorktreeCreate hook](https://code.claude.com/docs/zh-TW/hooks.md#worktreecreate) 建立的 worktree,請改為參閱 [WorktreeRemove](https://code.claude.com/docs/zh-TW/hooks.md#worktreeremove)。

145 145 

146子代理 worktrees 使用與 `--worktree` 相同的[基礎分支](#choose-the-base-branch),因此它們從您的儲存庫的預設分支分支,除非 `worktree.baseRef` 設定為 `"head"`。146子代理 worktrees 使用與 `--worktree` 相同的[基礎分支](#choose-the-base-branch),因此它們從您的儲存庫的預設分支分支,除非 `worktree.baseRef` 設定為 `"head"`。

147 147 


161 161 

162#### Worktree 鎖定與手動移除162#### Worktree 鎖定與手動移除

163 163 

164當代理正在執行時,Claude Code 會在其 worktree 上執行 `git worktree lock`,以便並行清理無法將其移除,並在代理完成時釋放鎖定。Claude Code 對為背景會話建立的 worktree 執行相同的鎖定,同時會話執行,因此掃描會保留 worktree 並且 `git worktree remove` 拒絕移除它。164Claude Code 會在其為 agent 建立的 worktree 上執行 `git worktree lock`,以便在 agent 首次執行期間、任何[恢復](https://code.claude.com/docs/zh-TW/sub-agents.md#resume-subagents)之前,並行清理無法將其移除。Claude Code 為移至背景的工作階段建立的 worktree,在工作階段執行期間也有相同的鎖定,因此掃描會保留該 worktree,且 `git worktree remove` 會拒絕移除它。

165 165 

166掃描也會釋放 Claude Code 為其程序已結束的工作階段設定的鎖定,因此被終止的背景工作階段不會永久鎖定其 worktree。掃描永遠不會釋放您自己使用 `git worktree lock` 設定的鎖定。166掃描也會釋放 Claude Code 為其程序已結束的工作階段設定的鎖定,因此被終止的背景工作階段不會永久鎖定其 worktree。掃描永遠不會釋放您自己使用 `git worktree lock` 設定的鎖定。

167 167