Mingyu's Library主页
AI Daily · 2026-08-15 · 深度学习AI Daily · 2026-08-15 · Deep dive

编码 Agent 的澄清提问与歧义处理:该猜,还是该问?

Clarifying Questions and Ambiguity in Coding Agents: guess, or ask?

由《为什么 Opus 5 用起来更差?》(2026-08-14)引出,结合 Ambig-SWE、ClarEval、LHAW 三套研究与 Claude Code 官方文档整理。读完你会知道:Agent 为什么爱猜、怎么量化“问得好不好”、在 Claude Code 里该怎么设规则。

Prompted by “Why does Opus 5 feel worse to work with?” (2026-08-14), drawing on three studies (Ambig-SWE, ClarEval, LHAW) and the official Claude Code docs. You will learn why agents tend to guess, how “asking well” is measured, and how to set rules in Claude Code.

130 秒速览

1The 30-second version

一句话:当任务描述缺了关键信息时,编码 Agent 有两条路——自己猜一个最可能的意思接着干,或者停下来问你。基准测试通常只奖励“做对”,不奖励“问对”,于是越会刷分的模型越可能“大胆猜”;但真实工作里需求、约束、预算很少写全,猜错的代价由你来付。

In one sentence: when a task description is missing key information, a coding agent can either guess the most likely meaning and keep going or stop and ask you. Benchmarks usually reward “getting it right”, not “asking the right question”, so the better a model is at scoring, the more likely it is to guess boldly; but real requirements, constraints and budgets are rarely fully written down, and you pay for a wrong guess.

先说名词:歧义 / 欠规范(underspecification)指任务描述缺少完成它所需的信息;澄清提问(clarifying question)是 Agent 在动手前向人要这些信息;假设(assumption)是 Agent 没问、自己替你做的决定。

Quick vocabulary: ambiguity / underspecification means the task description lacks information needed to complete it; a clarifying question is the agent asking a person for that information before acting; an assumption is a decision the agent makes for you without asking.

收到任务检测缺口:目标 / 前提 / 术语这个缺口会改变结果,且事后难以回滚?无关键缺口→ 直接执行无歧义停下提问一次问全、给出选项做最小假设并在回复里写明是否执行 → 验证 → 汇报:做了哪些假设、还剩什么待定作者据 Ambig-SWE 三步框架与 LHAW“关键性/可恢复性”维度整理的示意,非论文原图
图 1 · 面对歧义的决策流程(作者整理的示意图)
Task arrivesDetect gaps:goal / premise / termWould this gap change the resultand be hard to undo later?No critical gap→ just executeno ambiguityStop and askall at once, with optionsMake a minimal assumptionand state it in the replyyesnoExecute → verify → report the assumptions made and what is still openAuthor’s sketch from Ambig-SWE’s three steps and LHAW’s criticality/recoverability dimensions; not a paper figure
Figure 1 · A decision flow for ambiguity (author’s sketch)
为什么值得读:2026-08-14 一篇《为什么 Opus 5 用起来更差?》在 Hacker News 引发近 800 条评论,把“能力更强却更难协作”的体感摆上台面。学术界其实已经有三套工具来量化这件事(Ambig-SWE、ClarEval、LHAW),本文把它们串起来,并落到你今天就能在 Claude Code 里用的做法。
Why read this: on 2026-08-14 an essay titled “Why does Opus 5 feel worse to work with?” drew nearly 800 Hacker News comments by naming the feeling that a more capable model can be harder to work with. Research already has three tools to quantify this (Ambig-SWE, ClarEval, LHAW). This piece connects them and turns them into practices you can use in Claude Code today.

2背景:一篇文章点燃的讨论

2Background: the essay that started it

作者 Mun logadan 在 2026-08-14 发文称,他和同事觉得 Opus 5 在日常使用中比 Opus 4.7、Opus 4.8 和 Fable “退了一步”,但他强调这不是能力退步——“它比 Opus 4.7 和 4.8 更强,在基准上甚至可比肩 Fable”。问题出在协作方式:

