> Harness EngineeringHarness EngineeringHarness Engineering The engineering outside the model模型之外的工程模型之外的工程

A

Extension points cheat sheet擴充點速查表扩展点速查表

This appendix is a lookup table. When you wonder "where does this go, when does the agent see it, and can it be forced?", find the row here, then follow the link to the chapter that explains why.

這個附錄是一張查詢表。當你想問「這個東西放哪裡、agent 什麼時候看得到、能不能強制」,就在這裡找到那一列,再照連結去看解釋原因的章節。

这个附录是一张查找表。你想知道“这个东西放哪里、agent 什么时候能看到、能不能强制”,就在这里找到那一行,再顺着链接去看讲道理的那一章。

Read this first

Checked: 2026-10-27. I read the official docs of VS Code, Claude Code and Codex on that day. Names, folders, settings and preview labels change often, so this page will go stale. Trust the docs over this table, and check the date.

Two things to know before reading the rows.

  • VS Code now asks you to choose a harness first. The VS Code docs say the harness you pick (for example the Copilot harness or the Local harness) decides which formats and locations work: "Creating a file doesn't mean the selected harness can load or run it." Some rows below say "Local harness only" for this reason.
  • "Enforced" has one meaning here. A thing is enforced if the platform makes the agent obey it, so the model cannot choose otherwise. Almost every row is a request to the model. The exceptions are a hook that refuses a call, and a tool list that removes tools. Why this matters is the subject of A rule in a prompt is a request.

Where I could not confirm a counterpart on the official pages, the cell says "not confirmed". I did not guess.

A quick guide to the rows:

  • A rule for every task: always-on instructions.
  • A rule for some files: instructions by file.
  • A way of working the agent starts when it fits: a skill.
  • A different set of tools or a read-only helper: a custom agent.
  • Something that must be refused: a hook, or taking the tool away.

先讀這個

確認日期:2026-10-27。我在那一天讀了 VS Code、Claude Code 和 Codex 的官方文件。名稱、資料夾、設定和 Preview 標籤常常改,所以這一頁會過期。文件比這張表可信,也請看一下日期。

讀這些列之前,先知道兩件事。

  • VS Code 現在要你先選一個 harness。VS Code 文件說,你選的 harness(例如 Copilot harness 或 Local harness)決定哪些格式和位置行得通:「建立一個檔案,不代表選定的 harness 能載入或執行它。」下面有些列因此寫著「只有 Local harness」。
  • 這裡的「強制」只有一個意思。平台讓 agent 必須服從的東西,模型不能選擇不照做,才算強制。幾乎每一列都是對模型的請求。例外是拒絕呼叫的 hook,和移除工具的工具清單。為什麼這很重要,是 提示裡的規則只是請求 的主題。

官方頁面上我確認不了對應項目的地方,格子裡寫「未確認」。我沒有猜。

各列的快速指南:

  • 每個任務都適用的規則:永遠載入的指令。
  • 只對某些檔案適用的規則:依檔案的指令。
  • agent 在合適時啟動的做法:skill。
  • 不同的一組工具,或唯讀的幫手:custom agent。
  • 必須被拒絕的事:hook,或把工具拿掉。

先读这个

核对日期:2026-10-27。 那天我读了 VS Code、Claude Code 和 Codex 的官方文档。名称、文件夹、设置和预览版标签经常变,所以这一页会过期。以文档为准,不要以这张表为准,并看一下日期。

看各行之前,先知道两件事。

  • VS Code 现在要你先选一个 harness。 VS Code 文档说,你选的 harness(比如 Copilot harness 或本地 harness)决定哪些格式和位置有效:“创建了文件,不等于所选的 harness 能加载或运行它。”下面有几行写“仅限本地 harness”,就是这个原因。
  • 这里的“强制执行”只有一个意思。 平台让 agent 必须服从,模型没法选择不照做,才算强制执行。几乎每一行都只是对模型的请求。例外是拒绝调用的 hook,和把工具去掉的工具列表。为什么这很要紧,是提示里的规则只是请求这一章的主题。

