Summary

A technical guide to harness engineering for coding agents, covering three actionable optimizations: keeping .md config files lean (human-written outperforms LLM-generated by ~20% per ETH research), using the R.P.I. (Research-Plan-Implement) prompt framework, and leveraging subagents with parallel fan-out or pipeline patterns. The article frames harnesses as the “while(have next message) do {tool}” loop that makes LLM intelligence useful, distinguishing them from the model itself.

針對編碼代理 Harness 工程的技術指南,涵蓋三個可操作優化:精簡 .md 配置文件、R.P.I. 提示框架、子代理並行/管道模式。ETH 研究表明人工撰寫的系統提示比 LLM 生成的性能更好且節省約 20% 推理成本。

Key Points

  • Harness = manages stateless LLM via sessions/compression + handles tool calls, I/O, guardrails; distinct from model intelligence
  • “Instruction budget”: frontier LLMs can only reliably follow a few hundred instructions before entering the “dumb zone” — bloated CLAUDE.md causes hallucination
  • Progressive Disclosure: CLIs (—help discovery), Skills (name+description loaded at start; full SKILL.md only when relevant), MCP tools (Claude Code’s built-in search reduces context 85% vs loading all schemas upfront)
  • R.P.I. framework: Research (no action) → Plan (human-reviewed step-by-step) → Implement (new context window, use subagents for isolated subtasks)
  • Parallel fan-out: 3 candidate theories → 3 subagents investigate simultaneously → main agent synthesizes; faster + context isolation
  • Pipeline: sequential specialist roles (UX → architect → devil’s advocate) each adding perspective without polluting main context
  • Key advice: commit to one harness and iterate; switching loses institutional knowledge encoded in config files

Insights

The ETH finding that LLM-generated system prompts underperform human-written ones by ~20% while costing more is counterintuitive and under-cited. The mechanism is plausible: LLM-generated prompts tend toward verbose completeness, which fills instruction budget faster. The “Progressive Disclosure” principle as applied to MCP tools (Claude Code’s built-in search vs. OpenCode’s load-everything approach) explains a significant real-world performance difference between harnesses that aren’t obvious from documentation. The “commit to one harness” advice runs counter to the constant tool-switching culture but is grounded in a valid observation about institutional config knowledge.

Connections

Raw Excerpt

The best harness is the harness that you have customized and iterated on with human engineering; it’s the one that can handle edge cases which are smoothed out through your team’s usage.