一个猜测,回来时变成了事实
A guess that came back as a fact
一个假设(它自己的或子智能体的)进来时还标着“猜测”,出去时在总结里变成了“已验证的事实”,功能就建在它上面。
适用于: Claude Code · Cursor · Codex · Copilot agent
症状
没有出处却很确定的细节(“API 返回 ISO 日期”“这个接口没人用”),后来证明是错的,而代码依赖了它们。
为什么会这样
每经过一次总结,“可能”“大概”就丢一层。agent-failure-modes 把它分成 AFM-7 确定性走私(假设变成事实)和 AFM-5 信任洗白(子智能体的说法被当成已验证)。
示例
示意。
textSubagent: "Probably nothing calls /v1/legacy-export, couldn't find callers in src/."
Main agent summary: "Removed /v1/legacy-export (unused)."
Reality: the mobile app calls it.
复制即用的修复
按你用的智能体挑选文件。规则片段用英文写,放进任何仓库都能用。
规则
Claude Code:加入 CLAUDE.md
CLAUDE.md## Label what you verified vs. what you assume
- In plans and summaries, tag claims as **[verified: <command or file:line>]** or **[assumed]**.
- Never build on an [assumed] claim that would be expensive if wrong (deleting code, changing
data formats, removing endpoints). Verify it first or ask.
- Treat subagent output as [assumed] until you have checked the evidence yourself.
规则
Codex、Copilot 编码智能体等:加入 AGENTS.md
AGENTS.md## Label what you verified vs. what you assume
- In plans and summaries, tag claims as **[verified: <command or file:line>]** or **[assumed]**.
- Never build on an [assumed] claim that would be expensive if wrong (deleting code, changing
data formats, removing endpoints). Verify it first or ask.
- Treat subagent output as [assumed] until you have checked the evidence yourself.
Cursor 规则
Cursor:项目规则
.cursor/rules/assumption-smuggled-as-fact.mdc---
description: "AgentFails: A guess that came back as a fact"
alwaysApply: true
---
## Label what you verified vs. what you assume
- In plans and summaries, tag claims as **[verified: <command or file:line>]** or **[assumed]**.
- Never build on an [assumed] claim that would be expensive if wrong (deleting code, changing
data formats, removing endpoints). Verify it first or ask.
- Treat subagent output as [assumed] until you have checked the evidence yourself.
技能
全新上下文的审查技能(子智能体只看 diff,不看聊天记录)
沿用 Anthropic 代码审查文章里的做法:先验证,再让一个上下文干净的子智能体审 diff。命名为 review-diff,避免和内置或流行的 /code-review 技能重名。
.claude/skills/review-diff/SKILL.md---
name: review-diff
description: Review the current diff with fresh context before a PR. Use after /verify passes.
---
# Review the diff
Start a subagent that has NOT seen this conversation. Give it only:
- the original request (one paragraph, verbatim),
- the output of `git diff origin/main...HEAD`,
- the names of the test/build commands.
Ask it to report, with file:line for each finding:
1. **Wrong feature**: does the diff do what the request asked? Quote the request line each change serves.
2. **Bugs**: logic errors, missing edge cases (empty, null, boundary), unhandled errors,
unawaited promises, invented APIs or packages, swallowed exceptions.
3. **Overreach**: changes no request line needs (refactors, renames, formatting, dependency or
config edits, public API changes, weakened tests).
4. **Evidence gaps**: claims in the PR description that no command output supports.
Then fix real findings, or list them under "Known issues" in the PR. Do not argue with the reviewer
in the PR text; either fix or explain in one line.