在官方页面上确认不了对应功能的地方,格子里写“未确认”。我没有猜。

各行的简要指引:

  • 每个任务都适用的规则:始终开启的指令。
  • 只对某些文件适用的规则:按文件的指令。
  • 合适时由 agent 自己启动的做事方式:skill。
  • 一组不同的工具,或者一个只读的帮手:自定义 agent。
  • 必须拒绝的事:hook,或者把工具拿掉。

VS Code Copilot

Extension point What it is When it loads Enforced? Chapter
Instructions, always on .github/copilot-instructions.md and AGENTS.md at the repository root. CLAUDE.md is read by the Local harness only, when chat.useClaudeMdFile is on. Added to the agent's context automatically. Nested AGENTS.md files are experimental and off by default (Local harness). No. A request. The docs say applicable sources are additive, so do not rely on order to settle a conflict. Instructions and skills
Instructions, by file *.instructions.md in .github/instructions (Claude format: .claude/rules). Attached when the applyTo glob matches a file being changed, or loaded on demand when the description matches the task. No. A request. Instructions and skills
Prompt files *.prompt.md in .github/prompts (or your user profile). A saved prompt with optional agent, model and tools in its header. Only when you run it: type / and its name. Local harness sessions in the Chat view only. Not applied automatically. No. It is a prompt. Its tools list does take priority over the tool list of the agent it names. No chapter covers prompt files. Read the official docs of your tool.
Skills A folder with a SKILL.md, in .github/skills/, .claude/skills/ or .agents/skills/ (and the same under your home folder). Three levels: name and description first, the body when the request matches or you type /name, other files only when the body points to them. No. The model decides whether to use it. disable-model-invocation: true stops the model from starting it, which is a limit on who starts, not on what it does. Instructions and skills, Skills as workflows
Custom agents *.agent.md in .github/agents (Claude format: .claude/agents), with a header and a body of instructions. When you pick it in the Agent dropdown, or when another agent runs it as a subagent. In the Copilot harness its instructions are added to your custom instructions and win conflicts. The tools list is: the docs say "only those tools are available". The body, such as "do not do X", is a request. Custom agents, Use subagents sparingly
Hooks JSON files in .github/hooks/, or a hooks map in settings files. Events include sessionStart, userPromptSubmitted, preToolUse, postToolUse, subagentStart, subagentStop, agentStop. Run by the platform at those moments. In the Local harness chat.useHooks controls execution. Read when the window starts. Yes, for what it sees: preToolUse can return a deny with a reason. A timeout falls through to normal permissions. Labelled Preview in the docs. Hooks, Enforcement design
MCP servers Servers that add tools. Personal: ~/.copilot/mcp-config.json. Shared: .mcp.json at the project root (needs the experimental chat.mcp.workspaceRootConfig.enabled). Older: .vscode/mcp.json. Configured per user or workspace. The docs do not detail when a server starts; you review sign-in and tool approvals as they appear. No for what a server does. Your organization can restrict which servers are available. MCP servers
Tool sets and the tool list A tool picker in the chat (Copilot harness: Customizations editor, Tools tab; Local harness: Configure Tools). Type # to name a tool. A request can have at most 128 tools. Chosen per profile or per request. A tool that is not enabled cannot be called. But enabling a tool does not skip its approval. Tool calling, Custom agents
Settings VS Code settings that switch the above on or off, such as chat.useHooks, chat.useAgentsMdFile, chat.useClaudeMdFile, chat.includeApplyingInstructions, chat.useCustomizationsInParentRepositories. Read by VS Code. Copilot CLI and the Copilot app do not inherit editor settings, so the docs advise against relying on custom location settings. Settings are host configuration. Enterprise controls can switch hooks on or off, and the Claude and Codex harnesses are disabled when enterprise-managed Copilot settings apply. A minimal harness

