MarkTechPost AI生成式AI

Claude Code 指南 2026:25 項功能實例與示範

2026年6月15日 01:04

重點摘要

Claude Code 最初是終端機中的編碼助手,如今已發展為分層代理系統。其底層將記憶體、鉤子、技能、子代理、外掛程式與 MCP 區分為不同層級,每個層級都能影響模型所能看見或執行的事項。本文涵蓋 25 項功能與擴展 Claude Code 的策略,專為 AI 工程師、軟體工程師與資料科學家撰寫。每段程式碼範例皆遵循明確格式且可直接執行,各項目並標示狀態,讓您清楚哪些功能已隨 Claude Code 出貨、哪些尚未提供。什麼是 Claude Code?Claude Code 是 Anthropic 的代理式編碼工具,可在終端機、桌面應用程式與 IDE 中使用,能讀取檔案、執行命令、編輯程式碼並呼叫外部工具。其底層運作著一個代理迴圈,該迴圈會…

站內 AI 整理稿

Claude Code started as a terminal coding assistant. It now runs as a layered agentic system. Underneath, Claude Code separates memory, hooks, skills, subagents, plugins, and MCP into distinct layers. Each layer changes what the model can see or do. This article covers 25 features and strategies for scaling Claude Code. It is written for AI engineers, software engineers, and data scientists. Every code example follows a documented format and runs as written. Each item is labeled by status, so you know what ships with Claude Code and what does not. What is Claude Code Claude Code is Anthropic’s agentic coding tool. It works in the terminal, the desktop app, and your IDE. It can read files, run commands, edit code, and call external tools. Under the hood, it runs an agentic loop. That loop chooses tools, accumulates context, and manages long sessions through compaction. Safety boundaries come from permission modes, checkpoints, sandboxing, and managed settings. The same loop is exposed programmatically through the Agent SDK. Developers extend the tool with a small set of primitives. Those primitives are CLAUDE.md, skills, subagents, slash commands, hooks, and MCP servers. Plugins bundle these primitives into one installable unit. The 25 Features and Strategies Each feature/strategy is labeled. ‘Official’ means documented Anthropic functionality. ‘Community technique’ means a workflow pattern, not a shipped feature. ‘Third-party tool’ means software built outside Anthropic. CLAUDE.md memory file (Official). This file is the agent’s constitution for your repository. Claude reads it every session to anchor conventions and commands. Skills (Official). A skill is a SKILL.md file with frontmatter under .claude/skills/<name>/. It supports /name invocation and autonomous invocation by Claude. Subagents (Official). Subagents are specialized instances with their own context windows. Verbose work stays isolated, so your main conversation stays focused. Slash commands (Official). These are typed shortcuts starting with /. Built-ins include /init, /compact, /context, /review, and /security-review. Hooks (Official). Hooks are deterministic scripts that fire at defined lifecycle points. PreToolUse is the primary security checkpoint before any tool runs. MCP servers (Official). Model Context Protocol connects Claude Code to GitHub, databases, and browsers. The server handles integration; Claude reasons about what to do. Plugins (Official). A plugin is a versioned bundle of skills, subagents, commands, hooks, and MCP definitions. One /plugin command installs the whole set. Checkpoints (Official). Claude Code snapshots state automatically before changes. Press Escape twice to rewind when something breaks. Plan mode (Official). Plan mode explores and proposes without executing. It is ideal for scoping work before committing edits. Permission modes (Official). Default mode asks before each file write and shell command. Other modes trade oversight for speed. Auto Mode (Official, research preview). A separate Sonnet 4.6 classifier reviews each action first. Safe actions proceed; risky ones get blocked or escalated. Context compaction (Official). /compact condenses long sessions to preserve usable context. /context reports current context usage. Background tasks (Official). Long shell commands run with the run_in_background flag on the Bash tool. Claude polls output without blocking the conversation. Agent SDK (Official). The SDK exposes the same loop programmatically through query(). You can send slash commands like /code-review and process results. Headless CLI (Official). claude -p "query" runs a one-shot process and exits. Piped input like cat logs.txt | claude -p also works. GitHub Action and scheduled jobs (Official). Claude Code runs as a one-shot process without a TTY. This enables CI integration, scheduled jobs, and pre-commit hooks. Output styles and statusLine (Official). Output styles change response formatting. A custom statusLine renderer surfaces session state in the terminal. Remote Control and mobile push (Official). You can drive Claude Code from mobile or web surfaces. Claude can send push notifications when tasks finish. Away summary (Official). This session-level feature surfaces context when you return to a paused session. It is enabled by default and can be opted out. Sandboxing (Official). The sandboxed Bash tool enforces OS-level filesystem and network isolation. Commands run without prompts inside boundaries you define. Structured context folders (Community technique). Organize task-specific folders for brand guidelines, client data, or legal terminology. The right context loads for each task, improving output relevance. Dynamic workflows (Community technique). Break complex tasks into smaller steps using sub-agents. Common patterns include ‘classify and act’ and ‘fan out and synthesize.’ Modular skill pipelines (Community technique). Chain reusable skills into end-to-end workflows. A support pipeline can combine categorization, response generation, and escalation skills. External memory layers (Third-party tool). Tools such as Mem Search or Hermes extend recall across long projects. They sit outside Claude Code’s built-in memory. Resilience techniques (Community technique). Practitioners reset and retry tasks when output quality degrades. This avoids context pollution and keeps results consistent. Try the Interactive Demo #mtp-cc-demo *{box-sizing:border-box!important;margin:0;padding:0} #mtp-cc-demo{ background:#111!important;color:#e6e6e6!important; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important; border:1px solid #2a2a2a!important;border-radius:14px!important; max-width:920px!important;margin:24px auto!important;overflow:hidden!important; line-height:1.5!important;font-size:15px!important; } #mtp-cc-demo .ccd-head{padding:22px 22px 16px!important;border-bottom:1px solid #1f1f1f!important;background:linear-gradient(180deg,#141414,#111)!important} #mtp-cc-demo .ccd-badge{display:inline-block;font-size:11px!important;letter-spacing:.14em;text-transform:uppercase;color:#76B900!important;border:1px solid #2f4d00;padding:3px 9px;border-radius:999px;margin-bottom:10px;font-weight:700} #mtp-cc-demo .ccd-title{font-size:21px!important;font-weight:800;color:#fff!important;letter-spacing:-.01em} #mtp-cc-demo .ccd-sub{font-size:13px!important;color:#9a9a9a!important;margin-top:5px} #mtp-cc-demo .ccd-tabs{display:flex;flex-wrap:wrap;gap:6px;padding:14px 18px 0!important;background:#0d0d0d!important;border-bottom:1px solid #1f1f1f!important} #mtp-cc-demo .ccd-tab{appearance:none;border:1px solid #242424!important;background:#161616!important;color:#bdbdbd!important; padding:9px 14px!important;border-radius:9px 9px 0 0!important;font-size:13px!important;font-weight:600;cursor:pointer;transition:all .15s} #mtp-cc-demo .ccd-tab:hover{color:#fff!important;border-color:#3a3a3a!important} #mtp-cc-demo .ccd-tab.on{background:#111!important;color:#76B900!important;border-color:#2f4d00!important;border-bottom-color:#111!important} #mtp-cc-demo .ccd-body{padding:20px 22px 24px!important;min-height:340px} #mtp-cc-demo .ccd-pane{display:none} #mtp-cc-demo .ccd-pane.on{display:block;animation:ccdfade .25s ease} @keyframes ccdfade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}} /* Filter chips */ #mtp-cc-demo .ccd-chips{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:16px} #mtp-cc-demo .ccd-chip{border:1px solid #242424!important;background:#161616!important;color:#b5b5b5!important; font-size:12px!important;font-weight:600;padding:6px 12px!important;border-radius:999px!important;cursor:pointer;transition:all .15s} #mtp-cc-demo .ccd-chip:hover{border-color:#3a3a3a!important;color:#fff!important} #mtp-cc-demo .ccd-chip.on{background:#76B900!important;color:#0a0a0a!important;border-color:#76B900!important} #mtp-cc-demo .ccd-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px} #mtp-cc-demo

