claude@cli:~/docs$ cat claude-code.md

Claude Code: 企業部署

# 將 Claude Code 推行至整個組織,歸結為三項決定:由哪個雲端供應商提供模型、每位使用者取得哪些受管設定,以及推行如何分階段進行與稽核。

author: words: 3947 read_time: 37m updated: 2026-11-29 08:10

Part 3 of New to Claude Code

將 Claude Code 推行至整個組織,歸結為三項決定:由哪個雲端供應商提供模型、每位使用者取得哪些受管設定,以及推行如何分階段進行與稽核。

最後更新: 2026-11-29 · 37 分鐘閱讀 · 3K+ words

$ less claude-code.md

將 Claude Code 推行至整個組織,歸結為三項決定:由哪個雲端供應商提供模型、每位使用者取得哪些受管設定,以及推行如何分階段進行與稽核。

本節涵蓋:雲端供應商比較、受管設定部署、processWrapper 企業啟動器、企業版 CLAUDE.md、推行策略、稽核與合規,以及供管理員使用的 Analytics API。

雲端供應商比較

功能 Anthropic 直連 Amazon Bedrock Google Cloud 的 Agent Platform(原 Vertex AI) Microsoft Foundry
驗證 Claude 方案登入或 API 金鑰 IAM/API 金鑰 GCP 憑證 Entra ID/API 金鑰
成本追蹤 Console(API);claude.ai 分析(Team、Enterprise) AWS Cost Explorer GCP Billing Azure Cost Mgmt
稽核日誌 Compliance API(Enterprise 方案);OpenTelemetry 事件 CloudTrail Cloud Audit Logs Azure Monitor
SSO Claude for Teams 與 Enterprise 上支援;單純的 API 金鑰則無 IAM Identity Center IAM Entra ID

AWS 上的 Claude Platform 是第五種途徑:由 Anthropic 營運的 Claude API,搭配 AWS 驗證、IAM 存取控制與 AWS Marketplace 計費,預設模型與 Anthropic API 相同,皆為 Opus 5.5。364

Claude Models on Google Cloud (Anthropic managed) 是第六種:由 Anthropic 營運、透過您的 Google Cloud 專案存取的 Claude API,以 Google Cloud IAM 控管存取,並透過 Google Cloud Marketplace 計費。Anthropic 於2026年10月22日推出此途徑,沒有任何 Claude Code 版本說明提及它。它與由 Google 管理的 Agent Platform 是不同的服務。Claude Code 需要 v2.1.307 或更新版本、Application Default Credentials(gcloud auth application-default login,或服務帳戶金鑰檔),專案上的 roles/claude.user IAM 角色,以及 ~/.claude/settings.json 的 env 區塊中的三個變數:CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD=1、ANTHROPIC_GOOGLE_CLOUD_PROJECT 與 ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID(wrkspc_ 開頭的值)。之後 /status 會顯示一行包含 on Google Cloud 的 API provider(API 供應商)。文件的別名表為它列出 Opus 5.5、Sonnet 5.5 與 Haiku 4.5,預設為 Opus 5.5。528535

AWS Bedrock、Google Cloud 的 Agent Platform(原 Vertex AI)以及 AWS 上的 Claude Platform 的工作階段預設採用 Claude Opus 5.5(v2.1.280+)。204218 在 Microsoft Foundry 上,v2.1.332 的版本說明將預設值設為 Sonnet 5.5,但文件頁面仍寫著 Sonnet 4.5(請參閱可用的模型)。527528 自 v2.1.207 起,auto mode 在 Bedrock、Agent Platform 或 Microsoft Foundry 上不需要透過 CLAUDE_CODE_ENABLE_AUTO_MODE 選擇加入;管理員可透過 disableAutoMode 受管設定將其關閉。182

受管設定部署

透過 managed-settings.json 部署全組織政策:

位置: - macOS: /Library/Application Support/ClaudeCode/managed-settings.json - Linux 與 WSL: /etc/claude-code/managed-settings.json - Windows: C:\Program Files\ClaudeCode\managed-settings.json

政策範例:

{
  "permissions": {
    "allow": [
      "Read",
      "Glob",
      "Grep",
      "Bash(npm run:*)",
      "Bash(git:*)"
    ],
    "deny": [
      "Bash(rm -rf:*)",
      "Bash(curl:*)",
      "Read(.env*)",
      "WebFetch"
    ],
    "defaultMode": "default",
    "disableBypassPermissionsMode": "disable"
  },
  "model": "claude-opus-5-5",
  "allowManagedPermissionRulesOnly": true,
  "allowManagedHooksOnly": true
}

disableBypassPermissionsMode 位於 permissions 之下;這是 Claude Code 唯一記載它的位置,因此放在檔案頂層的副本不會關閉略過權限模式。Bash(...) 拒絕規則擋下的是指令的常見寫法,而非程式本身(/usr/bin/curl 或 sh -c 'curl ...' 都能繞過 Bash(curl:*)),因此在限制必須確實生效的地方,請搭配沙箱網路允許清單使用,並開啟 sandbox.network.strictAllowlist(或受管的 allowManagedDomainsOnly):若兩者皆未開啟,沙箱內的指令連到清單外的主機時,在 Manual 模式下會跳出提示,在 bypassPermissions 模式下則會被允許。365366391

管理員部署的設定(除非另有標示,否則僅限受管設定):

鍵 效果
allowManagedPermissionRulesOnly 禁止使用者/專案設定定義權限規則;僅套用受管規則
allowManagedHooksOnly 僅執行受管 hooks,以及 Agent SDK hooks 與受管設定強制啟用的 plugins 所帶的 hooks365
allowAllClaudeAiMcps 企業設定,可在 managed-mcp.json 之外一併載入 claude.ai 雲端 MCP 連接器(v2.1.149+)
allowClaudeInChromeWithManagedMcp 允許 claude --chrome 與獨占的 managed-mcp.json 並行執行(v2.1.282+)
deniedModels / availableModelsMatch 即使 availableModels 允許,仍可封鎖特定模型;"exact" 將每個 availableModels 項目限制為其指定的版本(v2.1.283+)
allowedProviders 限制機器可使用的 API 供應商:Anthropic API、自訂端點、Bedrock、Mantle、Agent Platform、Foundry、AWS 上的 Claude Platform,或 Cloud gateway(v2.1.285+)447
strictKnownMarketplaces plugin marketplace 的允許清單(空陣列 = 全面封鎖)。截至 v2.1.223,項目接受 "owner/*" 萬用字元,可允許某個 GitHub 組織下的所有 marketplace 儲存庫:一行即可,無需逐一列舉,且該組織下的新儲存庫會自動納入。blockedMarketplaces 採用相同的萬用字元形式。v2.1.232 新增更易懂的別名:此鍵對應 allowedMarketplaces,extraKnownMarketplaces 對應 additionalMarketplaces;GitLab 儲存庫 URL(含巢狀子群組)也可作為 marketplace 來源。197252 截至 v2.1.321,在受管 extraKnownMarketplaces 中宣告的市集名稱,無法再從其他來源新增:來自其他地方的項目會被隱藏,而宣告的市集所列出的 plugins 會從該市集重新安裝。283
allowedMcpServers 使用者可設定的 MCP 伺服器允許清單(空陣列 = 全面封鎖)。它不會檢查 managed-mcp.json 或 managedMcpServers 中的伺服器(v2.1.259+),但在 env 以外使用 ${VAR} 展開的 managed-mcp.json 伺服器除外;若要讓某個受管伺服器保持關閉,請為它新增一筆 deniedMcpServers 項目208425 截至 v2.1.305,它也不再過濾 managed-mcp.json 中僅在 env 使用 ${VAR} 的 stdio 伺服器,因此允許清單未列出的伺服器會在升級後載入;請用 deniedMcpServers 將其擋下275 可用於任何設定檔;請從受管設定強制執行365
deniedMcpServers MCP 伺服器的拒絕清單(優先於允許清單)。截至 v2.1.318,URL 項目也會封鎖上游 URL 相符的 Anthropic 提供的伺服器,以及雲端工作階段與自架 runner 上的連接器283 自 v2.1.330 起,名稱項目只會隱藏所指名的 claude.ai 連接器,不會隱藏同一 URL 上的其他連接器(若要全部封鎖,請拒絕確切的 URL);而自 v2.1.328 起,claude.ai <name> 形式的項目也會套用到雲端與自架 runner 工作階段中的該連接器527 可用於任何設定檔;請從受管設定強制執行365
managedMcpServers 向每位使用者提供 HTTP/SSE MCP 伺服器,項目格式與 .mcp.json 相同;指定要執行命令的項目會被略過(v2.1.259+)208
permissions.disableBypassPermissionsMode 設為 "disable" 時,會拒絕 --dangerously-skip-permissions,並忽略 agent 定義中的 permissionMode: bypassPermissions;位於 permissions 之下。可用於任何設定檔;請從受管設定強制執行365
disableAutoMode 全組織停用 Auto Mode:gateway 使用者不再透過環境變數選擇加入後,這是管理員端的控制方式(v2.1.207+)182 也接受 permissions.disableAutoMode 的寫法。可用於任何設定檔;請從受管設定強制執行365
forceLoginMethod 限制使用者的驗證方式(可用於任何設定檔;請從受管設定強制執行365)。在終端機、VS Code 擴充功能、SDK、claude setup-token 與 /install-github-app 中強制執行(v2.1.212+)186。截至 v2.1.261,"gateway" 也會清除殘留憑證:固定使用 Claude apps gateway 的機器會忽略殘留的 API 金鑰或 claude.ai 登入,改為要求執行 /login;Bedrock、Agent Platform 與 Foundry 工作階段不受影響211。截至 v2.1.265,受管設定中含有 forceLoginGatewayUrl 的機器,自啟動起即同樣視為 Claude apps gateway 工作階段——殘留的 claude.ai 登入或 API 金鑰不會被使用212
gatewayInternalNetworks 允許在組織自有的公開 IPv4 區段上 /login 至 Claude apps gateway(v2.1.268+)213
modelPricing 各模型的合約費率與折扣乘數;/usage、狀態列與遙測成本數字會採用這些值而非牌價(依設定參考文件為 v2.1.242 或更新版本;版本說明將其列於 2.1.243 之下)247383;截至 v2.1.271,乘數可高於 1,最高至 10,用於加成的內部成本分攤費率——Claude apps gateway 的 pricing 區塊也接受相同設定213
disableSkillShellExecution 禁止在 skills、自訂命令與 plugin 命令中內嵌執行 shell134 可用於任何設定檔;受管設定中的 true 無法在其他地方被覆寫365
forceRemoteSettingsRefresh 在遠端受管設定重新擷取完成前封鎖啟動;擷取失敗則結束(失敗即關閉)135
parentSettingsBehavior 管理員層級鍵("first-wins" 或 "merge"),讓 SDK 的 managedSettings(父層級)加入政策合併,而非在預設的先到先贏規則下落敗(v2.1.133+)157

使用者無法覆寫受管設定。受管設定在設定階層中具有最高優先權。

管理主控台的控制項也會影響 CLI:截至 v2.1.260,Claude Code 會遵循組織的 Claude in Chrome 管理員設定——管理員關閉後,--chrome、/chrome 與瀏覽器工具在成員的工作階段中都無法使用(請參閱 Claude in Chrome)。209

Claude apps gateway 強化(v2.1.268): gatewayInternalNetworks 受管設定讓管理員允許在組織自有的公開 IPv4 區段上 /login 至 gateway;access_control.allow_cidrs 為空的 gateway 現在會在啟動時發出警告,並在第一次收到來自公開位址的請求時再警告一次;若在 gateway.yaml 設定了 pricing:,已登入的 Claude Code 用戶端會透過受管設定收到相同費率,使 /usage 與遙測數字和 gateway 的支出計量一致。213

位於轉送代理後方的 Claude apps gateway(v2.1.277): 針對封閉網路中的 gateway 新增兩項功能。CLAUDE_GATEWAY_PROXY_IS_EGRESS_BOUNDARY=1 適用於唯一對外出口是轉送代理的 gateway:每個對外請求都會把主機名稱交給代理,而非在本機解析,因此即使 gateway 主機沒有直接對外路由,也無法解析外部名稱的 DNS,仍可透過代理連上供應商。此外,gateway 的 upstream 接受選用的 headers: 對應表,可將靜態標頭傳送給您架設在供應商前方的代理——這正是依自有標頭進行驗證或路由的代理所需的掛接點。同一版本也改進了 gateway 的 loopback 錯誤訊息,會明確指出 CLAUDE_GATEWAY_ALLOW_LOOPBACK,並修正了設定代理時 gateway 遙測轉送忽略 NO_PROXY 中所列收集器主機名稱或網域的問題。216

Claude apps gateway 新增功能(v2.1.281): Bedrock upstream 接受 assume_role,讓 gateway 以透過 STS 取得的 IAM 角色呼叫 Bedrock,必要時可跨 AWS 帳戶,並可選擇為每位開發者建立獨立工作階段;另接受 guardrail: {id, version},對所有經由該 upstream 送出的請求套用 Amazon Bedrock guardrail(須在所有 Bedrock upstream 上設定,或全部不設定)。telemetry.resource_attributes 為 Claude Desktop 與 /login 工作階段的遙測加上固定標籤,而 desktop 政策區塊接受較新的 Claude Desktop 鍵,包括 blockReadsOutsideWorkingDirectories 與 disableBypassPermissionsMode。當 managedMcpServers 項目的 envHelper 路徑以 \??\ 或 /??/ 開頭時,gateway 現在會拒絕啟動,因為目前的 Claude Desktop 不會執行這種路徑形式。221

