Claude Code: 什麼是 Subagents?
# Subagents 是專門化的 Claude 實例,能夠獨立處理複雜任務。它們是 Claude Code 最強大、卻也最少被理解的功能之一。熟練運用 subagents,能大幅擴展您所能完成的工作範圍。關於 Agent Teams、Subagents 與 Parallel Sessions 之間的取捨,請參閱決策框架。
Subagents 是專門化的 Claude 實例,能夠獨立處理複雜任務。它們是 Claude Code 最強大、卻也最少被理解的功能之一。熟練運用 subagents,能大幅擴展您所能完成的工作範圍。關於 Agent Teams、Subagents 與 Parallel Sessions 之間的取捨,請參閱決策框架。
Subagents 是專門化的 Claude 實例,能夠獨立處理複雜任務。它們是 Claude Code 最強大、卻也最少被理解的功能之一。熟練運用 subagents,能大幅擴展您所能完成的工作範圍。關於 Agent Teams、Subagents 與 Parallel Sessions 之間的取捨,請參閱決策框架。
為什麼需要 subagents: Claude Code 的主對話只有一個 context window。您討論的每件事、Claude 讀取的每個檔案、每一筆工具輸出,全都會消耗這個 context。在長時間的工作階段中,context 會逐漸填滿,Claude 開始忘記先前的決定,效能也隨之下降。Subagents 透過隔離工作來解決這個問題:探索的結果不會膨脹主對話,只有摘要會回傳。Claude 會並行執行 subagents:截至 v2.1.217 預設一次 20 個(CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS),超過此上限的產生請求會失敗,直到某個執行中的 subagent 完成為止。2191325 截至 v2.1.198(2026年7月1日),subagents 預設在背景執行:Claude 在它們運行時繼續工作,並在它們完成時收到通知。同一版本也讓內建的 Explore agent 繼承主工作階段的模型,而不再永遠使用 Haiku(當工作階段執行 Fable 時,若使用訂閱、Console 帳號或 LLM 閘道,Explore 會在 Opus 上執行;在 Bedrock、Agent Platform、Foundry、AWS 上的 Claude Platform 與 Claude apps gateway 上,則維持使用工作階段的模型);此外,subagents 與 context 壓縮現在都會繼承工作階段的 extended-thinking 設定,提升委派任務的品質。178325427
Subagents 如何運作
當 Claude 遇到需要專注處理的任務(深度探索、多步驟分析、專門工作)時,它可以生成一個 subagent。這個 subagent:495
- 以全新、隔離的上下文視窗啟動(fork 是例外:它會繼承目前為止的對話)
- 可存取指定的工具
- 在每次產生時指定的模型、其定義中指定的模型,或
CLAUDE_CODE_SUBAGENT_MODEL指定的模型上執行,否則使用主對話的模型 - 將結果回傳給主對話
這種架構可防止 context 溢位,同時支援複雜的工作流程。巢狀生成預設開啟,深度為 3(v2.1.219)——subagents 可以生成自己的 subagents,最多三層;設定 CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1 則會關閉巢狀。193
若您依賴深度設定,請明確設定它。 預設值為 3(v2.1.219+)。
如果您的編排邏輯取決於委派任務能扇出多深——無論是因為需要遞迴,還是因為必須保證它不會發生——建議在設定中固定 CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH,而不是沿用當前版本所附帶的預設值。168191193
截至 v2.1.186,當背景 subagent 遇到需要核准的工具時,提示會出現在您的主工作階段,而不是被自動拒絕——對話框會顯示是哪個 agent 在請求,按 Esc 只會拒絕該單一工具。主回合結束後,即使背景 agents 仍在執行,Esc 與 Ctrl+C 也依然保持回應。172
工作階段預算與權限繼承。 工作階段對 subagent 的總產生次數沒有上限。限制失控迴圈的是並行上限(預設同時執行 20 個 subagents)與巢狀深度(預設為主對話之下 3 層,CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH)。CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION 現已無作用:v2.1.224 移除了 v2.1.212 設下的每個工作階段 200 次產生上限,此變數也隨之失效。186198318553 WebSearch 仍保有每個工作階段 200 次呼叫的預算,而在互動式工作階段中,它會以每小時約 100 次的速率補充(v2.1.290+):CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR 可設定該速率,設為 0 則關閉補充。CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION 會提高上限本身(此上限可以調高,但無法關閉),/clear 會重設計數,而在 -p 執行與 Agent SDK 中,此限制以每個回合計算,除非您設定速率,否則不會補充。232234315 Task 工具的 mode 參數已棄用並會被忽略(v2.1.212),因此產生的 agent 無法透過該參數自行選擇模式,要求比啟動它的工作階段更寬鬆的權限;當主對話處於 default 或 dontAsk 模式時,subagent 的 permissionMode frontmatter 仍會設定其模式,例外情況見下方的設定表。186495
並行上限與真正的預算強制執行(v2.1.217)。 同時執行的 subagents 上限預設為 20,可透過 CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS 覆寫,因此單一訊息無法無限制地扇出背景 agents(啟用 ultracode 的工作階段不受此限)。--max-budget-usd 涵蓋背景 subagents:一旦達到上限,新的產生請求會被拒絕,執行中的背景 agents 也會被中止。191325
Fork 與背景預設值(v2.1.302)。 繼承完整對話的 fork subagents(subagent_type: "fork"),在終端機、claude -p、Agent SDK、桌面應用程式與 VS Code 中預設開啟;CLAUDE_CODE_FORK_SUBAGENT=0 會在所有環境關閉它們,而 claude mcp serve 從不提供此功能。桌面應用程式與 VS Code 和終端機一樣,一律在背景執行主對話的 subagents;在 claude -p、SDK、桌面應用程式與 VS Code 中,subagent 自身的 Agent 呼叫預設在前景執行。272273 v2.1.307 會告知一起啟動的 fork subagents 哪一個啟動是自己的,因此 forks 彼此做對方工作的機率大幅降低;sub-agents 與環境變數頁面將 fork 模式描述為自 v2.1.302 起預設開啟,在互動式終端機工作階段中則自 v2.1.232 起預設開啟。275276325
Subagent 模型與摘要(v2.1.323 至 v2.1.330)。 未指定模型而啟動的 subagent,在恢復時會維持使用它啟動時的模型,即使在 /model 之後亦然(v2.1.327)。subagent 的模型備援會延續下去:它接著啟動的未指定模型的 agents 與 forks 都會在備援模型上執行,而它們啟動的 agents 會使用其 Bedrock 區域(v2.1.330)。設定 CLAUDE_CODE_FORK_SUBAGENT=0 時,claude -p、Agent SDK、桌面應用程式與 VS Code 中的 subagents 預設會等待自己的 subagents,而 claude -p 會把背景 subagent 及其等待的 subagents 計入同一個 10 分鐘的等待時間;較長的鏈請調高 CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS(v2.1.328)。Subagent 的進度摘要改由簡短筆記撰寫,而不是整段對話,因此使用的 token 少得多(第三方供應商於 v2.1.327,Anthropic API 於 v2.1.328);CLAUDE_CODE_DISABLE_AGENT_PROGRESS_SUMMARIES=1 會關閉這些摘要及其請求。因同層級 agent 的訊息而恢復的 subagent,會遵循工作階段的權限設定,因此它可能會詢問,或在無人能回應時被拒絕(v2.1.327)。截至 v2.1.323,subagentStatusLine 設定已移除:subagent 的列一律使用預設外觀。527
動態工作流程規模(v2.1.219+)。 動態工作流程(可扇出數十到數百個背景 agents 的 /workflows 編排)採用建議性的規模準則,而非強制上限。可透過「Dynamic workflow size」(動態工作流程規模)這個 /config 控制項(小/中/大的 agent 數量,或不限制),或在任何設定檔(使用者、專案或受管設定)中以 workflowSizeGuideline 設定鍵設定;當設定檔提供該值時,/config 中的對應列會隱藏,而執行中的工作流程狀態列會顯示目前的規模,並附上指向 /config 的提示。預設值為 medium,即少於 10 個 agents;在 Pro 方案上則為 small(少於 5 個)(v2.1.271+)。326 由於此準則只是建議而非限制,真正的上限是工作流程執行環境本身的上限:預設最多同時執行 16 個 agents(CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS,v2.1.269+),每次執行最多 1,000 個 agents。179193325
內建 Subagent 類型
Explore(快速、唯讀):
- 模型:工作階段的模型(v2.1.198+)。當工作階段執行 Fable 時,若使用訂閱、Console 帳號或 LLM 閘道,Explore 會在 Opus 上執行;在 Bedrock、Agent Platform、Foundry、AWS 上的 Claude Platform 與 Claude apps gateway 上,則維持使用 Fable325427
- 模式:嚴格唯讀
- 工具:唯讀工具;Write 與 Edit 會被拒絕495
- 徹底程度:Quick、Medium、Very thorough
- 適用於:探索程式碼庫、尋找檔案、理解結構
General-purpose: - 模型:繼承自主對話 - 模式:完整讀寫 - 工具:所有可用工具 - 適用於:複雜的研究加修改任務
Plan:
- 模型:繼承自主對話(或搭配 opusplan 使用 Opus)
- 模式:唯讀
- 工具:唯讀工具;Write 與 Edit 會被拒絕495
- 適用於:在執行前規劃複雜的實作
輔助 agents(自動呼叫): claude 是處理不適合任何更專門 agent 之任務的通用 agent,也是派送出的背景工作階段的預設 agent;statusline-setup(Sonnet)會在您使用 /statusline 時執行;claude-code-guide(Haiku)負責回答關於 Claude Code 本身的問題;web-fetch(Haiku,若無法使用 Haiku 則採用起始對話的模型)會在使用它的工作階段中讀取網頁,這類工作階段的主對話沒有自己的 WebFetch 工具。325553
觸發 Subagents
Claude 會根據任務類型自動委派給 subagents。您也可以明確提出請求:
> Use the explore agent to find all authentication-related files
> Have a subagent analyze the database schema thoroughly
> Spawn an agent to research how error handling works in this codebase
專家提示: 對於複雜任務,不妨明確要求委派給 subagent。「Use an explore agent to find…」可以避免主對話的 context 膨脹。
建立自訂 Subagents
在 .claude/agents/(專案)或 ~/.claude/agents/(個人)中定義 subagents:
---
name: security-reviewer
description: Expert security code reviewer. Use proactively after any code changes to authentication, authorization, or data handling.
tools: Read, Grep, Glob, Bash
model: opus
permissionMode: plan
---
You are a senior security engineer reviewing code for vulnerabilities.
When invoked:
1. Identify the files that were recently changed
2. Analyze for OWASP Top 10 vulnerabilities
3. Check for secrets, hardcoded credentials, SQL injection
4. Report findings with severity levels and remediation steps
Focus on actionable security findings, not style issues.
當主對話處於 auto、acceptEdits 或 bypassPermissions 模式時,Claude Code 會忽略 permissionMode: plan,此審查者會以主對話的模式執行;auto mode 是互動式終端機與 VS Code 工作階段內建的起始模式(v2.1.283+)。tools 這一行是另一項獨立的控制:它是允許清單,因此此審查者會取得 Read、Grep、Glob 與 Bash,而沒有 Edit 或 Write 工具。495
設定欄位:
| 欄位 | 必填 | 選項 | 用途 |
|---|---|---|---|
name |
是 | 最多 256 個字元,不可含 :(例如 code-reviewer 或 reviewer-v2) |
唯一識別碼427 |
description |
是 | 自然語言 | 何時呼叫(加入「use proactively」(主動使用)之類的字句可鼓勵委派)427 |
tools |
否 | 以逗號分隔 | 省略時會繼承 subagents 可用的所有工具495。列出 Agent 可讓該 subagent 產生自己的 subagents;Agent(agent_type) 類型清單只對以 claude --agent 作為主執行緒執行的 agent 限制可產生的 agents(v2.1.63+;Task(...) 仍可作為別名使用)325;截至 v2.1.299,此處指定的 MCP 伺服器只提供其自身的工具,而名稱含有 __ 的伺服器會列為 mcp__<whole name>__*268 |
disallowedTools |
否 | 以逗號分隔 | 要拒絕的工具,會從繼承或指定的清單中移除。MCP 伺服器層級的規格(mcp__server、mcp__server__*、mcp__*)會在此比對(v2.1.178+)。170 帶有指定條件的項目(例如 Bash(git push *))仍會移除整個工具550 |
model |
否 | sonnet、opus、haiku、fable、完整的模型 ID、inherit |
省略時,模型依 subagent 模型順序決定:每次產生時指定的模型、此欄位、CLAUDE_CODE_SUBAGENT_MODEL,最後是主對話的模型。325 截至 v2.1.251,此處明確指定的 model: 與每次派生時明確指定的模型一樣,優先於 CLAUDE_CODE_SUBAGENT_MODEL,後者現在只設定預設值203,除非設定了 v2.1.257 的 CLAUDE_CODE_SUBAGENT_MODEL_FORCE,它甚至會覆寫此處的設定208 |
permissionMode |
否 | default(別名 manual)、acceptEdits、auto、dontAsk、bypassPermissions、plan |
subagent 執行時的權限模式;未設定時,會繼承主對話的模式。是否採用您的值,取決於主對話的模式。在 default 或 dontAsk 下,subagent 會以您設定的模式執行,但若您設定 bypassPermissions(v2.1.267+),或在其無法使用 auto mode 的情況下設定 auto,它會維持主對話的模式。在 auto、acceptEdits 或 bypassPermissions 下,它會以相同模式執行,您的值會被忽略。在 plan 下,無論您設定哪個值,它都會維持規劃模式,除非它以 agent team 隊友的身分執行。plugin subagents 會忽略此欄位325495 |
effort |
否 | low、medium、high、xhigh、max |
此 subagent 執行期間的 effort;會覆寫工作階段的等級,但不會覆寫 CLAUDE_CODE_EFFORT_LEVEL。可用的等級取決於模型325 |
color |
否 | red、blue、green、yellow、purple、orange、pink、cyan |
在任務清單與逐字稿中的顯示顏色325 |
initialPrompt |
否 | 文字 | 當 agent 以主工作階段 agent 執行時(--agent 或 agent 設定),作為第一個使用者回合送出。plugin subagents 會忽略此欄位325 |
maxTurns |
否 | 整數 | subagent 停止前的最大 agentic 回合數。截至 v2.1.246,達到上限的 subagent 會將其輸出標記為部分結果回傳,並提示可透過 SendMessage 繼續,而不會看起來像已完成246 |
memory |
否 | user、project、local |
agent 的持久記憶範圍(v2.1.33+)。關閉自動記憶時(autoMemoryEnabled 或 CLAUDE_CODE_DISABLE_AUTO_MEMORY)沒有作用495 |
skills |
否 | 以逗號分隔 | 啟動時自動將 skill 內容載入 subagent 的上下文;截至 v2.1.295,前 32 個不重複的名稱會被預先載入,每個只載入一次,而擁有 Skill 工具的 subagent 仍可呼叫其餘的 skill235237;設定了 disable-model-invocation: true 的 skill 無法預先載入495 |
mcpServers |
否 | 伺服器名稱或內嵌定義 | 此 subagent 可使用的 MCP 伺服器。位於專案 .claude/agents/ 下的 agent 檔案中的內嵌定義,只有在您信任該資料夾後才會載入(v2.1.238+)。plugin subagents 會忽略此欄位427495 |
hooks |
否 | Hook 設定物件 | 限定於此 subagent 執行期間的生命週期 hooks。plugin subagents 會忽略此欄位427 |
background |
否 | true、false |
設為 true 可讓此 subagent 即使在 Claude 要求等待它時仍保持在背景;Claude 從主對話產生的自訂 subagents 預設已在背景啟動(v2.1.49+)550 |
isolation |
否 | worktree |
在暫時的 git worktree 中執行,取得隔離的儲存庫副本;預設情況下,副本會從您的預設分支建立分支,而不是從父工作階段的 HEAD(v2.1.49+)550 |
experimental.cacheTtl |
否 | "5m"、"1h" |
各 agent 專屬的提示快取 TTL,在未設定任何 subagent TTL 時使用:若已設定 CLAUDE_CODE_SUBAGENT_PROMPT_CACHE_TTL 與 v2.1.242 優先順序鏈中的 subagentPromptCacheTtl 設定,仍以它們為準,而當您的 Claude 訂閱正在使用用量額度時,1h 會被忽略(v2.1.248+)203495 |
omitClaudeMd |
否 | true、false |
執行 subagent 時不載入使用者、專案與本機的 CLAUDE.md 檔案;受管的政策檔案仍會載入,但定義於受管設定中的 subagent 除外。當 agent 以主工作階段 agent 執行時(--agent 或 agent 設定),此欄位會被忽略。--agents JSON 也接受此欄位(v2.1.271+)213495 |
autoCompactWindow |
否 | Token 數量 | 讓此 subagent 比主對話的視窗更早自動壓縮;--agents JSON 也接受此欄位(v2.1.296+;sub-agents 文件將其描述為把此 subagent 的自動壓縮視窗降低「至 100000 以上的 token 數」)235269550 |
Subagent 的 effort(v2.1.316 至 v2.1.317)。 subagent 的 effort 依序來自 CLAUDE_CODE_EFFORT_LEVEL、每次呼叫的 effort 參數(v2.1.292+)、agent 定義中的 effort 欄位,然後是 CLAUDE_CODE_SUBAGENT_EFFORT(環境變數頁面標示為 v2.1.315,版本說明則為 2.1.316547),後者設定在沒有其他來源指定時 subagent 執行的等級,而非繼承工作階段的等級。使用與主對話不同模型的 subagent 或 teammate,會以該模型儲存的 effort 等級或其預設值執行,而非工作階段的等級(v2.1.317)。/tasks 會顯示每個 subagent 執行時所用的模型與 effort。281282
限制可派生的 subagent(v2.1.33+,v2.1.63 更名): tools 欄位支援 Agent(agent_type) 語法,用來限制某個 agent 可以派生哪些類型的 subagent。例如,tools: Read, Grep, Agent(Explore) 允許該 agent 直接使用 Read 與 Grep,但只能委派給 Explore 類型的 subagent。此類型清單只適用於以 claude --agent 作為主執行緒執行的 agent。在 subagent 定義中,列出 Agent 可讓該 subagent 在深度限制允許的範圍內產生自己的 subagents,但括號中的類型清單會被忽略;若要讓 subagent 完全無法產生 subagents,請不要在 tools 中列出 Agent。325 注意: 在 v2.1.63 中,Task 工具已更名為 Agent。設定與 agent 定義中既有的 Task(...) 參照仍可作為向下相容的別名使用。104
CLI 定義的 Subagent(v2.1.32+)
啟動時以 JSON 定義 subagent,方便快速測試或自動化。這些 subagent 只存在於該工作階段,不會儲存到磁碟:87
claude --agents '{
"code-reviewer": {
"description": "Expert code reviewer. Use proactively after code changes.",
"prompt": "You are a senior code reviewer. Focus on code quality and security.",
"tools": ["Read", "Grep", "Glob", "Bash"],
"model": "sonnet"
}
}'
--agents 旗標接受以 agent 名稱為頂層鍵的 JSON。每個定義都接受 prompt(系統提示),以及 frontmatter 欄位 description、tools、disallowedTools、model、permissionMode、mcpServers、hooks、maxTurns、autoCompactWindow、skills、initialPrompt、memory、effort、background、omitClaudeMd 與 isolation;color 與 experimental 會被忽略。427 截至 v2.1.281,--agents 除了內嵌 JSON 之外,也接受 JSON 檔案的路徑(搭配 -p),並允許 prompt 留空。221
Subagent 的 skill 探索修正(v2.1.133+): 較早的版本有一個錯誤,subagent 無法透過 Skill 工具探索 project、user 或 plugin 的 skills,因此派生出的 subagent 只看得到全域的 skill 目錄。v2.1.133 修正了此問題;subagent 現在會繼承父工作階段可用的完整 skill 圖譜,這對於隨 agent 一併提供任務專屬 skills 的 plugin 作者來說至關重要。157
管理 Subagent
v2.1.198 移除了 /agents 精靈:請改為請 Claude 建立或管理 subagent,或直接編輯 .claude/agents/ 中的檔案。輸入 /agents 會說明精靈去了哪裡,而 v2.1.281 則從指令選單與 /help 中移除了殘留的「(removed)」項目。221
部分結果與各 agent 的模型(v2.1.243–246): /tasks 與 agent 詳細資料對話框會顯示每個 subagent 執行時所用的模型與 effort 等級(v2.1.243)。在 maxTurns 上限停止的 subagent 會將其已產生的內容標記為部分結果回傳,並提示可透過 SendMessage 繼續,而不會看起來像已完成(v2.1.246);請將部分結果視為檢查點,而非答案。247246
Agent View(v2.1.139+): claude agents 已不再列出 subagent 定義(這是它在 v2.1.50 的行為),而是開啟 Agent View,這是一個研究預覽階段的操作畫面,可在同一處派發並監控多個 Claude Code 工作階段。可用它查看哪些工作階段正在執行、受阻或已完成;但不要把這個畫面當成品質關卡。工作是否完成,仍由測試、審查與 hook 證據決定。159 截至 v2.1.287,n:<text> 篩選器可比對工作階段名稱與任務,啟用中的篩選器會在收合的區段內顯示符合項目,按 Enter 則開啟第一個符合項目。從 claude agents 送出的回覆會以排隊訊息的形式送達:在回合執行期間送出的斜線指令(/stop 除外)會在回合結束時執行,而內容恰為 /stop 的回覆則會立即停止該工作階段。229230
v2.1.288 新增 Ctrl+F 依名稱尋找工作階段,以及 Alt+Up/Alt+Down 在群組之間跳轉;這兩者與重新命名都可在 keybindings.json 中透過 agents:find、agents:previousGroup、agents:nextGroup 與 agents:rename 動作重新綁定,而在 n: 篩選或 Ctrl+F 搜尋之後按 Enter,會開啟名稱最相符的項目。231234 截至 v2.1.290,從 claude agents 送往忙碌中背景工作階段的 /model、/effort 與 /rename 會立即套用,而非等到回合結束;正在等待 /loop 喚醒的背景工作階段在更新與記憶體不足期間會保持執行,因為重新啟動可能會悄悄遺失該喚醒。232 截至 v2.1.299,從 agent view 送出的 /effort 與 /fast 會設定新工作階段的起始值,在該處輸入不帶參數的 /model、/effort 或 /fast 會開啟選擇器,而以 --safe-mode 啟動的背景工作階段,其預覽面板會顯示一行安全模式提示。268
claude agents --json 會將作用中的工作階段以 JSON 陣列印出,供指令碼使用。若要檢視已設定哪些 subagents,請在工作階段中詢問 Claude,或讀取 .claude/agents/ 與 ~/.claude/agents/。327
遠端控制(v2.1.51+): claude remote-control 子指令會啟動 Remote Control 伺服器(別名 claude rc),讓您從 claude.ai 或 Claude 應用程式操作這台機器上的 Claude Code。它以伺服器模式執行,不會有本機互動式工作階段:96327108254283270499
claude remote-control # Start a Remote Control server on this machine
claude remote-control --name "My Project" # Custom session title visible in claude.ai/code (v2.1.69+)
claude remote-control --continue # Bring back the session the last server in this directory started with; works for about four hours after that server stopped (v2.1.200+)
claude remote-control --settings <file> # Apply a settings file to every session it starts; a changed file stops new sessions until you restart the command (v2.1.321)
# --sandbox and --no-sandbox were removed in v2.1.300 (they never had an effect); set sandbox.enabled in settings instead
在背景執行代理程式
適用於長時間執行的任務:
> Run a thorough security review in the background
> /tasks # Check status of running agents
背景 agent 完成時,其結果會以完成通知的形式送達 Claude;在此期間,/tasks 會顯示其狀態。325
背景工作階段的成果會如何處理(v2.1.221)。 背景工作階段現在會提交並推送以保留成果,只在任務確實需要時才開啟草稿 PR(先前的行為是例行開啟),遵循您 CLAUDE.md 中的 git 指示,並且一律在結束時回報成果所在位置——分支、提交或 PR。實際影響是:隔夜執行的背景任務不再把輸出遺留在未推送的 worktree 中,而您 CLAUDE.md 裡的 git 慣例(提交訊息格式、分支命名、「永不推送到 main」)現在對背景工作階段與互動式工作階段同樣有效。若您的 CLAUDE.md 對 git 隻字未提,建議在其中寫明偏好,而不是從一個突如其來的草稿 PR 得知預設行為。196
Shell 端管理(v2.1.251):背景工作階段子命令 claude attach <id>、claude logs、claude stop、claude respawn 與 claude rm 現在會顯示在 claude --help 中,而針對正在執行的背景工作階段,--resume 訊息會指明應執行的確切 claude attach <id> 命令。203 截至 v2.1.290,claude attach 與 claude logs 可以用執行中工作階段名稱的一部分取代 ID,例如 claude logs "auth refactor"。232234
跨工作階段訊息傳遞(v2.1.224)
Claude Code 工作階段可以跨您的任何機器彼此傳送訊息(macOS、Linux 與 WSL 2 自 v2.1.224 起;原生 Windows 依 CHANGELOG 自 v2.1.239 起,依文件頁面則自 v2.1.234 起328):ListAgents 依名稱探索您的其他本機工作階段、雲端工作階段與產生的 subagents,SendMessage 則負責將訊息送達。筆電上的工作階段可以直接把結果交給桌機上長時間執行的工作階段,無需您在終端機之間來回搬運。
Anthropic 為此功能提供了專屬的說明文件頁面;要點如下:428
看見運作機制。 /list-agents(別名 /peers)會顯示每一個可連線的 agent:目前工作階段中的 subagents、您的 agent team 隊友、您的其他本機工作階段(包含背景工作階段),以及在 Remote Control 連線期間,您在其他機器上的工作階段與雲端工作階段。/status 會顯示一列 Peer address,內容為該工作階段自身的收件匣 socket(以 uds: 為前綴),而每個 hook 與 Bash 指令都會以 CLAUDE_CODE_MESSAGING_SOCKET 的形式收到它,且在任何 hook(包括 SessionStart)執行之前就已匯出。429 工作階段會回應來自 /rename 或 --name 的名稱;若未指定,Claude Code 會自行為工作階段命名,互動式工作階段則會取得從目錄衍生的名稱,例如 myapp-3f。ListAgents 會將已中斷連線的 Remote Control 工作階段標記為 offline,並將您的雲端工作階段標示為 cloud(v2.1.229)。428254 自 v2.1.232 起,名稱可直接使用:在提示中輸入 @ 即可提及另一個運作中的工作階段,Claude 會透過 SendMessage 與其聯繫;與單一運作中工作階段完全相符的純名稱會直接送達,而不會要求您確認 [ref];同一台機器上的互動式工作階段會維持名稱唯一,因此以已被佔用的名稱啟動或重新命名時,會得到一個 name-word-word 變體並通知您。同樣自 v2.1.232 起,/config 提供 「Dialog expiry」(對話框逾期)與 「Messages from your other sessions」(來自您其他工作階段的訊息)(accept/hold/refuse)兩列。252
訊息是什麼。 一個 Claude 寫給另一個的純文字,絕不是傳送端的對話歷史或檔案,而權限邊界仍以各工作階段為單位。若要搬移對話,請改為恢復該工作階段。接收端的 Claude 會在進行中回合的工具呼叫之間讀取訊息,或在工作階段閒置時以新回合的形式讀取,而送達的訊息會與輸入的提示一樣計入用量。428
送達的內容無法採取行動。 接收端受四條規則約束:訊息無法核准待處理的權限提示;接收端的 Claude 被指示絕不因另一個工作階段的要求而變更權限設定、CLAUDE.md 或組態;文字中的斜線命令會以散文形式送達,絕不會被執行;而訊息所要求的任何事項,仍須經過接收端工作階段自身的權限提示。428
傳入控制。 每則送達的訊息都會被接受、保留或拒絕。crossSessionInbound(accept / hold / refuse)用於設定政策;若未設定,Claude Code 會根據兩個工作階段的權限模式類別逐則判斷:略過權限的工作階段構成一類,其餘的構成另一類。會詢問權限的工作階段會送達每則訊息,只保留傳送端自稱為略過權限的訊息;略過權限的工作階段則保留所有訊息,只有來自同樣略過權限之傳送端的訊息除外。在互動式終端機工作階段中,被保留的訊息會開啟核准對話框;若超過 dialogExpiry 期限(預設五分鐘)仍未回應,對話框會關閉,訊息也會被丟棄。同時最多保留 100 則訊息,超過時會丟棄最舊的一則。無頭的 claude -p 工作階段同樣會綁定收件匣 socket,但無法顯示對話框,VS Code 擴充功能與桌面應用程式也無法顯示。在這些環境中,依預設行為被保留的訊息會等待同樣的 dialogExpiry 期限,然後被丟棄,並向 Claude Code 能連線的傳送端回報為已逾期(dialogExpiry: "never" 會保留它直到工作階段結束;由明確的 hold 保留的訊息則不會逾期)。需要接收訊息的無人值守工作者,必須在自己的 --settings 中加入 crossSessionInbound: "accept"。Bare 模式的工作階段不綁定 socket,因此無法連線。428
閒置通知(v2.1.236)。 SendMessage 接受 notify_when_idle:請求這台機器上的另一個 Claude Code 工作階段在下次進入閒置時發送一則通知。它需自行選擇加入,且為一次性,無需輪詢(CHANGELOG 條目列出 macOS 與 Linux)。送達誠實性(v2.1.235 至 v2.1.238): 超過大小限制的訊息會在一開始就被拒絕,而不是無聲地丟棄;傳送給拒絕傳入訊息的工作階段(crossSessionInbound: "refuse")會回報「refused」(已拒絕),而不是靜默地顯示成功;而收件匣會丟棄訊息的接收者(速率限制或佇列已滿)會告知傳送者。243 自 v2.1.239 起,ListAgents 會告知工作階段自己的名稱(即對等方用來傳送訊息的名稱)並列出運作中的隊友,而對自己的名稱使用 SendMessage 時會明確說明,而不是回應「no agent named …」(找不到名為 … 的 agent)。202 截至 v2.1.247,對等方訊息預設以收合形式送達,顯示為一行 Message from @<sender>: <first line> 預覽;按 Ctrl+O 可展開完整內容。242
傳輸。 同一台機器上的訊息透過每個工作階段專屬的 Unix socket(在原生 Windows 上為具名管道)傳送,絕不經過 Anthropic 伺服器。容器中的工作階段與主機上的工作階段彼此無法連線,同一台電腦上的 WSL 2 工作階段與原生 Windows 工作階段也是如此,而同一容器內的兩個工作階段則可以。傳送到您其他機器或雲端工作階段的訊息,則經由 Anthropic 伺服器路由。SendMessage 可依名稱與其他機器上的 Remote Control 工作階段展開對話(v2.1.225+;ListAgents 會以 name [ref] 的形式顯示它們)。199 雲端工作階段同樣可以連線:在此工作階段連線至 Remote Control 期間,Claude 會找到它們,而訊息會直接送往該雲端工作階段。雲端工作階段無法以 SendMessage 回覆來自其他機器的訊息,因此請到 claude.ai/code 上它的逐字稿中閱讀其回應。430 isolatePeerMachines: true 要求任何內容離開這台機器之前都必須經您核准,即使在 bypassPermissions 下亦然,且任何設定範圍中的 true 都會勝出:已簽入的專案檔案可以收緊這道邊界,但絕不能放寬。430
指令碼化收件匣。 由於 socket 路徑已匯出,hook 或 Bash 指令都可以將訊息投遞回自身工作階段的收件匣;在沒有任何 crossSessionInbound 值適用時,Claude Code 會送達經其驗證確實來自該工作階段自身子程序的訊息。驗證方式因平台而異。Linux(以及 WSL 2)即使在投遞程序結束後,仍可依程序證據驗證;macOS 只能在其執行期間驗證。在缺少這類證據的情況下(macOS 上程序結束後、Claude Code 以程序 ID 1 執行的容器、原生 Windows),Claude Code 會驗證以 {"type":"auth","token":"<token>"} 這一行開啟連線的子程序,其中 token 是已匯出的 CLAUDE_CODE_MESSAGING_TOKEN。在原生 Windows 上,這一行是必要的:沒有這一行的連線會被關閉,且不會送達任何內容。兩種方式都無法驗證的訊息,會與其他未宣告權限類別的訊息一樣處理,因此略過權限提示的工作階段會將其保留,等待您核准。對於沙箱內的指令,沙箱的 Unix socket 設定(sandbox.network.allowUnixSockets 與 sandbox.network.allowAllUnixSockets)決定 Bash 指令能否連到該 socket。429
迴圈與限制。 重複的訊息會依傳送者進行速率限制,短時間內的相同重複訊息會被丟棄,而等待 Claude 讀取的已接受訊息最多 50 則,因此兩個工作階段之間的訊息迴圈會自行停止。僅限純文字;結構化的 agent team 協定訊息只留在團隊內部。430
可用性陷阱。 跨工作階段訊息傳遞可在原生 Windows 上運作(v2.1.239+),而截至 v2.1.248,也能在同一台機器上的 Bedrock、Vertex 與 Foundry 工作階段之間運作,且在停用遙測時同樣可用(CHANGELOG:「Added cross-session messaging (SendMessage / ListAgents) between sessions on the same machine on Bedrock, Vertex, and Foundry, and when telemetry is disabled」)。Claude 只有從連線至 Remote Control 的工作階段,才能找到您在其他機器上的工作階段與雲端工作階段,而 Remote Control 需要 claude.ai 登入,因此使用 API 金鑰時,或在 Bedrock、AWS 上的 Claude Platform、Google Cloud 的 Agent Platform 或 Microsoft Foundry 上,都無法找到它們。430256203 診斷方式:若 /list-agents 無法被識別,表示該工作階段不具備此功能;若指令可用但訊息始終送不到,則問題範圍較窄(拒絕規則或接收端的傳入控制)。傳送給雲端工作階段的訊息確實會送達;缺少的是回覆,因為雲端工作階段無法以 SendMessage 回覆。組織層級的總開關:在受管設定中拒絕 SendMessage 與 ListAgents,並加上 crossSessionInbound: "refuse"。拒絕 SendMessage 也會同時移除 subagents 與 agent team 的訊息功能,而設為拒絕的工作階段在其對等端看來與平常無異。430
這套信任設計呼應了 v2.1.222 的變更:該版本讓自動模式下的對外 SendMessage 內容經過權限分類器審查。跨會話流量的雙向都要通過一道檢查點,因為來自另一個會話的訊息是輸入,而非授權。198 v2.1.271 將同一原則套用到自動模式下的 subagents:subagent 透過一個由分類器審查的專用回報呼叫向呼叫端回報,而不是事後才審查它的最後一則訊息。213
Self-Hosted Runners(v2.1.224,Team/Enterprise)
claude self-hosted-runner 讓您自己的機器或容器成為Claude Code 網頁版、行動版與桌面版工作階段可以執行的地方。雲端介面不再綁定於 Anthropic 代管的環境:從 claude.ai 或手機啟動的工作階段,可以在您掌控的硬體上執行,使用您的網路存取、您的憑證,並處於您的合規邊界之內。對於程式碼儲存庫不能離開自家基礎設施的團隊而言,正是這一環讓網頁版與行動版介面真正可用。198
截至 v2.1.229,runner 工作階段會遵循伺服器提供的 Claude Code hooks(與受管環境的行為一致),而 Windows 上啟動時必須明確指定 --base-dir:Windows 沒有預設的 checkout 目錄。254 截至 v2.1.248,claude self-hosted-runner --client-label <label>(或 SELF_HOSTED_RUNNER_CLIENT_LABEL)可覆寫 runner 註冊時使用的標籤;預設為主機名稱。203 截至 v2.1.281,runner 會以私有檔案而非命令列文字的方式將系統提示傳給 Claude Code,因此大型提示不再導致啟動失敗;任何會附加 --system-prompt 或 --append-system-prompt 的包裝腳本或 command hook,都必須改用 --system-prompt-file 或 --append-system-prompt-file。221
自 v2.1.299 起,claude self-hosted-runner orchestrator --shutdown-drain-sec <seconds> 讓 SIGTERM 停止輪詢,並給進行中的輪詢與正在執行的 spawn hooks 最多該秒數的時間完成。268 自 v2.1.311 起,--hold-idle-file <path>(或 SELF_HOSTED_RUNNER_HOLD_IDLE_FILE)會在您的主機持續變更該檔案期間,將閒置工作階段保留在 runner 上;而 --max-hold-min <n> 則會在該分鐘數之後無論如何都釋放它(預設 1440;0 表示關閉保留)。281282 在 runner 工作階段內執行的 claude -p 擁有自己的工作階段 ID 與逐字稿(v2.1.317+);CLAUDE_CODE_DISABLE_NESTED_SESSION_ID=1 會讓它與該工作階段共用。在遇到 501 或 529 以外的 5xx 錯誤,或心跳未獲回應之後,runner 的下一次輪詢與工作階段的連線會重新建立,而不是沿用失敗的連線(v2.1.317)。281
文件將此功能稱為 self-hosted environments(Team 與 Enterprise 的公開測試版,預設關閉):包含總覽、快速入門、工作階段設定、生產環境部署、工作階段身分,以及 runner 參考文件。282
v2.1.323 至 v2.1.332 的 runner 變更。 新旗標:--repository-folder 指定 --capacity 1 時工作階段用於某個儲存庫的資料夾,orchestrator 上的 --hook-label 會將選定的工作階段標籤交給 spawn-runner hook,而 claude --environment 接受 --metadata key=value,可為該 hook 標記工作階段(v2.1.328);--start-dir(或 SELF_HOSTED_RUNNER_START_DIR)會讓 Claude 從儲存庫中的某個資料夾開始工作,而 spawn-runner hooks 現在可在先前的 hooks 仍在執行時啟動,每個 orchestrator 最多 --hook-concurrency 個,預設為 4 個(v2.1.330)。沒有 gh 的 Linux 與 macOS 工作階段,預設會透過 Anthropic 取得內建的 gh api(--use-anthropic-gh false 可將其關閉,v2.1.326);在設定依名稱把關 Claude 的 GitHub 工具的環境中,它預設關閉(v2.1.328)。工作階段資料夾或儲存庫路徑為符號連結的工作階段會被拒絕(v2.1.325),而在 --trust-workspace false 下,儲存庫的設定再也無法停用您的 hooks,也無法開啟或關閉 plugins(v2.1.323)。CLAUDE_CODE_OAUTH_TOKEN 的前綴除了以 oat01- 結尾之外,也可能以 oat02- 結尾:請更新比對 oat01- 的代理伺服器規則與日誌清理工具,並遮蔽整個值(v2.1.332)。兩個 /metrics 量測值會計算從工作單到註冊、以及到第一個工作階段的時間(v2.1.330)。527
進階模式
串接 subagents:
> First use the code-analyzer subagent to find performance issues, then use the optimizer subagent to fix them
平行探索:
> Have three explore agents search in parallel:
> 1. Authentication code
> 2. Database models
> 3. API routes
可恢復的 agents:
請 Claude 依 ID 或名稱恢復某個 agent;它會使用 SendMessage 工具,在保留上下文的情況下讓該 agent 繼續工作(這不需要啟用 agent teams):325
> Resume agent abc123 and continue the analysis
非同步 Subagents(2025年12月)
非同步 subagents 讓大規模專案得以多工處理與平行執行:
> Run security review in the background while I continue frontend work
> /tasks # Check status of running agents
Claude 會以 Read 工具讀取背景任務的輸出檔案(v2.1.277+,該版本移除了 TaskOutputTool);taskOutputMaxChars 設定與 TASK_MAX_OUTPUT_LENGTH 環境變數沒有作用。216
權限拒絕的韌性(v2.1.0+)
從 v2.1.0 開始,subagents 在遭到權限拒絕後會繼續工作,而不是完全停止。當 subagent 碰到權限牆時,會自動嘗試其他替代做法。這項變更讓自主工作流程更具韌性,也減少了人工介入的需要。39423
Agent Teams(實驗性)
Agent Teams 協調多個 Claude Code 實例共同工作。其中一個會話擔任團隊主導者(team lead),產生多個隊友(teammates),各自在自己的上下文視窗中獨立工作,並透過共用的信箱與任務清單直接彼此溝通。7782
與 subagents(在單一會話內執行,且只向呼叫端回報)不同,隊友是完整的獨立會話,能夠互相傳訊、質疑彼此的發現,並自行協調。
在 settings.json 中啟用:502
{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
}
}
或透過環境變數:export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
架構:
| 元件 | 角色 |
|---|---|
| 團隊主導者 | 建立團隊、產生隊友並協調工作的主會話 |
| 隊友 | 處理指派任務的獨立 Claude Code 實例 |
| 任務清單 | 隊友認領並完成的共用工作項目(以檔案鎖定) |
| 信箱 | 供 agent 之間溝通的訊息系統 |
顯示模式:
| 模式 | 方式 | 最適合 |
|---|---|---|
in-process(預設) |
所有隊友都在主終端機中。在 agent 面板中以上下方向鍵選取一位,然後按 Enter。 | 任何終端機 |
tmux / iTerm2 |
每位隊友各自位於獨立的分割窗格 | 視覺化監控 |
在設定中設定:"teammateMode": "in-process"、"auto"、"tmux" 或 "iterm2"。針對單一工作階段:claude --teammate-mode auto(這是 claude --help 未列出的實驗性旗標)。329
主要操作(in-process 模式):329
- 在 agent 面板中按上下方向鍵,然後按 Enter:選取隊友並檢視其工作階段;直接輸入即可傳送訊息給它
- 在選取的隊友上按 x:停止該隊友
- 檢視隊友時按 Shift+Tab:循環切換該隊友的權限模式
- Ctrl+T:切換共用任務清單的顯示
- Escape:清除選取;當您正在檢視隊友的逐字稿時,它會中斷該隊友目前的回合
何時使用 agent teams 而非 subagents:
| Subagents | Agent Teams | |
|---|---|---|
| 溝通方式 | 僅回報結果 | 隊友之間直接互相傳訊 |
| 協調方式 | 由主 agent 管理所有工作 | 共用任務清單並自行協調 |
| 最適合 | 只在乎結果的聚焦型任務 | 需要討論與協作的複雜工作 |
| Token 成本 | 較低 | 較高(每位隊友 = 獨立的上下文視窗) |
最佳使用情境: - 研究與審查(同時取得多種觀點) - 新模組/功能(每位隊友各自負責不同部分) - 以競爭假說進行除錯(平行驗證不同理論) - 跨層協調(前端、後端、測試分別由不同隊友負責)
隊友的計畫核准: 對於複雜或高風險的任務,可讓隊友先規劃再實作。在主導者處於規劃模式時產生的隊友,也會在規劃模式下工作,直到其計畫就緒為止,因此請先將主導者切換到規劃模式,再要求產生隊友:329
Spawn an architect teammate to refactor the authentication module.
隊友完成規劃後,會送出計畫核准請求。除非您變更了該隊友的權限模式,否則 Claude Code 會在請求送達時立即核准;若要讓主導者審閱計畫,請開啟該隊友的工作階段,並按 Shift+Tab 將其切換到規劃模式。主導者審閱計畫時,會自行核准或退回,不會詢問您。可以用準則引導它,例如「只核准包含測試覆蓋率的計畫」或「拒絕修改資料庫結構描述的計畫」。329
範例提示:
Create an agent team to review PR #142. Spawn three reviewers:
- One focused on security implications
- One checking performance impact
- One validating test coverage
Spawn a team with 4 teammates to refactor these modules in parallel.
Use Sonnet for each teammate.
儲存位置:團隊設定位於 ~/.claude/teams/{team-name}/config.json(members 陣列包含名稱、agent ID、agent 類型)。任務清單位於 ~/.claude/tasks/{team-name}/。任務支援相依性:受阻的任務會在其相依項目完成時自動解除封鎖。82
Hook 整合:使用 TeammateIdle(結束代碼 2 可傳送回饋並讓隊友繼續工作)與 TaskCompleted(結束代碼 2 可阻止任務完成)這兩個 hooks,對隊友強制執行品質關卡。
限制(實驗性功能):
- 行程內隊友不支援工作階段恢復(/resume 無法還原它們)
- 每個工作階段僅限一個團隊;不支援巢狀團隊
- 隊友無法建立自己的團隊
- 分割窗格需要 tmux 或 iTerm2;預設的 in-process 模式可在任何終端機中運作
- 產生時無法為個別隊友指定權限模式:新隊友會以主導者的模式啟動,但當主導者處於 dontAsk 模式時,隊友會以 Manual 模式啟動553
- 消耗大量 token:每位隊友都是獨立的 Claude 執行個體
Claude Tag(2026年6月):原生於 Slack 的姊妹產品
Claude Tag 是獨立的 Anthropic 產品,而非 Claude Code 的功能,但兩者共享足夠多的受管代理程式基因,若您在團隊中使用 Claude Code,值得一併了解。Claude Code 是您親自操作的終端機 CLI,而 Claude Tag 則存在於 Slack 之中:隊友在頻道裡標記 @Claude 即可交付任務,代理程式會將任務拆解為多個階段、自行逐一完成,再將結果回報到該頻道。174
其設計以多人協作為核心,而非以個人為單位。公司在 Slack 中共用同一個 Claude 身分,因此任何成員都能接手他人開始的任務,或交接尚未完成的工作,無需各自維護私人對話。管理員可限定 Claude 能存取哪些工具、資料來源與記憶,以及可在哪些頻道中使用,並提供頻道層級與組織層級的 token 支出上限,以及活動記錄。174
其文件稱它為公開測試版,開放給 Team 與 Enterprise 方案,不開放給個人方案(Free、Pro、Max 或 Ultra)或第三方部署。552
與 Claude Code 的關係:同一模型家族與相同的代理式定位,但介面與控制模式不同。Claude Code 是開發者本機的 CLI,具備 hooks、MCP、skills 與 subagents;Claude Tag 則是受管、非同步、共用的代理程式,專為 Slack 內的團隊工作而生。想要對程式編寫工作階段進行細緻的本機控制時,選擇 Claude Code;想要在團隊既有工作流程中擁有可委派任務的隊友時,選擇 Claude Tag。
Agent Skills(2025年12月)
Agent Skills 是由指示、腳本與資源組成的結構化資料夾,代理程式可動態探索並載入。23 它們提供可組合、可攜帶的領域專業知識:
.claude/skills/
├── security-review/
│ ├── SKILL.md # Instructions and prompts
│ ├── checklist.md # Security checklist
│ └── common-vulns.sh # Detection scripts
└── performance-audit/
├── SKILL.md
└── profiling-guide.md
每個 skill 都需要一個 SKILL.md 檔案。自訂指令已併入 skills:.claude/commands/deploy.md 與 .claude/skills/deploy/SKILL.md 都會建立 /deploy,運作方式相同。兩者都可以依名稱呼叫,Claude 也能在任務合適時載入任一者;skill 額外提供一個存放輔助檔案的目錄,以及控制誰可以呼叫它的 frontmatter。330 Claude Agent SDK(原名 Claude Code SDK)提供了建構具備 skill 支援之自訂代理程式的框架。24
參考資料
-
Claude Code Subagents。Subagents 文件。2025年12月。 ↩
-
Anthropic 工程部落格。Agent Skills:可重複使用的任務專屬模組。2025年12月。 ↩
-
使用 Claude Agent SDK 打造 agents,Claude,擷取於2026年11月11日:「我們將 Claude Code SDK 更名為 Claude Agent SDK」。 ↩
-
Claude Code CHANGELOG,2.1.0 章節,擷取於2026年11月11日:「Added support for running skills and slash commands in a forked sub-agent context using
context: forkin skill frontmatter」;「Improved subagents (Task tool) to continue working after permission denial, allowing them to try alternative approaches」。VentureBeat 報導了此版本:Claude Code 2.1.0 arrives with smoother workflows and smarter agents,Carl Franzen,2026年1月8日,於 Internet Archive 2026年1月10日的存檔中讀取:「讓 subagents 可以嘗試其他做法,而不是完全停止」。 ↩ -
Anthropic。「Introducing Claude Opus 4.6」。2026年2月5日。1M token 上下文(beta)、128K 最大輸出、自適應思考、effort 控制、agent teams、Terminal-Bench 2.0 最高分、GDPval-AA 較 GPT-5.2 高出 144 Elo、發現 500 多個零時差漏洞。每百萬 token $5/$25。另請參閱 TechCrunch、CNBC、Anthropic Pricing。 ↩
-
協調多個 Claude Code 工作階段組成的團隊,Claude Code 文件,擷取於2026年11月11日。架構表列出任務清單(「隊友認領並完成的共用工作項目清單」)與信箱(「供 agents 之間通訊的訊息系統」);團隊設定位於
~/.claude/teams/{team-name}/config.json,任務清單位於~/.claude/tasks/{team-name}/;關於相依性:「它會解除相依任務的封鎖,您不需要做任何動作」。Agent teams 於2026年2月5日隨 Opus 4.6 一同發表(TechCrunch)。 ↩↩ -
Claude Code Docs。Hooks 參考:以提示為基礎的 hooks、以 agent 為基礎的 hooks、hook 環境變數($CLAUDE_PROJECT_DIR、$CLAUDE_ENV_FILE)、PreToolUse 的 hookSpecificOutput 格式。2026年2月。Claude Code Docs。建立自訂 subagents:
--agentsCLI 旗標、disallowedTools、maxTurns、mcpServers、delegate 權限模式。2026年2月。2026年2月12日存檔的 sub-agents 頁面列出的permissionMode值為default、acceptEdits、delegate、dontAsk、bypassPermissions或plan。2026年11月10日擷取的頁面已沒有delegate值:「default、acceptEdits、auto、dontAsk、bypassPermissions、plan,或作為default別名的manual」。 ↩ -
Claude Code v2.1.51 版本說明,GitHub,2026年2月24日,擷取於2026年11月11日:「Env var interpolation now requires an explicit
allowedEnvVarslist in the hook configuration.」;「HTTP hooks are now routed through the sandbox network proxy when sandboxing is enabled, enforcing the domain allowlist. HTTP hooks are not supported for SessionStart/Setup events.」Claude Code CHANGELOG,2.1.51 章節,同次擷取:「Addedclaude remote-controlsubcommand for external builds, enabling local environment serving for all users.」;「Added support for custom npm registries and specific version pinning when installing plugins from npm sources」;「Updated plugin marketplace default git timeout from 30s to 120s and addedCLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MSto configure.」;「Tool results larger than 50K characters are now persisted to disk (previously 100K).」;「BashTool now skips login shell (-lflag) by default when a shell snapshot is available, improving command execution performance.」;「Fixed a security issue wherestatusLineandfileSuggestionhook commands could execute without workspace trust acceptance in interactive mode.」;「The/modelpicker now shows human-readable labels」。協調多個 Claude Code 工作階段組成的團隊,Claude Code 文件,同次擷取,涵蓋隊友的計畫核准,以及「使用 hooks 強制執行品質關卡」一節中的TeammateIdle與TaskCompletedhooks。 ↩ -
Claude Code Docs。「在 2.1.63 版中,Task 工具已更名為 Agent。設定與 agent 定義中既有的
Task(...)參照仍可作為別名使用。」2026年2月28日。 ↩ -
GitHub Releases。v2.1.69:/claude-api skill、InstructionsLoaded hook 事件、hook 事件中的 agent_id/agent_type/worktree、${CLAUDE_SKILL_DIR}、/reload-plugins、sandbox.enableWeakerNetworkIsolation、includeGitInstructions 設定、remote-control 自訂名稱、Voice STT 新增 10 種語言(共 20 種)、effort 層級顯示、Ctrl+U 退出 bash、數字鍵盤支援、Sonnet 4.5→4.6 自動遷移。70 多項錯誤修正。2026年3月5日。 ↩
-
Claude Code v2.1.133 版本說明。2026年5月7日。新增
worktree.baseRef設定(fresh|head);依版本說明所述:「the defaultfreshchangesEnterWorktree’s base back toorigin/<default>(it has been localHEADsince 2.1.128)」,以及「setworktree.baseRef: "head"to keep unpushed commits in new worktrees.」Hooks 現在可透過effort.levelJSON 輸入欄位與$CLAUDE_EFFORT環境變數取得目前的 effort 等級;Bash 工具的指令也能讀取$CLAUDE_EFFORT。新增sandbox.bwrapPath與sandbox.socatPath受管設定(Linux/WSL),可自訂 bubblewrap 與 socat 二進位檔的位置。新增parentSettingsBehavior管理層級鍵('first-wins' | 'merge'),可將 SDKmanagedSettings(父層級)納入政策合併。修正 subagents 無法透過Skill工具找到專案、使用者或 plugin skills 的問題。其他修正:平行工作階段中重新整理權杖後出現 401 的競態條件、磁碟根目錄允許規則的範圍、MCP OAuth 代理與 mTLS 支援、Remote Control 的停止/中斷可完整執行取消、跨工作階段的/effort外洩,以及--help中列出--remote-control。 ↩ -
Claude Code v2.1.137 至 v2.1.139 版本說明。v2.1.137(2026年5月9日):「[VSCode] 修正擴充功能在 Windows 上無法啟用的問題。」v2.1.138(2026年5月9日):「內部修正。」v2.1.139(2026年5月11日):Agent View(
claude agents)、/goal、command hook 的args: string[]、PostToolUse的continueOnBlock、供 MCP stdio 伺服器使用的CLAUDE_PROJECT_DIR、plugin 指令中的${CLAUDE_PROJECT_DIR}插值、--print模式下 OpenTelemetry 活動時間的修正,以及相關的可靠性修正。另請參閱:Agent View 文件 與 Goal 文件。 ↩ -
Claude Code v2.1.172 版本說明、Claude Code v2.1.173 版本說明 與 Claude Code Changelog(正式版)。2026年6月10日至11日。v2.1.172(6月10日):子代理可以再衍生自己的子代理,最深可達 5 層(遞迴委派);未設定
AWS_REGION時,AWS Bedrock 區域會從~/.aws讀取,且/status會顯示解析出的來源;/plugin新增 marketplace 搜尋列;claude_code.lines_of_code.countOTEL 指標新增model屬性。修正項目:1M 脈絡在無額度時工作階段卡住、圖片處理錯誤、背景子代理卡住的狀態、模型選擇器與限制,以及團隊記憶的回想。v2.1.173(6月11日,UTC):帶有[1m]後綴的 Fable 5 模型名稱會自動正規化並移除後綴(Fable 5 預設已包含 1M 脈絡,因此這個只對 Opus/Sonnet 有意義的後綴是多餘的);另有一項 Windows 修正,解決啟動時誤報「sandbox dependencies missing」警告的問題。 ↩ -
Claude Code v2.1.178 版本說明 與 v2.1.179 版本說明,以及 Claude Code Changelog(正式版)。2026年6月15日至16日。v2.1.178:
Tool(param:value)權限規則語法可比對工具輸入參數,並支援*萬用字元(例如Agent(model:opus));處理巢狀.claude/skills所在目錄的檔案時會載入其中的 skills,名稱衝突時以<dir>:<name>區分;巢狀.claude/的 agents、workflows 與 output-styles 在衝突時以最接近目前工作目錄者為準(專案範圍的 workflow 儲存會指向最接近的既有.claude/workflows/);auto 模式會在啟動前先以分類器評估 subagent 的衍生;壓縮現在會在過載或可用性錯誤時遵循--fallback-model鏈;subagentdisallowedTools中的 MCP 伺服器層級規格(mcp__server、mcp__server__*、mcp__*)不再被靜默忽略;/doctor改為扁平樹狀版面;/bug必須填寫描述;workflow 提示關鍵字僅在明確的語句下觸發;另有多項 subagent 逐字稿、Remote Control、驗證/憑證與claude agents的修正。v2.1.179:串流中途連線中斷時會保留部分回應;修正 WSL2 滑鼠滾輪捲動(v2.1.172 的回歸問題)、Linux 上沙箱denyRead/allowReadglob 涵蓋大型目錄樹時使 Bash 工具描述變得極大、意見回饋問卷的單位數擷取、歡迎畫面的促銷訊息堆疊、Ctrl+O 檢視 subagent 逐字稿,以及遠端背景任務與 plugin 載入的可靠性。v2.1.177:僅為 CHANGELOG.md/feed.xml 的例行變更。擷取於2026年6月17日。 ↩ -
Claude Code v2.1.185 版本說明 與 v2.1.186 版本說明,以及 Claude Code Changelog(正式版)。2026年6月20日至22日。v2.1.186:
claude mcp login <name>與claude mcp logout <name>可從 CLI 直接登入或登出 MCP 伺服器,無需開啟/mcp,並支援--no-browser透過 stdin 重新導向在 SSH 上完成驗證;!bash 指令現在會觸發 Claude 自動回應其輸出(設定"respondToBashCommands": false可保留先前僅加入脈絡的行為);Agent(type)拒絕規則與Agent(x,y)允許類型限制現在對具名 subagent 的產生也會強制執行;背景 subagent 的權限提示會顯示在主工作階段中(標明是哪個代理程式在詢問;按 Esc 僅拒絕該工具),而非自動拒絕,且主回合結束後背景代理程式執行期間 Esc/Ctrl+C 仍可正常回應;/review <pr>與/code-review medium使用相同的審查引擎;/workflows代理程式詳細檢視新增狀態篩選(按f);/plugin的 Installed 頁面新增 Skills 區塊;新增teammateMode: "iterm2"(當 auto 模式找不到it2CLI 時會顯示警告);設定了awsAuthRefresh時,/login新增「Claude Platform on AWS - refresh credentials」選項;skill frontmatter 的display-name/default-enabled/fallback/metadata.*接受 kebab-case、snake_case 與 camelCase,且格式錯誤的SKILL.mdYAML 會以空白中繼資料載入本文,而非默默失敗;claude mcp get/claude mcp remove在打錯字時會建議最接近的已設定伺服器名稱;當MEMORY.md索引接近大小上限時會提醒代理程式進行壓縮;CLAUDE_CODE_MAX_RETRIES上限為 15(無人值守的工作階段請改用CLAUDE_CODE_RETRY_WATCHDOG)。修正項目:睡眠喚醒後串流出現「Content block not found」/JSON 解析錯誤;subagent 逐字稿捲動在退出時滲入主逐字稿;背景任務預覽閃現原始工具名稱;權限閘門關閉時的 Chrome 分頁群組隔離;重複的背景摘要;
Agent(type)拒絕規則與Agent(x,y)允許類型未對具名產生強制執行;~~strikethrough~~渲染為字面上的波浪號;Workflowagent({schema})subagent 在 schema 驗證反覆失敗時無限迴圈(現在 5 次後中止)。v2.1.185:串流停滯提示現在顯示為「Waiting for API response · will retry in …」(原為「No response from API · Retrying in …」),且在靜默 20 秒後觸發,而非 10 秒。v2.1.184 未發布。擷取於2026年6月23日。 ↩ -
Anthropic,「Introducing Claude Tag」,anthropic.com,2026年6月23日:Introducing Claude Tag。Claude Tag 是專為 Claude Enterprise 與 Team 客戶打造的 Slack 原生代理程式:成員在頻道中標記 @Claude 即可委派任務,代理程式會將任務拆解為多個階段並以非同步方式完成,再將結果回傳至頻道;共用的單一 Claude 身分讓團隊成員得以交接進行中的工作;管理員可針對每個頻道設定工具、資料來源與記憶體的存取範圍,並搭配 token 支出上限與活動記錄;它以 Opus 4.8 運行。Anthropic 表示其產品團隊約有 65% 的程式碼變更是透過內部版本完成。同期報導可資佐證:Fortune 與 TechCrunch,2026年6月23日。擷取於2026年6月24日。 ↩↩
-
Claude Code Changelog(正式版),2026年6月29日至7月2日。v2.1.196(6月29日): 組織預設模型;可讀性更佳的預設工作階段名稱;可點擊的檔案附件;
claude mcp list/get不再啟動由儲存庫自行核准的.mcp.json伺服器(不受信任的工作區會顯示待核准狀態);串流閒置看門狗預設開啟,可透過CLAUDE_ENABLE_STREAM_WATCHDOG=0停用;/code-review的搜尋器已合併(token 用量減少約25%);非 Anthropic 的ANTHROPIC_BASE_URL停用 Remote Control;背景工作階段的可靠性改進。v2.1.197(6月30日): Claude Sonnet 5 成為 Claude Code 的預設模型,原生支援100萬token上下文視窗,並於8月31日前享有每百萬token $2/$10 的推廣定價(公告)。v2.1.198(7月1日): subagents 預設在背景執行;Claude in Chrome 正式推出;背景代理在完成 worktree 程式碼工作後會提交、推送並開啟草稿 PR;Notificationhook 事件agent_needs_input/agent_completed;/datavizskill;Claude Platform on AWS 可作為閘道上游;Explore 代理繼承工作階段的模型(上限為 Opus);subagents 與壓縮作業繼承延伸思考設定;移除/agents精靈。v2.1.199(7月2日): 堆疊的斜線 skill 呼叫會載入所有前置 skills(最多5個);訂閱用戶遇到暫時性伺服器 429 時會自動重試;CLAUDE_CODE_RETRY_WATCHDOG將非容量因素的重試預設值提高至300,並解除CLAUDE_CODE_MAX_RETRIES的15次上限;大量針對背景代理、subagent 錯誤回報與 hook stderr 的修正。擷取於2026年7月3日。 ↩ -
Claude Code Changelog(正式版) 與 GitHub 版本發布,2026年7月3日至6日。v2.1.200(7月3日):
default權限模式在 CLI、--help、VS Code 與 JetBrains 中統一改標示為「Manual」,並接受--permission-mode manual與"defaultMode": "manual",原有的default設定值維持不變;AskUserQuestion對話框預設不再自動繼續(可透過/config選擇啟用閒置逾時);另修正了disabledMcpServers/enabledMcpServers非陣列時的啟動當機、背景工作階段在睡眠/喚醒後停止、過期daemon.lock的處理、subagents 在產生任何輸出前即遭速率限制中斷時現在能正常返回,以及 tmux 3.4+ 同步輸出的閃爍問題。v2.1.201(7月3日): Claude Sonnet 5 工作階段不再使用對話中途的 system 角色傳遞 harness 提醒。v2.1.202(7月6日): 新增「Dynamic workflow size」/config設定(small/medium/large 代理數量僅為建議值,並非強制上限);由工作流程產生的代理帶有workflow.run_id與workflow.nameOpenTelemetry 屬性;/review <pr>回復為快速的單次審查(若要以指定投入程度執行多代理審查,請改用/code-review <level> <pr#>);重複呼叫已載入的 skill 不再將其指示重複附加至上下文;當伺服器設定有url但缺少type時,MCP 會顯示更清楚的錯誤並建議使用"type": "http";此外還有 Remote Control、多 worktree 儲存庫中依名稱恢復工作階段的效能,以及安裝程式/更新程式下載中途重試的修正。GitHub 版本發布時間:v2.1.200 與 v2.1.201 發布於 2026-07-03,v2.1.202 發布於 2026-07-06。擷取於2026年7月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日。 ↩↩ -
Claude Code CHANGELOG,v2.1.217 條目。2026年7月。v2.1.217: subagent 預設不再產生巢狀 subagent,可設定
CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH以允許更深的巢狀(推翻 v2.1.172 的遞迴產生預設值);新增同時執行中 subagent 的上限,預設為 20,可透過CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS覆寫;--max-budget-usd現在也會停止背景 subagent,一旦達到上限,新的產生請求會被拒絕,執行中的背景代理程式也會被中止;提示輸入支援 emoji 短碼自動完成(:heart:→ ❤️),可透過emojiCompletionEnabled設定停用。另有可靠性與隔離修正:符號連結的工作目錄會被正規化以確保背景工作階段隔離、受管理的OTEL_EXPORTER_OTLP_ENDPOINT統一管控所有訊號、轉錄寫入失敗的警告、MCP 截斷輸出的記憶體洩漏、Windows 自動更新的claude.exe還原、Bedrock Opus 4.8 自動壓縮、Claude Desktop 的企業 mTLS/TLS/OAuth/proxy 設定、--resume遇到格式錯誤附件的 TypeError、無法停止的背景 shell、大括號展開造成的 OOM、Remote Control 後加入者的提示、螢幕閱讀器修正、ssh/tmux 中可點擊的頁尾 PR 徽章(FORCE_HYPERLINK=0可停用)、登入到期警告從 5 天提前至 3 天,以及 frontend-design plugin 提示的顯示次數終身上限為 3 次。擷取於2026年7月22日。 ↩↩↩ -
Claude Code CHANGELOG,v2.1.219 與 v2.1.220 條目。2026年7月。v2.1.219(7月24日): 新增 Claude Opus 5(
claude-opus-5)作為新的預設 Opus 模型,具 1M 脈絡視窗,fast 模式定價為每 MTok $10/$50;新增sandbox.network.strictAllowlist設定,讓沙箱指令在不提示的情況下直接拒絕未列入允許清單的主機;新增DirectoryAddedhook,在/add-dir或 SDK 的register_repo_root控制請求於工作階段中途登錄新工作目錄後觸發;在 headless stream-json 的 init 事件中新增mcp_server_errors,列出因設定驗證而略過的--mcp-config項目(終端機執行時會印出啟動警告);新增workflowSizeGuideline設定鍵,讓建議性的 Dynamic workflow size 準則可由任一設定檔設定,設定後/config中對應的列會隱藏;stream-json 新增巢狀子代理程式轉送,設定--forward-subagent-text時,深度 2 以上產生的子代理程式也會出現,並以產生它們的 Agenttool_useid 作為鍵;動態工作流程改為預設採用中型規模準則(目標少於 15 個代理程式);將 Opus 4.7 自 fast 模式移除,/fast現在適用於 Opus 5 與 Opus 4.8;子代理程式現在預設可產生最深達第 3 層的巢狀子代理程式(原為 1);設定CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=1可停用巢狀;更新claude-apiskill,預設改為 Claude Opus 5,並提供自 Opus 4.8 的遷移路徑;伺服器連線失敗時,claude mcp list與/mcp會顯示 HTTP 狀態與錯誤文字,並對含隱藏前導或尾端空白字元的 MCP 設定值提出警告;受管理的 MCP 允許清單/拒絕清單中的
${VAR}項目改由啟動環境與受管理設定的 env 解析,不再使用設定檔的 env;在執行中工作流程的狀態列加入目前的預設工作流程規模;修正下列問題:claude -p文字輸出在回合因串流中途的 API 錯誤而中止時遺失已產生的回答、Fable 列顯示過時的「Requires usage credits」標籤、/model選擇器將合併後的 Opus 列顯示為單純的「Opus」而非「Opus (1M context)」、新版本醒目標示範圍超出最新模型名稱、GNU screen 選取即複製時印出 base64、Remote Control 用戶端在模型切換/重新連線/組織檢查失敗後仍保留過時的 fast 模式狀態、Windows 上的CLAUDE_CODE_GIT_BASH_PATH在路徑並非 bash/sh 二進位檔時直接結束或被當作 bash 使用(現在會忽略並顯示警告)、Vim 模式在空白提示下按 ← 無法從 NORMAL 模式返回 agent 檢視,以及螢幕閱讀器模式在每次按鍵時重寫整行輸入;改善「Remote Control is only available via api.anthropic.com」錯誤訊息,使其指出造成此情況的設定,並讓claude --teleport在不符時顯示目前 checkout 指向的儲存庫。v2.1.220(7月25日): 僅有錯誤修正與可靠性改善,沒有面向使用者的功能、設定、指令或定價變更。擷取於2026年7月25日。 ↩↩↩ -
Claude Code v2.1.221 版本說明 與 Claude Code v2.1.222 版本說明,2026年8月4日。v2.1.221:VSCode Focus 檢視(
Ctrl+Alt+F);Linux/WSL 上沙箱憑證檔案的mode: "mask",含哨兵副本與出站替換,macOS 則回退為deny;背景工作階段可 commit/push、僅在必要時建立草稿 PR、遵循 CLAUDE.md 的 git 指示,並在執行結束時回報位置;/fork工作階段擁有專屬 worktree;/plugin install可重新整理目錄並重試;安全時立即啟用 plugin;"."可作為 plugin 的skills路徑;修正 zsh[[ ]]正規表示式條件式的權限繞過;修正 PowerShell 引號路徑的權限問題;prompt-audit子命令;Stats 快取 token 細目;auto 模式提示快取重用。v2.1.222:Remote Control 自動啟動限制為使用者範圍;worktree 隔離的 git 修正延伸至所有工作階段類型的檔案編輯與 Bash;修正背景任務的 PreToolUse 自動允許繞過;SendMessage權限分類;移除 ultraplan。擷取於2026年8月5日。 ↩ -
Claude Code v2.1.224 版本說明,2026年8月7日。新增
claude self-hosted-runner(Team/Enterprise);macOS/Linux 上支援跨工作階段SendMessage,並可透過ListAgents探索,另有crossSessionInbound/dialogExpiry設定;archiveplugin 來源,可選擇以 SHA-256 鎖定;沙箱憑證遮罩選項extract/onExtractNoMatch、decode: "jwt"搭配maskClaims,以及awsPairs/sigv4(需要network.tlsTerminate;僅限 user/managed/--settings範圍);移除每個工作階段 200 個 subagent 的產生上限;修正長路徑的工作階段目錄跨越、結尾斜線的沙箱拒絕繞過,以及沙箱違規詳細資訊不可見的問題。擷取於2026年8月7日。 ↩↩↩ -
Claude Code v2.1.225 版本說明 與 Claude Code v2.1.226 版本說明,2026年8月7日(PST;UTC 發布時間分別為 2026-08-08T01:09:26Z 與 2026-08-08T02:48:05Z)。v2.1.225:可依名稱跨機器
SendMessage至 Remote Control 工作階段,並以name [ref]格式列出;用量警告中顯示 gateway 支出上限詳情;claude agents工作區信任提示;修正 OAuth token、keychain、auto 模式連續封鎖、跨工作階段暫存、self-hosted-runner 啟動與 Focus 檢視等問題。v2.1.226:僅含錯誤修正與可靠性改進。擷取於2026年8月7日。 ↩ -
Claude Code 版本說明 v2.1.239(8月21日)、v2.1.240 與 v2.1.241(8月22日與23日,兩者原文均為「錯誤修正與可靠性改進」),以及2026年8月24日的正式 CHANGELOG.md(最新標題:2.1.241;npm latest 為 2.1.241)。v2.1.239 原文:「成本估算(
/cost、狀態列、--max-budget-usd)現在納入資料駐留工作區的 1.1 倍美國限定推論加價」;「新增/claude-api upgrade,可將 Python 專案從anthropic0.x 遷移至 1.x」;「Windows:跨工作階段訊息現已可用」;plugin「現在顯示為name@synced… 且絕不會覆蓋您已安裝的同名 plugin」;「ListAgents現在會告知工作階段其自身名稱」;readline 字詞按鍵「Alt+F 與 Ctrl/Option+→ 停在字詞結尾,Alt+D 刪除至該處(Ctrl+Y 可貼回)」。/design與 Remote Control 的狀態出自第 34 週摘要:「/designskill 將 Claude Design 的畫板工作流程帶入 CLI 與 Claude Code Desktop,建構於 artifacts 之上 … 適用於 Pro、Max、Team 與 Enterprise。需要 v2.1.233 或更新版本」;「Remote Control 也已結束研究預覽階段。」兩者均於2026年8月24日直接擷取。 ↩ -
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(orCLAUDE_CODE_RESTRICTED=1): removes the built-in tools that run commands or code andWebFetch(unless named in--tools), keeps file tools inside the working directory, refusesbypassPermissions, and ignores user, project and local settings files」;「Addedexperimental.cacheTtl("5m"or"1h") to agent frontmatter: a per-agent prompt cache TTL used when no subagent TTL setting is configured」;「Addedclaude self-hosted-runner --client-label <label>(orSELF_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/doctorand/statusline explaining a load failure or why they weren’t fetched (Bedrock/Vertex/third-party provider, customANTHROPIC_BASE_URL)」;「Added/usage-creditsfor 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 newdesktopSessionCleanupPeriodDayssetting 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 bundledworkflow-authoringskill」;以及上傳修正:「Fixed/ultrareviewand locally seeded cloud sessions uploading uncommitted edits toprod.env-style and*.tfvarsfiles, 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
PreModelSwitchandPostModelSwitchhook events (block, confirm, or annotate a model switch);SessionStartresume 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/usageand arate_limits.spend_limitstatus 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 matchingprompt_cacheobject for status line scripts」;「Addedattach,logs,stop,respawn, andrmtoclaude --help; the--resumemessage for a running background session now names the exactclaude 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」;「ChangedCLAUDE_CODE_SUBAGENT_MODELto set the default subagent model rather than override everything: an agent definition’smodel: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/effortto 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_HEADERSfrom 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.jsonenvto no longer setCLAUDE_CONFIG_DIR,CLAUDE_CODE_TMPDIR, orTMPDIR/TMP/TEMP; set them in your shell, user, or managed settings instead」;「Fixed/usage-creditsfor 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 applyingRead(...)deny rules to files reached through a symlinked search path」。 ↩↩↩↩↩ -
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會整體從設定它們的最高層來源讀取);BashRead()/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 的 frontmattermodel:在互動式工作階段中會被採用,而自動模式會保留工作階段模型,不會在不支援的 frontmatter 模型上執行回合;claude plugin validate --json;以及 BashRead()拒絕涵蓋範圍延伸至選項值/運算元(--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 是這些項目的來源。 ↩ -
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/fasttyped in the session applies where your organization allows it”,v2.1.271)以及/fast off的修正;maxEffortLevel設定(”top-level or per model undermodelSettings: 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,並附「setCLAUDE_CODE_ENABLE_TODO_TOOLS=1elsewhere」,v2.1.268);符號連結目錄與env -C/eval拒絕規則的修正(v2.1.268);WebFetch 與 Artifact 規則的拆分(”Changed plainWebFetchdeny and ask rules to no longer apply to Artifact tool reads and updates; use anArtifactrule (orWebFetch(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的警告,以及 gatewaypricing:費率同步(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_URLHTTP 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);omitClaudeMdagent frontmatter 與--agentsJSON(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」。 ↩↩ -
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列的值、閘道直通,以及該變數的暫時性狀態)。 ↩ -
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_SERVERto also apply on a direct Anthropic API connection:0opts out of the server-side auto mode classifier (the local classifier then counts toward usage),1opts in」;「Changed the dangerousrmprompt in--dangerously-skip-permissionsand auto mode to wait 2 minutes for an answer, then deny the command with a rewrite hint」;「Added"attribution": falseinsettings.jsonto hide all commit and PR attribution」。移除/agents精靈一事出自同一份 CHANGELOG 的 2.1.198 章節:「Removed the/agentswizard; 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這個值。 ↩↩↩ -
Claude Code v2.1.287 版本說明(npm 於 2026年10月1日 16:59 UTC 發布;GitHub 版本 18:00 UTC;共 106 個項目,與正式 CHANGELOG 的 2.1.287 章節完全一致,於 2026年10月1日擷取)。本指南中所有 v2.1.287 項目的來源。10月1日的 npm dist-tags:latest 與 next 為 2.1.287,stable 為 2.1.285。重點引述:「Changed Opus 4.7+ and Fable to use a 1M context window by default on Bedrock, Vertex, Foundry and the Claude apps gateway, with no
[1m]suffix (CLAUDE_CODE_DISABLE_1M_CONTEXT=1keeps 200K)」;「Added Claude Mods: plugins may now modify deeper behavior」;「Added You should know, a built-in mod where a side agent watches your back and flags things you or Claude might miss」;「Added URL prompts from MCP servers on the 2025-11-25 protocol」;「Changed MCP serveralwaysLoad: falseto defer all of that server’s tools behind tool search」;「setCLAUDE_AX_PREPARK_MS=50to restore the pause」;「Changed automatic model switches after a flagged message to keep your current effort level instead of the new model’s default」;「Changed whole-toolBashallow rules and allowing hooks to prompt for, not run, shell writes to files Claude Code’s file tools refuse outright」;「Addedprompt_textto the OpenTelemetryuser_promptevent」。 ↩ -
Claude Code 文件,於 2026年10月1日擷取。權限模式:對於
claude -p或 Agent SDK,「defaultin sessions that fetch feature flags. In sessions that don’t, such as on a third-party provider or with telemetry off,autowith Claude Code v2.1.285 or later」。Mods 概覽:「Mods 預設為開啟。在終端機中,請使用 Claude Code v2.1.287 或更新版本」;「Mods aren’t sandboxed」;自 v2.1.287 起CLAUDE_CODE_ENABLE_FUNCTION_HOOKS會被忽略;cc-plugin-you-should-know為「Disabled by default」。模型設定:發生回退後,Claude Code「會保留被標記的請求執行時所用的 effort 等級」;「Opus 4.6 and Sonnet 4.6 reach 1M only through their[1m]variant」;閘道 1M 段落與/autocompact 200k。Amazon Bedrock 與 Agent Platform:「To enable it for a manually pinned model instead, append[1m]to the model ID.」環境變數:CLAUDE_AX_PREPARK_MS「Default0… Before v2.1.287, the default was50」;CLAUDE_CODE_DISABLE_WEB_FETCH「The WebSearch tool stays available. Requires Claude Code v2.1.285 or later」。Headless:「Before v2.1.286, these limits held only partly」。Agent 檢視:n:<text>篩選器與「A reply that is exactly/stopstops the session at once.」設定參考:allowClaudeInChromeWithManagedMcp(「Requires Claude Code v2.1.282 or later」)與allowedProviders項目。MCP 頁面並未列出bareElicitationCapability。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。 ↩ -
Claude Code 正式 CHANGELOG 的 2.1.288 章節,於 2026年10月6日擷取,以及同日讀取的
@anthropic-ai/claude-codenpm 登錄檔中繼資料:2.1.288 於 2026年10月2日 18:30 UTC 發布,2.1.289 於 10月3日 20:12 UTC,2.1.290 於 10月5日 18:12 UTC,2.1.291 於 10月6日 03:32 UTC,2.1.292 於 10月6日 17:10 UTC;dist-tags 的 latest 與 next 為 2.1.292,stable 為 2.1.285。CHANGELOG 從 2.1.287 到 2.1.292 連續無缺漏。本指南中所有 v2.1.288 項目的來源。重點引述:「Changedclaude project purgetoclaude purge; the old name still works and prints a notice」;「Changed the background command time limit to apply only in unattended sessions (-p, Agent SDK, CI, cloud); terminal, desktop app and VS Code sessions have no limit」;「Added--max-findings <n>|allto /code-review」;「addedCLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTSto turn structured outputs off」;「Changed the client-side auto mode classifier to ignore anANTHROPIC_DEFAULT_SONNET_MODELpin that names Claude Sonnet 5.5 or Opus 5.5 and use Claude Sonnet 5 instead」;「requests now time out after 60s (per-serverrequestTimeout)」。 ↩ -
Claude Code 正式 CHANGELOG 的 2.1.289、2.1.290 與 2.1.291 章節,於 2026年10月6日擷取。本指南中所有 v2.1.289、v2.1.290 與 v2.1.291 項目的來源。重點引述:「Fixed a regression in 2.1.290 where cloud sessions could drop answers to permission prompts」;「Fixed a regression in 2.1.288 where the last messages of a session could be lost when quitting」;「Changed the interactive session’s WebSearch budget to refill over time (100 calls/hour;
CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOURsets the rate, 0 turns it off) instead of ending after 200 calls」;「Changed Claude in Chrome so that a project’s settings files can no longer turn it on; use--chrome,/chromeor your user settings」;「Changed the Bash tool to ask for permission before runningpyright, which is no longer treated as a read-only command」;「ChangedCLAUDE_CODE_DISABLE_ATTACHMENTSso a repository’s.claude/settings.jsonor.claude/settings.local.jsoncan no longer set it」;「Addedagent.spawnfor teammates, one agent id across plugin hook events, and idle and waiting states in$.agent.list()」。 ↩↩↩ -
Claude Code 文件,擷取於2026年10月6日。環境變數:
CLAUDE_CODE_DISABLE_STRUCTURED_OUTPUTS「需要 Claude Code v2.1.288 或更新版本」;CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION仍為「(預設:200)」;沒有CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS或CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR的條目。CLI 參考與 Agent 檢視:claude attach和claude logs的部分工作階段名稱需要 v2.1.290;列出了claude purge。Claude 目錄:「在 v2.1.288 之前,此命令為claude project purge。」工具參考:「在 v2.1.288 之前,它適用於每個工作階段」(背景命令的時間限制)。程式碼審查:--max-findings「需要 Claude Code v2.1.288 或更新版本」。快捷鍵:agents:find、agents:rename、agents:previousGroup、agents:nextGroup,v2.1.288。記憶:「當 Claude 對相符的檔案使用 Read、Write 或 Edit 工具時,就會載入以路徑限定範圍的規則」。MCP:stdio 協商仍描述為「對 Claude Code v2.1.285 或更新版本,在 Claude Code 擷取功能旗標的工作階段中」啟用。Plugin CLI 參考:--marketplace僅列於/plugin install;marketplace 資訊清單的驗證行為「需要 Claude Code v2.1.289 或更新版本」。Mods 參考:寫明「截至 v2.1.289」;列出了帶有e.isTeammate的agent.spawn以及$.ui的selection。Sub-agents:effort僅記載為 frontmatter 欄位;name是「最多 256 個字元的唯一識別碼」,名稱「超過 256 個字元」的檔案會被略過,並在除錯記錄中寫入錯誤(10月6日稍後再次擷取)。設定參考:claudeInChromeDefaultEnabled的範圍為「全域設定」。命令:/claude-api列出managed-agents-onboard。搭配 Chrome 使用 Claude Code:「在 CLI 工作階段中執行/chrome,並選擇預設開啟 Chrome 的選項」;該頁面未提及 v2.1.290 的專案設定變更。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。 ↩↩↩ -
Claude Code 正式 CHANGELOG,2.1.293 至 2.1.296 各節,擷取於2026年10月11日,以及同日讀取的
@anthropic-ai/claude-codenpm registry 中繼資料:2.1.293 發布於2026年10月7日 17:18 UTC,2.1.294 為10月8日 03:42 UTC,2.1.295 為10月8日 18:22 UTC,2.1.296 為10月9日 16:58 UTC;dist-tags 的 latest 與 next 為 2.1.296,stable 為 2.1.287。GitHub 的發行說明(發布於 18:10、05:03、19:48 與 19:28 UTC)分別含有 56、2、143 和 79 個條目,與 CHANGELOG 完全一致。本指南中所有 v2.1.293 至 v2.1.296 項目的來源。關鍵引文:「新增 Claude Haiku 5.5(
claude-haiku-5-5),現為 Anthropic API 上的預設 Haiku 模型」,具備「1M 上下文,每 Mtok $0.10/$0.50(超過 100K 的提示為 $0.50/$2.50)」;「為命令與 HTTP hooks 新增onFailure: "block":無法啟動、逾時或以非預期代碼結束的 hook 會阻擋該動作,而不是放行」;「將預先傳送的 MCP 工具描述與 MCP 伺服器指示的預設上限從 2,048 個字元改為 4,096 個字元」;「模型透過工具搜尋載入的 MCP 工具描述改為在 16,384 個字元處截斷,而非 2,048」;「將 subagents 改為最多從skills欄位預載 32 個 skills,每個僅載入一次」;「在 subagent frontmatter 與--agents定義中新增autoCompactWindow,讓 subagent 能比主對話的視窗更早自動壓縮」;「更新/cost、狀態列、--max-budget-usd與 SDK 的費用數字,將 Sonnet 5.5 的快取讀取定價為每百萬 token $0.10(原為 $0.20)」;「為 Read 工具新增allow_large選項」;「還原 2.1.281 的自動模式拒絕訊息變更」;「修正在受管理設定將forceLoginMethod設為gateway但未設定forceLoginGatewayUrl的機器上,已儲存的 Claude apps gateway 登入會被忽略的問題(2.1.295 的回歸)」。 ↩↩ -
Claude Code 文件,擷取於2026年10月11日。Hooks:
onFailure是「hook 失敗時,觸發該 hook 的動作是否繼續進行:"continue"或"block"……需要 Claude Code v2.1.295 或更新版本」;它所計入的失敗包括「無法啟動」、「結束代碼不是 0 或 2」、「HTTP 錯誤」、「逾時」與「無效輸出」;「設為"block"時,失敗的效果等同於該事件上的結束代碼 2,但在PermissionRequest上則會拒絕該請求」;「此欄位對」Stop、SubagentStop、TaskCompleted、TeammateIdle以及背景(async、asyncRewake)命令 hooks「沒有作用」。環境變數:CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS「當 API 以529過載錯誤拒絕請求時,重試之間退避的起始延遲毫秒數(預設:500)……請以純數字提供 500 至 32000 之間的整數毫秒……需要 Claude Code v2.1.292 或更新版本」;CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS「未設定時,等待沒有上限。需要 Claude Code v2.1.295 或更新版本」;CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR「在互動式終端機工作階段中預設為100。在非互動式工作階段中預設為0,即關閉補充」;CLAUDE_CODE_FILE_READ_MAX_OUTPUT_TOKENS「Claude 使用allow_large參數進行的讀取,在上下文視窗仍有空間時可以超過此上限」;VERTEX_REGION_CLAUDE_HAIKU_5_5「於 v2.1.293 新增」;沒有CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS或CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL的條目。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。Sub-agents:
skills欄位預載「清單中最前面的 32 個不同名稱」;每次呼叫的effort參數「會覆寫effort欄位,並在 subagent 恢復時持續生效……需要 Claude Code v2.1.292 或更新版本」;autoCompactWindow不在所列的 frontmatter 欄位之中。狀態列:agentType「需要 Claude Code v2.1.293 或更新版本」。MCP:「Claude Code 預設會向 stdio 伺服器要求該修訂版。若要讓 stdio 通道伺服器維持在較早的交握方式,請將MCP_PROTOCOL_NEGOTIATION設為legacy,這會讓每個伺服器都維持在該方式。」Plugin CLI 參考:claude plugin install接受--marketplace <source>,「需要 Claude Code v2.1.292 或更新版本」。Mods 參考:仍寫明「截至 v2.1.290」;沒有$.ui.notify或prompt.autocomplete的條目。 ↩ -
Claude Code CHANGELOG,2.1.247 章節,擷取於2026年8月27日。npm 於2026年8月26日 18:02 UTC 發布 2.1.247(dist-tag latest:2.1.247;2.1.244 仍未發布),GitHub 發行版 v2.1.247 隨後於 23:06 UTC 發布,而正式文件變更日誌將此版本的日期標為2026年8月26日。原文照錄:「Added the
SendFeedbacktool: when something goes wrong in a session, Claude can draft a feedback report for you to review and send from/feedback(turn off with thefeedbackDraftssetting)」;「Added{id, text, cooldownSessions, priority}entries,tipsFile, andlabeltospinnerTipsOverride, so organizations can rotate their own tips alongside the built-in ones」;「Added a tip on Bash permission prompts pointing to auto mode, with a one-keystroke ‘Yes, and switch to auto mode’ option」;「Added/claude-api cost-optimizeto profile an existing project’s Claude API spend and work through cost levers (caching, token hygiene, batch, effort, model choice) one measured change at a time」;「Updated the/claude-apiskill with Admin API coverage (organization members, invites, workspaces, API keys, rate limit reports, workload identity federation, CMEK)」;「Changed Sonnet 5’s default auto-compact window to its full 1M context, so sessions on the 1M window now auto-compact at about 967K tokens instead of about 934K」;「Changed cross-session peer messages to collapse by default to a one-lineMessage from @<sender>: <first line>preview; Ctrl+O expands the full body」。設定參考尚未記載feedbackDrafts或新的spinnerTipsOverride鍵;截至2026年8月27日,CHANGELOG 是它們唯一的來源。 ↩ -
Claude Code 發行說明 v2.1.235(8月18日)、v2.1.236(8月19日)、v2.1.237 與 v2.1.238(8月20日),以及2026年8月20日的正式 CHANGELOG.md(最新標題:2.1.238)。以下行為引自說明原文:
spellcheck「using your installedaspell,hunspell, orispell」;ANTHROPIC_DEFAULT_MODEL「sets the model new sessions start on, while a/modelpick still overrides it and persists across restarts (unlikeANTHROPIC_MODEL)」;Concise「leads with results and skips preamble and narration, while doing the work just as thoroughly」;keybindingFlavor"readline"「Ctrl+W in the prompt delete back to the previous whitespace, as in Bash」;headersHelper「runs a command that mints HTTP headers (e.g. a short-lived token)」,目錄項目僅在安裝/更新時執行,專案/外掛/agent 範圍則會剝除憑證環境變數;auto 模式「Monitorallow rules are now set aside while auto mode is active」;macOS sandbox「wildcard read-deny rules (e.g.**/.env) now take precedence inside allowed read regions… and can’t be bypassed by renaming the denied file.」 ↩ -
Claude Code CHANGELOG,2.1.246 與 2.1.245 區段,擷取於2026年8月26日;npm 於2026年8月25日 04:45 UTC 發布 2.1.245,並於 19:17 UTC 發布 2.1.246,每個版本皆有對應的 GitHub 發行版。2.1.246 原文:「新增啟動警告,針對萬用字元位於子命令之前的 Bash 允許規則(例如
Bash(git * main)),因為這類規則也會比對到插入於子命令之前的選項」;「在/permissions新增 Auto mode 分頁,用於檢視與編輯 auto mode 分類器規則」;「改進/cd:新目錄的專案設定、hooks、.mcp.json伺服器(仍須經過一般的核准提示)、skills 與 agents 現在會在移動後立即生效,而非等到--resume」;「改進 subagent 結果:在maxTurns限制處停止的 subagent,現在會將其輸出標示為部分完成,並附上透過SendMessage繼續的提示,而非看起來像已完成」;「/goal:閒置的工作階段改為每個 goal 最多對長時間執行的背景工作發起三次確認;您的下一則訊息會再允許三次」;「修正 Bash 權限檢查,對於結尾有懸空&&或||運算子的格式錯誤命令,一律要求核准」;「修正送往 Anthropic 的遙測與指標請求夾帶為第三方閘道(ANTHROPIC_BASE_URL)設定的 API 金鑰的問題;憑證現在只會送往其所屬的主機」;「在回合結束的持續時間行末尾新增該回合的完成時間」。2.1.245 原文:「修正在搭載 glibc 2.44 的 Linux 發行版(例如 Arch Linux、CachyOS 與 Fedora Rawhide)上啟動時當機的問題」。 ↩↩ -
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/looptasks are easy to spot”;”AddedmodelPickersetting: curate the/modelpicker with an ordered, labeled list of models (any id spelling, including Vertex/Bedrock ids), appended to or replacing the built-in lineup”;”AddedpromptCacheTtlandsubagentPromptCacheTtlsettings so API-key and cloud-provider users can keep a 1-hour prompt cache on the main conversation while subagents stay at 5 minutes”;”AddedmodelPricingmanaged 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 sourcesline to/statusthat lists managed settings sources (for examplemanaged-settings.json) present but not applied because a higher-precedence managed source is active”;”Added amanagedmarker in/mcpand/pluginson 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/statusline showing whether GitHub is connected for Claude Code on the web (Pro/Max), pointing to/web-setupwhen it isn’t”;”Added the model (and effort level) each subagent ran on to/tasksand 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-setuprepeatedly asking you to log in when an older GitHub CLI (withoutgh 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”。 ↩ -
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日。 ↩ -
Claude Code v2.1.229 版本說明,2026年8月12日。新增
claude remote-control --continue、供自架執行器使用的伺服器端提供 hooks、閘道串流的 SSE keepalive ping、具mode: "link"的 plugin 市集command來源、ListAgents的offline/cloud標籤、工作流程扇出前綴錯開(CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS=0可停用)、加括號 IPv6 位址的沙箱網域清單改為失敗即封閉、/commit-push-pr對危險旗標的提示、Windows 上的--base-dir必填要求、VSCode 工作階段群組,以及可調整大小的/btw。修正項目包括串流重複、窄終端機的 RangeError 當機、\\?\/UNC 路徑當機、自動模式歸屬標頭失效、閘道拒絕 1M/model、MCP OAuth 的127.0.0.1重新導向、GitHub Action 審查發布,以及 IDE 診斷停滯。擷取於2026年8月12日。 ↩↩↩ -
傳送訊息給您的其他 Claude Code 工作階段,Anthropic Claude Code 文件。存取日期 2026年8月8日。此為以下內容的來源:傳遞結果(已傳遞/暫留/拒絕)、
crossSessionInbound語意與權限模式類別預設值、dialogExpiry的五分鐘預設值與 100 則暫留上限、接收端的四項限制、傳輸方式表與檔案系統可見性規則、-p/bare 模式的 socket 行為、各平台的自身子程序驗證、CLAUDE_CODE_MESSAGING_SOCKET的匯出時機、isolatePeerMachines任一範圍為 true 即生效的語意、迴圈節流與 50 則未讀訊息上限、可用性(macOS/Linux/WSL 2;不支援原生 Windows;不支援 Bedrock/AWS 上的 Claude Platform/Google Agent Platform/Microsoft Foundry),以及對CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC、DISABLE_TELEMETRY、DO_NOT_TRACK與DISABLE_GROWTHBOOK的功能旗標相依性。 ↩ -
Claude Code的正式CHANGELOG,2.1.299章節,擷取於2026年10月14日,以及同日讀取的
@anthropic-ai/claude-code之npm registry中繼資料:2.1.299於2026年10月14日00:23 UTC發布,2.1.300於14:27 UTC發布;dist-tags為latest 2.1.299、next 2.1.300、stable 2.1.287;npm上沒有2.1.297或2.1.298,CHANGELOG也沒有這兩版或2.1.300的章節。GitHub發行版(02:49 UTC)包含190條項目,與CHANGELOG完全相同。本指南中所有v2.1.299項目的來源。重點引述:「終端機新增閒置壓縮:超過200K token的對話若閒置約54分鐘,會在其一小時提示快取過期前先行壓縮,讓您的下一則訊息不必重新處理全部內容」;「新增CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS以變更閒置壓縮的200K token下限;在settings.json中設定"idleCompaction": false可將其關閉。兩者皆需v2.1.290或更新版本」;「新增CLAUDE_CODE_DISABLE_FILE_MENTIONS環境變數:Claude只會取得@檔案提及的路徑,再以其檔案工具讀取,而非直接取得檔案內容」;「MCP允許規則現在只涵蓋其指名的伺服器:mcp__a不再允許名為a__b或a_的伺服器;請以伺服器完整的正規化名稱寫成mcp__<server>__*」;「agent的
tools:清單現在只納入指名MCP伺服器的工具;名稱含有__的伺服器請寫成mcp__<whole name>__*」;「來自Anthropic位於api.anthropic.com的第一方MCP伺服器之MCP工具描述與伺服器指示,現在會完整送達Claude,而不再於4,096個字元處截斷」;「雲端工作階段與Remote Control的MCP連接器,在未擷取任何旗標的安裝上,現在預設協商MCP協定版本2026-07-28;可透過MCP_PROTOCOL_NEGOTIATION=legacy選擇退出」;「UserPromptSubmithooks現在會在skill或自訂斜線命令展開之前執行,因此封鎖提示的hook現在也會一併阻止其內嵌的shell命令」;「turn.startmod hook現在也會收到subagents與隊友的回合,而不只是主迴圈的回合;可透過e.agentId區分(主迴圈上不存在此欄位)」;「修正了對不執行rm的shell-c指令碼仍跳出rm提示的問題。在Claude Code無法讀取的指令碼中於執行期組成的rm,不再觸發提示,除非設定CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT=1」;「為
claude self-hosted-runner orchestrator新增--shutdown-drain-sec:收到SIGTERM時停止輪詢,並給予進行中的輪詢與執行中的spawn hooks至多該秒數的時間完成」;「為claude plugin eval新增--disallow-tools與disallowed_tools案例欄位,可將Agent等特定內建工具排除在eval執行之外」;「新增關閉Claude Desktop的Code分頁中署名區塊的支援:在Claude apps gateway的code政策之env中設定CLAUDE_CODE_ATTRIBUTION_HEADER=0」;「在agent檢視中新增/effort與/fast,用於設定新工作階段的起始值;在該處單獨輸入/model、/effort或/fast現在會開啟選擇器」;「當plugin hook無法接收動作或無法回傳其判定時,該hook可封鎖的動作現在會被拒絕而非放行;已執行的工具,其結果會被扣留」;「修正2.1.296的回歸問題:雲端與無頭工作階段在重新啟動後恢復時,若恰好有新訊息抵達,可能會將已核准的工具呼叫執行兩次」;「網路安全防護通知不再要求使用者申請Cyber Verification Program」。 ↩↩↩ -
Claude Code 文件,擷取於2026年10月14日。設定參考:
idleCompaction,「阻止 Claude Code 壓縮您已離開的冗長對話」;「符合條件的對話預設會啟用閒置壓縮。若要關閉,請將idleCompaction設為false。需要 Claude Code v2.1.290 或更新版本」。環境變數:CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS「對話套用閒置壓縮的脈絡大小,以 token 計(預設值:200000)」,低於100000的值會被提高至100000;CLAUDE_CODE_DISABLE_FILE_MENTIONS「需要 Claude Code v2.1.299 或更新版本」,在專案與本機設定中會被忽略;CLAUDE_CODE_ATTRIBUTION_HEADER「設為0可省略署名區塊」;CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS「當 API 以529過載錯誤拒絕請求時,該請求各次重試之間退避時間的上限,以毫秒計(預設值:32000)」;仍然沒有CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL或CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT的條目。子代理:autoCompactWindow現已列為 frontmatter 欄位,「100000以上的 token 數」;tools與disallowedTools「也接受整個 MCP 伺服器的項目」。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。Mods 參考:仍然標示「截至 v2.1.290」;「在
skill.prompt上,e.source、e.pluginName、e.path、e.frontmatter與e.frontmatterProblem需要 Claude Code v2.1.299 或更新版本」;turn.start列於事件清單中;沒有$.prompt.media、$.session.identity、tabular或serverToolUses。Plugin evals:「在 v2.1.299 之前,這類執行是依其已產出的內容評分」;沒有--disallow-tools。MCP:限制清單仍寫著「伺服器指示,以及預先載入之工具的描述:4,096 個字元」,沒有第一方例外;在 v2 執行階段上,Claude Code「會詢問 HTTP、stdio 與 claude.ai 連接器伺服器是否支援較新的修訂版,並對支援的伺服器使用該版本」。權限:「允許規則只在字面的mcp__<server>__前綴之後才接受工具名稱 glob。伺服器區段不得含有 glob,如此規則才會指向您所設定的特定伺服器。」Hooks:有描述CLAUDE_CODE_DISABLE_FILE_MENTIONS(「您相符的 PreToolUse hooks 會執行」);沒有說明UserPromptSubmit會在 skill 或命令展開之前執行。 ↩ -
Claude Code 正式 CHANGELOG,2.1.300 章節,擷取於2026年10月14日(21:40 PT),以及同時讀取的
@anthropic-ai/claude-codenpm 註冊表中繼資料:2.1.300 於10月14日 14:27 UTC 發布;dist-tags 為 latest 2.1.300、next 2.1.300、stable 2.1.292(當天早上還是 2.1.287)。GitHub 發行版(18:24 UTC)包含 88 個條目,與 CHANGELOG 完全相同。本指南中每一項 v2.1.300 項目的來源。關鍵引述:「在 AWS 上的 Claude Platform 新增/advisor;在您透過/advisor、advisorModel或--advisor選定之前不會有任何 advisor 執行,而CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1會將其關閉」;「為 mod 的提示裝飾新增virtualText:繪製在提示框中的文字,永遠不會進入草稿或送出的提示」;「為 mods 新增$.ui.view({ agentId }):在您要求時於主檢視中顯示某個代理的逐字稿,而$.ui.view({})會返回」;「新增prompt.changemod hook,在提示框文字未經鍵入編輯而變更時觸發:召回的歷史條目、清除、復原,或是 plugin 的填入」;「在 OpenTelemetryapi_request事件中新增cache_creation_5m_tokens與cache_creation_1h_tokens,依存留期區分快取寫入」;「在追蹤 span 中新增 OpenTelemetry GenAI 語意慣例屬性,例如
gen_ai.provider.name、gen_ai.conversation.id、gen_ai.tool.name與error.type」;「將傳送至 api.anthropic.com 的大型請求改為即使停用遙測也使用 gzip 壓縮;設定CLAUDE_CODE_GZIP_REQUEST_BODIES=0可將其關閉」;「變更 hooks:來自 PreToolUse 與 PermissionRequest hooks 的updatedInput現在會像 Claude 自身的輸入一樣進行驗證:未知的鍵會被捨棄,而被工具拒絕的輸入會使呼叫遭到拒絕」;「從claude remote-control移除原本沒有作用的--sandbox與--no-sandbox旗標;現在傳入任一旗標都會以錯誤結束。請在設定中設置sandbox.enabled以沙箱化工作階段」;「變更本機工作階段逐字稿,使其也記錄每個 API 請求的系統提示、工具與參數,讓您選擇分享的逐字稿能精確重現請求」;「變更結束行為:背景命令在被要求停止 1.5 秒後仍在執行時將被強制終止」;「修正在背景命令仍在執行時結束,SessionEnd hooks 有時不會執行的問題」;「修正claude daemon stop --any在卡住的背景服務仍在執行時仍印出「stopped」的問題:現在會等待、強制終止該服務,若服務仍在則以結束代碼 1 回報」。 ↩ -
Claude Code 正式 CHANGELOG,2.1.301 與 2.1.302 兩節,擷取於2026年10月17日(太平洋時間 15:40),以及同時讀取的
@anthropic-ai/claude-codenpm registry 中繼資料:2.1.301 於10月15日 14:34 UTC 發布,2.1.302 於10月16日 16:48 UTC 發布;dist-tags latest 為 2.1.302、next 為 2.1.302、stable 為 2.1.292。GitHub 發行版 v2.1.301(19:22 UTC,51 項)與 v2.1.302(20:53 UTC,63 項)與 CHANGELOG 完全一致。本指南中所有 v2.1.301 與 v2.1.302 項目的來源。重點引文,2.1.302:”Changedclaude -pand Agent SDK sessions with no permission mode to start indefaultmode on third-party providers, with telemetry off or on a fresh install;--permission-mode autokeeps auto”;”Changed fork subagents (subagent_type: "fork") to be on by default inclaude -p, the Agent SDK, the desktop app and VS Code, as they already are in the terminal;CLAUDE_CODE_FORK_SUBAGENT=0turns them off, andclaude mcp servenever offers them”;”Changed the desktop app and VS Code to always run the main conversation’s subagents in the background, as the terminal does, rather than let Claude choose; a subagent’s own Agent calls inclaude -p, the Agent SDK, the desktop app and VS Code now run in the foreground by default”;“Changed prompt and agent hooks so that at most 12 of one event run at a time; the rest wait their turn”;”Added
CLAUDE_CODE_AUTO_MODE_MODELto choose the model the client-side auto mode classifier uses; it does not change the model for server-side auto mode”;”Added anIdle compactionrow to/configfor turning idle compaction off or back on; the notices shown after an idle compaction now say how to turn it off”;”Added a notice to/design-syncand/design-loginthat standalone Claude Design (claude.ai/design) closes by December 14, 2026”;”Fixed the Read tool loading an image file of any size, or a pipe or device named like an image, entirely into memory; image sources over 128 MB are now refused”;”Improved auto mode with the server-side classifier: a conversation too long for the safety check is now compacted, instead of every checked tool call being denied”。2.1.301:”Added
CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MSso unattended retry mode (CLAUDE_CODE_RETRY_WATCHDOG) ends a request at a usage limit that resets too far away instead of waiting”;”Added the%motion to vim mode: jump to the matching bracket, alone or with d/c/y”;”Addedrowsto a mod’sInput: a text field of several lines in the terminal, where Enter submits and Shift+Enter or a backslash before Enter starts a new line”;”Addedclassifier_verdictandpermission_modeto OpenTelemetrytool_decisionevents, so auto mode classifier decisions can be told apart from permission rules”;”Addedclassifier_categoryto OpenTelemetrytool_decisionevents, naming the built-in rule a classifier block matched, whenOTEL_LOG_TOOL_DETAILS=1“;”Fixed thefable(andbest) model alias erroring on the Anthropic API when the newest Fable model is not available to your organization: Claude Code now retries once on the previous Fable model”;”Improved switching to a model with a smaller context window: a conversation too long for the new model is now summarized by the previous model first”;”Changed a mod hook’s.catchhandler to run only when the hook throws or times out; events raised beneath the hook’s own calls now skip that hook without asking its.catch“;”Changed a mod’s$.env.setto resolve with{}once the variable is set or unset, or with{ deny }saying why when the write is not made”。 ↩ -
Claude Code 文件,擷取於2026年10月17日。互動模式:”
%| Jump to the matching(),[], or{}bracket, starting from the next bracket on the current line when the cursor isn’t on a bracket. Requires Claude Code v2.1.301 or later” 以及 “d%/c%/y%| Delete, change, or yank from the cursor through the bracket that%jumps to”。VS Code 頁面列出了 LaTeX 數學式渲染。仍停留在 2.1.302 之前規則的頁面:權限模式表格(”claude -por the Agent SDK |defaultin sessions that fetch feature flags. In sessions that don’t, such as on a third-party provider or with telemetry off,autowith Claude Code v2.1.285 or later”);環境變數頁面(CLAUDE_CODE_FORK_SUBAGENT“is on by default in interactive sessions only. Set to1to turn it on inclaude -pand the Agent SDK as well, or0to turn it off in every kind of session”);以及 subagents 頁面(”Fork mode is off in non-interactive mode with-pand in the Agent SDK unless you turn it on”)。文件中完全未提及的項目:
CLAUDE_CODE_AUTO_MODE_MODEL、CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS、tool_decision的classifier_verdict、permission_mode與classifier_category屬性(監控頁面一項都未列出)、/config的 Idle compaction 列、Claude Design 的關閉日期,以及 12 個 hooks 的上限(hooks:”All matching hooks run in parallel”)。mods 文件現已自成一節:概覽、參考(”Entries cover the Claude Code CLI and the Desktop app as of v2.1.290, and the VS Code extension as of v2.1.299”)、事件(.catch:”Whenguardthrows or times out on a Bash call, Claude Code calls the handler with the same event”,未納入 v2.1.301 的重入規則)、API,以及介面;這些新頁面皆未提及Input的rows、$.env.set、nothing-to-fork、virtualText、$.ui.view、prompt.change、$.prompt.media或$.session.identity。advisor 頁面仍寫著該工具 “is not available on Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, or Microsoft Foundry”。 ↩ -
Claude Code 正式 CHANGELOG,2.1.303 至 2.1.310 各節,擷取日期為2026年10月23日(太平洋時間17:20),以及同時讀取的
@anthropic-ai/claude-codenpm 登錄檔中繼資料: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」;「Addeddecider: "person"to a mod’stool.checkanswer: 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 customANTHROPIC_BASE_URL; a 400 or 422 from the gateway is retried without it」;「Changed mods’settings.readhooks 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.allowNestedUserNamespacesso sandboxed commands on Linux can create user namespaces (Chromium, rootless podman); this lets them get around the sandbox’s file protections」;「AddedCLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MSso 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, andfapplies the fixes; the same fixes appear in VS Code and/doctor」;「ChangedallowedMcpServersto stop filteringmanaged-mcp.jsonstdio servers that use${VAR}only inenv: one your allowlist left out now loads on upgrade; usedeniedMcpServersto keep it off」。2.1.307:「Added
/claude-api api-versionto move Claude API code to API version2026-10-21」;「Added theclaude_code.safety_eventOpenTelemetry 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(alsooffandpause) to Code Review, ending an@claude review alwayssubscription 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」;「Changedsed -ito 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」;「Changedclaude ultrareviewto 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 setCLAUDE_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-24beta value or mid-conversation system messages; Claude Code now retries without them」;「Linux: Improved/sandboxand 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」。 ↩ -
Claude Code 文件,擷取於2026年10月23日。現已正式記載:環境變數列出
CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS、CLAUDE_CODE_DISABLE_ULTRAREVIEW_TRUST_CHECK(「請在啟動 Claude Code 的環境中設定,而非設定檔的env」)、CLAUDE_CODE_AUTO_COMPACT_WINDOW(「200k這類帶後綴的值需要 v2.1.304 或更新版本」)以及CLAUDE_CODE_AUTO_MODE_MODEL(「請使用完整的模型 ID」),並改稱CLAUDE_CODE_FORK_SUBAGENT「控制 fork 模式,該模式預設開啟」;設定參考列出sandbox.allowNestedUserNamespaces(「使用者或受管」);auto mode 設定頁面寫有「使用/auto-mode-setup產生環境項目」;費用頁面:「當/usage頁尾顯示f to fix 2 of 3這類提示時,按下f即可讓 Claude Code 執行它能處理的建議。f快捷鍵需要 Claude Code v2.1.305 或更新版本」;斜線指令列出/claude-api api-version(「v2.1.307 或更新版本」)與managed-agents-secure [<agent-id>];監控列出safety_event與classifier_verdict(「需要 Claude Code v2.1.301 或更新版本」);ultrareview頁面記載了
--trust-workspace(「不接受任何值:請將 PR 編號或基底分支放在它前面」)以及Error: Workspace not trusted的結束狀態;程式碼審查頁面列出 Quick、Standard 與 Deep 三個層級;hooks載有 1,024 個 hook 與 16,384 字元的上限;mods 參考將e.isReadOnly標註為「v2.1.304 或更新版本」;沙箱頁面載有 Ubuntu AppArmor 設定檔;而權限模式表格現在寫為「claude -p或 Agent SDK |default」,與 v2.1.302 一致。仍僅見於發行說明的有:decider: "person"、settings.read層級、@claude review stop、sed -i的變更、自訂 base URL 下的工具搜尋預設行為、Pro 與 Max 方案的工作階段恢復警告、--checkout-hook-timeout-min、multiagent_20261001、CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS、Claude Design 的結束日期,以及 mod 新增的$.env.set、virtualText、$.ui.view與prompt.change;advisor頁面仍寫著該工具「無法在 Amazon Bedrock、AWS 上的 Claude Platform、Google Cloud 的 Agent Platform 或 Microsoft Foundry 使用」。 ↩ -
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_eventOpenTelemetry 事件」。2.1.317:「在 OTel 指標、事件與 span 中新增anthropic.plan、anthropic.seat_type、anthropic.provider與anthropic.custom_base_url」。 ↩↩↩ -
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 個頁面的 sitemaplastmod發生變動;Wayback CDX 索引顯示其中沒有任何頁面是在該期間首次發布。 ↩↩↩ -
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 tofable: on Pro and Max plans at once, on Team and Enterprise plans once your organization allows it; use/model claude-fable-5-1to switch back」;「Added--settings <file>toclaude 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 indontAskmode」;「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=0to keep using it (Bedrock, Vertex and Foundry are unchanged)」;「Added support for MCP tasks in the terminal」;「Addedpermissions.denyInsteadOfPromptingsetting: a tool call that would wait on a permission prompt is denied and the turn continues, in terminal sessions, subagents and teammates」;「Added theCLAUDE_CODE_DISABLE_FEATURE_FLAGSenvironment 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); setCLAUDE_CODE_DISABLE_MCP_TASKS=1to turn them off」;「Changed self-paced/loopto end when a turn finishes without rescheduling … setCLAUDE_CODE_LOOP_KEEPALIVE=1to keep the old behavior」;「Removedshortcuts_listandshortcuts_execute… from Claude Code’s built-in Claude in Chrome tools」。2.1.318:「Added the date a stored claude.ai sign-in ends toclaude auth status(loginExpiresAt) and toclaude -pJSON 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」。 ↩ -
工具參考,Claude Code 文件,擷取於2026年11月10日。任務工具:「任務追蹤工具
TaskCreate、TaskGet、TaskUpdate、TaskList與TodoWrite,僅在 Opus 4.7、Sonnet 4.6、Haiku 4.5 及更早的模型上預設提供」,可用CLAUDE_CODE_ENABLE_TODO_TOOLS=1或claude --allowedTools TaskCreate選擇加入,且「在背景工作階段與雲端工作階段中,Claude Code 會在每個模型上提供相同的工具」。WebSearch:「互動式終端機工作階段的 WebSearch 呼叫上限為 200 次」;「在 Claude Code v2.1.290 或更新版本上,互動式終端機工作階段的上限會以每小時約 100 次的速度補充」;「此上限可以調高,但無法關閉」;「在使用-p的非互動模式與 Agent SDK 中,此上限以每個回合計算,而非每個工作階段。」 ↩ -
環境變數,Claude Code 文件,擷取於2026年11月10日:
CLAUDE_CODE_SESSION_ID:「在 Bash 與 PowerShell 工具的子程序、hook 指令的子程序以及 stdio MCP 伺服器的子程序中,會自動設為目前的工作階段 ID」;CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION:「已於 v2.1.224 移除,現已無作用」;CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING:「設為1可在 Opus 4.6 與 Sonnet 4.6 上停用自適應推理,並退回由MAX_THINKING_TOKENS控制的固定思考預算」;MAX_THINKING_TOKENS:「Claude Code 會將其上限設為比請求的最大輸出 token 少一個 token,且絕不低於 1,024 … 未設定且已啟用思考時,具備自適應推理的模型會自行選擇思考深度,其他模型則使用該上限 … 若為正值,在採用自適應推理的模型上,Claude Code 會忽略該數值本身」。 ↩ -
建立自訂 subagents,Claude Code 文件,擷取於2026年11月10日。限制:「Claude 在一個工作階段中可產生的 subagents 總數沒有上限」;「當工作階段中有 20 個 subagents 正在執行時,再以 Agent 工具產生另一個會失敗,並出現
Concurrent subagent limit reached」;「啟用 ultracode 的工作階段不受此限」。Frontmatter:model接受「sonnet、opus、haiku、fable、完整的模型 ID(例如claude-opus-5-5),或inherit」;permissionMode接受「default、acceptEdits、auto、dontAsk、bypassPermissions、plan,或作為default別名的manual。plugin subagents 會忽略此項」;effort、color與initialPrompt的列;模型的優先順序(每次呼叫的參數、frontmatter、CLAUDE_CODE_SUBAGENT_MODEL、主對話的模型)。「Agent(agent_type)允許清單語法僅適用於以claude --agent作為主執行緒執行的 agent。」Explore:「若使用 Claude 訂閱、Anthropic Console 帳號,或透過ANTHROPIC_BASE_URL連線的 LLM 閘道,Explore 會在opus別名所解析的 Opus 模型上執行」;輔助 agentsclaude、statusline-setup與claude-code-guide。結果與恢復:「背景 subagent 的結果會在稍後的回合中,以完成通知的形式送達 Claude」;「Claude 會使用SendMessage工具,並以該 agent 的 ID 或名稱作為to欄位來恢復它。」Fork 模式:「自 Claude Code v2.1.302 起預設開啟,而在互動式終端機工作階段中則自 v2.1.232 起即預設開啟。」工作流程限制,取自以動態工作流程大規模協調 subagents,同次擷取:「預設最多 16 個並行 agents」(CLAUDE_CODE_WORKFLOW_MAX_CONCURRENT_AGENTS)以及「每次執行總計 1,000 個 agents」。 ↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩↩ -
所有設定,Claude Code 文件,擷取於2026年11月10日。
workflowSizeGuideline:「"small"要求少於 5 個 agents,"medium"少於 10 個,"large"少於 50 個」,預設值為「"medium";若您以 Pro 方案登入且使用 Claude Code v2.1.271 或更新版本,則為"small"」。Claude Code CHANGELOG,v2.1.271:「Changed the default dynamic workflow size to small on Pro plans and lowered the medium size guideline from 15 to 10 agents」。 ↩ -
CLI 參考,Claude Code 文件,擷取於2026年11月10日:
claude agents:「開啟 agent 檢視,以監看並分派平行的背景工作階段 … 或使用--json將作用中的工作階段以 JSON 陣列印出,供指令碼使用」;claude remote-control:「啟動 Remote Control 伺服器,以便從 claude.ai 或 Claude 應用程式控制 Claude Code。別名:claude rc。以伺服器模式執行(沒有本機互動式工作階段)。」同日在 Claude Code 2.1.322 上執行的claude agents --help,將此指令描述為「Manage background agents」(管理背景 agents)。2026年11月25日重新讀取,措辭已變動之處:cli-reference,「開啟 agent 檢視,以監看並分派平行的背景工作階段。」。Claude Code 2.1.332 印出相同的--help文字(2026年11月25日執行)。 ↩↩ -
傳送訊息給您的其他 Claude Code 工作階段,Claude Code 文件,擷取於2026年11月10日:「跨工作階段訊息功能在 macOS、Linux 與 WSL 2 上需要 Claude Code v2.1.224 或更新版本,在原生 Windows 上則需要 v2.1.234 或更新版本。」同次擷取的 CHANGELOG 將「Windows: cross-session messaging is now available」列於 2.1.239 之下,而其 2.1.234 章節中沒有 Windows 訊息功能的條目。 ↩
-
協調多個 Claude Code 工作階段組成的團隊,Claude Code 文件,擷取於2026年11月10日:「Agent teams 屬於實驗性功能,預設停用」;「在 agent 面板中使用上下方向鍵選取隊友,然後按 Enter 檢視其工作階段,並直接輸入文字傳送訊息給它。在選取的隊友上按
x可將其停止。按 Ctrl+T 可切換任務清單」;「若要循環切換執行中隊友的權限模式,請按Shift+Tab」;「先將主導者切換到規劃模式,再請求該隊友」;「若您自產生該隊友後就沒有變更過其權限模式,Claude Code 會在請求送達時立即核准計畫,而不經主導者審查」;teammateMode:「在您變更teammateMode設定之前,隊友會以 in-process 模式執行。」;「--teammate-mode旗標屬於實驗性功能,不會出現在claude --help中。」2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。 ↩↩↩↩ -
使用 skills 擴充 Claude,Claude Code 文件,擷取於2026年11月10日:「自訂指令已併入 skills。您現有的
.claude/commands/檔案仍可繼續使用。」以及術語表中的「位於.claude/commands/deploy.md的檔案與位於.claude/skills/deploy/SKILL.md的檔案都會建立/deploy,運作方式相同;現有的指令檔案仍可繼續使用。」;「每個 skill 都需要一個SKILL.md檔案」;「在 skill 清單中,description與when_to_use合併後的文字會在 1,536 個字元處截斷」;「allowed-tools欄位會在呼叫該 skill 的回合中,授予所列工具的權限 … 它不會限制哪些工具可用」;「若要在 skill 啟用期間將工具從 Claude 的可用工具中移除,請將它們列在disallowed-tools中」;$N是「$ARGUMENTS[N]的簡寫,例如$0代表第一個引數,$1代表第二個」;位於.claude/commands/子目錄中的檔案,會以「相對於commands/的子目錄路徑,並將每個/替換為:」命名,例如/frontend:component;「在本機終端機工作階段中,您的 skill 會取代內建指令,但不會取代其別名」;disable-model-invocation:「設為true可防止 Claude 自動載入此 skill。」2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。 ↩ -
Claude Code CHANGELOG,擷取於2026年11月11日。2.0.72:「Changed thinking toggle from Tab to Alt+T to avoid accidental triggers」。2.1.0:「Added hooks support to agent frontmatter, allowing agents to define PreToolUse, PostToolUse, and Stop hooks scoped to the agent’s lifecycle」;「Added hooks support for skill and slash command frontmatter」;「Improved subagents (Task tool) to continue working after permission denial, allowing them to try alternative approaches」。2.1.7:「Enabled MCP tool search auto mode by default for all users. When MCP tool descriptions exceed 10% of the context window, they are automatically deferred and discovered via the MCPSearch tool instead of being loaded upfront.」 ↩
-
建立自訂 subagents,Claude Code 文件,擷取於2026年11月11日。Explore:「在 Amazon Bedrock、Google Cloud 的 Agent Platform、Microsoft Foundry、AWS 上的 Claude Platform 或 Claude apps gateway 上,Explore 會維持使用 Fable。」
name:「最多 256 個字元的唯一識別碼,例如code-reviewer或reviewer-v2」;「名稱不得包含:」。委派:「若要鼓勵主動委派,請在 subagent 的 description 欄位中加入『use proactively』之類的詞句。」hooks:「限定於此 subagent 的生命週期 hooks。對 plugin subagents 會被忽略」;「plugin subagents 不支援hooks、mcpServers或permissionModefrontmatter 欄位」。--agentsJSON:「JSON 中每個頂層鍵都是一個 agent 的名稱,其值即為該 agent 的定義。」;「agent 的系統提示,相當於以檔案定義的 subagents 中的 markdown 本文」;「description、tools、disallowedTools、model、permissionMode、mcpServers、hooks、maxTurns、autoCompactWindow、skills、initialPrompt、memory、effort、background、omitClaudeMd與isolation」;「color與experimental在此不被接受,會被忽略而不是被拒絕。」2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。 ↩↩↩↩↩↩↩ -
傳送訊息給您的其他 Claude Code 工作階段,Claude Code 文件,擷取於2026年11月11日。訊息:「訊息是一個 Claude 寫給另一個 Claude 的一段文字,絕不會是寄件者的逐字稿或檔案。」;「接收端的 Claude 會在進行中的回合裡、於工具呼叫之間讀取訊息。接收端工作階段閒置時,Claude Code 會以該訊息開始新的回合。」;「權限邊界維持以工作階段為單位。」接收規則:「來自另一個工作階段的訊息絕不算作您的同意」;「Claude Code 絕不會執行它」。傳入訊息的預設值:「沒有任何值適用時,Claude Code 會依兩個工作階段的權限模式逐則決定。」;「期限預設為五分鐘。」;「Claude Code 最多保留 100 則訊息,超過後會丟棄最舊的訊息。」;「VS Code 擴充功能或桌面應用程式中的工作階段無法顯示該對話框。」;「
-p工作階段無法顯示核准對話框。」;「Claude Code 會丟棄該訊息,並向它能聯繫到的寄件者回報該訊息已過期。」;「將dialogExpiry設為"never",即可將預設保留的訊息保留到工作階段結束。由明確的hold設定保留的訊息不會過期」;在 bare 模式下「Claude Code 不會綁定 socket」。清單中有「Teammates」(隊友)與「Your other local sessions」(您的其他本機工作階段)兩列。名稱:「若您未設定名稱,Claude Code 會自行為工作階段命名。」;管理工作階段,同次擷取:「預設名稱由工作目錄的名稱加上兩個字元的後綴組成,例如my-app-3f」。 ↩↩↩↩↩ -
傳送訊息給您的其他 Claude Code 工作階段,Claude Code 文件,「工作階段的收件匣 socket」一節,擷取於2026年11月11日:「
/status會在Peer address列中顯示它。路徑前綴為uds:。」;「Claude Code 會在任何 hook 執行之前匯出此變數,包括SessionStart。」;「傳送到自身工作階段 socket 的指令碼,可以在連線的第一行傳送{"type":"auth","token":"<token>"},其中<token>是CLAUDE_CODE_MESSAGING_TOKEN的值。」;「若連線的第一行不是有效的驗證行,Claude Code 會關閉該連線,且不會傳遞來自該連線的任何內容。」;「在 Linux 上(包括 WSL 2 內),即使子程序已經結束,Claude Code 也能透過程序證據加以驗證。在 macOS 上,只有在傳送訊息的程序仍在執行時才能以這種方式驗證;而在 Claude Code 以程序 ID 1 執行的容器中,則完全沒有程序證據。在原生 Windows 上同樣沒有。」;「在原生 Windows 上,該 token 是 Claude Code 驗證來自自身子程序之訊息的唯一方式。」;「Claude Code 兩種方式都無法驗證時,會將該訊息視同任何未主張權限類別的訊息,因此略過權限提示的工作階段會保留該訊息等待您核准。」;沙箱內的指令則受「sandbox.network.allowAllUnixSockets與sandbox.network.allowUnixSockets」控管。 ↩↩ -
傳送訊息給您的其他 Claude Code 工作階段,Claude Code 文件,擷取於2026年11月11日。傳輸方式:「在 macOS 與 Linux 上透過每個工作階段各自的 socket,在原生 Windows 上則透過每個工作階段各自的具名管道,絕不經由 Anthropic 伺服器」;「經由 Anthropic 伺服器,直接送達雲端工作階段」;「容器內的工作階段與主機上的工作階段無法互相聯繫。」;「同一部電腦上 WSL 2 內的工作階段與原生 Windows 工作階段也無法互相聯繫。」雲端工作階段:雲端工作階段「無法使用
SendMessage回覆來自另一部機器的訊息」;「訊息仍會送達。請在 claude.ai/code 上該雲端工作階段的逐字稿中閱讀其回應。」isolatePeerMachines:「任何設定範圍中的true都會生效,因此已簽入的專案檔案可以開啟這項要求,但無法將其關閉。」上限:Claude Code「最多會將 50 則已接受的訊息排入佇列,供 Claude 讀取」。開放範圍:「使用 API 金鑰,或在 Amazon Bedrock、AWS 上的 Claude Platform、Google Cloud 的 Agent Platform 與 Microsoft Foundry 上時,Claude 找不到那些工作階段。」;「/list-agents無法被辨識」;「拒絕SendMessage也會移除與 subagents 及 agent team 隊友之間的訊息傳遞,因為兩者使用同一個工具。」;「拒絕接收的工作階段不會顯示任何可見的變化」。 ↩↩↩↩↩ -
建立自訂 subagents,Claude Code 文件,擷取於2026年11月11日。權限模式:「若您未設定,subagent 會繼承主對話的權限模式。」;「主對話的權限模式決定 Claude Code 是否採用您設定的值」;「主對話處於
bypassPermissions、acceptEdits或 auto mode 時,您的 subagent 會以相同模式執行,且 Claude Code 會忽略您設定的permissionMode。」;「主對話處於plan模式時,無論您設定哪個permissionMode,subagent 都會維持在規劃模式,除非它依 agent teams 規則以 agent team 隊友的身分執行。」;「主對話處於default或dontAsk模式時,subagent 會以您設定的權限模式執行。在下列這類情況下,它會改為沿用主對話的權限模式」;「您設定了bypassPermissions。bypassPermissions這項例外需要 Claude Code v2.1.267 或更新版本。」;「您設定了auto,但 subagent 無法使用 auto mode」。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。工具:「若要限制工具,請將
tools欄位作為允許清單,或將disallowedTools欄位作為拒絕清單。」;「省略時會繼承 subagents 可用的所有工具。」;Explore 與 Plan 各自列出「唯讀工具;Write 與 Edit 會被拒絕」。上下文與模型:「每個 subagent 都從全新、隔離的上下文視窗開始。」;「fork 是一種繼承至今為止整段對話、而非從頭開始的 subagent。」;模型順序為「每次呼叫的model參數」、「subagent 定義的modelfrontmatter,其中inherit會選取主對話的模型」、「CLAUDE_CODE_SUBAGENT_MODEL環境變數,當您將其設為模型別名或模型 ID 時」、「主對話的模型」。omitClaudeMd:「受管政策檔案仍會載入,但受管 subagents 除外」;「當 agent 透過--agent或agent設定以主工作階段 agent 的身分執行時會被忽略。」experimental:「在您的 Claude 訂閱使用用量額度期間會忽略1h」。memory:「若您透過autoMemoryEnabled設定或CLAUDE_CODE_DISABLE_AUTO_MEMORY關閉自動記憶,memory欄位就沒有作用」。skills:「您無法預先載入設定了disable-model-invocation: true的 skills」。mcpServers:「Claude Code 只有在您信任 agent 檔案所在的資料夾之後,才會從專案.claude/agents/目錄或--add-dir目錄之.claude/agents/中的 agent 檔案載入內嵌的 MCP 伺服器。在 v2.1.238 之前,Claude Code 會在不檢查信任的情況下載入這些伺服器。」frontmatter hooks:「若要讓專案層級 subagent 的 frontmatter hooks 執行,請接受包含該 agent 檔案之資料夾的工作區信任對話框。來自~/.claude/agents/中使用者層級 subagents 的 hooks,以及來自您以--agents傳入之定義的 hooks,無須此步驟即可執行。」選擇權限模式,同次擷取:「在 Claude Code v2.1.283 或更新版本中,auto mode 是互動式終端機與 VS Code 工作階段內建的起始權限模式。」 ↩↩↩↩↩↩↩↩↩↩↩↩ -
透過 Remote Control 從任何裝置接續本機工作階段,Claude Code 文件,擷取於2026年11月11日。
--continue:「找回此目錄中最後一個伺服器所啟動的工作階段,而不是建立新的工作階段。」;「需要 Claude Code v2.1.200 或更新版本。」;「這些指令在伺服器停止後約四小時內有效。」同日在 Claude Code 2.1.322 上執行的claude remote-control --help:「Reattach to the sessionclaude remote-controllast recorded for this directory (or one of its git worktrees) instead of creating a new one.」(重新附加到claude remote-control為此目錄(或其某個 git worktree)最後記錄的工作階段,而不是建立新的工作階段。)2026年11月25日重新讀取,措辭已變動之處:remote-control,「找回此目錄中最後一個伺服器所啟動的工作階段,而不是建立新的工作階段。」Claude Code 2.1.332 印出相同的--help文字(2026年11月25日執行)。 ↩ -
Claude Code 文件,擷取於2026年11月11日。Claude Code 設定:「設定檔是嚴格的 JSON:
//註解或結尾逗號都屬於語法錯誤,Claude Code 會在下次啟動時將該檔案回報為 Settings Error。」Hooks 參考,「比對器模式」一節:比對器為*、空字串或完全沒有比對器時,會被評估為「比對全部」;「Bash比對 Bash 工具」;「mcp__memory__.*比對來自memory伺服器的所有工具」;「若您在不支援比對器的事件上加入matcher欄位,該欄位會被默默忽略。」;列出UserPromptSubmit的那一列寫著「不支援比對器」與「每次發生時一律觸發」。協調多個 Claude Code 工作階段組成的團隊:「若要啟用,請將CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS環境變數設為1,可在 shell 環境中設定,或透過 settings.json 設定」。 ↩ -
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:latest2.1.332、next2.1.332、stable2.1.326。2.1.332 原文:「Changed the default model on Microsoft Foundry to Sonnet 5.5: deployclaude-sonnet-5-5, or setANTHROPIC_DEFAULT_SONNET_MODELto a model you have deployed」;「Changed thesonnetmodel alias on Google Cloud’s Agent Platform and Microsoft Foundry to Sonnet 5.5, and Foundry’sopusalias to Opus 5.5;sonneton Amazon Bedrock stays at Sonnet 4.5」;「Added aPreSkillShellCommandhook 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 asserver:skillin 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”;/routinesstill works」。2.1.330:「Changed recurring scheduled tasks and/loopto 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; setsandbox.autoAllowBashIfSandboxed: trueto 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 thesubagentStatusLinesetting: 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/autocompactto compact earlier, orCLAUDE_CODE_DISABLE_1M_CONTEXT=1to keep 200K」;「ChangedMCP_SDK_GENERATION=v1to run the v2 MCP client in a compatibility mode (earlier handshake, relaxed OAuth sign-in checks), because the v1 MCP client is removed」。 ↩↩ -
環境變數,Claude Code 文件,擷取於2026年11月25日,並與本指南的環境變數參考章節逐列比對。
CLAUDE_CODE_SUBAGENT_EFFORT:「它不適用於 forks、fork 出來的 skills 或隊友。需要 Claude Code v2.1.315 或更新版本」。CLAUDE_CODE_SYNC_SKILLS:「在互動式工作階段中,此變數需要 v2.1.323 或更新版本」。CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT:「當CLAUDE_CODE_DISABLE_INLINE_SHELL_RM_PROMPT為1時沒有作用。需要 Claude Code v2.1.299 或更新版本」。CLAUDE_CODE_SESSION_ID:「在 Bash 與 PowerShell 工具的子程序中,會自動設為目前的工作階段 ID」。CLAUDE_CODE_WORKFLOW_PREFIX_STAGGER_MS:「預設值為5000。設為0可停用等待。」CLAUDE_CODE_LOOP_KEEPALIVE:「在其第二次或之後的迭代結束且沒有排定任何事項時」。CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH:「以 UTF-16 程式碼單元計算(預設值:61440,即 60 KB)」。該頁面沒有OTEL_EXPORTER_OTLP_TIMEOUT這一列;其上限來自 Claude Code CHANGELOG 的 2.1.323:「Fixed OpenTelemetry exports failing when a proxy took over 10 seconds to reach the collector; it now has 25 seconds, also the most thatOTEL_EXPORTER_OTLP_TIMEOUTcan allow (previously 30)」。 ↩ -
Claude Code 文件,擷取於2026年11月25日。設定檔與優先順序:「設定的優先順序,由高至低:受管設定、命令列、專案本機、共用專案、使用者。」;「其他旗標(例如
--model)會為該工作階段設定一項內容,不屬於這個堆疊」;「當您在多個檔案中設定同一個清單鍵(例如permissions.allow)時,Claude Code 會合併這些清單,而不是擇一採用」;「Claude Code 還會保留第五個檔案~/.claude.json,由它自行寫入;您不需要編輯它。其中存放您的帳號資訊、MCP 伺服器設定、各專案的狀態(例如信任決定),以及/config替您寫入的全域設定鍵。」驗證:「在 macOS 上,憑證儲存在加密的 macOS 鑰匙圈中。」;「在 Linux 上,憑證儲存在~/.claude/.credentials.json,檔案模式為0600。」;「在 Windows 上,憑證儲存在%USERPROFILE%\.claude\.credentials.json」。建立自訂 subagents,frontmatter 表格:background,「設為true可讓此 subagent 即使在 Claude 要求等待它時仍保持在背景。預設情況下,Claude 從主對話產生的自訂 subagents 已在背景啟動」;autoCompactWindow,「將此 subagent 的自動壓縮視窗調低至100000以上的 token 數。需要 Claude Code v2.1.296 或更新版本」;disallowedTools,「帶有指定條件的項目(例如Bash(git push *))仍會移除整個工具」;isolation,「預設情況下,副本會從您的預設分支建立分支,而不是從父工作階段的HEAD。」 ↩↩↩↩ -
claude.com 上的 Claude Tag 文件,擷取於2026年11月25日。使用 Claude Tag:「Claude Tag 開放給 Anthropic 第一方服務上的 Team 與 Enterprise 方案。個人方案(Free、Pro、Max 或 Ultra)與第三方部署均無法使用。」;「它會在討論串中隨進度張貼檢查清單,整個交流過程對頻道保持可見。」設定總覽:「Claude Tag 目前為公開測試版。此處所述的功能與行為在正式推出前可能有所變更。」;「執行設定需要 Team 或 Enterprise 方案上 Claude 組織的 Owner 角色。」;「頻道工作會從您組織的用量餘額中扣除;在 Team 方案上,儲值額度之前不會執行任何工作。」;「執行
@Claude connect需要 Slack 工作區管理員」。從先前的 Claude in Slack 遷移:「您現有的 Slack 應用程式與@Claude帳號名稱會保留,且不會移轉任何資料。改變的是 Claude 以誰的身分行事,以及由誰進行設定。」;「新版本一開始沒有任何自己的存取權。GitHub 儲存庫與其他連線不會從個別使用者已連結的帳號延續過來」。總覽頁面另寫道:「Slack 頻道中的任何人都可以標註 Claude 來處理某個問題,並將工作交給它」。 ↩ -
Claude Code 文件,2026年11月25日重新讀取,針對11月10日與11日擷取之後有所變動的段落。透過 MCP 將 Claude Code 連接至工具:「終端機 CLI 工作階段、Agent SDK 工作階段與 GitHub Actions 執行在 v2.1.304 或更新版本上具備它們」;「若擷取功能旗標已關閉,例如在 Amazon Bedrock 上或已關閉遙測時,您需要 Claude Code v2.1.317 或更新版本上的互動式終端機工作階段」;「由主對話啟動的非 fork subagent,位於會擷取功能旗標的互動式終端機工作階段中,且版本為 v2.1.331 或更新版本。該伺服器不能是定義在 subagent 自身檔案中的伺服器」;「MCP 任務可以在 VS Code 擴充功能與本機桌面應用程式工作階段中運作。這兩者都需要 Claude Code v2.1.331 或更新版本,以及會擷取功能旗標的工作階段。」;「來自 subagents 的呼叫,雲端中的 MCP 任務除外」。為 Claude Code 設定終端機:「Ghostty、Kitty、iTerm2、WezTerm、Warp、Windows Terminal 1.25 或更新版本 | 無需設定即可使用」;「gnome-terminal、Windows Terminal 1.25 之前的版本、PyCharm 與 Android Studio 等 JetBrains IDE | 無法使用;請使用 Ctrl+J 或
\後接 Enter」;「/terminal-setup與首次執行時的終端機設定提示,只會在 macOS 26 及更早版本上啟用此設定。兩者也都會關閉您設定檔的提示音。」指令:「/voice [hold\|tap\|off]| 切換語音聽寫,或以特定模式開啟。需要 Claude.ai 帳號」;/code-review這一列:「傳入--fix可讓 Claude 套用審查結果,傳入--comment可將結果張貼到 GitHub PR 或 GitLab merge request,傳入ultra則可執行深度雲端審查。」;該頁面沒有/buddy這一列。Hooks 參考:「Setup只支援commandhooks。SessionStart只支援command與mcp_toolhooks」。使用 advisor 工具升級困難決策:「advisor 工具屬於實驗性功能,需要 Anthropic API、AWS 上的 Claude Platform,或 Claude Models on Google Cloud (Anthropic managed)。在 AWS 上的 Claude Platform 或 Claude Models on Google Cloud (Anthropic managed) 上,需要 Claude Code v2.1.300 或更新版本。在 Amazon Bedrock、Google Cloud 的 Agent Platform 或 Microsoft Foundry 上無法使用。」建立自訂 subagents:「web-fetch | Haiku;無法使用 Haiku 時,則為啟動它的對話所用的模型」;「Claude Code 會在幾秒內偵測到變更,下一次委派就會使用更新後的定義,不需要重新啟動。」;「Claude Code 不會監看以--add-dir或/add-dir加入之目錄中的.claude/agents/」;「以--disable-slash-commands啟動的工作階段完全不會監看這些目錄。」協調多個 Claude Code 工作階段組成的團隊:「分割窗格需要 tmux 或 iTerm2:預設的 in-process 模式可在任何終端機中運作。」;「產生時無法為個別隊友指定權限模式」。設定沙箱化的 Bash 工具:「沙箱可在 macOS、Linux 與 WSL2 上執行。在原生 Windows 上,Claude Code 會在沙箱外執行指令。」指令,/batch <instruction>:「在程式碼庫中平行協調大規模變更。研究程式碼庫,將工作拆解為 5 至 30 個獨立單元,並提出計畫。核准後,為每個單元在隔離的 worktree 中產生一個背景 subagent。每個 subagent 實作其單元、執行測試,並開啟 PR 或回報結果。需要 git 儲存庫,或一個會建立 worktrees 的WorktreeCreatehook。在 git 儲存庫之外,/batch需要 Claude Code v2.1.281 或更新版本。」協調多個 Claude Code 工作階段組成的團隊,權限:「新隊友會以主導者的模式啟動」;「若主導者處於dontAsk模式,隊友則會改以 Manual 模式啟動。」環境變數:CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS,「在 Agent 工具拒絕產生另一個之前,可在單一工作階段中同時執行(預設值:20)」;CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH,「允許位於主對話之下(預設值:3)」;CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION,「已於 v2.1.224 移除,現已無作用。」開始使用 Claude Code on the web:「雲端工作階段開放給 Pro、Max、Ultra 與 Team 方案,以及擁有進階席次或 Chat + Claude Code 席次的 Enterprise 使用者。」 ↩↩↩