A note on tool sets. The VS Code docs say user-defined tool sets (.jsonc files) are deprecated and not supported in the Copilot harness. For a reusable choice of tools they recommend a custom agent with a tools list. I treat tool sets as legacy.

VS Code Copilot

擴充點 它是什麼 什麼時候載入 強制? 章節
指令,永遠載入 倉庫根目錄的 .github/copilot-instructions.md 和 AGENTS.md。CLAUDE.md 只有 Local harness 讀,而且要開啟 chat.useClaudeMdFile。 自動加進 agent 的上下文。巢狀的 AGENTS.md 是實驗性的,預設關閉(Local harness)。 不強制。是請求。文件說適用的來源是疊加的,所以不要靠順序解決衝突。 指令與 skill:只載入需要的
指令,依檔案 .github/instructions 裡的 *.instructions.md(Claude 格式:.claude/rules)。 正在改的檔案符合 applyTo glob 時附上,或 description 符合任務時按需載入。 不強制。是請求。 指令與 skill:只載入需要的
Prompt 檔 .github/prompts(或你的使用者設定檔)裡的 *.prompt.md。一個存起來的 prompt,標頭可以選擇性地帶 agent、model 和 tools。 只有你執行它的時候:輸入 / 和它的名字。只在 Chat 檢視裡的 Local harness 會話。不會自動套用。 不強制。它是一個 prompt。它的 tools 清單,優先於它指名的 agent 的工具清單。 沒有章節涵蓋 prompt 檔。請讀你的工具的官方文件。
Skills 一個帶 SKILL.md 的資料夾,放在 .github/skills/、.claude/skills/ 或 .agents/skills/(你的家目錄下也一樣)。 三層:先是名稱和描述;請求符合或你輸入 /name 時載入內文;其他檔案只在內文指向它們時載入。 不強制。由模型決定要不要用。disable-model-invocation: true 讓模型不能啟動它,這限制的是誰來啟動,不是它做什麼。 指令與 skill:只載入需要的、把團隊的做法寫成 skill
Custom agent .github/agents(Claude 格式:.claude/agents)裡的 *.agent.md,有標頭和一段指令內文。 你在 Agent 下拉選單選它時,或別的 agent 把它當子 agent 執行時。在 Copilot harness 裡,它的指令加進你的自訂指令,衝突時以它為準。 tools 清單強制:文件說「只有那些工具可用」。內文,例如「不要做 X」,是請求。 Custom agent:固定模型和工具的角色、慎用子 agent
Hooks .github/hooks/ 裡的 JSON 檔,或設定檔裡的 hooks 對照表。事件包括 sessionStart、userPromptSubmitted、preToolUse、postToolUse、subagentStart、subagentStop、agentStop。 由平台在那些時刻執行。在 Local harness,chat.useHooks 控制是否執行。視窗啟動時讀。 強制,限於它看得到的:preToolUse 可以回傳附原因的拒絕。逾時會落到正常的權限檢查。文件標為 Preview。 Hooks:每次呼叫都會經過的執行點、把執行層當軟體來設計
MCP server 新增工具的 server。個人:~/.copilot/mcp-config.json。共用:專案根目錄的 .mcp.json(需要實驗性的 chat.mcp.workspaceRootConfig.enabled)。較舊的:.vscode/mcp.json。 依使用者或工作區設定。文件沒有詳細說明 server 何時啟動;登入和工具批准出現時,由你審查。 server 做什麼,不強制。你的組織可以限制哪些 server 可用。 MCP server:插工具的標準接口
工具組和工具清單 對話裡的工具挑選器(Copilot harness:Customizations 編輯器的 Tools 分頁;Local harness:Configure Tools)。輸入 # 來指名一個工具。一個請求最多可以有 128 個工具。 依設定檔或依請求選擇。 沒有啟用的工具不能呼叫。但啟用一個工具,不會跳過它的批准。 Tool calling,和給 agent 設計工具、Custom agent:固定模型和工具的角色
設定 開關以上各項的 VS Code 設定,例如 chat.useHooks、chat.useAgentsMdFile、chat.useClaudeMdFile、chat.includeApplyingInstructions、chat.useCustomizationsInParentRepositories。 由 VS Code 讀取。Copilot CLI 和 Copilot app 不繼承編輯器的設定,所以文件建議不要依賴自訂位置的設定。 設定是主機的設定。企業控制可以開關 hook,而企業管理的 Copilot 設定生效時,Claude 和 Codex harness 會被停用。 30 分鐘搭一個最小 harness