Claude apps gateway 新增項目(v2.1.312 至 v2.1.317): oidc.user_id_claim 可改用 sub 以外的 id_token 宣告來識別使用者,例如 Microsoft Entra ID 的 oid(v2.1.312)。上游設定中可選的 groups 清單,只會把屬於這些 IdP 群組的開發者導向該上游,容錯移轉時亦然;在 Bedrock 上游的 guardrail 旁加上 guardrail_trace: true,則會記錄某次請求觸發了哪個 Amazon Bedrock guardrail 篩選器,但不含比對到的文字(v2.1.314)。281

在 v2.1.316 與 v2.1.317 中,支出上限管理 API 的 pooled_budget 讓群組在每位成員各自的限額之外,另享一份由成員共用的每月預算;managed.policy_mode: layered 會套用每一條符合該開發者的政策,並依序將每條政策合併覆蓋於其下方列出的政策之上(以往使用者只會套用第一條符合的政策),而早於 v2.1.316 的 gateway 一旦發現此鍵便會拒絕啟動;guardrail.input_tagging 則會用 Bedrock guardrail 提示詞攻擊篩選器所需的輸入標籤包住提示詞,設為 all_messages_and_system 時連系統提示詞也會一併標記(v2.1.316)。管理 API 的 GET /v1/organizations/analytics/cost 可回報某段日期範圍內的過往支出,可依總計、每位開發者、每日或每個 IdP 群組呈現;其資料來源是每位開發者所屬群組的每日記錄,於設定了 admin: 的 gateway 上保留 admin.identity_retention_days 天(預設 90 天)(v2.1.317)。gateway 現在也會將請求指定的每個模型逐一對照 availableModels、deniedModels 與 models 檢查,不符時回應 400 並註明欄位(v2.1.316);同時會原樣傳遞 Bedrock 的「Input is too long.」(輸入過長。)錯誤,讓工作階段改為進行壓縮,而不是直接失敗(v2.1.317)。參考資料:Claude apps gateway 設定。281282

Claude apps gateway 新增項目(v2.1.318 至 v2.1.321): assume_role 可用於 mantle 上游,適用於其他 AWS 帳戶中的角色,以及依開發者區分的 AWS 成本歸屬(v2.1.318)。admin.pooled_conflict_rule(default_order 為預設值,或 priority_list)設定開發者屬於多個群組時,gateway 嘗試各群組共用預算的順序,而 admin.pooled_priority_order 可指定最多 50 個優先嘗試其預算的群組;早於 v2.1.319 的 gateway 伺服器一旦發現其中任一鍵便會拒絕啟動,因此請先升級每個副本再加入這些鍵。頂層的 login_notice 鍵會在 gateway 的瀏覽器驗證頁面與 Claude Code 的登入畫面上,顯示一則由營運者定義、最多 500 個字元的訊息;CLAUDE_GATEWAY_LOG_FORMAT=json 會將維運日誌行轉為含 severity、time 與 message 的 JSON;而對於沒有支出上限的開發者,/usage 會顯示今日、本週與本月的支出(以上皆為 v2.1.319)。283

在 policy_mode: layered 下,受管 MCP 伺服器現在會在每一條符合的政策(包括 match: {})之間累加,因此已採用此模式的 gateway 在升級後會提供更多伺服器。Bedrock、Vertex 與 Foundry 上游也會忽略 gateway 環境中的 ANTHROPIC_*_BASE_URL 變數,因此若要使用其他端點,請在上游設定 base_url(v2.1.321)。283

Claude apps gateway 新增項目(v2.1.323 至 v2.1.332): oidc.groups_jsonpath 會使用 JSONPath(RFC 9535)的一個小子集,從物件清單中符合的項目讀取群組;而 CLAUDE_GATEWAY_IDP_CONNECT_BY_HOSTNAME=1 會讓登入請求在 oidc.use_proxy: true 下,將 https IdP 的主機名稱交給代理伺服器,即使設定了 NO_PROXY 亦然(v2.1.331)。attributionProject 設定會在設定了 admin.billing_group_tag 的 gateway 上指定工作階段的計費群組,而 gateway 的提示標頭新增了 x-claude-code-managed-settings-checksum(v2.1.327)。access_control.allow_cidrs 為空時顯示的啟動警告,現在改為每次啟動都會顯示的通知,在文字日誌中以方框呈現,說明絕不可將 gateway 暴露於公開網際網路(v2.1.329)。maxEffortLevel 不是有效 effort 等級的政策會產生啟動警告(v2.1.328)。在 gateway 的內建模型清單中,Sonnet 5.5 取代 Sonnet 4.5 成為第二個模型,在政策不允許 Opus 4.6 的情況下,Claude Desktop 會以它啟動(v2.1.332)。對於第三方供應商上的 Claude Desktop 工作階段,CLAUDE_CODE_AUTO_MODE_MODEL 會從受管設定讀取(v2.1.323)。527

v2.1.323 至 v2.1.331 的受管設定。 開啟沙箱的受管設定,並不會讓沙箱內的指令免提示執行:若要如此,請在您排名最高的受管來源中設定 sandbox.autoAllowBashIfSandboxed: true(v2.1.325)。組織設定與政策請求不再使用僅由 ALL_PROXY 設定的代理伺服器,因此若您的網路需要代理伺服器才能處理這些請求,請設定 HTTPS_PROXY;而受管的 policyHelper 也不再從使用者設定檔或 --settings 檔案取用環境變數(v2.1.323)。不含 "$defaults" 的受管 autoMode.environment 清單,在 Claude Desktop 與 Agent SDK 應用程式中同樣會取代所有內建項目(v2.1.326)。工作階段期間新增的 managed-mcp.json 可能會在下一次檢查時套用,而已開啟的工作階段需要重新啟動才能完整套用(v2.1.326)。在 Windows 上,HKLM 政策的排名高於 managed-settings.json,而損壞的登錄值可能導致無法啟動,因此請在升級前檢查登錄設定(v2.1.331)。在 Anthropic 的 Enterprise Admin Console 中管理的組織可從 CLI 登入:執行 claude auth login 後,Claude Code 會套用該組織的設定,並使用其雲端供應商或 gateway(v2.1.330)。527

平台原生部署(v2.1.51+): 除了 JSON 檔案之外,受管設定也可以透過 macOS 設定描述檔或 Windows 登錄檔部署,與現有的 MDM(行動裝置管理)及群組原則基礎架構相互配合:105365

  • macOS: 透過您的 MDM(Jamf、Intune 或類似工具)將設定描述檔部署至 com.anthropic.claudecode 受管偏好設定網域,使用與 managed-settings.json 相同的頂層鍵,巢狀設定以字典表示,清單則以 plist 陣列表示
  • Windows: 透過群組原則或 Intune,將 JSON 部署為 HKLM\SOFTWARE\Policies\ClaudeCode 下名為 Settings 的 REG_SZ 或 REG_EXPAND_SZ 值