On 2026-08-14 Mun logadan wrote that he and his colleagues find Opus 5 a step back in day-to-day use compared with Opus 4.7, Opus 4.8 and Fable, while stressing this is not a capability regression: “it is a more capable model than Opus 4.7 and Opus 4.8 and even rivals Fable in benchmarks.” The problem is how it collaborates:

  • 意图不明时不停下来问;
  • 不核实假设,直接按猜测推进;
  • 会未经同意重新解读或改动用户的计划;
  • 因此需要“小心看护”(careful babysitting)。
  • It does not stop to ask when intent is unclear;
  • it does not verify assumptions and pushes ahead on guesses;
  • it reinterprets or changes the user’s plan without asking;
  • so it needs “careful babysitting”.

作者把原因归为两点,并自称“毫无根据的猜测”:一是行业追求能自我迭代的 AI;二是基准压力——好的基准往往“自成一体、无需提示或外部信息即可解”,按基准(包括可验证奖励的强化学习)选模型,会“天然选择那些在歧义面前做出大胆、通常正确的假设的模型”。他的反驳是:“现实生活不是基准”,在后果真实的场景里,“我不希望 Agent 拿它的最佳猜测去赌”。

The author offers two causes and calls them “baseless speculation”: the industry’s drive toward self-improving AI, and benchmark pressure. Good benchmarks tend to be self-contained and solvable without hints or outside information, so selecting models by benchmark (including RL with verifiable rewards) “inherently selects for models that make bold, usually-correct assumptions in the face of ambiguity.” His rebuttal: “Real life just isn’t a benchmark,” and when consequences are real, “I do not want an agent taking its best guess!”

据 Developers Digest 08-15 简报,HN 帖子约 873 分、794 条评论,讨论共识是“跑你自己的评测”。注意:原文没有给出具体对话记录或量化数据,属于用户体感;下文的研究也没有直接测 Opus 5,只说明这类行为可以被量化。

According to the Developers Digest brief of 08-15, the HN thread reached about 873 points and 794 comments, with the consensus “run your own evals”. Note that the essay gives no transcripts or measurements; it is a user impression. The research below also does not test Opus 5 directly; it shows that this behavior can be measured.

3核心概念

3Core concepts

欠规范(Underspecification)
任务描述缺少完成它所需的信息。它和“任务难”不同:难题信息齐全但不好解,欠规范是信息本身不在。
三类缺口(ClarEval 的分类)
目标缺失(要做成什么样没说)、前提缺失(技术前提或约束没说)、术语歧义(一个词可以有多种理解)。
四类信息片段(LHAW 的分类)
目标(goal)、约束(constraint)、输入(input)、上下文(context);每个片段再按关键性(缺了会不会影响结果)与可恢复性(Agent 能否自己从环境里找回)打分。
欠问 vs 过问
欠问:静默选一种理解就干,或幻想出不存在的约束(ClarEval 称“臆断式生成”);过问:问得太多、太碎,一轮一个问题,浪费人的注意力。
信息价值(Value of information)
一次提问换来的成功率提升。好的 Agent 不是问得越多越好,而是每个问题带来的提升高。
Underspecification
The task description lacks information needed to complete it. It differs from a hard task: a hard task has all the information but is difficult to solve; an underspecified one is missing the information itself.
Three kinds of gap (ClarEval’s taxonomy)
Missing goal (what the result should look like is not said), missing premise (a technical precondition or constraint is not said), ambiguous terminology (a word has several readings).
Four kinds of segment (LHAW’s taxonomy)
Goal, constraint, input and context; each segment is scored for criticality (does its absence change the outcome?) and recoverability (can the agent find it in the environment on its own?).
Under-asking vs over-asking
Under-asking: silently picking one reading and going ahead, or hallucinating constraints that do not exist (ClarEval calls it “assumptive generation”); over-asking: too many, fragmented questions, one per turn, wasting human attention.
Value of information
The gain in success that one question buys. A good agent is not the one that asks most but the one whose each question buys the most.

4研究证据:三套基准怎么量化“该不该问”

4The evidence: how three benchmarks measure “should it ask”

Ambig-SWE(CMU 等,arXiv 2502.13069,2025-02 首发,v3 于 2026-02):把 SWE-bench Verified 改成欠规范版本,分三步评估——能否察觉信息不足、能否提出有针对性的问题、能否利用回答。结论:模型很难区分“说清楚了”和“没说清楚”的指令;信息不全时倾向于做无依据的假设而非提问,导致结果变差、工具误用和算力浪费;而一旦真正交互,性能比不交互最高提升 74%。