關於工具組的說明。VS Code 文件說,使用者定義的工具組(.jsonc 檔)已棄用,Copilot harness 不支援。想要可重複使用的工具選擇,它們建議用帶 tools 清單的 custom agent。我把工具組當成舊的東西。

VS Code Copilot

扩展点 是什么 什么时候加载 强制执行吗? 章节
指令,始终开启 仓库根目录的 .github/copilot-instructions.md 和 AGENTS.md。CLAUDE.md 只有本地 harness 会读,且要打开 chat.useClaudeMdFile。 自动加入 agent 的上下文。嵌套的 AGENTS.md 是实验功能,默认关闭(本地 harness)。 不。是请求。文档说适用的来源是叠加的,所以不要靠顺序来解决冲突。 指令与 skill:只加载需要的
指令,按文件 .github/instructions 里的 *.instructions.md(Claude 格式:.claude/rules)。 applyTo 通配符匹配到正在修改的文件时附上;或者 description 与任务匹配时按需加载。 不。是请求。 指令与 skill:只加载需要的
Prompt 文件 .github/prompts(或你的用户配置)里的 *.prompt.md。一个保存下来的 prompt,头部可以带可选的 agent、model 和 tools。 只在你运行它的时候:输入 / 和它的名字。只限聊天视图里的本地 harness 会话。不会自动应用。 不。它就是个 prompt。不过它的 tools 列表优先于它指定的 agent 的工具列表。 没有章节讲 prompt 文件。请读你所用工具的官方文档。
Skill 一个带 SKILL.md 的文件夹,放在 .github/skills/、.claude/skills/ 或 .agents/skills/(以及主目录下的同名位置)。 三层:先是名称和描述;请求匹配或你输入 /name 时加载正文;其他文件只在正文指到它们时才加载。 不。由模型决定用不用。disable-model-invocation: true 能阻止模型启动它,这限制的是谁来启动,不是它做什么。 指令与 skill:只加载需要的、把团队的做法写成 skill
自定义 agent .github/agents(Claude 格式:.claude/agents)里的 *.agent.md,有头部和一段指令正文。 你在 Agent 下拉框里选它的时候,或者另一个 agent 把它当子 agent 运行的时候。在 Copilot harness 里,它的指令会加到你的自定义指令上,冲突时它说了算。 tools 列表是强制的:文档说“只有这些工具可用”。正文,比如“不要做 X”,是请求。 自定义 agent:固定模型和工具的角色、慎用子 agent
Hook .github/hooks/ 里的 JSON 文件,或者设置文件里的 hooks 映射。事件包括 sessionStart、userPromptSubmitted、preToolUse、postToolUse、subagentStart、subagentStop、agentStop。 由平台在这些时刻运行。在本地 harness 里,chat.useHooks 控制是否执行。窗口启动时读取。 是,对它看得到的范围:preToolUse 可以返回拒绝并附上原因。超时则回到正常的权限流程。文档里标为预览版。 Hook:每次调用都会经过的执行点、把执行层当软件来设计
MCP server 增加工具的 server。个人的:~/.copilot/mcp-config.json。共享的:项目根目录的 .mcp.json(需要打开实验设置 chat.mcp.workspaceRootConfig.enabled)。较早的:.vscode/mcp.json。 按用户或工作区配置。文档没有细说 server 什么时候启动;登录和工具审批出现时,由你来审查。 对 server 做什么,不。你的组织可以限制哪些 server 可用。 MCP server:接工具的标准接口
工具集和工具列表 聊天里的工具选择器(Copilot harness:自定义编辑器的 Tools 标签页;本地 harness:Configure Tools)。输入 # 可以点名一个工具。一次请求最多可以有 128 个工具。 按配置档或按请求选择。 没启用的工具调用不了。但启用一个工具,并不会跳过它的审批。 Tool calling,以及怎么给 agent 设计工具、自定义 agent:固定模型和工具的角色
设置 打开或关闭上面各项的 VS Code 设置,比如 chat.useHooks、chat.useAgentsMdFile、chat.useClaudeMdFile、chat.includeApplyingInstructions、chat.useCustomizationsInParentRepositories。 由 VS Code 读取。Copilot CLI 和 Copilot 应用不继承编辑器的设置,所以文档建议不要依赖自定义位置的设置。 设置是宿主的配置。企业管控可以打开或关闭 hook;适用企业托管的 Copilot 设置时,Claude 和 Codex 的 harness 会被禁用。 30 分钟搭一个最小 harness