Related

相關文章

鈦媒體生成式AI

Edge AI Daily 早報(6月19日)

AI Engineer World's Fair 2026規模再創新高,標誌AI工程從幕後走向舞臺中央。行業面臨結構性調整:楊立昆警示OpenAI年虧210億美元揭示商業模式脆弱性,Transformer之父轉投OpenAI反映人才爭奪白熱化。Anthropic多線佈局——語音支持七種語言、加入碳清除聯盟、落子首爾辦事處,展現生態擴張野心。監管壓力加劇,意大利依據DMA調查蘋果iCloud,巴西開放iOS側載佣金降至5%,蘋果圍牆花園持續崩塌。

2 小時前
智東西生成式AI

谷歌時隔6年再發智能音箱,Gemini上桌,售價不到700元

智東西 編譯 | 劉煜 編輯 | 陳駿達 智東西6月18日消息,谷歌昨日宣佈,其首款搭載居家版Gemini語音助手的智能音箱(Google Home Speaker)已開啟預售,將於當地時間6月25日正式上市,售價為99.99美元(約合人民幣677.03元)。在此之前,谷歌已有6年沒有推出過獨立智能音箱產品。 谷歌這款智能音箱外觀近似球形,風格類似亞馬遜新一代Echo音箱與蘋果舊款音箱HomePod Mini。 ▲谷歌智能音箱(圖源:谷歌官網) 使用音箱時,用戶只需通過口令“Hey Google”或“OK Google”喚醒Gemini,就可以繼續下達相應指令。這與谷歌舊款音箱、智能顯示屏等喚醒語音助手的方式相同。此外,用戶只要按照日常說話習慣下達命令,Gemini便能理解用戶意圖,相比之前大大提升溝通效率。 一、加強短時對話記憶,會員可與Gemini不限次數對話 谷歌此次推出的全新音箱升級諸多功能。其中,音箱搭載的Gemini語音助手擁有10款全新擬人化語音音色,用戶可以根據喜好自行選擇聲線。音箱還可支持用戶一次性下達多條語音指令,即使指令未能說對、說完整,用戶中途改口Gemini也能識別。 Gemini還具備多鏈路推理能力,落地到實際生活場景中比較實用。例如,用戶問:“我支持的足球隊下場比賽天氣如何?”Gemini收到指令後,會自動查詢賽事時間、舉辦地點,同時匹配相應時段天氣,再給出答覆。 同時,Gemini加強了短時對話記憶,能承接上下文實現連續對話功能。即使用戶連續追問、甚至串聯多項任務、不重複交代前置條件,該語音助手也能實現來回連貫交流。 ▲谷歌Gemini對話場景(圖源:谷歌官網) 不僅如此,Gemini搭配的連續對話功能,能讓應答後的音箱麥克風保持短暫收音,用戶無需重複喊“OK Google”就能繼續提問。該功能現已全面支持所有Gemini原生適配的語言,包括

22 小時前

微軟,考慮接入DeepSeek

這篇消息聚焦「微軟,考慮接入DeepSeek」。原始導語提到:Copilot Cowork轉為按量計費。 從 AI 情報角度來看,這類內容值得關注其背後的技術進展、產品落地、產業競爭與後續市場影響。

22 小時前