哪個受管來源勝出: 預設情況下,各來源不會合併(選擇性啟用合併的方式請參閱下方的 managedSourcesBehavior)。當存在多個受管來源時,Claude Code 會依下列順序採用第一個提供至少一個政策鍵的來源,並忽略其餘來源(少數跨來源的鍵例外,例如 sandbox 鎖定、forceRemoteSettingsRefresh,以及逐變數合併的 env,這些仍會從每個管理來源讀取):245

  1. 來自 claude.ai 的遠端設定(伺服器管理設定)或 Claude apps gateway,在工作階段具備符合資格的憑證、以 /login 登入 gateway,或在提供該工作階段設定的 gateway 後方於 Claude Desktop 的 Code 分頁中執行時擷取523
  2. MDM 或作業系統層級的政策:macOS plist 或 HKLM 登錄機碼
  3. 受管設定檔案:managed-settings.d/*.json 與 managed-settings.json,兩者會合併在一起
  4. Windows 上的 HKCU 登錄檔(啟用 wslInheritsWindowsSettings 後在 WSL 上亦然),僅在其上方沒有任何管理來源存在(即設定了政策鍵的來源,或雖存在但無法讀取的 HKLM 值、受管設定檔或 managed-settings.d 目錄),且主機提供的上層設定也未提供限制性鍵時才會讀取523

若某個檔案或政策只包含控制鍵 wslInheritsWindowsSettings,則不列入計算,Claude Code 會繼續檢查下一個來源。對於被略過的來源不會顯示任何警告;截至 v2.1.243,/status 會印出一行 Skipped sources,列出存在但因較高優先順序的來源生效而未套用的受管來源(例如位於 MDM plist 之下的 managed-settings.json)。247

v2.1.273 補上了此機制的一個執行漏洞:透過 MDM 或 managed-settings.json 設定的 allowManagedMcpServersOnly、deniedMcpServers 與 disableClaudeAiConnectors,在伺服器管理設定同時存在時會被忽略——現在即使兩種來源同時生效,MCP 與連接器鎖定仍會維持有效。214

選擇啟用合併:managedSourcesBehavior: "merge"。 先到先贏只是預設行為。在您部署的最高排名來源中將控制鍵 managedSourcesBehavior 設為 "merge" 後,會改為依鍵的種類組合所有管理來源。permissions.allow、hooks 與 sandbox.network.allowedDomains 等清單會跨來源合併其項目。allowManagedHooksOnly 與 permissions.disableBypassPermissionsMode 等鎖定採用任一來源所設的最嚴格值。限制性的允許清單(availableModels、allowedMcpServers、strictKnownMarketplaces、allowedChannelPlugins 與 fallbackModel 鏈)會從設定它們的最高排名來源整個讀取,不會加入較低來源的項目,sandbox.credentials.awsPairs 與 sandbox.ripgrep 亦然(v2.1.257+)。model 或 cleanupPeriodDays 這類一般鍵,則採用設定它的最高排名來源的值。HKCU 登錄檔絕不會與其他來源合併,而 managedSourcesBehavior 本身是控制鍵而非政策鍵,因此只設定它的來源不算提供了政策。208523

診斷功能與安全核准對話框(v2.1.248 至 v2.1.251): 伺服器管理設定載入失敗時會在啟動時顯示警告,而 /doctor 與 /status 會說明載入失敗的原因,或指出為何根本沒有擷取這些設定:Bedrock/Vertex/第三方供應商的工作階段,或自訂的 ANTHROPIC_BASE_URL,一律不會擷取它們(v2.1.248)。203

對於 Team 與 Enterprise 登入,自 v2.1.316 起,從 Anthropic 的 API 擷取的設定已直接套用,不再出現核准提示(見下一段),但文件頁面仍描述本段所說的對話框。454 針對高風險受管設定的核准對話框在 v2.1.251 收緊:自該版本起,凡是會終止 sandbox TLS、將 sandbox 流量導向您自己的代理伺服器、注入憑證或削弱 sandbox 隔離的伺服器管理設定,都必須先經核准才會套用;而來自受管或專案設定的 ANTHROPIC_CUSTOM_HEADERS,若設定了憑證、組織/租戶、路由或 API 行為相關的標頭(例如 Authorization 或 Host),也需要核准。對話框只會列出自您上次核准以來有所變更的設定,在設定未變更的情況下重新登入同一個 Claude apps gateway 時不會再次出現,而用戶端逾時、MCP 啟動模式與串流看門狗的環境變數則完全不再觸發它(v2.1.248)。203 截至 v2.1.259,若某個受管設定來源無法解析,Claude Code 會拒絕啟動並指出出問題的來源。208 而 v2.1.260 將一項設定移出對話框:受管的 CLAUDE.md(即 claudeMd 設定)不再觸發安全核准對話框,而 hooks、shell 指令、sandbox 與不安全的 env 設定仍需核准。209

免提示的伺服器管理設定(v2.1.314 至 v2.1.317): 對於 Team 與 Enterprise 登入,從 Anthropic 的 API 擷取的設定會直接套用,不再出現核准提示,而無法通過驗證的本機儲存副本會被拒絕(v2.1.316)。這是版本說明的措辭;現今的文件頁面仍描述針對 shell 指令、sandbox、env 與 hook 設定的安全核准對話框,因此在依賴任一描述之前,請先確認您組織自身的設定實際如何運作。454 Claude 的檔案工具在編輯您組織的伺服器管理設定本機副本前會先詢問,就像處理您自己的設定檔案一樣(v2.1.314)。僅在遠端受管設定中設定的 forceRemoteSettingsRefresh,在本機儲存副本過期後仍會持續生效,因此在無法連上伺服器時,工作階段不會以無政策狀態啟動(v2.1.314)。桌面應用程式的 Code 分頁會在組織的遠端受管設定尚未為該工作階段載入時顯示提示,載入完成後再顯示另一則提示(v2.1.317)。擁有者可從 claude.ai 主控台設定這些項目;說明文件頁面為 設定伺服器管理設定。281282

企業啟動器:processWrapper(v2.1.208)

若組織要求受管端點上的每個程序都必須經由安全或監控墊片啟動,可以讓 Claude Code 的自行產生的程序也經由該墊片執行。在 macOS 與 Linux 上,CLAUDE_CODE_PROCESS_WRAPPER 環境變數(v2.1.208)或 processWrapper 設定(v2.1.210)可指定一個啟動器,Claude Code 會將它置於自身執行檔所啟動的背景程序之前:包括背景服務、在 agent 檢視中託管的工作階段,以及更新後的重新啟動。如此便能實現 EDR 歸因、程序層級的政策控管與企業啟動器整合,而無需修改 CLI。您自己在終端機中啟動的工作階段不在涵蓋範圍內,Windows 會忽略此變數,專案設定與本機設定也無法指定該啟動器。Anthropic 在專屬的 企業啟動器頁面 記錄了此模式。183367

企業版 CLAUDE.md

部署全組織通用的脈絡:

位置: - macOS:/Library/Application Support/ClaudeCode/CLAUDE.md - Linux 與 WSL:/etc/claude-code/CLAUDE.md - Windows:C:\Program Files\ClaudeCode\CLAUDE.md368

內容:

# Company Standards

## Security Requirements
- Never commit secrets or credentials
- All external API calls require security review
- Use parameterized queries for all database access

## Code Standards
- Follow company style guide at @docs/STYLE.md
- All PRs require two approvals
- Test coverage minimum: 80%

## Approved Tools
- npm, yarn, pnpm for package management
- Jest for testing
- ESLint + Prettier for formatting

推行策略

  1. 從文件著手:部署前先把 CLAUDE.md 寫好
  2. 試行小組:先從 5 至 10 位開發者開始
  3. 問答階段:讓試行人員先用 Claude 探索程式碼
  4. 引導式開發:進一步處理小型錯誤修正
  5. 全面部署:搭配受管設定全面推行
  6. 監控成本:追蹤各團隊的使用量

稽核與合規

資料處理: - 工作階段逐字稿以純文字形式儲存在本機的 ~/.claude/projects/ 下(預設保留 30 天;可用 cleanupPeriodDays 變更) - 除了模型請求之外,Claude Code 還會傳送用量指標與錯誤回報。指標絕不包含程式碼、提示或檔案路徑。錯誤回報包含來自 Claude Code 自身內部的錯誤訊息與堆疊追蹤,且 Claude Code 會在回報離開機器之前,遮蔽已知模式的密鑰、檔案路徑、電子郵件地址與其他個人資訊。DISABLE_TELEMETRY=1 會關閉指標,DISABLE_ERROR_REPORTING=1 會關閉錯誤回報。錯誤回報只有在以 Pro、Max 或 Ultra 登入、使用 v2.1.198 或更新版本、直接連線至 Claude API,且所屬組織沒有 Zero Data Retention 或 HIPAA 協議時才會開啟。在 Bedrock、Agent Platform、Foundry 與 AWS 上的 Claude Platform 上,兩者預設皆為關閉,但當主機平台設定了 CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST 時,指標在這些平台上預設為開啟369520 - API 請求會送往 api.anthropic.com(直接連線),或經由您的雲端供應商(Bedrock、Agent Platform、Foundry、AWS 上的 Claude Platform)轉送 - 依據商業條款(Team 與 Enterprise 方案、API 及第三方平台),除非客戶選擇加入,Anthropic 不會以傳送給 Claude Code 的程式碼或提示訓練模型。Free、Pro、Max 與 Ultra 帳號在其模型改進設定開啟時,會被用於訓練369 - 若有資料駐留需求,請經由您自己的雲端供應商進行推論;Claude apps gateway 正是為必須這麼做的組織而設計。在 Bedrock 上,Claude Code 會依序從 AWS_REGION、AWS_DEFAULT_REGION、您的 AWS 設定檔取得區域,最後退回 us-east-1,因此請明確設定。在 Agent Platform 上,CLOUD_ML_REGION 可接受特定區域(例如 us-east5)、多區域位置(例如 eu 或 us)或 global525

SSO 與身分驗證: - Anthropic 直接連線:Claude for Teams 與 Claude for Enterprise 包含 SSO,而 claude auth login --sso 可在 CLI 強制以 SSO 登入;Enterprise 另外提供網域擷取、角色型權限與合規 API。SSO、SCIM 佈建與席次指派是在 Claude 帳號層級設定的。環境中的 API 金鑰不涉及登入,因此不具備 SSO358364 - Claude apps gateway:開發者透過位於 Bedrock、AWS 上的 Claude Platform、Google Cloud 或 Foundry 前方的 OIDC 身分識別提供者登入(不支援 SAML 與 LDAP)364 - Amazon Bedrock:IAM 角色,並透過 AWS IAM Identity Center 使用 SSO - Google Cloud 的 Agent Platform:GCP IAM 搭配 Workforce Identity Federation,支援 SAML/OIDC - Microsoft Foundry:Entra ID 原生 SSO

合規框架: - Anthropic 列出 SOC 2 Type I 與 Type II、ISO 27001:2022、ISO/IEC 42001:2023,以及可簽署 BAA 的 HIPAA 就緒設定;報告請透過 Anthropic Trust Portal 申請369 - 雲端供應商(AWS、GCP、Azure)各自具備合規認證(SOC 2、HIPAA BAA、ISO 27001、FedRAMP),經由某個供應商轉送的流量即適用該供應商的協議 - 醫療產業:Anthropic 的 BAA 適用於套用了 HIPAA 設定或啟用了 Zero Data Retention 的 Claude for Enterprise 帳號上的 Claude Code。在 HIPAA 設定下,雲端工作階段、Remote Control、行動版應用程式中的 Claude Code,以及經由第三方雲端供應商或 gateway 轉送的流量都不在涵蓋範圍內。若您改在 Bedrock、Agent Platform 或 Foundry 上執行,適用的協議則是該雲端供應商自己的協議369

記錄與監控: - OpenTelemetry 事件是任何方案或供應商上 Claude Code 活動的稽核資料來源:每個事件都帶有身分屬性,可將工具呼叫、MCP 活動與權限決策對應到使用者369 - 模型請求的稽核請使用雲端供應商的記錄服務(CloudTrail、Cloud Audit Logs、Azure Monitor) - 可考慮使用 LiteLLM 代理伺服器,詳細追蹤各團隊的用量 - 以受管設定強制執行合規政策 - Analytics API 為 Claude Console 組織提供每位使用者的每日用量彙總(詳見下文)

Analytics API(管理員)

Claude Console(API)組織可透過 Claude Code Analytics Admin API 讀取每日的 Claude Code 用量。它不會回傳以 Pro、Max、Ultra、Team 或 Enterprise 訂閱登入者的用量:Team 與 Enterprise 可使用 claude.ai 中的分析儀表板,Claude Enterprise 另有搭配 Analytics API 金鑰使用的 Enterprise Analytics API,而 OpenTelemetry 匯出則適用於任何方案。370

端點: GET /v1/organizations/usage_report/claude_code

驗證: 需要 Admin API 金鑰(sk-ant-admin01-...,由組織管理員在 Claude Console 中建立)、具有 org:admin 範圍的 OAuth token,或未限定於工作區的個人或服務帳戶金鑰;工作區 API 金鑰無法使用。370455

可用指標:

類別 指標
生產力 每位使用者的工作階段數、新增/移除的程式碼行數、commit 數、PR 數
工具使用 各工具(Edit、MultiEdit、Write、NotebookEdit)的接受/拒絕率
成本 依使用者與模型劃分的預估成本

請求參數: - starting_at - 每日彙總的 UTC 日期(YYYY-MM-DD);只回傳該日的資料 - limit - 每頁筆數(預設 20,最多 1000) - page - 上一次回應中的 next_page 游標 - 回傳指定日期的使用者層級資料

範例:

curl "https://api.anthropic.com/v1/organizations/usage_report/claude_code?starting_at=2026-01-25&limit=20" \
  -H "anthropic-version: 2026-10-21" \
  -H "x-api-key: $ANTHROPIC_ADMIN_KEY"

限制: - 僅提供每日彙總(為確保一致性,約有 1 小時延遲) - 如需即時監控,請使用 OpenTelemetry 整合 - 僅涵蓋 Claude API 用量:不含訂閱登入,也不含 Bedrock、Agent Platform 或 Foundry。在 AWS 上的 Claude Platform 上,請在 Claude Console 的 Usage 頁面檢視 Claude Code 用量

費用: 具備 Admin API 存取權的組織可免費使用。


參考資料


  1. Claude Code CHANGELOG,2.1.51 章節,擷取於2026年11月11日:「Managed settings can now be set via macOS plist or Windows Registry.」 ↩

  2. GitHub Releases v2.1.91。v2.1.91:MCP _meta["anthropic/maxResultSizeChars"] 上限達 500K、disableSkillShellExecution 設定、外掛 bin/ 可執行檔、多行深層連結提示、Edit 工具更短的 old_string 錨點、改良的 /claude-api skill、逐字稿鏈中斷修正。2026年4月2日。 ↩

  3. GitHub Releases v2.1.92。v2.1.92:forceRemoteSettingsRefresh 失敗即封閉政策、互動式 Bedrock 設定精靈、依模型與快取命中區分的 /cost 明細、/release-notes 互動式選擇器、Remote Control 主機名稱前綴、提示快取到期的頁尾提示、移除 /tag 與 /vim、Linux 沙箱 apply-seccomp 輔助程式、Write 工具處理大型檔案的 diff 快 60%。2026年4月4日。 ↩

  4. Claude Code v2.1.133 版本說明。2026年5月7日。新增 worktree.baseRef 設定(fresh | head);依版本說明所述:「the default fresh changes EnterWorktree’s base back to origin/<default> (it has been local HEAD since 2.1.128)」,以及「set worktree.baseRef: "head" to keep unpushed commits in new worktrees.」Hooks 現在可透過 effort.level JSON 輸入欄位與 $CLAUDE_EFFORT 環境變數取得目前的 effort 等級;Bash 工具的指令也能讀取 $CLAUDE_EFFORT。新增 sandbox.bwrapPath 與 sandbox.socatPath 受管設定(Linux/WSL),可自訂 bubblewrap 與 socat 二進位檔的位置。新增 parentSettingsBehavior 管理層級鍵('first-wins' | 'merge'),可將 SDK managedSettings(父層級)納入政策合併。修正 subagents 無法透過 Skill 工具找到專案、使用者或 plugin skills 的問題。其他修正:平行工作階段中重新整理權杖後出現 401 的競態條件、磁碟根目錄允許規則的範圍、MCP OAuth 代理與 mTLS 支援、Remote Control 的停止/中斷可完整執行取消、跨工作階段的 /effort 外洩,以及 --help 中列出 --remote-control。 ↩

  5. Claude Code v2.1.207 版本說明。2026年7月。v2.1.207: Auto Mode 在 AWS Bedrock、Google Vertex AI 與 Microsoft Foundry 上不再需要 CLAUDE_CODE_ENABLE_AUTO_MODE 選擇啟用,管理員可透過 disableAutoMode 受管設定將其停用;Bedrock、Vertex AI 與 Claude Platform on AWS 現在預設為 Claude Opus 4.8;autoMode 設定不再從儲存庫的 .claude/settings.local.json 讀取(請改用 ~/.claude/settings.json);plugin 安全性:shell 形式的 plugin 命令會拒絕 ${user_config.*} 插值(請改用 exec 形式或 $CLAUDE_PLUGIN_OPTION_<KEY> 環境變數),且 pluginConfigs 不再從專案層級的 .claude/settings.json 讀取。擷取於2026年7月17日。 ↩↩

  6. Claude Code v2.1.208 版本說明、Claude Code 無障礙功能文件,以及 Claude Code 企業啟動器文件。2026年7月。v2.1.208: 螢幕閱讀器模式可透過 claude --ax-screen-reader、CLAUDE_AX_SCREEN_READER=1 或 "axScreenReader": true 設定啟用,並記載於新的無障礙功能頁面;processWrapper 設定/CLAUDE_CODE_PROCESS_WRAPPER 環境變數會將 Claude Code 自行產生的所有程序導向一個包裝執行檔,以便與企業啟動器整合;vimInsertModeRemaps 設定可定義 vim 插入模式的按鍵重新對應(例如 jj → Escape);命令替換($(...)、反引號、<(...))內的災難性刪除(如 rm -rf ~)現在即使在 --dangerously-skip-permissions 與 auto 模式下也會提示確認。擷取於2026年7月17日。 ↩

  7. Claude Code v2.1.212 版本說明。2026年7月。v2.1.212: /fork 現在會將對話複製到一個新的背景工作階段,並在 claude agents 中擁有自己的一列,先前的工作階段內分支行為則改名為 /subtask;新增 claude auto-mode reset 子命令,可搭配 --yes 略過確認;每個工作階段的預算:WebSearch 呼叫與 subagent 產生次數各預設為每個工作階段 200 次,分別透過 CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION 與 CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION 調整,/clear 會重設 subagent 預算;執行超過 2 分鐘的 MCP 工具呼叫會自動移至背景,門檻可透過 CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS 設定;Task 工具的 mode 參數已棄用並被忽略,subagent 會繼承父工作階段的權限模式;企業版 forceLoginMethod 設定現在也對 VS Code 擴充功能、SDK、claude setup-token 與 /install-github-app 強制生效(先前僅限終端機)。擷取於2026年7月17日。 ↩

  8. Claude Code v2.1.223 版本說明,2026年8月6日。新增 "owner/*" 萬用字元項目至 strictKnownMarketplaces 與 blockedMarketplaces;將 /review 設為 /code-review 的別名,並記住上次輸入的工作量等級(/code-review ultra 進行深度雲端審查);擴大 CLAUDE_CODE_DISABLE_1M_CONTEXT 的範圍,讓所有原生 1M 模型透過自動壓縮維持在 200K 並於啟動時顯示警告,另新增 CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT 以處理無法辨識的模型 ID;安全修正涵蓋精心構造命令的 Bash 權限繞過、核准對話框中的不可見 Unicode 命令填充、workflow 指令碼動態 import() 的沙箱逃逸,以及 agent 定義的 bypassPermissions 忽略組織停用政策的問題。擷取於2026年8月6日。 ↩

  9. Claude Code CHANGELOG,2.1.248、2.1.250 與 2.1.251 各節,擷取於2026年8月30日。npm 於2026年8月27日 20:35 UTC 發布 2.1.248,同日 22:27 UTC 發布 2.1.250(其章節內容僅為逐字的「Bug fixes and reliability improvements」),並於2026年8月28日 15:34 UTC 發布 2.1.251(dist-tag latest:2.1.251);2.1.249 從未在 npm 上發布。2.1.248 原文:「Added --restricted (or CLAUDE_CODE_RESTRICTED=1): removes the built-in tools that run commands or code and WebFetch (unless named in --tools), keeps file tools inside the working directory, refuses bypassPermissions, and ignores user, project and local settings files」;「Added experimental.cacheTtl ("5m" or "1h") to agent frontmatter: a per-agent prompt cache TTL used when no subagent TTL setting is configured」;「Added claude self-hosted-runner --client-label <label> (or SELF_HOSTED_RUNNER_CLIENT_LABEL) to override the label the runner registers with (default: hostname)」;「Added server-managed settings diagnostics: a startup warning when the settings fail to load, and a /doctor and /status line explaining a load failure or why they weren’t fetched (Bedrock/Vertex/third-party provider, custom ANTHROPIC_BASE_URL)」;「Added /usage-credits for Enterprise organizations billed through AWS Marketplace, self-serve Enterprise, and Enterprise trials, so members can request a higher usage limit from their admin」;

    「Added cross-session messaging (SendMessage / ListAgents) between sessions on the same machine on Bedrock, Vertex, and Foundry, and when telemetry is disabled」;桌面版保留期修正:「the transcript cleanup now keeps desktop-written sessions while they are in the app (unless org policy manages retention); the new desktopSessionCleanupPeriodDays setting caps the exemption」;「Improved managed settings: client-side timeout, MCP startup-mode, and stream-watchdog env vars no longer trigger the settings-approval prompt」;「Changed /loop: self-paced dynamic mode and the no-prompt autonomous default are now always available, including on Bedrock/Vertex/Foundry」;「Improved the Workflow tool’s prompt footprint: its description is now about 1k tokens instead of 5.7k, with the script-writing reference moved into a bundled workflow-authoring skill」;以及上傳修正:「Fixed /ultrareview and locally seeded cloud sessions uploading uncommitted edits to prod.env-style and *.tfvars files, or to editor swap, temp, and backup copies of credential files (e.g. key.pem.tmp, id_rsa.swo); they now stay on your machine」。

    2.1.251 原文:「Added PreModelSwitch and PostModelSwitch hook events (block, confirm, or annotate a model switch); SessionStart resume hooks now receive session staleness and the estimated re-cache cost」;「Added live streaming of a foreground subagent’s tool calls and results to Remote Control clients (background subagents, the default, still show status only)」;「Added a Spend limit bar to /usage and a rate_limits.spend_limit status line field for developers behind a Claude apps gateway with spend limits」;「Added a per-session prompt-cache line to /cost (hit ratio, misses, tokens re-cached, warm/cold) and a matching prompt_cache object for status line scripts」;「Added attach, logs, stop, respawn, and rm to claude --help; the --resume message for a running background session now names the exact claude attach <id> command」;「Changed Claude in Chrome so browser actions always go through Claude Code’s permission checks, including in sessions with telemetry disabled, which previously used the Chrome extension’s own prompts」;「Changed CLAUDE_CODE_SUBAGENT_MODEL to set the default subagent model rather than override everything: an agent definition’s model: and an explicit per-spawn model now take precedence over it」;「Changed the default model for seat-based Enterprise subscriptions to Opus 5, matching other premium plans」;「Changed /effort to save your default effort level per model, so each model keeps its own setting when you switch」;

    「Changed server-managed settings that terminate sandbox TLS, route sandbox traffic through your own proxy, inject credentials, or weaken sandbox isolation to require approval before they apply」;「Changed ANTHROPIC_CUSTOM_HEADERS from managed or project settings to require approval when it sets a credential, org/tenant, routing, or API-behavior header (e.g. Authorization, Host)」;「Changed project-level .claude/settings.json env to no longer set CLAUDE_CONFIG_DIR, CLAUDE_CODE_TMPDIR, or TMPDIR/TMP/TEMP; set them in your shell, user, or managed settings instead」;「Fixed /usage-credits for Team and Enterprise members whose admin set the org’s usage-credit limit to $0: it now offers to ask the admin instead of saying a cap was reached」;安全性修正原文:「Fixed file tools (Read, Write, Edit) following a symlink swapped inside the working directory after the permission check, which could read or write outside the approved location」;「Fixed plugin commands declared in a marketplace entry being able to point outside the plugin directory; such paths are now rejected with a path-traversal error」;「Fixed Bash permission checks auto-approving commands that assign an arithmetic expression to an integer shell variable (e.g. OPTIND=1/0, RANDOM=2+2); these now prompt for approval」;「Fixed Grep and Glob not applying Read(...) deny rules to files reached through a symlinked search path」。 ↩↩

  10. 模型設定,擷取於2026年8月30日,「default model setting」一節。原文:「The behavior of default depends on your account type」;「Max, Team Premium, Enterprise pay-as-you-go, and Anthropic API: defaults to Opus 5」;「Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform: defaults to Opus 5」;「Pro, Team Standard, and Enterprise subscription seats: defaults to Sonnet 5」;「Microsoft Foundry: defaults to Sonnet 4.5」;「Enterprise pay-as-you-go means an Enterprise organization billed by usage rather than by subscription seat.」歷史註記原文:「Before v2.1.219, default resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.207. Before v2.1.207, default resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud’s Agent Platform.」Enterprise 席次這一列,是 CLI 已經超前文件的唯一一處:v2.1.251 的 CHANGELOG(2026年8月28日)寫道「Changed the default model for seat-based Enterprise subscriptions to Opus 5, matching other premium plans」,比文件頁面更新。因此本指南將席次方案的預設記為 Opus 5,並註明文件尚未跟上。 ↩

  11. Claude Code 版本說明 v2.1.257 與 v2.1.258(皆為2026年9月1日)及 v2.1.259(2026年9月2日),以及2026年9月3日的正式 CHANGELOG。當日的 npm dist-tags:latest 與 next 皆為 2.1.259,stable 為 2.1.236;npm 已發佈的版本從 2.1.252 直接跳到 2.1.257——2.1.253 至 2.1.256 從未發佈,CHANGELOG 中也沒有對應章節(與 2.1.244/2.1.249 的模式相同)——因此 2.1.258 說明中的「2.1.255 引入的回歸」指的是未發佈的內部建置,而 v2.1.257 是第一個可安裝且支援 Fable 5.1 的版本。v2.1.257 各項目的來源:Fable 5.1 支援及閘道警語(在 Claude apps 閘道工作階段中,fable 與 best 別名目前仍解析為 Fable 5,因為尚未針對 Fable 5.1 設定的閘道會拒絕它——請改在 /model 中選取);timeFormat/timeZone;自動模式的「Containment Escape」規則(雲端中繼資料憑證擷取、出口規避與跨租戶存取不會自動核准,除非環境將其標記為預期行為);CLAUDE_CODE_SUBAGENT_MODEL_FORCE;第一次讀取工作目錄之外的檔案前的一次性提示,加上 permissions.blockReadsOutsideWorkingDirectories;/effort s 與以工作階段為範圍的 --effort;專案/本機的 defaultMode: "bypassPermissions" 會被忽略;managedSourcesBehavior: "merge" 的細部調整(sandbox.credentials.awsPairs 與 sandbox.ripgrep 會整體從設定它們的最高層來源讀取);Bash Read()/Edit() 拒絕規則涵蓋 < file 輸入重新導向以及 tac、egrep 等讀取指令;以及 --add-dir、/add-dir 與 additionalDirectories 對網路路徑(UNC 共用、/net/<host> 自動掛載)的拒絕。

    v2.1.258 修正的來源:未發佈的 2.1.255 所引入的 macOS 12 啟動回歸,以及遠端/排程工作階段在需要非空內容的請求上失敗。v2.1.259 各項目的來源:managedMcpServers;allowedMcpServers 的範圍改為僅限使用者新增的伺服器;--permission-prompts none(任何原本會提示的操作都會自動拒絕,而目前的權限模式仍持續做決定);無法解析的受管設定會拒絕啟動並指出來源;自訂指令與 skills 的 frontmatter model: 在互動式工作階段中會被採用,而自動模式會保留工作階段模型,不會在不支援的 frontmatter 模型上執行回合;claude plugin validate --json;以及 Bash Read() 拒絕涵蓋範圍延伸至選項值/運算元(--ignore-revs-file=.env、-f.env、@file 引數、git diff/git grep 運算元、cd DIR && cat FILE 複合指令,以及對含有遭拒檔案的目錄執行 grep -r/cp -r 現在會詢問)。設定文件尚未記載 timeFormat/timeZone 或 managedMcpServers,CLI 參考也尚未列出 --permission-prompts;截至2026年9月3日,CHANGELOG 是這些項目的來源。 ↩↩↩↩

  12. Claude Code v2.1.260 版本資訊,發布於2026年9月3日 23:48 UTC(太平洋時間下午4:48;npm 發布早於此,為 22:32 UTC),以及當晚的正式 CHANGELOG。當晚的 npm dist-tags:latest 與 next 皆為 2.1.260,stable 為 2.1.236。還原說明原文:”Reverted the 2.1.259 change applying Read() deny rules to Bash arguments; it denied npm run build under a Read(./**/build/**) rule in every mode and made cd … && grep prompt even in auto mode” – v2.1.257 的重新導向與讀取類命令涵蓋範圍未在此次還原中提及,仍然有效。本註為下列內容的來源:/diff 全螢幕差異面板(”Added a diff panel that opens beside the conversation in fullscreen mode and shows your uncommitted changes as Claude edits; toggle it with /diff“);含括號路徑的權限修正(路徑含括號的規則「被視為無效而捨棄,或被 Bash 沙箱忽略,導致『唯讀』資料夾實際可寫」;無法編譯的模式,例如未閉合的 [,不再「讓每次檔案編輯都以 Invalid regular expression 失敗」,此類拒絕規則現在會保護其字面拼寫的路徑;針對 Edit(C:\dir\(name)\**) 改進的設定錯誤訊息,其中 \( 被解讀為跳脫的括號而非路徑分隔符號;尾端帶有多餘文字的規則如 Bash(ls) x 會回報為無效設定);

    四項 Fable 5.1 上市叢集修正(/model 選擇器對可使用 Fable 5.1 的組織顯示該模型,先前「只接受以 /model claude-fable-5-1 輸入」;提示快取在修正前未涵蓋「工具結果之後附加的上下文,因此每次工具呼叫回合都以未快取輸入重新送出」;工作階段中途變更 /effort 不再使提示快取失效;model: fable 代理程式會遵循 ANTHROPIC_DEFAULT_FABLE_MODEL 釘選上的 [1m] 標籤,而非「默默地以 200K 上下文視窗執行」);自動壓縮改進(”Opus and Fable sessions now compact shortly before the 1M-token limit, and recovery compaction on very large contexts no longer times out at 10 minutes”);加入 /cost 與狀態列 prompt_cache 欄位的可能未命中原因說明(”e.g. tool definitions or system prompt changed, idle past the TTL”);! bash 模式的例外處理(”Changed commands typed at the ! bash-mode prompt to run outside the sandbox even when strict sandbox mode (sandbox.allowUnsandboxedCommands: false) is on, like typing into your own terminal”);受管理 CLAUDE.md 的變更(”a managed CLAUDE.md (claudeMd) no longer triggers the security approval dialog; hooks, shell-command, sandbox, and unsafe env settings still require approval”);以及 Claude in Chrome 遵循「your organization’s Claude in Chrome admin setting; when an admin turns it off, --chrome, /chrome and the browser tools are unavailable」。嚴格沙箱模式的語意(allowUnsandboxedCommands: false 會完全忽略 dangerouslyDisableSandbox,每個命令都必須在沙箱中執行或列於 excludedCommands,且 /sandbox 的 Overrides 分頁將此狀態標示為 Strict sandbox mode)取自沙箱文件,於2026年9月3日擷取。 ↩↩

  13. Claude Code v2.1.261 版本資訊,發布於2026年9月4日 19:58 UTC,以及同日的正式 CHANGELOG。當日的 npm dist-tags:latest 與 next 皆為 2.1.261,stable 為 2.1.236。按鍵綁定變更原文:”Changed the prompt’s word-editing keys to match Bash: Ctrl+W deletes back to whitespace, Alt+F and Alt+D stop at word end, punctuation separates words; keybindingFlavor no longer has any effect.” 本註為下列內容的來源:/skill-doctor,可顯示哪些已載入的 skills 未被使用及其佔用的上下文成本,方便您加以精簡;bashOutputMaxChars 與 taskOutputMaxChars 設定,可提高 Claude 在輸出儲存至檔案前以內嵌方式接收的命令輸出與背景任務輸出量,上限為 128K 字元(此機制與 BASH_MAX_OUTPUT_LENGTH 不同,後者依工具參考文件的定義,是從命令工作輸出檔案讀回的視窗,原文:它 “sets how many characters of output Claude Code reads back from the working file into a command’s result: 30,000 by default, up to a hard ceiling of 150,000”);auto 模式將把內容封裝進公開圖表渲染服務 URL 的連結(mermaid.live 類型,資料直接編碼於 URL 本身)視為上傳行為,除非您主動要求,否則不再自動核准;以及 forceLoginMethod: "gateway" 會清除殘留的憑證,因此釘選至 gateway 的機器會忽略殘留的 API 金鑰或 claude.ai 登入並要求 /login,而 Bedrock、Vertex AI 與 Foundry 工作階段不受影響。 ↩

  14. Claude Code v2.1.265 版本資訊,發布於2026年9月8日 20:37 UTC,以及同日的正式 CHANGELOG(發布內文與 CHANGELOG 章節完全相同)。當日的 npm dist-tags:latest 與 next 皆為 2.1.265,stable 為 2.1.236;npm 已發布版本從 2.1.261 跳至 2.1.263 再到 2.1.265 – 2.1.262 與 2.1.264 從未發布(與 2.1.244/2.1.249/2.1.253-256 相同的模式)– 而 2.1.263(9月6日發布)僅載明 “Bug fixes and reliability improvements”。本註為下列內容的來源:--plugin-dir 指向含多個 plugins 的資料夾(”each child folder with a manifest loads, and children added or removed while running are picked up”);兩項提示快取前綴修正,原文:”Fixed resuming a foreground-spawned subagent changing its tool list and system prompt prefix, which broke prompt-cache reuse for that agent” 以及 “Fixed agent teammates and resumed subagents moving SubagentStart hook context and preloaded skills out of the prompt prefix on later turns, which broke prompt-cache reuse”;非互動式工作階段(搭配 stream-json 輸入的 -p、Agent SDK、雲端工作階段)不再於每則新使用者訊息時重設 shell 工作目錄,因此 cd 可跨回合保留;

    設定為 http 但僅支援舊版 HTTP+SSE 傳輸的 MCP 伺服器,現在會依 MCP 規範所述回退至 SSE;儲存至磁碟的工具結果設有 1 GB 上限,且對話內預覽會註明已儲存的檔案是否遭截斷;受管理設定中含 forceLoginGatewayUrl 的機器自啟動起即為 Claude apps gateway 工作階段,如同 forceLoginMethod: "gateway",殘留的 claude.ai 登入或 API 金鑰不會被使用;Claude apps gateway 工作階段會將 OpenTelemetry 直接匯出至 gateway 受管理設定在 OTEL_EXPORTER_OTLP_ENDPOINT 中指定的收集器,而非透過 gateway 的中繼(未指定收集器的工作階段仍使用中繼),且 Claude Desktop 與 Cowork 透過 Claude apps gateway 傳送的遙測資料新增了 user.email 與 user.groups,與終端機工作階段一致;雙鍵鍵盤快捷鍵會等待第二個按鍵 3 秒,逾時則顯示通知,先前若第二個按鍵在超過一秒後才到達(如在 tmux 內的情況)會默默取消;以及在提示中途輸入的斜線命令會以清單顯示相符項目(非全螢幕時以 Tab 開啟),而非僅顯示單一建議,且 plugin skill 可用其簡短名稱找到。 ↩

  15. Claude Code 版本說明 v2.1.266(2026年9月8日)、v2.1.267(9月9日)、v2.1.268(9月10日)、v2.1.269(9月11日)、v2.1.270(9月12日)、v2.1.271(9月14日)及 v2.1.272(npm 於9月14日發布,GitHub 版本於9月15日 00:42 UTC 發布),以及2026年9月15日的正式 CHANGELOG – 七個版本的說明內容與其 CHANGELOG 章節完全一致。9月15日(約 13:15 PT)的 npm dist-tags:latest 2.1.272、next 2.1.273、stable 2.1.236;2.1.273(9月15日 18:06 UTC 發布)沒有 GitHub 版本,也沒有 CHANGELOG 章節,因此其內容未收錄於此;2.1.263 仍只寫著「Bug fixes and reliability improvements」– 從未補上任何說明。以下內容的出處(引述處皆為原文):/output-style 的回歸(”Added /output-style [name] to list and switch output styles, including over Remote Control and in cloud and other headless sessions”,v2.1.269);claude plugin eval(”run a plugin’s eval suite against Claude Code and get scored, reproducible results (JSON + HTML report)”,v2.1.269);Claude Code Remote 工作階段中的 fast mode(”cloud and self-hosted runners: the host’s fast-mode setting or /fast typed in the session applies where your organization allows it”,v2.1.271)以及 /fast off 的修正;

    maxEffortLevel 設定(”top-level or per model under modelSettings: caps the effort level on every provider, including Bedrock, Vertex and Foundry; users can still pick a lower level”,v2.1.267);--system-prompt-snapshot off(v2.1.267);v2.1.267 的 prompt-cache 穩定性修正批次(恢復工作階段時的工具清單、工具描述與 MCP 宣告文字的改寫;/model 切換時重新傳送每一個工具定義,署名文字改為對話備註;--system-prompt/--append-system-prompt 工作階段只記錄一次提示詞與工具定義;工作階段中途加入的 MCP 與 plugin 工具改為延遲載入的定義);固定預設 effort 模型(Opus 4.7、Opus 4.8、Fable 5;v2.1.267)上 effort: frontmatter 的修正;marketplace 反斜線隔離修正(v2.1.267);任務追蹤工具的允許清單(「Changed the task-tracking tools (TaskCreate/Get/Update/List, TodoWrite) to be offered only on」Claude 3.x、Opus 4.0 至 4.7、Sonnet 4.0 至 4.6 與 Haiku 4.5,並附「set CLAUDE_CODE_ENABLE_TODO_TOOLS=1 elsewhere」,v2.1.268);符號連結目錄與 env -C/eval 拒絕規則的修正(v2.1.268);WebFetch 與 Artifact 規則的拆分(”Changed plain WebFetch deny and ask rules to no longer apply to Artifact tool reads and updates; use an Artifact rule (or WebFetch(domain:claude.ai)) to block or gate them”,v2.1.268);/plugin 變更於選單關閉時生效(v2.1.268);WebFetch 的 300 秒期限與 CLAUDE_CODE_WEBFETCH_DEADLINE_MS(v2.1.268);gatewayInternalNetworks、空白 allow_cidrs 的警告,以及 gateway pricing: 費率同步(v2.1.268),再加上 multiplier 可高於 1 並最高至 10(v2.1.271);

    ${VAR} 與 git URL 的機密防護修正(v2.1.268);claude auth status --json 中的 configDirectory(v2.1.268);第三方 ANTHROPIC_BASE_URL HTTP 400 迴歸問題的修正(v2.1.268);bashEditDiffEnabled(v2.1.269);署名提醒的修正(”Fixed the attribution reminder overriding a CLAUDE.md or memory rule against commit and pull request attribution; lines set by managed settings still apply”,v2.1.269);環境變數 OTEL_METRICS_INCLUDE_REPOSITORY、CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS(1-256)、CLAUDE_CODE_GATEWAY_MODEL_DISCOVERY_TIMEOUT_MS(預設 3 秒)及 CLAUDE_CODE_BG_TASKS_REPORT_RUNNING(v2.1.269);v2.1.247 鍵盤迴歸問題的修正,以及透過 SSH 的 kitty 查詢鍵盤支援(v2.1.269);Edit()/tee、Bash(tee:*) 與開頭 ! 的範圍判定修正(v2.1.269);啟用沙箱的 auto mode 下,Bash、PowerShell 與 Monitor 的逐命令 allowed_domains(v2.1.271);omitClaudeMd agent frontmatter 與 --agents JSON(v2.1.271);auto mode 的行內 ! 與 subagent 交還機制的變更(v2.1.271);claude plugin install/update 的 --accept-command <sha256>(v2.1.271);--resume 在不同模型系列間保留 [1m](v2.1.271);無法讀取的 managed-mcp.json 改為預設拒絕(v2.1.271);fmt/column、萬用字元展開、變數宣告旗標與 blockReadsOutsideWorkingDirectories 檢查器的修正(v2.1.271);以及 Markdown artifacts 改以具樣式的文件頁面呈現,artifact 監看數提高至 10(v2.1.271)。v2.1.266 只有一行(CLAUDE_CODE_USE_GATEWAY 迴歸問題的修正),v2.1.270 只有一行(v2.1.269 git 提示迴歸問題的修正),而 v2.1.272 僅寫著「Bug fixes and reliability improvements」。 ↩↩↩

  16. Claude Code v2.1.273 版本說明,發布於2026年9月15日 20:23 UTC,以及2026年9月16日的正式 CHANGELOG:版本說明內文與 CHANGELOG 章節完全相同,各為 64 行。9月16日(約太平洋時間 10:00)的 npm dist-tags:latest 為 2.1.273、next 為 2.1.273、stable 為 2.1.267,這是 stable 標籤首次離開 2.1.236。以下項目的來源,引用處皆為原文:deny 規則回退(”回退了 2.1.268 的一項變更,該變更會對權限檢查器無法分析的 Bash 指令行(eval、env -C)檢查 Read 與 Edit 的 deny 規則;像 time -p make build 這類指令現在會再次提示,而不是被拒絕”);無法分析的指令與子 shell 修正(”修正了權限檢查器無法完整分析的 Bash 指令在 permissions.blockReadsOutsideWorkingDirectories 下跳過提示的問題,以及在 bypass 模式中子 shell 藏匿危險 rm 的問題”);記憶目錄修正(”修正了 permissions.blockReadsOutsideWorkingDirectories:由儲存庫設定所選定的記憶目錄,不再被載入提示、召回、建立索引,或供記憶擷取使用”);閘道分類器預設值(”將 Bedrock、Vertex 與 Foundry 上的 auto 模式暫時改為預設使用本機分類器;設定 CLAUDE_CODE_AUTO_MODE_SERVER=1 即可改用平台的伺服器端分類器”);提示標頭(”為 LLM 閘道新增了 x-claude-code-request-class、x-claude-code-agent-type、x-claude-code-prev-tool-durations、x-claude-code-compaction 與 x-claude-code-context-compacted 請求標頭;以 CLAUDE_CODE_GATEWAY_HINT_HEADERS=1 選擇啟用”);

    受管設定優先順序修正(”修正了透過 MDM 或 managed-settings.json 設定的 allowManagedMcpServersOnly、deniedMcpServers 與 disableClaudeAiConnectors 在同時存在伺服器管理設定時被忽略的問題”);context 計量修正(”修正了 context 計量與自動壓縮將 advisor 工具回合計為實際 context 大小約兩倍的問題,這導致自動壓縮在實際視窗約一半時就觸發”);提示快取修正(”修正了 /login、/upgrade 與 /extra-usage 捨棄對話中先前思考內容的問題,該問題會迫使下一次請求完整重寫提示快取”);遙測變更(”變更 OTEL_LOG_TOOL_DETAILS=1,使其在成本與 token 指標上也包含實際的 agent、skill、plugin 與 MCP 伺服器名稱”);/bug//feedback 資料最小化(”變更 /bug 與 /feedback 回報,使其僅包含最後一次 API 請求的模型行為參數(模型、系統提示、工具),省略請求中繼資料與 CLAUDE_CODE_EXTRA_BODY 欄位”);登入變更(”變更以 Claude 帳號登入的流程,使其同時請求存取您的 claude.ai plugins”);Remote Control 分支(”新增從 Claude 應用程式分支以 claude --remote-control 或 /remote-control 啟動的工作階段;分支會在您的電腦上以背景工作階段執行”);以及 stream-json 修正(”修正了 SDK 與 --output-format stream-json 輸出在 subagent 於執行中途被移至背景(例如透過 CLAUDE_AUTO_BACKGROUND_TASKS)後,遺漏其剩餘訊息與最終報告的問題”)。 ↩

  17. Claude Code 版本說明 v2.1.277(npm 發布於 2026年9月18日 16:22 UTC;GitHub release 為 18:06 UTC)與 v2.1.278(npm 為 9月19日 01:48 UTC;GitHub release 為 03:10 UTC),以及2026年9月21日的正式 CHANGELOG。本指南中所有 v2.1.277 與 v2.1.278 項目的來源。關鍵引文:”新增 AGENTS.md 支援:在沒有 CLAUDE.md 的專案中,Claude Code 會改為讀取 AGENTS.md;可在 /config 的 "Project instructions" 下變更(Bedrock、Vertex 或 Foundry 尚未支援)”;”變更 Claude API 與 Enterprise 使用者,以及 Bedrock、Vertex、Foundry 與閘道上的 auto 模式,預設改用伺服器端分類器,該分類器不收取分類器額外費用”;”在 /status 新增 Auto mode server 列,顯示此工作階段的 auto 模式分類器是否在伺服器上執行”。於 2026年9月21日取得的佐證文件:Memory,AGENTS.md 章節(載入矩陣、Project instructions 的值、agents-md@builtin 的 pluginConfigs 位置、不會讀取的檔案)與 Auto 模式分類器請求費用(備援通知文字與送達方式、/status 列的值、閘道直通,以及該變數的暫時性狀態)。 ↩

  18. Anthropic 官方模型文件,擷取於2026年9月22日:模型總覽與Claude Code 模型設定文件。Claude Opus 5.5 的資料來源:Claude API ID 與別名 claude-opus-5-5;Amazon Bedrock ID 為 anthropic.claude-opus-5-5,Google Cloud、Microsoft Foundry 與 Claude Platform on AWS 的 ID 為 claude-opus-5-5;定價「$4 / input MTok, $20 / output MTok」;快取讀取為基礎輸入價格的 5%(「Claude Opus 5.5 與 Claude Sonnet 5.5 的快取命中與重新整理按基礎輸入價格的 0.05 倍計價」),即 $0.20/MTok;思考模式為「Adaptive (always on)」——與 Claude Fable 5.1 相同的標示,而 Claude Sonnet 5 則標示為「Adaptive」;預設 effort 為 medium(Claude Fable 5.1 與 Claude Sonnet 5 皆為 high);context window 為 1M tokens;最大輸出 128K tokens,且 Opus 5.5 名列 Message Batches API 上支援「up to 300k output tokens with the output-300k-2026-03-24 beta header」的模型之一;可靠知識截止日為2026年6月、訓練資料截止日為2026年6月,與 Claude Fable 5.1 相同;退役時間「Not sooner than September 22, 2027」;總覽建議「start with Claude Opus 5.5 for most workloads」;以及 Claude Opus 5 現已列入 Legacy models 表格,與 Fable 5、Opus 4.8、4.7、4.6、4.5 及 Sonnet 4.6、4.5 並列。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。

    出自模型設定文件的各方案預設表格原文:「Pro, Max, Team, Enterprise, and Anthropic API: defaults to Opus 5.5」;「Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform: defaults to Opus 5.5」;「Microsoft Foundry: defaults to Sonnet 4.5」;opus 別名表格(Anthropic API、Claude Platform on AWS、Amazon Bedrock 與 Google Cloud 的 Agent Platform 皆解析為 Opus 5.5;Microsoft Foundry 則解析為 Opus 4.6);版本下限(「Opus 5.5 requires Claude Code v2.1.280 or later. Opus 5 requires v2.1.219 or later. Sonnet 5 requires v2.1.197 or later.」);以及歷史註記(「Before v2.1.280, default resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud’s Agent Platform from v2.1.219.」)。 ↩

  19. Claude Code v2.1.281 版本說明(npm 於2026年9月23日 17:01 UTC 發布;GitHub 發布版本為 19:19 UTC;176 個條目,與正式 CHANGELOG 的 2.1.281 章節完全一致,擷取於2026年9月24日,該檔案從 2.1.280 連續涵蓋至 2.1.281,沒有缺漏)。本指南中每一項 v2.1.281 內容的資料來源。9月24日的 npm dist-tags:latest 與 next 為 2.1.281,stable 為 2.1.273。關鍵引文:「Changed send now (ctrl+enter or ctrl+x ctrl+s) to move running tools to the background instead of cancelling the turn」;「Changed CLAUDE_CODE_AUTO_MODE_SERVER to also apply on a direct Anthropic API connection: 0 opts out of the server-side auto mode classifier (the local classifier then counts toward usage), 1 opts in」;「Changed the dangerous rm prompt in --dangerously-skip-permissions and auto mode to wait 2 minutes for an answer, then deny the command with a rewrite hint」;「Added "attribution": false in settings.json to hide all commit and PR attribution」。移除 /agents 精靈一事出自同一份 CHANGELOG 的 2.1.198 章節:「Removed the /agents wizard; ask Claude to create or manage subagents, or edit .claude/agents/ directly.」auto mode 分類器計費文件,擷取於2026年9月24日,當時仍寫著「The variable isn’t read on a direct connection to the Anthropic API」;到了9月26日,該頁面已改為「On a direct connection to the Anthropic API, the variable requires Claude Code v2.1.281 or later.」同日的設定參考記載了 attribution 物件,並將 includeCoAuthoredBy 標示為已棄用;到了9月26日也一併記載了 false 這個值。 ↩

  20. Claude Code 文件,擷取於2026年8月26日。受管設定,「Claude Code 使用哪個受管來源」:「Claude Code 會使用提供至少一個政策鍵的來源中排名最高者,並忽略其餘來源而非加以合併,『從每個管理來源讀取的鍵』中的鍵除外」;「Claude Code 對於被略過的來源不會顯示任何警告;/status 會列出它使用的來源以及它略過的來源」;順序,優先權由高至低:「1. 遠端設定,由 claude.ai 以伺服器管理設定的形式提供,或由 Claude apps gateway 提供……2. MDM 或作業系統層級的政策:macOS plist 或 HKLM 登錄機碼 3. 受管設定檔案,managed-settings.d/*.json 與 managed-settings.json 合併在一起 4. HKCU 登錄,適用於 Windows,以及在 WSL 上當 HKLM 登錄或 Windows 受管設定檔案開啟 wslInheritsWindowsSettings、且 HKCU 的值也設定了它時。」2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。

    提示快取:「除非您自行選擇 TTL,否則 Claude Code 僅在 Claude 訂閱方案且位於方案內含用量範圍內時,才會要求一小時 TTL」;各儲存區的表格列出 Main conversation:一小時(訂閱方案,方案用量範圍內)/五分鐘(用量額度、API 金鑰或雲端供應商),以及 Everything else:「五分鐘,但由伺服器控制的輔助請求除外,其取得一小時」/五分鐘;「兩項設定與兩個環境變數皆需要 Claude Code v2.1.242 或更新版本」;優先順序:「1. FORCE_PROMPT_CACHING_5M=1,強制兩個儲存區皆為五分鐘 2. 該儲存區的環境變數 3. 該儲存區的設定 4. ENABLE_PROMPT_CACHING_1H=1,為兩個儲存區要求一小時 5. 該請求所屬儲存區的預設值。」

    設定參考,modelPicker:「範圍:使用者或受管。Claude Code 會從受管設定、--settings 與使用者設定讀取此鍵值,並在專案與本機設定中忽略它,因此您複製的儲存庫無法重新標示選擇器」;「類型:物件,包含一個由列組成的 options 陣列,以及選用的 replaceBuiltInOptions 布林值」;「availableModels 允許清單仍適用於這些列」;「標籤改變的是選擇器顯示的內容,而非 Claude Code 執行的模型」;「需要 Claude Code v2.1.242 或更新版本」(本指南的範例沿用該頁面自身的 Bedrock 列)。promptCacheTtl 與 subagentPromptCacheTtl:「範圍:任何檔案」;「類型:字串,為下列之一:"5m"……"1h"」;「需要 Claude Code v2.1.242 或更新版本。」設定範例中的供應商 ID 來自 Amazon Bedrock(「主要模型 | Opus 5,例如 us-* 區域中的 us.anthropic.claude-opus-5」)、Google Cloud(「主要模型 | claude-opus-5」)與 Microsoft Foundry(export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-8',該頁面所列最新的 Opus ID)。 ↩

  21. Claude Code CHANGELOG,2.1.243 章節,擷取於2026年8月26日。npm 於2026年8月24日 19:16 UTC 發布 2.1.242,並於 23:10 UTC 發布 2.1.243;2.1.242 沒有 CHANGELOG 章節,2.1.244 從未發布,而官方文件將 modelPicker、promptCacheTtl 以及 /usage 的 Loops 列的最低版本訂為 v2.1.242。原文如下:”Added a Loops breakdown to /usage: per-loop run count, total tokens, tokens per run, and last run, so runaway or chatty /loop tasks are easy to spot”;”Added modelPicker setting: curate the /model picker with an ordered, labeled list of models (any id spelling, including Vertex/Bedrock ids), appended to or replacing the built-in lineup”;”Added promptCacheTtl and subagentPromptCacheTtl settings so API-key and cloud-provider users can keep a 1-hour prompt cache on the main conversation while subagents stay at 5 minutes”;”Added modelPricing managed setting so an organization’s contracted per-model rates and discount multiplier are used for /cost, the status line, and telemetry cost figures instead of list price”;”Added a keyless sign-in under /login → Anthropic Console: ‘Sign in with your Console account’ (recommended) alongside creating an API key, so organizations that don’t allow API keys can sign in”;

    “Added a Skipped sources line to /status that lists managed settings sources (for example managed-settings.json) present but not applied because a higher-precedence managed source is active”;”Added a managed marker in /mcp and /plugins on claude.ai connectors whose authentication is managed by your organization”;”Added a tip pointing claude.ai users who haven’t connected GitHub for Claude Code on the web to /web-setup“;”Added a /status line showing whether GitHub is connected for Claude Code on the web (Pro/Max), pointing to /web-setup when it isn’t”;”Added the model (and effort level) each subagent ran on to /tasks and the agent detail dialogs”;”Improved /loop: consecutive wake-ups where Claude has nothing to do now fold into a single line in the terminal instead of printing each one”;”Fixed /web-setup repeatedly asking you to log in when an older GitHub CLI (without gh auth token) was already authenticated”;”Improved native install and auto-update download size: the binary is now zstd-compressed (about 75 MB instead of 340 MB on Linux x64)”;”Changed the cross-session messaging inbox socket to close connections that send no complete line within 30 seconds; scripts posting to it should connect once their data is ready”。 ↩↩

  22. Claude Code v2.1.231 與 v2.1.232 版本資訊,2026年8月13日。v2.1.231:針對預先註冊用戶端的 MCP OAuth redirect-URI 修正。v2.1.232:subagent 分支(forking)預設開啟並繼承 prompt cache;可用 @ 提及執行中的工作階段,並以純名稱精確比對進行 SendMessage 傳遞;每台機器獨一無二的工作階段名稱;/config 新增對話框逾時與跨工作階段傳入的設定列;GitLab token 系列遮蔽、glab 憑證保護以及 GitLab plugin marketplace;additionalMarketplaces/allowedMarketplaces 別名;gateway 桌面覆蓋層的 schema 驗證與政策項目的啟動驗證;/advisor 支援 Fable 5;PowerShell、Cygwin 符號連結與巢狀 git 信任的安全性修正。擷取於2026年8月14日。 ↩

  23. Claude Code 正式 CHANGELOG,2.1.303 至 2.1.310 各節,擷取日期為2026年10月23日(太平洋時間17:20),以及同時讀取的 @anthropic-ai/claude-code npm 登錄檔中繼資料:2.1.303 於10月18日 21:15 UTC 發布,2.1.304 於10月19日 19:47 UTC,2.1.305 於10月20日 19:29 UTC,2.1.306 於10月21日 02:28 UTC,2.1.307 於10月21日 20:47 UTC,2.1.308 於10月22日 04:19 UTC,2.1.309 於10月22日 20:34 UTC,2.1.310 於10月23日 21:20 UTC;dist-tags 為 latest 2.1.310、next 2.1.310、stable 2.1.308。GitHub 各版本分別包含 1、76、38、2、43、1、79 與 26 個條目,與 CHANGELOG 一致。本指南中所有 v2.1.303 至 v2.1.310 項目的來源。

    重要引文,2.1.304:「Added /auto-mode-setup: a guided setup that reads your project and recent sessions to teach auto mode about your environment, now also available on Bedrock, Vertex, Foundry, Claude apps gateway and telemetry-disabled sessions」;「Added decider: "person" to a mod’s tool.check answer: only the permission dialog or a host’s callback can approve the ask, and it is refused with the mod’s reason where nobody can be asked」;「Added a warning on Pro and Max plans when resuming an inactive conversation would use a noticeable share of your 5-hour usage limit」;「Changed tool search to be on by default behind a custom ANTHROPIC_BASE_URL; a 400 or 422 from the gateway is retried without it」;「Changed mods’ settings.read hooks to receive each settings layer and rewrite the merged settings, so a managed mod can make an organization’s setting a ceiling」;「Changed skill hooks: the skills of one source (a repo, your own folder, or a plugin) can register at most 1,024 hooks and 16,384 matcher characters per session」。

    2.1.305:「Added sandbox.allowNestedUserNamespaces so sandboxed commands on Linux can create user namespaces (Chromium, rootless podman); this lets them get around the sandbox’s file protections」;「Added CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS so unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) notices a usage limit that was lifted before its reset」;「Fixed every request failing on Vertex, Bedrock and other providers when the endpoint or a gateway rejects tool search, and behind gateways with ToolSearch disallowed or left out of --tools (a 2.1.304 regression): Claude Code now retries without it」;「Improved /usage: each warning is now a one-line fix that names its source, and f applies the fixes; the same fixes appear in VS Code and /doctor」;「Changed allowedMcpServers to stop filtering managed-mcp.json stdio servers that use ${VAR} only in env: one your allowlist left out now loads on upgrade; use deniedMcpServers to keep it off」。

    2.1.307:「Added /claude-api api-version to move Claude API code to API version 2026-10-21」;「Added the claude_code.safety_event OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back」;「Improved fork subagents launched together: each is now told which launch is its own, so forks are much less likely to try to start each other’s work」;「[Code Review] Added @claude review stop (also off and pause) to Code Review, ending an @claude review always subscription on a pull request without starting a new review」。2.1.309:「Fixed sandboxed Bash commands on macOS and Linux running the shell’s startup files outside the sandbox before each command」;「Changed sed -i to get the standard Bash prompt and run as written, not a simulated file-edit preview; like other Bash edits, it is no longer restored by /rewind」;「Changed claude ultrareview to require workspace trust: it asks on a terminal, else refuses; scripts pass --trust-workspace, which takes no value (put a PR number or base branch before it), or set CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK=1」;「Fixed sessions compacting repeatedly after reading files under a very large nested CLAUDE.md; a nested CLAUDE.md over the size limit now loads only its start」;「Changed worktree creation and reuse so git no longer fetches objects on demand, in ordinary clones and in partial clones with a Bash sandbox configured; such a partial clone fetches them first」。

    2.1.310:「Added the Monitor tool and plugin monitors on Bedrock, Vertex, and Foundry, and when telemetry or nonessential traffic is disabled; long foreground sleeps are now blocked there too」;「Fixed requests failing behind some gateways and compatible servers that reject the effort-2025-11-24 beta value or mid-conversation system messages; Claude Code now retries without them」;「Linux: Improved /sandbox and the sandbox startup warning to name Ubuntu’s AppArmor restriction on user namespaces, and how to lift it, when it keeps bubblewrap from starting the sandbox」。 ↩

  24. Claude Code CHANGELOG,v2.1.311 至 v2.1.317(提交時間為 2026-10-26T21:51Z、10-27T20:23Z、10-30T01:06Z、10-31T01:01Z 與 11-03T01:25Z),以及對應的 GitHub 發行版本 v2.1.311(2026-10-26T21:51:23Z)、v2.1.312(10-27T20:24:20Z)、v2.1.314(10-30T01:06:26Z)、v2.1.316(10-31T01:01:35Z)與 v2.1.317(11-03T01:25:46Z),各版內容均與其 CHANGELOG 章節完全相同;npm 發布時間取自 npm view @anthropic-ai/claude-code time:2.1.311 為 2026-10-26T19:47:57Z、2.1.312 為 10-27T18:36:10Z、2.1.314 為 10-30T00:12:56Z、2.1.315 為 10-30T21:05:24Z(無 CHANGELOG 條目,亦無 GitHub 發行版本)、2.1.316 為 10-31T00:42:05Z、2.1.317 為 11-02T23:57:53Z;2026-11-02 當日的 dist-tags:latest 與 next 為 2.1.317,stable 為 2.1.311。原文摘錄,2.1.311:「將互動式終端機中的 ultrathink 改為透過 Anthropic 的 API,在 Opus 5.5、Sonnet 5.5、Haiku 5.5 與 Fable 5.1 上以 xhigh 強度等級執行該輪;若在 Claude 工作期間輸入,則提升該輪剩餘部分的強度」。2.1.316:「自2026年10月30日起棄用 Opus 4.8 的快速模式;將於2026年11月30日移除。移除後,Opus 4.8 上的快速模式請求會回傳錯誤,且不會回退至標準 Opus 4.8。請遷移至 Opus 5.5 以保留加速效果」。2.1.314:「新增 permissions.blockWritesOutsideWorkingDirectories:在所有權限模式下,Write、Edit 與 NotebookEdit 均拒絕工作目錄以外的路徑」。2.1.312:「將 prompt 與 agent hooks 改為每個工作階段最多同時執行 24 個(含 subagents),其中等待時間超過其事件逾時的最多 12 個;timeout 低於 1 秒者現在以 1 秒計」;「Claude Code 不再傳送 claude_code.safety_event OpenTelemetry 事件」。2.1.317:「在 OTel 指標、事件與 span 中新增 anthropic.plan、anthropic.seat_type、anthropic.provider 與 anthropic.custom_base_url」。 ↩↩↩

  25. Claude Code 文件,擷取於2026年11月2日:以快速模式加快回應(「Opus 4.8 的快速模式已於2026年10月30日棄用,並將於2026年11月30日移除。若在該日期之後仍以 Opus 4.8 為模型並開啟快速模式,API 會拒絕您的請求」);模型設定(「終端機提示:該字詞可以提升該回合時,會以彩虹色顯示。需要 Claude Code v2.1.311 或更新版本。」);所有設定中的 permissions.blockWritesOutsideWorkingDirectories(「讓 Write、Edit 與 NotebookEdit 工具在所有權限模式下(包括 bypassPermissions)拒絕工作目錄以外的路徑」;「此鍵啟用後,Claude Code 也會移除 EnterWorktree 與 ExitWorktree 工具」)、idleCompaction(預設啟用於「互動式終端機工作階段、VS Code 擴充功能的聊天面板,或桌面應用程式 Code 分頁中於您的機器上或透過 SSH 執行的工作階段」)以及 disableRemoteControl(「Claude Code 會拒絕 claude remote-control、--remote-control 旗標、自動啟動與工作階段內的切換」);2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。

    環境變數中的 CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT、CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK、CLAUDE_CODE_SYNC_SKILLS、CLAUDE_CODE_TRANSCRIPT_LOCAL_GC、CLAUDE_CODE_SKIP_PROMPT_HISTORY、CLAUDE_CODE_DISABLE_CFC_PROMPT 與 FORCE_HYPERLINK(「在 v2.1.314 之前,false、no 與 off 反而會啟用超連結」);該頁面尚未列出 CLAUDE_CODE_DISABLE_ULTRATHINK、CLAUDE_CODE_SUBAGENT_EFFORT、CLAUDE_CODE_MODEL_CATALOG、CLAUDE_CODE_DISABLE_LOOPED_CROSS_CERT_DROP、CLAUDE_CODE_DISABLE_NESTED_SESSION_ID 或 OTEL_EXPORTER_OTLP_TIMEOUT;建立自訂 subagents(「CLAUDE_CODE_EFFORT_LEVEL 環境變數的優先順序高於兩者」);自架環境參考(--hold-idle-file、--max-hold-min:「需要 Claude Code v2.1.311 或更新版本」);自架環境(「於 Team 與 Enterprise 方案公開測試中,預設關閉」);設定伺服器管理的設定;Claude 應用程式閘道設定(「policy_mode 需要閘道伺服器上的 Claude Code 為 v2.1.316 或更新版本」;identity_retention_days「預設 90」);透過 Remote Control 從任何裝置接續本機工作階段。2026年10月26日至11月3日間,code.claude.com 共有 137 個頁面的 sitemap lastmod 發生變動;Wayback CDX 索引顯示其中沒有任何頁面是在該期間首次發布。 ↩↩

  26. Claude Code CHANGELOG,v2.1.318 至 v2.1.322(提交時間為 2026-11-04T00:00Z、11-06T17:03Z、11-09T19:22Z 與 11-10T02:29Z),以及對應的 GitHub 發行版本 v2.1.318(2026-11-04T00:01:03Z)、v2.1.319(11-06T17:04:01Z)、v2.1.321(11-09T19:22:30Z)與 v2.1.322(11-10T02:29:43Z),各版內容均與其 CHANGELOG 章節完全一致(分別為 84、146、118 與 1 條項目);v2.1.320 沒有任何標籤、發行版本或 CHANGELOG 章節。npm 發布時間取自 npm view @anthropic-ai/claude-code time:2.1.318 為 2026-11-03T21:55:17Z、2.1.319 為 2026-11-06T00:58:56Z、2.1.321 為 2026-11-09T19:02:47Z、2.1.322 為 2026-11-10T01:58:41Z;2026-11-10 時的 dist-tags:latest 為 2.1.322、next 為 2.1.322、stable 為 2.1.311。2.1.321 原文:「Added Claude Fable 5.2 (claude-fable-5-2), now the default Fable model」,並附「1M context, $8/$40 per Mtok with $0.20/Mtok cache reads」;「Changed saved Fable 5.1 model picks to move to fable: on Pro and Max plans at once, on Team and Enterprise plans once your organization allows it; use /model claude-fable-5-1 to switch back」;「Added --settings <file> to claude remote-control, which applies a settings file to every session it starts」;「Changed mods Claude writes to turn on without asking in auto and bypass modes … and not to load in dontAsk mode」;「Changed mods’ own tool calls ($.tool.call, $.mcp.call) to raise no permission prompt」。2.1.322:「Added fast mode on Vertex in the global, us and eu regions, falling back to standard speed if Vertex refuses it」。

    2.1.319:「Changed auto mode with telemetry or feature flags off, including behind LLM gateways: calls the server can’t check are asked about or denied, with no fallback to the built-in classifier; set CLAUDE_CODE_AUTO_MODE_SERVER=0 to keep using it (Bedrock, Vertex and Foundry are unchanged)」;「Added support for MCP tasks in the terminal」;「Added permissions.denyInsteadOfPrompting setting: a tool call that would wait on a permission prompt is denied and the turn continues, in terminal sessions, subagents and teammates」;「Added the CLAUDE_CODE_DISABLE_FEATURE_FLAGS environment variable, which stops feature-flag fetching without turning off telemetry」;「Changed MCP tasks to work in the terminal without feature-flag fetching (Bedrock, Vertex, Foundry, LLM gateways, DISABLE_TELEMETRY); set CLAUDE_CODE_DISABLE_MCP_TASKS=1 to turn them off」;「Changed self-paced /loop to end when a turn finishes without rescheduling … set CLAUDE_CODE_LOOP_KEEPALIVE=1 to keep the old behavior」;「Removed shortcuts_list and shortcuts_execute … from Claude Code’s built-in Claude in Chrome tools」。2.1.318:「Added the date a stored claude.ai sign-in ends to claude auth status (loginExpiresAt) and to claude -p JSON results (credential_expires_at)」;「Changed Claude Code to no longer install or update the IDE extension when started in an IDE terminal」;「Changed background subagents to move a shell command to the background after 3 minutes on all providers」。 ↩↩↩↩

  27. CLI 參考:「若您未提供名稱,Claude Code 會自動產生一個。」;「為對話使用特定的工作階段 ID(必須是有效的 UUID)」;「設定工作階段的顯示名稱」;「(研究預覽)Claude 在此工作階段中應監聽其頻道通知的 MCP 伺服器。」;「--sso 可強制使用 SSO 驗證」。擷取於2026年11月10日。 ↩

  28. 驗證:「具備協作功能、管理工具、SSO、帳單管理與伺服器管理設定的自助式方案」;「另外提供網域擷取、角色型權限與合規 API」。為您的組織設定 Claude Code:「SSO、SCIM 佈建與席次指派是在 Claude 帳號層級設定的。」適用於 Amazon Bedrock、AWS 上的 Claude Platform、Google Cloud 與 Microsoft Foundry 的 Claude apps gateway:「開發者以您企業的身分識別提供者(IdP)登入,而不必持有 API 金鑰或雲端憑證。」;「不支援 SAML 與 LDAP。」AWS 上的 Claude Platform 上的 Claude Code:「AWS 上的 Claude Platform 是由 Anthropic 營運的 Claude API,採用 AWS 驗證、IAM 存取控制與 AWS Marketplace 計費。」擷取於2026年11月10日。 ↩↩↩

  29. 所有設定:「是唯一支援的目標;Claude Code 會忽略其他項目。」;「true:只執行受管 hooks,外加 Agent SDK hooks,以及由您的受管設定強制啟用之 plugins 的 hooks。」;「受管設定中的 true 無法被其他位置的 false 覆寫。」;「也可在 permissions 之下以 permissions.disableAutoMode 的形式使用。」設定權限:「disableBypassPermissionsMode 通常放在受管設定中以強制執行組織政策,但它在任何範圍中都有效。」部署受管設定:「com.anthropic.claudecode 受管偏好設定網域」;「在 HKLM\SOFTWARE\Policies\ClaudeCode 之下,以名為 Settings 的 REG_SZ 或 REG_EXPAND_SZ 值存放的 JSON」。擷取於2026年11月10日。 ↩↩↩↩↩↩↩↩↩

  30. 設定權限:「拒絕或詢問規則涵蓋的是 Claude 通常產生的呼叫方式,並非針對該程式的安全邊界」;「規則依序評估:先拒絕,再詢問,最後允許。」;「拒絕規則不會比對以路徑呼叫或位於 sh -c 內的同一個程式,因此當限制必須成立時,請搭配沙箱網路允許清單使用」。擷取於2026年11月10日。 ↩

  31. 在企業啟動器後方執行 Claude Code:「CLAUDE_CODE_PROCESS_WRAPPER 需要 Claude Code v2.1.208 或更新版本。」;「對應的 processWrapper 設定需要 v2.1.210 或更新版本。」;「在 Windows 上,此變數會被忽略」;「專案設定與本機設定無法設定啟動器。」擷取於2026年11月10日。 ↩

  32. Claude Code CHANGELOG(第一則引文出自 2.0.70 版,第二則出自 2.1.154 版):「Removed # shortcut for quick memory entry (tell Claude to edit your CLAUDE.md instead)」;「Removed the stale “& for background” hint from the shortcuts help panel」。Claude 如何記住您的專案:「或透過 /memory 自行編輯該檔案」;「每個 CLAUDE.md 檔案以少於 200 行為目標」;「在 v2.1.281 之前,部分工作階段(例如在 Amazon Bedrock 上或已停用遙測的工作階段)只會讀取 CLAUDE.md 檔案。」;「C:\Program Files\ClaudeCode\CLAUDE.md」。擷取於2026年11月10日。 ↩

  33. 法律與合規:「若客戶已與 Anthropic 簽署商業夥伴協議(BAA),該 BAA 會在兩種設定下延伸適用於 Claude Code」;「透過第三方雲端供應商或閘道路由的 Claude Code 不在涵蓋範圍內」。Anthropic 取得了哪些認證?:「符合 HIPAA 要求的設定(可提供 BAA)」;「ISO 27001:2022」;「ISO/IEC 42001:2023」;「SOC 2 Type I 與 Type II」;「如需索取我們的合規文件副本,請前往我們的 Trust Portal」。資料使用:「Anthropic 不會使用依商業條款傳送至 Claude Code 的程式碼或提示來訓練生成式模型」;「此設定開啟時,我們會使用 Free、Pro、Max 與 Ultra 帳號的資料訓練新模型」;「Claude Code 用戶端預設會以純文字將工作階段逐字稿儲存在本機的 ~/.claude/projects/ 之下,保留 30 天」;「指標絕不包含您的程式碼、提示或檔案路徑。」;「設定 DISABLE_TELEMETRY=1 即可選擇退出。」;關於錯誤回報:「Claude Code 會在任何內容離開您的機器之前,遮蔽已知模式的密鑰、檔案路徑、電子郵件地址與其他個人資訊。設定 DISABLE_ERROR_REPORTING=1 即可選擇退出。」;Claude API 上的錯誤回報「在 v2.1.198+ 上以 Pro、Max 與 Ultra 登入時開啟,其他情況則關閉。」;「使用 Amazon Bedrock、Google Cloud 的 Agent Platform、Microsoft Foundry 或 AWS 上的 Claude Platform 時,錯誤回報、遙測與問題回報預設為停用。」監控:「OpenTelemetry 事件是 Claude Code 活動的稽核資料來源。」擷取於2026年11月10日;資料使用頁面於2026年11月11日重新讀取。 ↩↩↩↩↩

  34. Claude Code Analytics API:「當有人以 Claude 訂閱方案(例如 Pro、Max、Team 或 Enterprise)登入 Claude Code 時,其用量會歸屬於其 claude.ai 組織,而此 API 不會回傳該用量。」;「此 API 只追蹤 Claude API 上的 Claude Code 用量。」;「每頁的紀錄數(預設:20,上限:1000)」;「所有能存取 Admin API 的組織都可以免費使用 Claude Code Analytics API。」擷取於2026年11月10日。 ↩↩

  35. Claude Code Docs,「所有設定」;Claude Code Docs,「驗證」;Claude Code CHANGELOG;以及 @anthropic-ai/claude-code 的 npm registry 紀錄。擷取於2026年11月11日。設定參考中的 modelPricing 項目:「Claude Code 不會從您的合約或 Claude Console 讀取它們。需要 Claude Code v2.1.242 或更新版本。」驗證頁面中關於不使用 API 金鑰登入的說明:「在 /login 提示中選擇 Anthropic Console 帳號後,Claude Code 會詢問您要以何種方式登入。需要 Claude Code v2.1.242 或更新版本。」CHANGELOG 有 2.1.243 章節與 2.1.241 章節,但沒有 2.1.242 章節;它在 2.1.243 之下列出「Added modelPricing managed setting so an organization’s contracted per-model rates and discount multiplier are used for /cost, the status line, and telemetry cost figures instead of list price」與「Added a keyless sign-in under /login → Anthropic Console」。registry 的 time 欄位將 2.1.242 的時間記為 2026-08-24T19:16:14.767Z,2.1.243 記為 2026-08-24T23:10:45.498Z。 ↩

  36. Claude Code Docs,「設定沙箱化的 Bash 工具」,以及 Claude Code Docs,「所有設定」。擷取於2026年11月11日。取自沙箱頁面,關於允許網域以外的主機:「在互動式終端機工作階段中,決定取決於您的權限模式」,表格各列為「bypassPermissions 模式,以及可使用略過權限的規劃模式」(「不經提示即允許」)、「Manual 模式、acceptEdits 模式,以及其他情況下的規劃模式」(「會出現提示」)、auto mode(「拒絕,除非指令已列出該主機且分類器已核准該清單」)以及 dontAsk 模式(「拒絕」)。嚴格允許清單:「內建的沙箱代理伺服器會在每種權限模式下拒絕連線。在 bypassPermissions 模式下,允許網域以外的主機會被允許,除非其中一項已開啟。」可設定的位置:「在使用者、受管或 CLI --settings 設定中設為 true」以及「在儲存庫的 .claude/settings.json 或 .claude/settings.local.json 中設定沒有作用。需要 Claude Code v2.1.219 或更新版本。」設定參考中的 sandbox.network.strictAllowlist 項目將範圍列為「使用者或受管」,並補充「儲存庫無法將其開啟或關閉。」 ↩

  37. 為您的組織控管 MCP 伺服器存取,Claude Code 文件,擷取於2026年11月11日:「managed-mcp.json 中的伺服器不需要 allowedMcpServers 項目,只有一個例外:伺服器在 env 以外使用 ${VAR} 展開時,Claude Code 會依允許清單檢查該伺服器。在 v2.1.305 之前,只在 env 中使用 ${VAR} 展開的伺服器也會受到檢查;而在 v2.1.259 之前,只要設定了允許清單,每個受管伺服器都會受到檢查。」;「在指令、引數、URL 或標頭中使用 ${VAR} 展開的 managed-mcp.json 伺服器仍會受到檢查。」;「deniedMcpServers 也適用於受管伺服器,因此符合某個項目的受管伺服器不會載入。」;「這些伺服器會在每位使用者首次啟動不檢查它們的版本時開始載入,不會有任何提示或通知」。 ↩

  38. Claude Code Docs。「所有設定」。擷取於2026年11月11日。worktree.baseRef 項目:「"fresh" 會從 origin/<default-branch> 建立分支,取得與遠端相符的乾淨工作樹;"head" 會從您目前的本機 HEAD 建立分支,因此未推送的提交與功能分支的狀態都會出現在 worktree 中。」allowedProviders 項目將其 "vertex" 值列為「Google Cloud 的 Agent Platform,原 Vertex AI」。 ↩

  39. Claude Code Docs,「設定伺服器管理設定」,以及 Claude Code CHANGELOG,2.1.316 章節。擷取於2026年11月11日。文件頁面,「安全性核准對話框」:「某些可能帶來安全風險的設定,需要使用者明確核准,Claude Code 才會在互動式工作階段中套用」以及「這些設定存在時,使用者會看到一個說明正在設定哪些內容的安全性對話框。」;其下的清單列出 shell 指令設定、沙箱設定、自訂環境變數與 hook 設定。CHANGELOG:「Changed server-managed settings for Team and Enterprise logins: settings fetched from Anthropic’s API now apply without an approval prompt, and a stored copy that doesn’t verify is refused」。 ↩↩

  40. Claude Platform Docs。「Claude Code Analytics API」。擷取於2026年11月11日。「您可以使用 Admin API 金鑰、具有 org:admin 範圍的 OAuth token,或未限定於工作區的個人或服務帳戶金鑰來存取;工作區 API 金鑰無法使用。」 ↩

  41. 資料使用,Claude Code 文件,擷取於2026年11月11日。錯誤回報:「來自 Claude Code 自身內部的錯誤訊息與堆疊追蹤,透過 TLS 傳送至第三方錯誤追蹤服務。Claude Code 會在任何內容離開您的機器之前,遮蔽已知模式的密鑰、檔案路徑、電子郵件地址與其他個人資訊。設定 DISABLE_ERROR_REPORTING=1 即可選擇退出。」;「只有在下列條件全部符合時,錯誤回報才會開啟」,接著是「您以 Claude Pro、Max 或 Ultra 訂閱登入」、「您執行的是 Claude Code v2.1.198 或更新版本」、「您直接連線至 Claude API」,以及「您的組織沒有 zero data retention 或 HIPAA 協議」。供應商:「使用 Amazon Bedrock、Google Cloud 的 Agent Platform、Microsoft Foundry 或 AWS 上的 Claude Platform 時,錯誤回報、遙測與問題回報預設為停用。」;「當主機平台設定了 CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST 時,Google Cloud 的 Agent Platform、Amazon Bedrock、Microsoft Foundry 與 AWS 上的 Claude Platform 的指標預設為開啟,並遵循標準的 DISABLE_TELEMETRY 選擇退出方式。」 ↩

  42. 部署受管設定與所有設定,Claude Code 文件,擷取於2026年11月11日。遠端設定:「工作階段符合下列其中一個條件時,Claude Code 可以擷取此來源」:「它具有符合資格的憑證」;「它透過 /login 登入閘道」;「它在位於閘道後方、且該閘道會為該工作階段提供設定的 Claude Desktop Code 分頁中執行」。HKCU 登錄檔:「只有在其上方沒有任何管理文件,且主機提供的上層設定沒有提供限制性鍵時,Claude Code 才會讀取它」;當「它將任何政策鍵設為 null 以外的值,即使是 Claude Code 無法讀取的值」或「它是存在但無法讀取的 HKLM 值、受管設定檔或 managed-settings.d 目錄」時,即視為存在文件。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。

    合併:「在您部署的最高排名來源中將 managedSourcesBehavior 設為 "merge"」;「使用者可寫入的 HKCU 登錄檔絕不會與其他來源合併。」;清單:「合併每個來源的項目」;鎖定:「套用任何來源所設定的最嚴格值;較寬鬆的值只有來自最高排名來源時才會套用」;限制用允許清單:「從設定該清單的最高排名來源取得整份清單,不加入較低來源的項目」;整體取用的值:「從設定該值的最高排名來源取得整個值,不合併較低來源的項目或欄位」;其他所有鍵:「採用設定該值的最高排名來源的值」。政策鍵是指「除了 wslInheritsWindowsSettings 與 managedSourcesBehavior 這兩個控制鍵以外,設定中的任何鍵」。部署方式:「上述步驟中的檔案,是將受管設定放到機器上的四種方式之一。」;「透過 Jamf、Intune、群組原則或類似工具,以 macOS 設定描述檔或 Windows HKLM 登錄值的形式部署」;「Linux 與 WSL」之下的「/etc/claude-code/managed-settings.json」。設定參考:「整體取用 sandbox.credentials.awsPairs 與 sandbox.ripgrep 需要 Claude Code v2.1.257 或更新版本。」 ↩↩↩

  43. 適用於 Amazon Bedrock、AWS 上的 Claude Platform、Google Cloud 與 Microsoft Foundry 的 Claude apps gateway、Amazon Bedrock 上的 Claude Code 與 Google Cloud 的 Agent Platform 上的 Claude Code,Claude Code 文件,擷取於2026年11月11日。閘道:「Claude apps gateway 專為必須(或偏好)經由自己的雲端供應商進行推論的組織而設計,例如為了符合資料駐留要求。」Bedrock:「Claude Code 依下列順序解析區域」,接著是 AWS_REGION、AWS_DEFAULT_REGION、「您目前使用中 AWS 設定檔上設定的 region」,以及 us-east-1。Agent Platform:「將 CLOUD_ML_REGION 設為 global、eu 或 us 等多區域位置,或 us-east5 等特定區域。」 ↩

  44. Claude Code CHANGELOG,v2.1.323 至 v2.1.332,擷取於2026年11月25日(2.1.323、2.1.325、2.1.326、2.1.327、2.1.328、2.1.329、2.1.330、2.1.331 與 2.1.332 分別有 294、139、367、173、144、130、142、135 與 150 條最上層項目;沒有 2.1.324 章節),以及 GitHub 發行版本 v2.1.323(2026-11-12T22:12:13Z)、v2.1.325(11-13T20:40:01Z)、v2.1.326(11-16T22:11:05Z)、v2.1.327(11-17T23:17:45Z)、v2.1.328(11-19T01:14:04Z)、v2.1.329(11-19T22:14:41Z)、v2.1.330(11-20T22:32:56Z)、v2.1.331(11-23T21:34:41Z)與 v2.1.332(11-25T01:32:14Z);不存在 v2.1.324 發行版本。npm 發布時間取自 npm view @anthropic-ai/claude-code time:2.1.323 為 2026-11-12T20:29:28Z、2.1.324 為 11-13T18:42:36Z、2.1.325 為 11-13T20:07:25Z、2.1.326 為 11-16T18:43:39Z、2.1.327 為 11-17T20:33:19Z、2.1.328 為 11-18T23:09:39Z、2.1.329 為 11-19T18:40:25Z、2.1.330 為 11-20T19:16:01Z、2.1.331 為 11-23T18:36:26Z、2.1.332 為 11-24T22:06:38Z;2026-11-25 當日的 dist-tags:latest 2.1.332、next 2.1.332、stable 2.1.326。2.1.332 原文:「Changed the default model on Microsoft Foundry to Sonnet 5.5: deploy claude-sonnet-5-5, or set ANTHROPIC_DEFAULT_SONNET_MODEL to a model you have deployed」;「Changed the sonnet model alias on Google Cloud’s Agent Platform and Microsoft Foundry to Sonnet 5.5, and Foundry’s opus alias to Opus 5.5; sonnet on Amazon Bedrock stays at Sonnet 4.5」;「Added a PreSkillShellCommand hook event that can refuse a skill or command’s inline shell commands as it loads; on 2.1.331 and older, a settings file naming it opens a dialog at start」;「Added skills from MCP servers (beta). They show as server:skill in the / menu; other skills keep their names」;「Changed /schedule, permission prompts and /loop’s cloud offer to say “cloud scheduled task” instead of “routine” or “cloud schedule”; /routines still works」。2.1.330:「Changed recurring scheduled tasks and /loop to run up to 30 days instead of 7 while their session keeps running, and say when they end; tasks made before this release still end at 7 days」。2.1.328:「Added auto mode for Claude Opus 4.6 and Sonnet 4.6 on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry and Claude apps gateway; interactive sessions with no permission mode start in it」。2.1.325:「Changed sandboxed Bash commands to follow the normal permission flow by default; set sandbox.autoAllowBashIfSandboxed: true to keep running them without prompts」。2.1.323:「Added Code Mode, an experimental opt-in in which Claude writes JavaScript to call its tools」;「Removed the subagentStatusLine setting: subagent rows always use the default look, and settings files that still hold the key load as before」;「Changed the context window assumed for a model ID that Claude Code doesn’t recognize from 200K to 1M; use /autocompact to compact earlier, or CLAUDE_CODE_DISABLE_1M_CONTEXT=1 to keep 200K」;「Changed MCP_SDK_GENERATION=v1 to run the v2 MCP client in a compatibility mode (earlier handshake, relaxed OAuth sign-in checks), because the v1 MCP client is removed」。 ↩↩↩↩

  45. Claude Code 文件,擷取於2026年11月25日:模型設定(sitemap lastmod 2026-11-25)、Microsoft Foundry 上的 Claude Code 與 Google Cloud 的 Agent Platform 上的 Claude Code(兩者的 lastmod 均為 2026-11-24)。模型設定,別名表格:「Anthropic API | Opus 5.5 | Sonnet 5.5 | Haiku 5.5」;「AWS 上的 Claude Platform | Opus 5.5 | Sonnet 4.6 | Haiku 4.5」;「Claude Models on Google Cloud (Anthropic managed) | Opus 5.5 | Sonnet 5.5 | Haiku 4.5」;「Amazon Bedrock、Google Cloud 的 Agent Platform | Opus 5.5 | Sonnet 4.5 | Haiku 4.5」;「Microsoft Foundry | Opus 4.6 | Sonnet 4.5 | Haiku 4.5」。預設模型:「AWS 上的 Claude Platform、Claude Models on Google Cloud (Anthropic managed)、Amazon Bedrock 與 Google Cloud 的 Agent Platform:預設為 Opus 5.5」;「Microsoft Foundry:預設為 Sonnet 4.5」。Foundry 頁面:「為每個部署固定特定的模型版本」;「若未設定 ANTHROPIC_DEFAULT_OPUS_MODEL,Microsoft Foundry 上的 opus 別名會解析為 Opus 4.6」。Agent Platform 頁面:「若未設定 ANTHROPIC_DEFAULT_SONNET_MODEL,sonnet 別名會解析為 Sonnet 4.5」。在該日,這些頁面尚未跟上 v2.1.332 的版本說明。 ↩↩

  46. 搭配 Claude Models on Google Cloud (Anthropic managed) 使用 Claude Code,Claude Code 文件,擷取於2026年11月25日(sitemap lastmod 為 2026-11-14;首次 Wayback Machine 存檔為 2026-11-15):「由 Anthropic 營運、透過您的 Google Cloud 專案存取的 Claude API」;「安裝 Claude Code v2.1.307 或更新版本」;含有 CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD、ANTHROPIC_GOOGLE_CLOUD_PROJECT 與 ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID 的 env 區塊;「API provider 這一行包含 on Google Cloud」。推出日期取自 Claude Platform 版本說明,2026年10月22日:「We’ve launched Claude Models on Google Cloud (Anthropic managed), the Claude API operated by Anthropic and reached through your Google Cloud project. Google Cloud IAM controls access. Google Cloud Marketplace handles billing.」Claude Code CHANGELOG 未提及此供應商或其變數。 ↩