关于工具集的一点说明。VS Code 文档说,用户自定义的工具集(.jsonc 文件)已弃用,Copilot harness 不支持。想要一个可复用的工具选择,文档推荐用带 tools 列表的自定义 agent。我把工具集当作遗留功能。

The same points in Claude Code and Codex

Extension point Claude Code Codex
Instructions, always on CLAUDE.md (project, user, organization). It can also read a repository's AGENTS.md in place of CLAUDE.md. The docs call it "context, not enforced configuration". AGENTS.md per directory from the project root down to the current folder, and AGENTS.override.md where you need to replace one. Built once per run; combined size capped at project_doc_max_bytes (32 KiB by default).
Instructions, by file .claude/rules/* with a paths header. Nested AGENTS.md files closer to the work. A file-pattern header: not confirmed.
Prompt files .claude/commands/*.md still works, but commands have been merged into skills. A skill with the same name wins. Custom prompts in ~/.codex/prompts/ exist but are deprecated in favour of skills. Run as /prompts:name. Not shared through the repository.
Skills .claude/skills/<name>/SKILL.md (project), ~/.claude/skills/ (personal). Descriptions are always in context; the body loads when invoked. .agents/skills (repository, from the current folder up to the root), $HOME/.agents/skills, /etc/codex/skills. Same three-level loading. allow_implicit_invocation: false in agents/openai.yaml turns off model-started use.
Custom agents .claude/agents/*.md, with tools (an allowlist), disallowedTools and model. .codex/agents/*.toml (project) or ~/.codex/agents/, one agent per file, with name, description, developer_instructions and optional model settings. Subagents inherit the parent's sandbox, approval policy and MCP servers. A tool allowlist per agent: not confirmed.
Hooks hooks in .claude/settings.json, .claude/settings.local.json or ~/.claude/settings.json. Exit code 2, or a JSON permissionDecision of deny, blocks on PreToolUse. By default a hook that fails or times out does not block. hooks.json or [hooks] in config.toml, in ~/.codex/ or <repo>/.codex/. PreToolUse can deny. Project hooks load only for a trusted project and must be reviewed first. The docs call hooks a guardrail, not a complete enforcement boundary. What happens when a hook times out: not confirmed.
MCP servers .mcp.json in the project (shared), ~/.claude.json (local and user scopes). Project servers ask for approval in interactive sessions. [mcp_servers.<name>] in ~/.codex/config.toml, or .codex/config.toml for a trusted project. codex mcp add and codex mcp list.
Tool sets Not confirmed as a separate feature. The nearest I found is a subagent's tools allowlist. Not confirmed.
Settings settings.json (user, project, local, and managed policy). I checked it only for hooks. ~/.codex/config.toml and .codex/config.toml, with approval_policy and sandbox_mode. requirements.toml can restrict them on managed machines.

Claude Code 和 Codex 裡的同樣幾點

擴充點 Claude Code Codex
指令,永遠載入 CLAUDE.md(專案、使用者、組織)。它也可以讀倉庫的 AGENTS.md 來代替 CLAUDE.md。文件稱它為「上下文,不是強制的設定」。 從專案根目錄一路往下到目前資料夾,每個目錄的 AGENTS.md,以及需要取代某一個時用的 AGENTS.override.md。每次執行建一次;合併後的大小上限是 project_doc_max_bytes(預設 32 KiB)。
指令,依檔案 帶 paths 標頭的 .claude/rules/*。 更靠近工作的巢狀 AGENTS.md 檔。依檔案樣式的標頭:未確認。
Prompt 檔 .claude/commands/*.md 仍然行得通,但 command 已經合併進 skill。同名的 skill 優先。 ~/.codex/prompts/ 裡有自訂 prompt,但已棄用,改用 skill。以 /prompts:name 執行。不透過倉庫共用。
Skills .claude/skills/<name>/SKILL.md(專案)、~/.claude/skills/(個人)。描述永遠在上下文裡;內文在被呼叫時才載入。 .agents/skills(倉庫,從目前資料夾一路到根目錄)、$HOME/.agents/skills、/etc/codex/skills。同樣的三層載入。agents/openai.yaml 裡的 allow_implicit_invocation: false 會關掉模型啟動的使用。
Custom agent .claude/agents/*.md,有 tools(允許清單)、disallowedTools 和 model。 .codex/agents/*.toml(專案)或 ~/.codex/agents/,一個檔案一個 agent,有 name、description、developer_instructions 和選用的模型設定。子 agent 繼承父層的沙箱、批准政策和 MCP server。每個 agent 的工具允許清單:未確認。
Hooks .claude/settings.json、.claude/settings.local.json 或 ~/.claude/settings.json 裡的 hooks。結束碼 2,或 JSON 的 permissionDecision 為 deny,會在 PreToolUse 擋下。預設情況下,失敗或逾時的 hook 不會擋。 ~/.codex/ 或 <repo>/.codex/ 裡的 hooks.json,或 config.toml 裡的 [hooks]。PreToolUse 可以拒絕。專案的 hook 只在受信任的專案載入,而且必須先審查。文件稱 hook 是護欄,不是完整的強制邊界。hook 逾時會怎樣:未確認。
MCP server 專案裡的 .mcp.json(共用)、~/.claude.json(本機和使用者範圍)。專案的 server 在互動式會話裡要求批准。 ~/.codex/config.toml 裡的 [mcp_servers.<name>],或受信任專案的 .codex/config.toml。codex mcp add 和 codex mcp list。
工具組 未確認為獨立的功能。我找到最接近的,是子 agent 的 tools 允許清單。 未確認。
設定 settings.json(使用者、專案、本機,和受管理的政策)。我只對 hook 檢查過。 ~/.codex/config.toml 和 .codex/config.toml,有 approval_policy 和 sandbox_mode。requirements.toml 可以在受管理的機器上限制它們。

Claude Code 和 Codex 里的对应项

扩展点 Claude Code Codex
指令,始终开启 CLAUDE.md(项目、用户、组织)。也可以读仓库的 AGENTS.md 来代替 CLAUDE.md。文档称它是“上下文,不是强制执行的配置”。 从项目根目录到当前文件夹,每个目录一份 AGENTS.md;需要替换某一份时,用 AGENTS.override.md。每次运行构建一次;合并后的大小上限是 project_doc_max_bytes(默认 32 KiB)。
指令,按文件 带 paths 头部的 .claude/rules/*。 离工作更近的嵌套 AGENTS.md。文件模式的头部:未确认。
Prompt 文件 .claude/commands/*.md 仍然可用,但命令已经并入 skill。同名的 skill 优先。 ~/.codex/prompts/ 里有自定义 prompt,但已弃用,改用 skill。以 /prompts:name 运行。不通过仓库共享。
Skill .claude/skills/<name>/SKILL.md(项目)、~/.claude/skills/(个人)。描述始终在上下文里;正文在调用时加载。 .agents/skills(仓库,从当前文件夹一直到根目录)、$HOME/.agents/skills、/etc/codex/skills。同样的三层加载。agents/openai.yaml 里的 allow_implicit_invocation: false 会关闭由模型启动的用法。
自定义 agent .claude/agents/*.md,带 tools(允许名单)、disallowedTools 和 model。 .codex/agents/*.toml(项目)或 ~/.codex/agents/,每个文件一个 agent,有 name、description、developer_instructions 和可选的模型设置。子 agent 继承父级的沙箱、审批策略和 MCP server。每个 agent 单独的工具允许名单:未确认。
Hook .claude/settings.json、.claude/settings.local.json 或 ~/.claude/settings.json 里的 hooks。退出码 2,或者 JSON 里 permissionDecision 为 deny,会在 PreToolUse 上拦截。默认情况下,失败或超时的 hook 不会拦截。 ~/.codex/ 或 <repo>/.codex/ 里的 hooks.json,或 config.toml 里的 [hooks]。PreToolUse 可以拒绝。项目 hook 只在受信任的项目里加载,而且必须先审查。文档称 hook 是护栏,不是完整的强制边界。hook 超时会怎样:未确认。
MCP server 项目里的 .mcp.json(共享)、~/.claude.json(本地和用户范围)。项目里的 server 在交互会话中要先审批。 ~/.codex/config.toml 里的 [mcp_servers.<name>],或者受信任项目的 .codex/config.toml。codex mcp add 和 codex mcp list。
工具集 未确认有单独的这个功能。我找到的最接近的是子 agent 的 tools 允许名单。 未确认。
设置 settings.json(用户、项目、本地,以及托管策略)。我只查了 hook 相关的部分。 ~/.codex/config.toml 和 .codex/config.toml,有 approval_policy 和 sandbox_mode。在托管的机器上,requirements.toml 可以限制它们。

How to use this page

Two habits make this table useful.

  • Put a rule in the lightest point that is enough. Always-on instructions cost room every turn; a skill costs room only when used; a hook costs code. The order and the reasoning are in Context is a budget and A rule in a prompt is a request.
  • Check the harness before the file. If a file seems ignored, first ask whether the harness you selected can load that kind of file at all. Troubleshooting starts from symptoms.

The examples in this book come from one setup on the Copilot side. I have not run the Claude Code and Codex columns myself; they come from the vendors' docs on the date above.

怎麼用這一頁

兩個習慣讓這張表有用。

  • 把規則放在夠用的最輕的那一點。永遠載入的指令每一輪都占空間;skill 只在用到時占空間;hook 花的是程式碼。順序和推理在 上下文是一份預算 和 提示裡的規則只是請求。
  • 先查 harness,再查檔案。如果一個檔案好像被忽略,先問你選的 harness 到底能不能載入這種檔案。排錯 從症狀開始。

這本書的例子,都來自 Copilot 這一邊的一套設定。Claude Code 和 Codex 的欄位我自己沒有執行過;它們來自廠商在上面那個日期的文件。

怎么用这一页

两个习惯,会让这张表有用。

  • 规则放在够用的、最轻的那个点上。 始终开启的指令每一轮都占地方;skill 只在用到时占地方;hook 要花代码。顺序和道理见上下文是一份预算和提示里的规则只是请求。
  • 先查 harness,再查文件。 如果一个文件似乎被忽略了,先问一问你选的 harness 到底能不能加载这类文件。排错从症状出发。

本书的例子来自 Copilot 一侧的同一套配置。Claude Code 和 Codex 那两列我自己没有跑过;它们来自上面那个日期各厂商的文档。