Ambig-SWE (CMU and others, arXiv 2502.13069, first posted 2025-02, v3 in 2026-02) turns SWE-bench Verified into an underspecified variant and evaluates three steps: detecting missing information, asking targeted questions, and using the answers. Findings: models struggle to tell well-specified instructions from underspecified ones; with incomplete instructions they tend to make unwarranted assumptions instead of asking, leading to worse results, tool misuse and wasted compute; when they do interact, performance improves by up to 74% over non-interactive settings.

ClarEval(吉林大学,arXiv 2603.00187):在 HumanEval 与 LiveCodeBench 上注入三类歧义,共 750 题、2,250 个实例,测 11 个代码 Agent。用“关键问题覆盖率(KQC)”“平均澄清轮数(ATC)”等指标衡量“问得全不全、快不快”。

ClarEval (Jilin University, arXiv 2603.00187) injects three kinds of ambiguity into HumanEval and LiveCodeBench tasks, 750 problems and 2,250 instances, and tests 11 code agents. Metrics such as Key Question Coverage (KQC) and Average Turns to Clarify (ATC) measure how complete and how quick the clarification is.

最高 +74%交互 vs 不交互
Ambig-SWE
89.02% → 8.94%GPT-4o Pass@1
澄清后 vs 有歧义(ClarEval)
r = 0.32单轮与多轮澄清表现
相关性很弱(ClarEval)
285LHAW 验证过的
欠规范任务变体
up to +74%interactive vs not
Ambig-SWE
89.02% → 8.94%GPT-4o Pass@1
clarified vs ambiguous (ClarEval)
r = 0.32single-turn vs multi-turn
weak correlation (ClarEval)
285validated underspecified
task variants (LHAW)

ClarEval 的几个要点:术语歧义最难(GPT-4o 消融中 Pass@1 仅 6.71%);GPT5-Coder 单轮 KQC 0.867、多轮 MPR 0.951、ATC 最低 1.493;Qwen2.5-Coder ATC 2.396,约多用 60% 的轮次;Aider-GPT5 单轮 KQC 排第二,多轮却掉到第十。作者认为顶尖模型已基本能察觉歧义,难点转为高效、完整地问。论文部分表格标签有不一致之处,模拟用户靠关键词触发(作者称与 LLM 裁判一致率 96.5%)。

ClarEval highlights: ambiguous terminology is hardest (Pass@1 only 6.71% in the GPT-4o ablation); GPT5-Coder has single-turn KQC 0.867, multi-turn MPR 0.951 and the lowest ATC, 1.493; Qwen2.5-Coder has ATC 2.396, about 60% more turns; Aider-GPT5 ranks second on single-turn KQC but tenth multi-turn. The authors argue top models have largely solved detecting ambiguity; the hard part is now asking efficiently and completely. Some table labels in the paper are inconsistent, and the simulated user relies on keyword triggers (reported 96.5% agreement with an LLM judge).

LHAW(Scale Labs,2026-02-17):面向长时程任务,从 MCP-Atlas、TheAgentCompany、SWE-Bench Pro 中挑出关键信息片段,用删除、模糊化、泛化等方式造出 285 个验证过的欠规范变体。发现:澄清能找回相当一部分损失但不是全部;Claude Opus 4.5 与 Gemini 3 Pro 问得更少、每问收益更高,GPT-5.2 问得多得多、绝对收益更高但单问收益低;提问成本低时 Agent 问得多、进展高,成本高时问得少、承担更多失败风险;各模型差异最大的是问题质量、过度澄清和误读回答。

LHAW (Scale Labs, 2026-02-17) targets long-horizon tasks: it picks key information segments from MCP-Atlas, TheAgentCompany and SWE-Bench Pro and deletes, vaguifies or genericizes them to build 285 validated underspecified variants. Findings: clarification recovers much but not all of the lost performance; Claude Opus 4.5 and Gemini 3 Pro ask less often and gain more per question, while GPT-5.2 asks far more, gaining more in absolute terms but less per question; when asking is cheap, agents ask more and progress further; when it is expensive, they ask less and accept more risk of failure; models differ most in question quality, over-clarification and misreading answers.

