Claude Code: 什麼是MCP(模型上下文協定)?
# MCP 透過標準化協定,擴充 Claude Code 存取外部工具、資料庫、API 與服務的能力。其生態系成長迅速:Anthropic 於2025年12月將 MCP 捐贈給 Agentic AI Foundation 時,統計有超過 10,000 個活躍的公開 MCP 伺服器,以及 Python 與…
MCP 透過標準化協定,擴充 Claude Code 存取外部工具、資料庫、API 與服務的能力。其生態系成長迅速:Anthropic 於2025年12月將 MCP 捐贈給 Agentic AI Foundation 時,統計有超過 10,000 個活躍的公開 MCP 伺服器,以及 Python 與…
MCP 透過標準化協定,擴充 Claude Code 存取外部工具、資料庫、API 與服務的能力。其生態系成長迅速:Anthropic 於2025年12月將 MCP 捐贈給 Agentic AI Foundation 時,統計有超過 10,000 個活躍的公開 MCP 伺服器,以及 Python 與 TypeScript 合計每月超過 9,700 萬次的 SDK 下載量。320 若要將 Claude 整合至現有工具鏈,瞭解 MCP 至關重要。
MCP對開發者的重要性:沒有MCP時,Claude Code處理的是您機器上的內容與開放網路:檔案、shell指令、搜尋與擷取。有了MCP,只需以自然語言提出要求,Claude就能查詢正式環境資料庫、建立Jira工單、審查GitHub PR、檢查Sentry錯誤,並與團隊使用的任何API互動。此協定將AI工具連接外部服務的方式標準化,避免受制於單一供應商。如需判斷何時該使用MCP或其他擴充機制,請參閱決策框架。
遠端MCP支援(2025年6月)
Claude Code現在支援遠端MCP伺服器,並內建OAuth驗證。20無須管理本機伺服器,即可連接工具與資料來源。只要完成一次驗證,Claude Code便會自動更新權杖。
# Connect to remote MCP server with OAuth
claude mcp add --transport http linear https://mcp.linear.app/mcp
# Then run /mcp inside Claude Code to sign in through the browser
Linear 的 /mcp 端點是其 Streamable HTTP 端點;Linear 將較舊的 https://mcp.linear.app/sse 稱為已棄用的備援。321
SDK mcp_authenticate redirectUri(v2.1.121+):Agent SDK的mcp_authenticate接受redirectUri參數,可透過自訂URI配置完成OAuth。桌面應用程式與無法使用預設迴路位址重新導向的claude.ai連接器流程,需要使用此參數。151
claude.ai MCP連接器(v2.1.46+)
Claude Code現在可以使用您在claude.ai帳號中設定的MCP連接器。這打通了網頁介面與CLI之間的連結:透過claude.ai介面設定的MCP伺服器,會自動出現在Claude Code中,無須在本機重新設定。93
停用方式:在環境變數或settings.json的env區塊中設定ENABLE_CLAUDEAI_MCP_SERVERS=false,即可阻止載入claude.ai MCP伺服器。102
組織管理的連接器(v2.1.243+):/mcp與/plugins會為由組織管理驗證的claude.ai連接器加上managed標籤,方便區分管理員佈建的連接器與您自行連接的連接器。247
MCP工具搜尋(v2.1.7+)
隨著MCP伺服器的功能日益豐富(有些提供超過50個工具),工具說明開始占用過多上下文。MCP工具搜尋只在需要時動態載入工具說明,藉此解決問題,相當於AI工具的延遲載入機制。46423
效能影響: Anthropic 於2025年11月發表的、針對 API 之 Tool Search Tool 的自家評估指出:320 - Opus 4:MCP評測從49% → 74% - Opus 4.5:MCP評測從79.5% → 88.1% - Token額外用量減少:85%
運作方式: 工具搜尋預設啟用。MCP 工具會延遲載入:Claude 能看到工具名稱,並在需要某個工具時才載入其定義。10% 門檻只在您選擇加入 ENABLE_TOOL_SEARCH=auto 時適用;此時工具會預先載入,直到其定義達到上下文視窗的 10% 為止。322
各供應商的預設行為(v2.1.304-305)。自v2.1.304起,使用自訂ANTHROPIC_BASE_URL時,預設會啟用工具搜尋;若閘道回傳400或422,則會停用工具搜尋後重試。v2.1.305修正了2.1.304引入的退化問題:在Vertex、Bedrock及其他端點拒絕工具搜尋的供應商上,以及禁止ToolSearch或未將其列入--tools的閘道後方,每次請求都會失敗。Claude Code現在會停用工具搜尋後重試。275 在 Google Cloud 的 Agent Platform(Vertex AI)上,Opus 4.5、Sonnet 4.5、Haiku 4.5 及之後的版本預設啟用工具搜尋;該平台上較早的模型會預先載入所有工具,且 ENABLE_TOOL_SEARCH=true 無法改變這一點。託管於 Azure 的 Microsoft Foundry 部署會拒絕工具搜尋,因此 Claude Code 在那裡也會預先載入工具。322
設定: 請在 shell 中,或在 settings.json 的 env 下設定 ENABLE_TOOL_SEARCH 環境變數:322
{
"env": { "ENABLE_TOOL_SEARCH": "auto:15" }
}
可用值:
- 未設定或 true:延遲載入所有 MCP 工具,並按需載入(預設值)
- auto:預先載入工具,直到其定義達到上下文視窗的 10%,之後改為延遲載入
- auto:N:同上,但使用您自訂的百分比(0-100)
- false:預先載入所有工具定義,不延遲載入
進階技巧:啟用工具搜尋後,可以連接更多MCP伺服器,無須擔心上下文限制。延遲載入之下,各伺服器不會爭用上下文。
MCP強制載入覆寫設定(v2.1.121+)
工具搜尋會延後載入完整說明,直到需要工具時才載入。若某個受信任伺服器的工具預期每一輪都會用到,可為該伺服器設定alwaysLoad: true以略過延遲載入。該伺服器的所有工具都會在工作階段開始時載入提示詞,省去ToolSearch往返:151
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"alwaysLoad": true
}
}
}
alwaysLoad: false(v2.1.287):將此欄位設為false,會讓該伺服器的所有工具延後至透過工具搜尋時才載入。229
MCP啟動自動重試(v2.1.121+): 當 HTTP 或 SSE 伺服器的首次連線因暫時性錯誤(例如 5xx 回應、連線遭拒或逾時)而失敗時,Claude Code 最多會重試三次,才將該伺服器標記為失敗,這有助於處理仍在啟動中的後端。這些重試不適用於 stdio 或 WebSocket 伺服器的首次連線,也不適用於驗證錯誤或找不到資源的錯誤,這類錯誤需要變更設定(若 headersHelper 是該伺服器 Authorization 標頭的唯一來源,發生驗證錯誤時仍會重試連線)。在互動式工作階段中,請從 /mcp 裡該伺服器的選單選擇 Reconnect(重新連線),即可重新啟動失敗的 stdio 伺服器。151551
MCP資訊徵詢(v2.1.76+)
MCP伺服器現在可以在任務進行中,透過互動式對話方塊要求使用者提供結構化輸入。116當MCP伺服器需要額外資訊(例如選擇分支、輸入專案名稱、確認操作)時,會送出資訊徵詢請求,由Claude Code顯示為表單欄位或瀏覽器URL。
hooks整合:新增的2個hooks事件——Elicitation(對話方塊出現前)與ElicitationResult(使用者回應後)——可讓您以程式攔截、驗證或覆寫資訊徵詢回應。企業因此能建立依政策預先填入或限制MCP伺服器提示內容的工作流程。
URL模式(v2.1.281):使用2026-07-28版MCP協定的連線,可由伺服器透過URL模式的資訊徵詢,要求Claude Code開啟瀏覽器流程。若伺服器無法確認流程是否完成,畫面上就不會保留等待中的對話方塊。221v2.1.287新增支援使用2025-11-25版協定的伺服器發出URL提示,例如要求登入。若伺服器在更新後無法連線,請在其MCP設定項目中加入"bareElicitationCapability": true。229230截至v2.1.288,若伺服器無法回報使用者何時完成操作,其URL提示會等待您選擇「我已完成,繼續」後,才繼續工具呼叫,讓您能先在瀏覽器中完成操作。231
MCP結果大小覆寫設定(v2.1.91+)
過大的 MCP 結果會儲存至檔案,而不是遭到截斷:預設情況下,不含圖片內容的成功結果若超過 50,000 個字元,就會寫入檔案,並在對話中以檔案參照取代。伺服器可以在工具的 tools/list 項目中設定 _meta["anthropic/maxResultSizeChars"],為單一工具提高此門檻,上限為 500,000 個字元。134424 對於文字內容,無論 MAX_MCP_OUTPUT_TOKENS 設為多少,此註記都會套用,適合輸出本來就很大的工具,例如資料庫結構描述或完整的檔案樹。回傳圖片資料的工具仍受 token 上限約束。
MCP說明長度上限覆寫設定(v2.1.280+)
除了上述的結果上限,Claude Code 也會限制伺服器加入上下文的說明文字:MCP 工具說明與伺服器指示會在 4,096 個字元處截斷(v2.1.296+)。CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH 可調整此數值,而模型透過工具搜尋載入的說明會在 16,384 個字元處截斷(v2.1.295+)。217235 自 v2.1.299 起,Anthropic 託管於 api.anthropic.com 的部分 MCP 伺服器,其工具說明與伺服器指示會完整傳送給 Claude,此變數也不會截斷它們。268269322
CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH=8192 claude
使用此設定前,請先瞭解三項特性:
- 它適用於整個工作階段,無法針對個別伺服器設定。變更紀錄明確指出,新上限適用於「工作階段中的每個MCP伺服器」。無法只提高某個冗長伺服器的上限,同時讓其他伺服器維持預設值;提高上限會一併套用至所有伺服器。
- 一個數值同時設定兩項限制。 此值會同時取代 4,096 個字元的預先載入限制與 16,384 個字元的工具搜尋限制,因此低於 16,384 的數值(例如上方的
8192)會提高前者,同時降低後者。322 - 允許載入的內容可能會常駐於上下文。伺服器指示一律在工作階段開始時載入。工具說明則只有在工具搜尋未延後載入時,才會預先載入:例如工具搜尋已停用(
ENABLE_TOOL_SEARCH=false,或無法使用工具搜尋的供應商或模型)、在auto模式下未達門檻,或伺服器已設定alwaysLoad。預先載入的說明會保留在每次請求的提示詞中,不論模型是否呼叫過那些工具。因此,若對十幾個這類伺服器提高上限,就會持續占用更多上下文。220
適合調整的情況:伺服器的工具確實需要較長說明才能正確呼叫,例如資料結構繁複的資料庫伺服器,或參數語意不直觀的內部API介面,而且已觀察到截斷導致呼叫錯誤。值得調整的具體徵兆是:模型誤用某個工具,而該工具在/mcp中的說明恰好在句子中途被截斷。
不適合調整的情況:伺服器只是說明過於冗長。成本較低的修正方式仍較理想:MCP工具搜尋能解決上述預先載入的成本,因為它會等到Claude需要工具時,才將工具定義放入提示詞;精簡伺服器本身的說明則能處理根本原因,而非只是放寬額度。只有在準確性需要時才提高上限,並在調整後查看/context,確認增加了多少用量。
新增伺服器:指令形式
claude mcp add 已不再提供互動式精靈。早期版本曾有此精靈(於 0.2.32 新增,於 0.2.108 棄用)7;如今不帶引數執行時,此指令會以 error: missing required argument 'name'(錯誤:缺少必要引數 ‘name’)停止。它需要名稱與目標:遠端伺服器使用 claude mcp add --transport http <name> <url>,本機伺服器使用 claude mcp add --transport stdio <name> -- <command>,或使用 claude mcp add-json <name> '<json>' 貼上為其他用戶端撰寫的設定。322 自 v2.1.327 起,claude mcp add-json <name> - 會從 stdin 讀取 JSON,例如 cat server.json | claude mcp add-json <name> -,可避免 token 出現在命令列上;請在 Claude Code 工作階段之外執行。527533
傳輸類型
HTTP(建議用於遠端伺服器):
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
# With authentication
claude mcp add --transport http api https://api.example.com/mcp \
--header "Authorization: Bearer $API_TOKEN"
SSE(已棄用,但仍可運作):497
# my-sse-server and the URL are placeholders: use your server's name and SSE endpoint
claude mcp add --transport sse my-sse-server https://mcp.example.com/sse
# With an authentication header
claude mcp add --transport sse private-api https://api.company.com/sse \
--header "X-API-Key: your-key-here"
即使是舊版伺服器,通常也無須明確指定旗標:設定為 http、但只支援舊版 HTTP+SSE 傳輸的 MCP 伺服器,會依 MCP 規格自動退回 SSE(v2.1.265+)。212 v2.1.274 補上了此退回機制的缺口(即使舊版伺服器對第一個請求回傳 422 或其他 4xx 錯誤,現在也能連線),同時讓最後一批安裝環境改用新版用戶端:Bedrock、Vertex、Foundry 及停用遙測的安裝環境,在直接連接 HTTP 伺服器時,現在預設使用 v2 MCP 用戶端與 MCP 2026-07-28 協定交涉,與其他安裝環境一致。若要選擇退出,請設定 MCP_SDK_GENERATION=v1 或 MCP_PROTOCOL_NEGOTIATION=legacy。215 v2.1.323 移除了 v1 MCP 用戶端:其版本說明指出,MCP_SDK_GENERATION=v1 現在會以相容模式執行 v2 用戶端,採用較早的交握方式與較寬鬆的 OAuth 登入檢查。2026年11月25日讀取的環境變數頁面,仍將 v1 描述為以 MCP TypeScript SDK 1.x 建構的執行環境。527533
Stdio(本機伺服器):
# PostgreSQL
claude mcp add --transport stdio postgres \
-- npx -y @bytebase/dbhub --dsn "postgresql://readonly:pass@localhost:5432/analytics"
# Custom server
claude mcp add --transport stdio custom -- python /path/to/server.py --port 8000
DBHub(@bytebase/dbhub)是 Anthropic 的 MCP 文件用於資料庫的伺服器;請為它提供唯讀的資料庫使用者,讓 Claude 執行的查詢無法修改資料。322
原生 Windows 的 stdio 伺服器已不再需要包裝:v2.1.119 將「Windows requires ‘cmd /c’ wrapper」(Windows 需要 ‘cmd /c’ 包裝)這項設定警告視為誤報而移除,現今的 MCP 文件也不要求任何包裝。若某個 npx 伺服器在該環境中仍無法啟動,包裝後的形式如下:
claude mcp add --transport stdio my-server -- cmd /c npx -y airtable-mcp-server
WebSocket(會推送事件的遠端伺服器): "type": "ws" 項目需寫在 .mcp.json 中,或透過 claude mcp add-json 新增;--transport 只接受 stdio、sse 與 http。驗證僅能透過標頭進行,不支援 OAuth,因此若伺服器只回應請求,建議改用 HTTP。322
claude mcp add-json events-server \
'{"type":"ws","url":"wss://mcp.example.com/socket","headers":{"Authorization":"Bearer YOUR_TOKEN"}}'
stdio協定預設值(v2.1.292)。所有安裝環境的本機(stdio)伺服器連線,預設都會交涉MCP協定版本2026-07-28,包括Bedrock、Vertex與Foundry。設定MCP_PROTOCOL_NEGOTIATION=legacy可停用此行為,讓所有伺服器維持舊版交握方式。若stdio伺服器忽略新版協定檢查,系統會在一次緩慢連線後記住此情況7天,改用舊方式連線,省去等待。MCP文件說明,Claude Code預設會要求stdio伺服器使用該版本,而legacy會讓所有伺服器維持舊版交握方式。若stdio通道伺服器在升級後停止傳遞訊息,文件指出,使用2026-07-28版本的通道伺服器不會在v2執行環境中註冊為通道,並提供legacy作為解法。233234237
工具名稱超過128個字元(v2.1.292)。 名稱超過 128 個字元的 MCP 工具會被略過,並在 MCP 錯誤中指出其名稱。233
範圍管理
MCP伺服器有3種範圍,優先順序明確(本機覆寫專案,專案覆寫使用者):
| 範圍 | 儲存位置 | 可見範圍 | 使用情境 |
|---|---|---|---|
| 本機 | ~/.claude.json(專案路徑) |
僅您本人,此專案 | 個人API金鑰 |
| 專案 | .mcp.json |
透過git供整個團隊使用 | 共用整合 |
| 使用者 | ~/.claude.json(根層級) |
您本人,所有專案 | 個人工具 |
安裝時指定範圍:
claude mcp add --scope project --transport http github https://...
claude mcp add --scope user --transport stdio personal-tool -- ./my-tool
設定檔格式
.mcp.json檔案定義專案層級的伺服器:
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
},
"database": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@bytebase/dbhub", "--dsn", "${DATABASE_URL}"]
},
"sentry": {
"type": "http",
"url": "https://mcp.sentry.dev/mcp",
"headers": {
"Authorization": "Bearer ${SENTRY_API_KEY}"
}
},
"internal-api": {
"type": "http",
"url": "${API_BASE_URL:-https://api.example.com}/mcp",
"headers": {
"X-API-Key": "${INTERNAL_API_KEY}"
}
}
}
}
環境變數使用${VAR}語法展開,也可指定預設值:${VAR:-default}。展開適用於伺服器的 command、args、env、url 與 headers 值。322 截至v2.1.268,解析後的值不再出現在顯示介面中:/mcp與/plugin的伺服器詳細資訊、claude mcp list與claude mcp get,以及MCP登入錯誤,都不再顯示從${VAR}預留位置解析出的機密值;plugins與市集錯誤也不再回顯嵌入git來源URL的權杖或密碼。213
有一個type值保留給不同的宿主使用:截至v2.1.274,.mcp.json、設定檔、plugins及代理程式檔案中的"type": "sdk"項目會被略過並顯示警告。只有SDK宿主應用程式可以註冊處理程序內的伺服器,因此CLI工作階段無法載入這些項目。215
MCP管理命令
claude mcp list # View all configured servers
claude mcp get github # Get specific server details
claude mcp remove github # Remove a server
claude mcp reset-project-choices # Reset project-scoped approvals
claude mcp add-from-claude-desktop # Import from Claude Desktop
claude mcp add-json weather '{"type":"http","url":"..."}' # Add from JSON
claude mcp login github # Authenticate a server from the CLI (v2.1.186); --no-browser completes over SSH
claude mcp logout github # Sign out of a server (v2.1.186)
# Within Claude Code REPL
> /mcp # Interactive MCP management
> /mcp reconnect all # Retry every failed or unauthenticated server (v2.1.284)
OAuth驗證
對於需要OAuth的伺服器:
> /mcp
# Follow browser-based OAuth flow
# Tokens stored securely and auto-refreshed
# Use "Clear authentication" to revoke access
截至v2.1.288,當MCP伺服器在工具呼叫期間要求更多OAuth權限範圍時,Claude Code會顯示重新驗證提示。231
使用MCP資源與提示詞
參照資源:
@github:issue://123
@postgres:schema://users
@docs:file://api/authentication
將MCP提示詞用作斜線命令:
/mcp__github__list_prs
/mcp__github__pr_review 456
/mcp__jira__create_issue "Bug title" high
輸出限制
Claude Code會限制MCP輸出,以防止上下文溢位: - 警告門檻:10,000個token - 預設上限:25,000個token
如有需要,可提高上限:
export MAX_MCP_OUTPUT_TOKENS=50000
超過 token 上限的成功結果不會遭到截斷:Claude Code 會將其儲存至檔案,並將路徑交給 Claude。此變數不會改變MCP結果大小覆寫設定中所述、另行設定的 50,000 個字元門檻。424
長時間執行的MCP呼叫自動移至背景(v2.1.212)。 主對話中的 MCP 工具呼叫若在 2 分鐘後仍在執行,就會移至背景,不再阻塞對話:工作階段會繼續運作,並在呼叫完成後取得結果。可透過 CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS 調整門檻(單位為毫秒)。186 來自 subagents 的呼叫(雲端中的 MCP 任務除外)、對 IDE 伺服器的呼叫,以及非互動模式下的呼叫(claude -p,除非設定了 CLAUDE_AUTO_BACKGROUND_TASKS=1),都絕不會移至背景。553
MCP 任務(公開測試版,v2.1.304+)。 MCP 任務是由伺服器依 MCP tasks 擴充自行執行的長時間工作,例如報表匯出或建置。伺服器接受工作後,Claude 的工具呼叫就會完成,頁尾會顯示計數 1 MCP task(1 個 MCP 任務),Claude Code 會向伺服器檢查狀態以追蹤它,逐字稿也會說明它何時結束;遠端伺服器上的任務在您退出後仍會繼續執行,恢復同一個工作階段時會接續追蹤。283284
在雲端以外,呼叫只有在下列條件全部成立時才會成為任務:553
- 伺服器支援任務,且是使用協定修訂版 2026-07-28 的 HTTP、stdio 或 claude.ai 連接器伺服器(
MCP_SDK_GENERATION=v1或MCP_PROTOCOL_NEGOTIATION=legacy會排除這種情況)。 - 工作階段屬於支援任務的類型:v2.1.304 或更新版本的終端機 CLI 工作階段、Agent SDK 工作階段與 GitHub Actions 執行;v2.1.331 或更新版本的 VS Code 擴充功能與本機桌面應用程式工作階段,且須是會擷取功能旗標的工作階段。
- 在關閉擷取功能旗標的情況下(Amazon Bedrock,或已關閉遙測),工作階段須為互動式終端機工作階段。文件將 v2.1.317 列為此情況的版本下限;版本說明將此變更列於 2.1.319 之下。
- 呼叫來自主對話,或來自主對話所啟動的非 fork subagent(須在會擷取功能旗標的互動式終端機工作階段中,且為 v2.1.331 或更新版本)。定義在 subagent 自身檔案中的伺服器不符合資格。
- 工作階段為互動式,或是 Agent SDK 工作階段或讀取
--input-format stream-json的claude -p執行(搭配CLAUDE_AUTO_BACKGROUND_TASKS=1)。單次的claude -p "<prompt>"執行不會取得 MCP 任務。
CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND=1 會讓 Claude 在呼叫內等待結果(2 分鐘的自動移至背景仍然適用),CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS=0 效果相同,而 CLAUDE_CODE_DISABLE_MCP_TASKS=1 則會關閉任務。283284
來自 MCP 伺服器的 skills(公開測試版,v2.1.332)。 實作 MCP Skills extension 的伺服器,可以在工具之外一併提供 skills:claude.ai 連接器、您新增的伺服器,以及來自 plugins 的伺服器都符合資格。skill 的名稱為 <server>:<skill>,因此您命名為 docs 的伺服器上的 pdf skill,會以 /docs:pdf report.pdf 執行;連接器與 plugin 伺服器會加上前綴,例如 claude_ai_Docs:pdf。在 auto mode 下,分類器會在不讀取 MCP skill 的情況下,決定 Claude 是否可以載入它;在 Manual 或 acceptEdits 模式下,您會看到提示,而 Allow this version(允許此版本)會略過提示,直到伺服器變更該 skill 的檔案為止。規則使用 Skill 工具名稱:在 deny 中加入 Skill(mcp__docs__*) 會封鎖某個伺服器的 skills(包括手動輸入的指令),放在 ask 中則每次都會詢問。版本說明於 2.1.332 新增此功能,而 MCP 文件將 v2.1.331 列為版本下限。527533
依賴此功能前,請先確認其限制。MCP skills 對 Pro、Max 與 Ultra 登入為開啟,在 Team 與 Enterprise 上則為關閉,直到組織將其開啟。它們需要 Fable 模型,或 Opus 4.8、Sonnet 5、Haiku 5.5 或更新的模型,並須直接連線至 Anthropic 且開啟擷取功能旗標;在雲端工作階段、claude -p、GitHub Actions、Agent SDK 中,或透過雲端供應商或自訂 ANTHROPIC_BASE_URL 時都無法使用。Anthropic 會掃描在 claude.ai 上新增的第三方 Directory 連接器所提供的 skills,以及 Enterprise 組織維持掃描開啟時的自訂連接器所提供的 skills;它不會掃描來自其他伺服器的 skills,包括以 claude mcp add 新增的 Directory 伺服器。文件的警告適用於此:「Skills 可以指示 Claude 執行程式碼。伺服器隨時可以變更 skills。請只新增您信任的伺服器。」在受管裝置上,disableDirectMcpSkills: true 會關閉來自連接器以外伺服器的 skills。533
常用MCP伺服器
| 伺服器 | 用途 | 主要功能 |
|---|---|---|
| GitHub | 儲存庫管理 | PR、議題、CI/CD、程式碼審查 |
| PostgreSQL | 資料庫存取 | 查詢、結構檢視、資料分析 |
| Sentry | 錯誤監控 | 錯誤查詢、堆疊追蹤、部署關聯分析 |
| Linear | 專案管理 | 議題、專案、衝刺 |
| Jira/Atlassian | 企業專案管理 | 工單、看板、工作流程 |
| Playwright | 網頁自動化 | E2E測試、無障礙樹 |
| Stripe | 付款 | 交易查詢、客戶資料 |
| Cloudflare | 基礎架構 | DNS、workers、分析 |
| Supabase | 後端即服務 | 資料庫、驗證、儲存 |
| Context7 | 文件 | 即時、對應特定版本的程式庫文件 |
| Figma Dev Mode | 設計轉程式碼 | 圖層階層、自動版面配置、設計token。Figma於2026年2月透過原生整合合作,深化與Claude Code的整合。34106 |
| Sequential Thinking | 問題解決 | 透過結構化思考流程進行動態、反思式的問題解決323 |
| Magic UI | 元件 | React + Tailwind行銷元件 |
MCP實用模式
GitHub工作流程:
> Review PR #456
> List all open issues assigned to me
> Create a bug issue for the authentication failure we found
資料庫查詢:
> What's our total revenue this quarter?
> Show the schema for the users table
> Find customers with no purchases in 90 days
錯誤監控:
> What errors occurred in production today?
> Show the stack trace for error ABC123
> Which deployment introduced these errors?
企業MCP設定
系統管理員可透過兩種方式控管 MCP。324
固定的伺服器組合(managed-mcp.json)。 此檔案使用與專案 .mcp.json 相同的格式。部署它即取得獨佔控制:每位使用者都會取得這些伺服器,且無法新增其他伺服器。空的伺服器對應表會封鎖 MCP,但在獨佔控制下仍會載入的少數伺服器除外。
{
"mcpServers": {
"github": { "type": "http", "url": "https://api.githubcopilot.com/mcp/" }
}
}
位置:
- macOS: /Library/Application Support/ClaudeCode/managed-mcp.json
- Linux 與 WSL:/etc/claude-code/managed-mcp.json
- Windows: C:\Program Files\ClaudeCode\managed-mcp.json
允許清單與拒絕清單(受管設定)。 allowedMcpServers 與 deniedMcpServers 是受管設定的鍵。請在 managed-settings.json 或伺服器管理設定中設定它們,而不是在 managed-mcp.json 中:
{
"allowedMcpServers": [
{ "serverUrl": "https://api.githubcopilot.com/*" },
{ "serverCommand": ["npx", "-y", "@modelcontextprotocol/server-filesystem"] }
],
"deniedMcpServers": [
{ "serverUrl": "https://*.untrusted.example.com/*" }
],
"allowManagedMcpServersOnly": true
}
allowManagedMcpServersOnly: true 會讓允許清單具有最終效力;若未設定,來自各個設定範圍的允許清單會合併,使用者因此可以在自己的設定中擴大您的允許清單。請以 serverUrl 或 serverCommand 進行比對:serverName 項目比對的是使用者自行取的標籤,因此並非安全控制。拒絕清單優先。serverCommand 必須完全相符,包括引數順序。
managedMcpServers:受管設定可提供伺服器(v2.1.259)。 除了篩選使用者自行設定的伺服器,受管設定的 managedMcpServers 鍵還能將 HTTP/SSE MCP 伺服器提供給每位使用者,項目格式與 .mcp.json 相同。指定要執行指令的項目會被略過:受管佈建僅涵蓋遠端伺服器。與 managed-mcp.json 不同,它不會取得獨佔控制:每位使用者都會取得您列出的伺服器,並保留自己的伺服器。208324
allowedMcpServers 不會篩選 managed-mcp.json(v2.1.259+)。 允許清單不適用於 managed-mcp.json 中的伺服器,但有一個例外:在 env 以外(於其指令、引數、URL 或標頭中)使用 ${VAR} 展開的受管伺服器會受到檢查;自 v2.1.305 起,只在 env 中使用 ${VAR} 的受管伺服器則不受檢查。因此,原本只靠允許清單擋下的受管伺服器會載入,且不會有任何提示或通知,除非適用上述例外。若要持續擋下,請新增 deniedMcpServers 項目:拒絕清單同樣適用於受管伺服器。208425
無法讀取 managed-mcp.json 時失敗即關閉(v2.1.271): 企業的 managed-mcp.json 若無法讀取或解析,仍會保有對 MCP 的獨佔控制(使用者、專案及 plugins 的伺服器不會載入),並在啟動時發出警告,與受管設定採用相同的失敗即關閉做法。213
MCP Apps(2026年1月)
Anthropic推出了MCP Apps,這項模型上下文協定擴充功能可直接在Claude介面中呈現互動式工具UI。69MCP Apps讓使用者無須離開Claude,即可檢視、編輯外部服務的內容並與之互動,支援的服務包括Asana、Box、Canva、Figma、Hex、monday.com及Slack。任何MCP伺服器都能提供在Claude內呈現的互動式UI。雖然MCP Apps目前出現在claude.ai網頁介面中,但隨著伺服器採用新的互動功能,其底層MCP協定擴充也與Claude Code的MCP生態系息息相關。
API 平台:程式碼執行工具 v2(2025年9月)
Anthropic 於2025年9月2日推出 程式碼執行工具 v2 beta 版,以 Bash 指令執行與直接檔案操作,取代原本僅支援 Python 的工具。70 主要變更: - 在沙箱容器中執行 Bash 指令,而不只是 Python426 - 以其他語言撰寫程式碼70 - 程式化工具呼叫(於2025年11月24日以 beta 版推出):Claude 可在程式碼執行過程中呼叫工具,降低多工具工作流程的延遲與 token 用量426
自2026年2月17日起,程式碼執行工具與程式化工具呼叫都不再需要 beta 標頭。426
v2工具主要影響API使用者,但也顯示了Claude Code雲端執行能力的發展方向。
參考資料
-
Claude Code CHANGELOG,0.2.32 新增了「Interactive MCP setup wizard」(執行
claude mcp add「to add MCP servers with a step-by-step interface」);0.2.108:「Deprecated MCP wizard interface in favor of other MCP commands」。如今claude mcp add需要名稱與目標:透過 MCP 將 Claude Code 連接至工具,Claude Code 文件,擷取於2026年11月10日,列出遠端伺服器使用claude mcp add --transport http <name> <url>,本機伺服器使用claude mcp add [options] <name> -- <command> [args...]。 ↩ -
Claude Code 的遠端 MCP 支援,Claude,2025年6月18日,擷取於2026年11月11日:「Claude Code 也原生支援遠端 MCP 伺服器的 OAuth,確保與您現有帳號的連線安全。」 ↩
-
Builder.io,擷取於2026年11月11日:Figma 的「官方 Dev Mode MCP 伺服器會公開您在 Figma 中所選圖層的即時結構」,文章將其列為階層、自動版面配置、變體、文字樣式與 token 參照。 ↩
-
Claude Code just got updated with one of the most-requested user features,Carl Franzen,VentureBeat,2026年1月15日,於 Internet Archive 2026年1月19日的存檔中讀取,引述 Boris Cherny:「每位 Claude Code 使用者都獲得了多得多的上下文、更好的指示遵循能力,以及接入更多工具的能力。」該文章重述的準確率數字出自 Anthropic 本身,來源為在 Claude Developer Platform 上推出進階工具使用,2025年11月24日,擷取於2026年11月11日:「啟用 Tool Search Tool 後,Opus 4 從 49% 提升至 74%,Opus 4.5 從 79.5% 提升至 88.1%。」;「這代表 token 用量減少 85%,同時仍可使用完整的工具庫。」Anthropic 自己的採用數字見於捐贈 Model Context Protocol 並成立 Agentic AI Foundation,2025年12月9日,同次擷取:「超過 10,000 個活躍的公開 MCP 伺服器」與「Python 與 TypeScript 合計每月 SDK 下載量 97M+」。 ↩
-
Claude expands tool connections using MCP,Help Net Security,2026年1月27日,擷取於2026年11月11日:「Anthropic 已為其 Claude AI 平台新增互動式工具支援」;「Claude 的互動式工具支援使用名為 MCP Apps 的 MCP 擴充功能。」;「使用者無須離開 Claude 視窗,即可檢視、編輯並操作來自 Asana、Box、Canva、Figma、Hex、monday.com、Slack 等服務的內容。」 ↩
-
Claude Platform 版本說明,2025年9月2日的條目,擷取於2026年11月11日:「launched v2 of the Code Execution Tool in beta, replacing the original Python-only tool with Bash command execution and direct file manipulation capabilities, including writing code in other languages」。 ↩↩
-
Claude Code GitHub CHANGELOG。v2.1.45(2月17日):支援 Sonnet 4.6、
spinnerTipsOverride設定、SDKRateLimitInfo/SDKRateLimitEvent型別、修正 Agent Teams 在 Bedrock/Vertex/Foundry 上的問題、修正 sandbox 暫存檔問題。v2.1.46(2月18日):Claude Code 中的 claude.ai MCP 連接器、修正 macOS 上的孤兒程序問題。v2.1.47(2月18日):Ctrl+F可終止背景 agents、Stop/SubagentStop hooks 中的last_assistant_message、chat:newline快速鍵、statusline 的added_dirs欄位、/rename可設定終端機分頁標題、resume 選擇器顯示 50 個 session、啟動速度提升約 500ms、記憶體改進、修正 CJK 對齊、修正 plan mode 壓縮、修正 Edit 工具 Unicode 問題、多項 Windows 修正。 ↩ -
GitHub Releases。v2.1.63(2月28日):內建的
/simplify與/batch斜線指令、worktree 共用的專案設定與自動記憶、ENABLE_CLAUDEAI_MCP_SERVERS=false停用選項、HTTP hooks 的type: http處理器、/copy的「一律複製完整回應」選項、VSCode 工作階段重新命名/移除、/clear重設 skill 快取、多項記憶體洩漏修正、REPL bridge 競態條件修正。2026年2月28日。 ↩ -
CNBC。「Figma 與 Anthropic 合作推出整合 Claude Code 的 AI 功能。」2026年2月17日。 ↩
-
GitHub Releases。v2.1.76:MCP elicitation 支援:MCP 伺服器可在任務進行中透過互動式對話框(表單欄位或瀏覽器 URL)請求結構化輸入。新增 Elicitation 與 ElicitationResult hooks。
-n/--nameCLI 旗標可設定工作階段顯示名稱。worktree.sparsePaths支援 monorepo 的 git sparse-checkout。PostCompact hook。/effort斜線指令。工作階段品質問卷(feedbackSurveyRate)。錯誤修正:延遲載入工具在壓縮後遺失輸入 schema、計畫模式重新核准、語音模式按鍵、自動壓縮斷路器(最多 3 次嘗試)、透過 SSH 在 tmux 中複製到剪貼簿、Remote Control 工作階段穩定性。2026年3月14日。 ↩ -
GitHub Releases v2.1.91。v2.1.91:MCP
_meta["anthropic/maxResultSizeChars"]上限達 500K、disableSkillShellExecution設定、外掛bin/可執行檔、多行深層連結提示、Edit 工具更短的old_string錨點、改良的/claude-apiskill、逐字稿鏈中斷修正。2026年4月2日。 ↩ -
Claude Code版本說明,為v2.1.121(2026年4月28日,00:31 UTC)與v2.1.122(2026年4月28日,22:05 UTC)的綜合參考。v2.1.121:
alwaysLoadMCP伺服器設定選項(略過工具搜尋延遲載入);MCP啟動時自動重試3次;claude plugin prune與--prune連鎖清理;/skills支援輸入即篩選;PostToolUse的hookSpecificOutput.updatedToolOutput從僅限MCP擴展至所有工具;.claude/skills/、.claude/agents/、.claude/commands/不再觸發--dangerously-skip-permissions提示;Vertex AI以X.509憑證為基礎的Workload Identity Federation(mTLS ADC);SDKmcp_authenticateredirectUri;OTel在LLM請求span中新增stop_reason、gen_ai.response.finish_reasons與user_system_prompt(須透過OTEL_LOG_USER_PROMPTS啟用);/terminal-setup啟用iTerm2剪貼簿存取,讓/copy可在tmux中使用;分頁標題遵循language設定;CLAUDE_CODE_FORK_SUBAGENT=1擴展至非互動式的claude -p;升級後啟動更快(版本說明啟動畫面移除了Recent Activity面板);claude.ai連接器針對相同上游URL去除重複。v2.1.122:ANTHROPIC_BEDROCK_SERVICE_TIER環境變數(default/flex/priority)以X-Amzn-Bedrock-Service-Tier傳送;/resume可依PR URL搜尋,涵蓋GitHub、GHE、GitLab、Bitbucket;/mcp顯示隱藏的連接器並附上移除重複項的提示,同時釐清瀏覽器授權後的未授權訊息;OTel新增claude_code.at_mention記錄事件,用於@提及的解析;api_request/api_error的數值屬性以數字輸出(先前為字串)。兩個版本中的重要修正:/usage約2GB的記憶體洩漏、圖片密集工作階段的RSS成長達數GB、--resume略過損毀的逐字稿行並修正大型外部建置工作階段當機、CWD被刪除或移動時的Bash復原、Bedrock在application inference profile上的thinking修正、Vertex/Bedrock在結構化輸出時對output_config額外輸入的拒絕、ToolSearch遺漏工作階段開始後才連線的非阻塞MCP工具、較新模型的圖片縮放上限由2576改為2000 px、bash模式中的!exit/!quit不再終止CLI、tmux/GNOME/Windows Terminal/Konsole上的回捲重複,以及格式錯誤的hooks項目不再使整個settings.json失效。 ↩↩↩ -
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 版本說明 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.265 版本資訊,發布於2026年9月8日 20:37 UTC,以及同日的正式 CHANGELOG(發布內文與 CHANGELOG 章節完全相同)。當日的 npm dist-tags:latest 與 next 皆為 2.1.265,stable 為 2.1.236;npm 已發布版本從 2.1.261 跳至 2.1.263 再到 2.1.265 – 2.1.262 與 2.1.264 從未發布(與 2.1.244/2.1.249/2.1.253-256 相同的模式)– 而 2.1.263(9月6日發布)僅載明 “Bug fixes and reliability improvements”。本註為下列內容的來源:
--plugin-dir指向含多個 plugins 的資料夾(”each child folder with a manifest loads, and children added or removed while running are picked up”);兩項提示快取前綴修正,原文:”Fixed resuming a foreground-spawned subagent changing its tool list and system prompt prefix, which broke prompt-cache reuse for that agent” 以及 “Fixed agent teammates and resumed subagents moving SubagentStart hook context and preloaded skills out of the prompt prefix on later turns, which broke prompt-cache reuse”;非互動式工作階段(搭配 stream-json 輸入的-p、Agent SDK、雲端工作階段)不再於每則新使用者訊息時重設 shell 工作目錄,因此cd可跨回合保留;設定為
http但僅支援舊版 HTTP+SSE 傳輸的 MCP 伺服器,現在會依 MCP 規範所述回退至 SSE;儲存至磁碟的工具結果設有 1 GB 上限,且對話內預覽會註明已儲存的檔案是否遭截斷;受管理設定中含forceLoginGatewayUrl的機器自啟動起即為 Claude apps gateway 工作階段,如同forceLoginMethod: "gateway",殘留的 claude.ai 登入或 API 金鑰不會被使用;Claude apps gateway 工作階段會將 OpenTelemetry 直接匯出至 gateway 受管理設定在OTEL_EXPORTER_OTLP_ENDPOINT中指定的收集器,而非透過 gateway 的中繼(未指定收集器的工作階段仍使用中繼),且 Claude Desktop 與 Cowork 透過 Claude apps gateway 傳送的遙測資料新增了user.email與user.groups,與終端機工作階段一致;雙鍵鍵盤快捷鍵會等待第二個按鍵 3 秒,逾時則顯示通知,先前若第二個按鍵在超過一秒後才到達(如在 tmux 內的情況)會默默取消;以及在提示中途輸入的斜線命令會以清單顯示相符項目(非全螢幕時以 Tab 開啟),而非僅顯示單一建議,且 plugin skill 可用其簡短名稱找到。 ↩ -
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.274(發布於 2026年9月17日 00:12 UTC,108 個項目)、v2.1.275(9月17日 22:33 UTC,96 個項目)與 v2.1.276(9月18日 02:12 UTC,一行),以及2026年9月17日的正式 CHANGELOG:三份版本說明內文與其 CHANGELOG 章節逐位元組相同。9月17日(約太平洋時間 22:08)的 npm dist-tags:latest 與 next 皆為 2.1.276,stable 為 2.1.267。以下項目的來源,引用處皆為原文:claude.ai 同步(”新增將您 claude.ai 帳號上啟用的 skills 與 plugins 同步至以該帳號登入的終端機工作階段;以
syncClaudeAiSkills: false或syncClaudeAiPlugins: false選擇停用”,v2.1.275);立即送出鍵(”新增立即送出鍵(ctrl+enter,或 ctrl+x ctrl+s),可中斷目前回合並一次送出所有排隊中的訊息;已送出與排隊中的訊息會以灰色顯示,直到模型接收為止”,v2.1.275);/plugin install <plugin> --marketplace <source>(”會在安裝 plugin 前主動提議加入該 marketplace”,v2.1.275);npm plugin 來源強化(”變更從 npm 來源安裝的 plugins,改以npm pack --ignore-scripts取得並驗證完整性,因此套件的安裝指令碼不再執行”,v2.1.275);同步帳號 skills 的 Write/Edit 結果(”現在會說明變更未儲存至您的帳號,以及如何儲存”,v2.1.275);分頁圖示變更(”變更 Artifact 工具,首次發布時改為要求一個單字的分頁圖示,而非 emoji favicon”,v2.1.275);CLAUDE_CODE_MCP_STARTUP_WAIT_MS(”用於限制第一個非互動式回合等待 MCP 伺服器連線的時間(0= 不等待)”,v2.1.274);MCP 用戶端預設值(”變更 Bedrock、Vertex、Foundry 與停用遙測的安裝,預設改用 v2 MCP 用戶端,並與直接 HTTP 伺服器採用 MCP 2026-07-28 協商,與其他安裝一致(選擇停用:MCP_SDK_GENERATION=v1或MCP_PROTOCOL_NEGOTIATION=legacy)”,v2.1.274);舊版 HTTP+SSE 4xx 修正(”修正了設定為http且僅支援舊版 HTTP+SSE 的 MCP 伺服器,在以 422 或其他 4xx 錯誤回應第一個請求時無法連線的問題”,v2.1.274);"type": "sdk"略過(”變更.mcp.json、設定、plugins 與 agent 檔案中的"type": "sdk"MCP 項目,改為略過並顯示警告:只有 SDK 宿主應用程式才能註冊行程內伺服器”,v2.1.274);命名變更(”變更/status的 GitHub 行文字為 "Cloud sessions",並將/web-setup、/ultrareview與 teleport 訊息改為顯示 "cloud session" 而非 "Claude Code on the web"“,v2.1.274);artifact 監看(”變更本機工作階段中的 artifact 監看:在其他地方發布的新版本不再啟動回合;Claude 會從之後的 Artifact 工具結果得知”,v2.1.274);以及 v2.1.276 的回歸修正(”修正了當ANTHROPIC_BASE_URL指向 proxy 或閘道時,每個請求都以400 … Input tag 'advisor_20260301'失敗的問題(2.1.275 回歸)”)。 ↩↩ -
Claude Code v2.1.280 版本說明(npm 發布於 2026年9月22日 15:44 UTC;GitHub release 為 16:38 UTC),以及2026年9月22日與9月23日的正式 CHANGELOG。本指南中所有 v2.1.280 項目的來源。9月23日的 npm dist-tags:latest 與 next 為 2.1.280,stable 為 2.1.267;2.1.279 從未發布。關鍵引文:”新增 Claude Opus 5.5(
claude-opus-5-5),現為預設的 Opus 模型”,並具備 “1M context、每 Mtok $4/$20,快取讀取每 Mtok $0.20”;”將 Pro 與 Team Standard 方案的預設模型從 Sonnet 改為 Opus,與 Max、Team Premium 和 Enterprise 一致”;”修正了當安全檢查未給出答案時,auto 模式不停歇地反覆拒絕動作的問題;重試現在會退避,連續十次後回合會停止並顯示訊息”。 ↩ -
Claude Code 文件,擷取於2026年9月23日:模型設定、Fast mode、記憶、權限模式、Auto mode 分類器請求費用與MCP。以下內容的資料來源:依內容判定的備援機制(「biology-flagged requests re-run on Opus 5, and cybersecurity-flagged requests re-run on Opus 4.8」,適用於 Fable 5.1、Fable 5 與 Opus 5.5);effort 預設值(Opus 5.5 為
medium,頂層的effortLevel無法影響它);「You can’t turn thinking off on Opus 5.5 or the Fable models」;Opus 4.8 及之後版本在 Bedrock、Agent Platform 與 Foundry 上的 200K 視窗,以及 Foundry 的opus解析為 Opus 4.6;fast mode 的模型支援,以及自 v2.1.280 起 Opus 5.5 成為 fast mode 預設;AGENTS.md 差異表格、首次工作階段的注意事項,以及 v2.1.280 之前/memory與/context不會列出直接讀取的AGENTS.md這項說明;內建起始模式表格(Pro、Max 與 Team 為 auto;Enterprise、Console API 金鑰與第三方供應商為 Manual);伺服器端檢查清單,其中包含 Claude Platform on AWS;以及 Tool Search 在工作階段開始時僅載入工具名稱與伺服器指示。 ↩ -
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.292 章節,於 2026年10月6日擷取。本指南中所有 v2.1.292 項目的來源。重點引述:「Added
CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MSenvironment variable to set a longer base delay for the backoff when retrying an overloaded (529) request」;「Added aneffortparameter to the Agent tool」;「Added--marketplace <source>toclaude plugin install」;「Changed local (stdio) MCP server connections to negotiate protocol version 2026-07-28 by default on every install, including Bedrock, Vertex and Foundry;MCP_PROTOCOL_NEGOTIATION=legacyopts out」;「Security: Fixed PreToolUse hook approvals and auto mode bypassing the permission prompt for file reads from network (UNC) paths」;「Changed agent names to allow at most 256 characters」。 ↩↩ -
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.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的正式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.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 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」。 ↩↩ -
Anthropic 文件,擷取於2026年11月10日。Claude Fable 5.2 模型總覽:「2026年11月9日發布」;「上下文視窗:1M token · 最大輸出:128K token · 輸入定價:$8 / MTok · 輸出定價:$40 / MTok」;定價表格(5 分鐘快取寫入 $10、1 小時快取寫入 $16、快取讀取 $0.20);「預設 effort |
high」;「可靠知識截止日期 | 2026年6月」;「需要 30 天的資料保留,除非經 Anthropic 明確授權,否則無法在 Zero Data Retention 下使用」;Mythos 5.2「與 Claude Fable 5.2 共用相同的規格與定價」。定價:Fable 5.2 這一列($8 / $10 / $16 / $0.20 / $40)、Fable 5.1 這一列($10 / $12.50 / $20 / $0.25 / $50)、「Claude Fable 5.2、Claude Mythos 5.2、Claude Fable 5.1 與 Claude Mythos 5.1 的快取命中與重新整理按基礎輸入價格的 0.025 倍計價」、快速模式表格(「Claude Fable 5.2 | $16 USD / MTok | $80 USD / MTok」),以及「Claude Fable 5.2 的快速模式也可在 Claude Models on Google Cloud 上使用」。推出 Claude Fable 5.2 與 Claude Mythos 5.2。模型設定:「
best| 使用與opus相同的模型」(Wayback Machine 於11月2日、6日與9日對同一頁面的存檔寫的是「在可使用 Fable 的環境中,使用fable別名所解析的模型」);「fable別名在 Claude apps gateway 工作階段中解析為 Fable 5,在其他所有環境中解析為 Fable 5.2」;「在任何方案或供應商上,都沒有任何 Fable 模型是帳號類型的預設模型」;「在 Pro、Max、Ultra、Team 與 Enterprise 方案上,儲存在使用者設定中的claude-fable-5-1模型會改為fable別名」;「Fable 5.2 需要 Claude Code v2.1.321 或更新版本」;「Fable 5.2、Opus 5.5、Sonnet 5.5 與 Haiku 5.5 預設為medium,Opus 4.7 則預設為xhigh」。快速模式:「Claude Fable 5.2 與 Claude Opus 5.5 的快速模式已可使用。Claude Opus 5 與 Claude Opus 4.8 的快速模式處於研究預覽階段」;「Fable 5.2 為 $16/$80,Opus 5.5 為 $8/$40,Opus 5 與 Opus 4.8 為 $10/$50」;「Fable 5.2 上的快速模式需要 Claude Code v2.1.321 或更新版本」;「在 Fable 5.2 上,只有在您使用 Fable 5.2 時開啟的快速模式才會保留」;Agent Platform 章節(「需要 Claude Code v2.1.322 或更新版本」、「export VERTEX_REGION_CLAUDE_FABLE_5_2=global」、「Fast mode needs Vertex region global, us or eu」(快速模式需要 Vertex 區域為 global、us 或 eu)、「Using standard speed on Fable 5.2 · fast mode wasn’t available」(以標準速度使用 Fable 5.2 · 無法使用快速模式))。所有設定:「permissions.denyInsteadOfPrompting… 需要 Claude Code v2.1.319 或更新版本」;「範圍:使用者或受管,以及--settings。儲存庫無法替您設定此項」;「denyInsteadOfPrompting還會阻止哪些操作」清單。環境變數:
CLAUDE_CODE_DISABLE_FEATURE_FLAGS(「需要 Claude Code v2.1.319 或更新版本 … 舊名稱DISABLE_GROWTHBOOK仍可使用,而且 v2.1.124 至 v2.1.318 只會讀取這個名稱」)、CLAUDE_CODE_DISABLE_MCP_TASK_BACKGROUND(「需要 Claude Code v2.1.304 或更新版本」)。MCP:「MCP 任務在 Claude Code CLI 中處於公開測試階段,需要 Claude Code v2.1.304 或更新版本」;「呼叫要成為 MCP 任務需要什麼」清單;「單次的claude -p "<prompt>"執行不會取得 MCP 任務」。費用:「訂閱方案定價(Pro、Max、Ultra、Team、Enterprise)」;claude.com/pricing:「Free、Pro、Max、Ultra、Team 與 Enterprise 等方案層級」。使用 advisor 工具升級困難決策,依主模型列出可接受的 advisor:「Haiku 4.5 | Fable、Opus、Sonnet、Haiku 5.5」、「Sonnet 4.6 | Fable、Opus、Sonnet、Haiku 5.5」、「Opus 4.6 | Fable、Opus、Sonnet 5 或更新版本、Haiku 5.5」、「Sonnet 5 或 Haiku 5.5 | Fable、Opus 4.7 或更新版本、Sonnet 5 或更新版本、Haiku 5.5」、「Opus 4.7 或 Opus 4.8 | Fable、Opus 4.7 或更新版本、Sonnet 5.5」、「Sonnet 5.5 | Fable、Opus 5 或更新版本、Sonnet 5.5」、「Opus 5 或 Opus 5.5 | Fable、Opus 5 或更新版本」、「Fable 5 | Fable 5.2、Fable 5.1 或 Fable 5」、「Fable 5.1 | Fable 5.2 或 Fable 5.1」、「Fable 5.2 | Fable 5.2」;「Fable 5.2 需要 Claude Code v2.1.321 或更新版本,Fable 5.1 則需要 v2.1.257 或更新版本」。 ↩↩ -
Anthropic,在 Claude Developer Platform 上推出進階工具使用,2025年11月24日,擷取於2026年11月10日:「這代表 token 用量減少 85%,同時仍可使用完整的工具庫」以及「啟用 Tool Search Tool 後,Opus 4 從 49% 提升至 74%,Opus 4.5 從 79.5% 提升至 88.1%。」Anthropic,捐贈 Model Context Protocol 並成立 Agentic AI Foundation,2025年12月9日,同次擷取:「目前已有超過 10,000 個活躍的公開 MCP 伺服器」以及「Python 與 TypeScript 合計每月 SDK 下載量 97M+。」 ↩↩
-
MCP server,Linear 文件,擷取於2026年11月10日:
claude mcp add --transport http linear-server https://mcp.linear.app/mcp,接著是「開啟 Claude Code 工作階段後,執行一次 /mcp 以完成驗證流程」;「位於 https://mcp.linear.app/sse 的 SSE 端點是已棄用的備援機制,供不支援 Streamable HTTP 的用戶端使用。」 ↩ -
透過 MCP 將 Claude Code 連接至工具,Claude Code 文件,擷取於2026年11月10日。工具搜尋:「工具搜尋預設啟用:MCP 工具會延遲載入,並按需探索」;「使用
ENABLE_TOOL_SEARCH環境變數控制工具搜尋的行為」,其auto值為「門檻模式。原本會延遲載入的工具,在其定義合計低於上下文視窗的 10% 時會預先載入」;在 Google Cloud 的 Agent Platform 上,「Claude Opus 4.5、Sonnet 4.5、Haiku 4.5 及之後的模型:工具搜尋預設開啟」,較早的模型則會預先載入所有工具,且「ENABLE_TOOL_SEARCH=true無法覆寫此行為」;「託管於 Azure 的 Microsoft Foundry 部署不支援工具搜尋」。描述長度上限:「Claude Code 會將該數字同時用於兩個上限」,而部分由 Anthropic 託管的伺服器所提供的文字會「完整送達 Claude,設定此變數也不會將其截斷」。新增伺服器:claude mcp add --transport http <name> <url>、claude mcp add-json,以及「claude mcp add --transport旗標不接受ws」;WebSocket 伺服器的設定方式為「在.mcp.json中或使用claude mcp add-json」,且「驗證僅能透過標頭進行」。資料庫範例:claude mcp add --transport stdio db -- npx -y @bytebase/dbhub --dsn "postgresql://readonly:pass@prod.db.com:5432/analytics",並附「請使用唯讀的資料庫使用者」。變數展開適用於「伺服器的command、args、env、url或headers值」。同日驗證:在 Claude Code 2.1.322 上不帶引數執行claude mcp add,會印出「error: missing required argument ‘name’」(錯誤:缺少必要引數 ‘name’);npm registry 中有@bytebase/dbhub1.6.1,沒有名為@anthropic-ai/mcp-server-postgres的套件,並將@modelcontextprotocol/server-postgres標示為已棄用(「Archived and unmaintained」(已封存且不再維護))。 ↩↩↩↩↩↩↩↩↩ -
Sequential Thinking MCP Server,modelcontextprotocol/servers 儲存庫中的 README,擷取於2026年11月10日:「此 MCP 伺服器實作提供一項工具,透過結構化思考流程進行動態、反思式的問題解決。」 ↩
-
為您的組織控管 MCP 伺服器存取,Claude Code 文件,擷取於2026年11月10日:
managed-mcp.json「使用與專案.mcp.json檔案相同的格式」,位於/Library/Application Support/ClaudeCode/managed-mcp.json(macOS)、/etc/claude-code/managed-mcp.json(Linux 與 WSL)以及C:\Program Files\ClaudeCode\managed-mcp.json(Windows);「若要讓允許清單具有權威性,請在受管設定來源中同時設定allowedMcpServers與allowManagedMcpServersOnly: true」;「serverName項目無論位於哪一份清單,都不是安全控制措施」;「指令必須完全相符。每個引數都須依序相符。」;提供伺服器的模式:「每位使用者都會取得您列出的遠端伺服器,並保留自己的伺服器」。 ↩↩ -
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.」 ↩
-
透過 MCP 將 Claude Code 連接至工具,Claude Code 文件,「MCP 輸出上限與警告」一節,擷取於2026年11月11日:「成功且不含圖片內容的結果超過 token 上限時,Claude Code 會將其儲存到檔案,並在對話中以一則標明檔案路徑的訊息取代它」;「成功且不含圖片內容的結果一旦超過 50,000 個字元,無論其 token 數為何,Claude Code 都會將其儲存到檔案。設定
MAX_MCP_OUTPUT_TOKENS不會改變這個門檻」。「為特定工具提高上限」一節:「方法是在該工具的tools/list回應項目中設定_meta["anthropic/maxResultSizeChars"]。Claude Code 會將該工具的門檻提高到所標註的值,硬性上限為 500,000 個字元。」;「對文字內容而言,此標註的作用與MAX_MCP_OUTPUT_TOKENS互相獨立」;「回傳圖片資料的工具仍受 token 上限約束。」CHANGELOG,同次擷取,2.1.2:「Changed large tool outputs to be persisted to disk instead of truncated, providing full output access via file references」。 ↩↩ -
為您的組織控管 MCP 伺服器存取,Claude Code 文件,擷取於2026年11月11日:「
managed-mcp.json中的伺服器不需要allowedMcpServers項目,只有一個例外:伺服器在env以外使用${VAR}展開時,Claude Code 會依允許清單檢查該伺服器。在 v2.1.305 之前,只在env中使用${VAR}展開的伺服器也會受到檢查;而在 v2.1.259 之前,只要設定了允許清單,每個受管伺服器都會受到檢查。」;「在指令、引數、URL 或標頭中使用${VAR}展開的managed-mcp.json伺服器仍會受到檢查。」;「deniedMcpServers也適用於受管伺服器,因此符合某個項目的受管伺服器不會載入。」;「這些伺服器會在每位使用者首次啟動不檢查它們的版本時開始載入,不會有任何提示或通知」。 ↩ -
Claude Platform 版本說明,擷取於2026年11月11日。2025年11月24日的條目:「launched programmatic tool calling in beta, allowing Claude to call tools from within code execution to reduce latency and token usage in multi-tool workflows」。2026年2月17日的條目:「The web search tool and programmatic tool calling are available with no beta header required.」;「The code execution tool, web fetch tool, tool search tool, tool use examples, and memory tool no longer require a beta header.」程式碼執行工具,Claude API 文件,同次擷取:「所有操作都在安全的沙箱容器中執行。」;「
code_execution_20250825支援 Bash 指令與檔案操作。」;「三個工具版本都不需要anthropic-beta標頭。」 ↩↩↩ -
透過 MCP 將 Claude Code 連接至工具,Claude Code 文件,擷取於2026年11月11日。SSE:「SSE(Server-Sent Events)傳輸方式已棄用。請在可行時改用 HTTP 伺服器。」;該頁面的兩個範例為
claude mcp add --transport sse asana https://mcp.asana.com/sse,以及帶有標頭的claude mcp add --transport sse private-api https://api.company.com/sse後接--header "X-API-Key: your-key-here"。自動移至背景:「主對話中的 MCP 工具呼叫若在兩分鐘後仍在執行,就會移至背景任務,而不會阻塞工作階段。」;「有些呼叫永遠不會移至背景」;「來自 subagents 的呼叫,雲端中的 MCP 任務除外」;「對 IDE 伺服器的呼叫」;「非互動模式中的呼叫,除非CLAUDE_AUTO_BACKGROUND_TASKS設為1,因為單次執行可能在結果送達前就已結束」。2026年11月25日,該範例中的 Asana 端點回傳 HTTP 410(「Asana MCP v1 has been permanently shut down」(Asana MCP v1 已永久停止服務)),因此本指南的 SSE 範例改用預留位置 URL;永遠不會移至背景的呼叫清單,則依今日的頁面引用於 553。2026年11月25日重新讀取;措辭已有變動的引文,改以當日的措辭呈現。 ↩ -
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」。 ↩↩↩ -
透過 MCP 將 Claude Code 連接至工具與環境變數,Claude Code 文件,擷取於2026年11月25日。MCP skills:「MCP skills 目前為公開測試版,需要 Claude Code v2.1.331 或更新版本。」;「skill 的名稱為
<server>:<skill>。」;「在 auto mode(預設)中,Claude 載入 MCP skill 時您不會看到提示。由分類器決定是否載入該 skill,且不會讀取其內容。」;「在 Pro、Max 或 Ultra 方案上以/login登入時,MCP skills 為開啟。在 Team 或 Enterprise 方案上以/login登入時,則在您的組織開啟之前維持關閉。」;「Anthropic 不會掃描來自其他連接器或伺服器的 skills,包括以claude mcp add新增的 Directory 伺服器。」;「Skills 可以指示 Claude 執行程式碼。伺服器隨時可以變更 skills。請只新增您信任的伺服器。」關於add-json:「若要以管線傳入 JSON,請在其位置傳入-:cat server.json | claude mcp add-json <name> -。請在 Claude Code 工作階段之外執行此指令。需要 Claude Code v2.1.327 或更新版本。」環境變數,MCP_SDK_GENERATION:「固定此程序用來連接 MCP 伺服器的 MCP 用戶端執行環境:v1,建構於 MCP TypeScript SDK 1.x;或v2」。 ↩↩↩↩ -
Claude Code 文件,擷取於2026年11月25日。透過 MCP 將 Claude Code 連接至工具,「首次連線失敗」:「當 HTTP 或 SSE 伺服器的首次連線因暫時性錯誤(例如 5xx 回應、連線遭拒或逾時)而失敗時,Claude Code 最多會重試三次。若連線仍然失敗,Claude Code 會將該伺服器標記為失敗。」;「這些重試不適用於下列情況」:「stdio 伺服器的首次連線」、「WebSocket 伺服器的首次連線」,以及「驗證錯誤或找不到資源的錯誤,因為這類錯誤需要變更設定才能解決。」設定 auto mode:「在 Pro、Max、Ultra 或 Team 方案上,您需要 v2.1.228 或更新版本,在原生 Windows 上則需要 v2.1.233 或更新版本。在 Enterprise 方案上或使用 Claude Console API 金鑰時,您需要 v2.1.283 或更新版本。」;「遙測關閉、第三方供應商或 Claude apps gateway:在 v2.1.304 之前,此指令在未擷取功能旗標的工作階段中無法使用。」 ↩
-
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 使用者。」 ↩↩