Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add fanyty/claude-distill-book --skill agent-harness-engineeringgit clone --depth 1 https://github.com/fanyty/claude-distill-bookWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/fanyty/claude-distill-book/agent-harness-engineering)<a href="https://agentmods.dev/skills/fanyty/claude-distill-book/agent-harness-engineering"><img src="https://agentmods.dev/badge/skills/fanyty/claude-distill-book/agent-harness-engineering/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/fanyty/claude-distill-book/agent-harness-engineering"><img src="https://agentmods.dev/badge/skills/fanyty/claude-distill-book/agent-harness-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00105 | $0.02593 |
| Opus 5 | $0.00053 | $0.01296 |
| Sonnet 5 | $0.00021 | $0.00519 |
| Haiku 4.5 | $0.00011 | $0.00259 |
Grade A, and why
agent-harness-engineering scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Harness Engineering(Agent 执行框架工程)
概述
本文档蒸馏自 "Agent Harness Engineering: A Survey"(Li et al., 2026)综述论文。该论文 系统性梳理了 170+ 开源项目,提出 ETCLOVG 七层分类法,并论证了核心论点:对于长周期任务, 执行框架(Harness)而非模型本身是真实世界 Agent 可靠性的主要约束。
信源声明
- A 级(原书直接提取):90% — 论文原文的概念、分类、数据、案例
- B 级(论文引用的学术文献):5% — Liu et al.、Hong et al.、Packer et al. 等被引研究
- C 级(解读与组织):5% — 章节重组、表述精简、中文翻译
- D 级(模型补充知识):0%
- 编辑编译:部分(将分散在各节的内容按主题重组)
核心原则
1. 约束绑定论点(Binding-Constraint Thesis)
对于长周期任务,执行框架(Harness)而非模型本身是真实世界 Agent 可靠性的主要约束。
- 仅修改 Harness 层可在编码基准上获得高达 10 倍提升(Bölük, 2026a)
- Terminal-Bench 2.0 从 52.8% 提升到 66.5%(+13.7pp),完全通过基础设施变更(Trivedy, 2026)
- Meta-Harness 在 Terminal-Bench-2 达 76.4%,超越所有手工方法(Lee et al., 2026)
- 这些 Harness-only 增益超过相同基准上典型的模型驱动改进(2-4pp)
2. 三个工程阶段演化
| 阶段 | 时期 | 核心问题 | 工程范围 |
|---|---|---|---|
| Prompt Engineering | 2022–2024 | "输入是什么?" | 优化单个文本输入 |
| Context Engineering | 2025 | "模型每步应看到什么信息?" | 管理多个信息流 |
| Harness Engineering | 2026+ | "需要设计什么治理、约束、反馈环?" | 七层整体 |
后一阶段包含前一阶段:Harness 工程包含 Context 工程,Context 工程包含 Prompt 工程。
3. ETCLOVG 七层分类法
| 层 | 职责 | 开源覆盖 |
|---|---|---|
| E Execution & Sandbox | 在哪里执行、沙箱约束 | 密集 |
| T Tool Interface & Protocol | 工具描述、发现、调用 | 密集 |
| C Context & Memory Management | 短/中/长期记忆管理 | 中 |
| L Lifecycle & Orchestration | 控制流、单/多 Agent 编排 | 密集 |
| O Observability & Operations | 追踪、成本、可靠性信号 | 较薄 |
| V Verification & Evaluation | 评估、失败归因、回归反馈 | 密集 |
| G Governance & Security | 权限、身份、策略、审计 | 较薄 |
结构层(E/T/C/L)+ 控制层(O/V/G)。Observability 和 Governance 被提升为独立层, 而非生命周期钩子的副作用。
4. 沙箱的三重目的
- 安全性 — LLM 生成代码不可审计、自主执行、提示注入使传统沙箱不够
- 可复现性 — 快速重置执行状态到已知基线,对评估和训练至关重要
- 活跃性 — 定义边界,Agent 可在其中自由行动,将权限从"逐动作"转为"会话配置"
Anthropic 数据:引入沙箱后,Claude Code 的权限提示减少了 84%,同时保持安全性。 沙箱同时是笼子和许可证,许可证方面才是使自主长周期执行成为可能的原因。
5. 上下文管理的核心挑战
- 二次方注意力成本 — 上下文长度加倍,计算和内存成本翻四倍
- U 型注意力曲线 — 中间信息准确率比开头/结尾低 30%+(Liu et al., 2024)
- Context Rot — 200K 额定的模型在 50K 就可能明显下降(Hong et al., 2025)
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 181 lines · 105 tokens per session scan A d3fd8ea81a65
agent-harness-engineering is a skill published in the GitHub repository fanyty/claude-distill-book (5 stars, last pushed 2mo ago), licensed MIT. It adds 105 tokens to every session and 2,593 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
next-cache-components-adoption
Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…
insight-error-page
Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…
next-cache-components-optimizer
Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…
next-partial-prefetching-adoption
Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…