可恢复性(事后改起来容不容易)→对结果的影响 →高影响 · 难恢复先问再做例:删数据、改公共 API、迁移高影响 · 易恢复先做一小步,尽早给人看例:新页面布局、函数拆分低影响 · 难恢复用保守默认,并明确标注例:依赖版本、配置默认值低影响 · 易恢复直接做,事后一句话汇报例:变量命名、日志措辞难易
图 2 · 按“影响 × 可恢复性”决定问还是猜(作者据 LHAW 维度整理的经验框架,非论文结论)
Recoverability (how easy to change later) →Impact on the result →High impact · hard to undoAsk before actinge.g. deleting data, public API, migrationsHigh impact · easy to undoTake a small step, show it earlye.g. a new page layout, splitting a functionLow impact · hard to undoUse a conservative default; flag ite.g. dependency versions, config defaultsLow impact · easy to undoJust do it; mention it afterwardse.g. variable names, log wordinghardeasy
Figure 2 · Ask or guess by impact × recoverability (author’s rule of thumb from LHAW’s dimensions, not a paper result)

5三套基准对比

5Comparing the three benchmarks

Ambig-SWEClarEvalLHAW
来源CMU 等,arXiv 2502.13069吉林大学,arXiv 2603.00187Scale Labs 博客,2026-02-17
任务真实仓库修 bug(SWE-bench Verified 改写)函数级编程(HumanEval / LiveCodeBench)长时程 Agent 任务(MCP-Atlas / TAC / SWE-Bench Pro)
怎么造歧义把问题描述改为欠规范版本注入三类歧义:目标 / 前提 / 术语按关键性与可恢复性挑片段,删除 / 模糊化 / 泛化
主要看什么察觉 → 提问 → 利用回答问得全(KQC)、问得快(ATC)信息价值、提问成本敏感性、过问 / 欠问
代表结论交互最高 +74%;模型倾向于假设而非提问察觉已基本解决,难在高效完整地问问得少而准的模型单问收益更高
Ambig-SWEClarEvalLHAW
SourceCMU and others, arXiv 2502.13069Jilin University, arXiv 2603.00187Scale Labs blog, 2026-02-17
TasksReal-repo bug fixing (rewritten SWE-bench Verified)Function-level coding (HumanEval / LiveCodeBench)Long-horizon agent tasks (MCP-Atlas / TAC / SWE-Bench Pro)
How ambiguity is madeIssue text rewritten as underspecifiedThree injected kinds: goal / premise / terminologySegments chosen by criticality and recoverability, then deleted / vaguified / genericized
What it measuresDetect → ask → use the answerCompleteness (KQC), speed (ATC)Value of information, sensitivity to asking cost, over- / under-asking
Headline findingUp to +74% with interaction; models assume rather than askDetection largely solved; asking efficiently and completely is hardModels that ask less but better gain more per question
可比性提示:三者任务、模型版本、模拟用户都不同,数字不能横向比较;测到的也都是 2025 至 2026 年初的模型,不能直接推出 Opus 5 或其他新模型的表现。
Comparability note: the three differ in tasks, model versions and simulated users, so their numbers cannot be compared across benchmarks; they also test models from 2025 to early 2026, so nothing follows directly about Opus 5 or other newer models.

6在 Claude Code 里怎么做

6What to do in Claude Code

Claude Code 本身提供了“问”的通道。官方工具文档(2026-10 检索)写明:AskUserQuestion 用于“收集需求或澄清歧义”的多选题,可选项之外还能通过 Other 行或备注框自由输入;问题默认一直等你回答。若设置 askUserQuestionTimeout(60s / 5m / 10m),超时后对话框会自动提交已选项,并告诉 Claude 你可能不在,让它按自己的判断继续,之后可再问;后台会话、读屏模式和 Remote Control 下计时器不启动;权限确认(包括计划审批)永远不会因空闲自动通过。

Claude Code already provides a channel for asking. The official tools reference (checked 2026-10) says AskUserQuestion asks multiple-choice questions “to gather requirements or clarify ambiguity”, and you can also type free text through the Other row or the notes field; questions stay open until you answer by default. If you set askUserQuestionTimeout (60s / 5m / 10m), an unanswered dialog closes on its own, submits any selected options and tells Claude you may be away, so it proceeds on its own judgment and can re-ask later; the timer never starts in background sessions, screen reader mode or Remote Control; permission prompts, including plan approval, never auto-resolve on idle.

以下是作者基于上述研究的建议做法,不是 Anthropic 官方指南:

