Files
knowledge-base/6 - Zettelkasten/20260319120100 Hook驱动优于提示词驱动.md
Yaojia Wang 872401be72 vault: add ECC methodology deep-dive and zettelkasten insights
New resource note with 6 core methodologies, community best practices,
pitfalls, and practical examples. Three zettelkasten notes extract key
insights: hook vs prompt reliability, MCP context tradeoffs, and the
instinct learning system. Updated existing guides with cross-links.
2026-03-19 23:19:56 +01:00

983 B
Raw Blame History

created, type, tags, source
created type tags source
2026-03-19 12:01 zettel
claude-code
agent-reliability
automation
https://github.com/affaan-m/everything-claude-code

Hook 驱动优于提示词驱动

AI Agent 的行为控制有两种机制提示词Skill/Rule和 Hook。核心区别在于确定性

  • Hook: 触发率 100%,确定性执行,不依赖模型判断
  • 提示词: 触发率 50-80%,概率性,受上下文长度、模型注意力影响

因此,关键质量控制(格式化、安全检查、状态保存)应通过 Hook 实现,而非依赖提示词。提示词适合灵活的、需要判断力的任务Hook 适合必须每次都执行的不变量。

这解释了 ECC v2 为什么把学习观察从 Skill 迁移到了 Hook — v1 中观察经常遗漏v2 通过 PreToolUse/PostToolUse Hook 实现了 100% 捕获率。