The following are the author’s suggested practices based on the research above, not official Anthropic guidance:

  1. 把“何时必须问”写进 CLAUDE.md:按图 2 的“高影响 · 难恢复”象限列出具体情形(删数据、改公共接口、数据库迁移、动 CI/部署),要求先用 AskUserQuestion 一次问全。
  2. 其余情况要求“假设透明”:允许做最小假设,但在回复末尾列出“我做了哪些假设”,方便你一眼纠正——这对应 Ambig-SWE 指出的“无依据假设”风险。
  3. 大任务先进 Plan Mode:让计划先过你这关(计划审批不会因空闲自动通过),在动手前暴露它对目标、前提和术语的理解。
  4. 无人值守时别指望它问:CI、-p 无头模式、超时自动继续的场景里,把关键信息写进 prompt 或规格文件;能自动验证的(测试、类型检查)交给验证闭环。
  5. 用自己的任务评测:像 HN 共识说的,挑几条你团队里真实的“含糊需求”,看换模型或换提示后它是问、是猜、猜得对不对。
  1. Write “when you must ask” into CLAUDE.md: list concrete cases from the “high impact · hard to undo” quadrant of Figure 2 (deleting data, changing public interfaces, database migrations, touching CI/deploys) and require one complete round of AskUserQuestion first.
  2. Otherwise require “transparent assumptions”: minimal assumptions are fine, but the reply must end with “assumptions I made” so you can correct them at a glance, addressing the unwarranted-assumption risk Ambig-SWE describes.
  3. Start big tasks in Plan Mode: the plan has to get past you first (plan approval never auto-resolves on idle), exposing its reading of goals, premises and terms before any code is written.
  4. Don’t expect questions when nobody is there: in CI, -p headless mode or with auto-continue timeouts, put key information in the prompt or a spec file, and leave what can be checked automatically (tests, type checks) to a verification loop.
  5. Evaluate on your own tasks: as the HN consensus says, take a few genuinely vague requests from your team and see whether, after a model or prompt change, it asks or guesses, and whether its guesses are right.
## 澄清规则(CLAUDE.md 示例)
- 以下情形动手前必须用 AskUserQuestion 一次问全,给出 2-4 个选项:
  删除或迁移数据、修改公共 API / 数据库 schema、改 CI 或部署配置、需求里有两种以上合理理解。
- 其他情形可以做最小假设,但每次回复末尾列出「本次假设」与「待确认」。
- 不要在一轮里只问一个问题再等下一轮;相关问题合并提问。
- 不要擅自改动我给出的计划;需要改时先说明原因并征求同意。
## Clarification rules (CLAUDE.md example)
- Before any of the following, ask once with AskUserQuestion, offering 2-4 options:
  deleting or migrating data, changing a public API / database schema, changing CI or deploy config, or a request with two or more reasonable readings.
- Otherwise minimal assumptions are fine, but end every reply with "Assumptions made" and "Still to confirm".
- Don't ask one question per turn; group related questions together.
- Don't change a plan I gave you on your own; explain why and ask first.

7坑与未解问题

7Pitfalls and open questions

过问同样是失败:LHAW 与 ClarEval 都把“问太多、问太碎”记为问题。把规则写成“有任何不确定就问”,会让 Agent 变成每一步都要你点头的助手,失去自主执行的价值。规则要具体到情形,而不是情绪。
Over-asking is also a failure: both LHAW and ClarEval count “too many, too fragmented questions” as a problem. A rule like “ask whenever unsure” turns the agent into an assistant that needs your nod at every step and loses the value of autonomy. Rules should name situations, not moods.
超时自动继续 = 回到“猜”:设置了 askUserQuestionTimeout 后,无人回答时 Claude 会按自己的判断继续。对“高影响 · 难恢复”的操作,应靠权限规则或 hooks 兜底(它们不会因空闲自动通过),而不是只靠提问。
Auto-continue on timeout means back to guessing: with askUserQuestionTimeout set, Claude proceeds on its own judgment when nobody answers. For “high impact · hard to undo” operations, rely on permission rules or hooks as the backstop (they never auto-resolve on idle), not on questions alone.
证据边界:引发讨论的文章是个人体感,作者自称原因是猜测;三套基准测的是较早的模型;“基准选择导致敢猜”是一个合理但未被证实的假说。图 2 的四象限是作者的经验框架。
Limits of the evidence: the essay is a personal impression and its author calls the cause speculation; the three benchmarks test older models; “benchmark selection breeds bold guessing” is plausible but unproven. Figure 2’s quadrants are the author’s rule of thumb.

8资源与来源

8Resources and sources