Problem
When a subagent (Task tool) finishes and claims success, there is currently no structural verification that it actually produced the artifacts it promised. We rely on prompt discipline — the <epistemic-honesty> block in CLAUDE.md, the verify-fix skill, the verification-before-completion superpower — but prompts are advisory, not enforceable. A subagent can return "done, all tests pass" without having written the file, run the test, or produced the artifact.
This is the single most-cited failure mode in our own rules. We should fix it at the harness level, not via more prompt discipline.
What to build
A SubagentStop hook that intercepts subagent completion, parses the subagent's claimed deliverables out of its final message, and verifies they exist before letting the parent treat the task as complete. If verification fails, the hook either:
- blocks the stop and forces the subagent to actually produce the artifact, OR
- surfaces the discrepancy to the parent agent with a structured "unverified claim" payload.
Implementation strategy is open — the worker should research current SubagentStop hook capabilities in Claude Code (see https://docs.claude.com/en/docs/claude-code/hooks) and decide which approach the hook lifecycle actually supports.
Reference
oh-my-claudecode (https://github.com/yeachan-heo/oh-my-claudecode) implements a `verify-deliverables` SubagentStop hook. Worth reading their implementation to understand how they parse claimed artifacts and what validation they run. Don't copy verbatim — their stack and ours differ — but their lifecycle pattern is the prior art.
Their broader pattern is interesting: they shift discipline that we currently enforce via prompts into hook lifecycle interceptors. We should think about whether other prompt-enforced rules (e.g. "never claim a fix without running tests") have a similar harness-level home.
Open questions for the implementer
- How does the hook know what was "promised"? Parse the subagent's final message? Require subagents to emit a structured deliverables list? Read the parent's Task prompt?
- What's the failure mode when verification fails — block, warn, or annotate?
- Should this be opt-in (per-skill, per-task) or always-on?
- Where does it live in our plugin layout (`plugins/core/hooks/`)?
- How do we test it without a real Claude Code session?
Success criteria
- A subagent that lies about completing work cannot have that lie reach the parent unchallenged.
- Our existing skills (`do-issue`, `autotask`, `ship`, etc.) all benefit automatically without per-skill changes.
- The hook is documented and installable as part of the plugin.
Out of scope
- Verifying correctness of artifacts (that's what `verify-fix` and tests are for). This issue is about existence — did the subagent actually do the thing it said it did.
Problem
When a subagent (Task tool) finishes and claims success, there is currently no structural verification that it actually produced the artifacts it promised. We rely on prompt discipline — the
<epistemic-honesty>block in CLAUDE.md, theverify-fixskill, theverification-before-completionsuperpower — but prompts are advisory, not enforceable. A subagent can return "done, all tests pass" without having written the file, run the test, or produced the artifact.This is the single most-cited failure mode in our own rules. We should fix it at the harness level, not via more prompt discipline.
What to build
A
SubagentStophook that intercepts subagent completion, parses the subagent's claimed deliverables out of its final message, and verifies they exist before letting the parent treat the task as complete. If verification fails, the hook either:Implementation strategy is open — the worker should research current SubagentStop hook capabilities in Claude Code (see https://docs.claude.com/en/docs/claude-code/hooks) and decide which approach the hook lifecycle actually supports.
Reference
oh-my-claudecode (https://github.com/yeachan-heo/oh-my-claudecode) implements a `verify-deliverables` SubagentStop hook. Worth reading their implementation to understand how they parse claimed artifacts and what validation they run. Don't copy verbatim — their stack and ours differ — but their lifecycle pattern is the prior art.
Their broader pattern is interesting: they shift discipline that we currently enforce via prompts into hook lifecycle interceptors. We should think about whether other prompt-enforced rules (e.g. "never claim a fix without running tests") have a similar harness-level home.
Open questions for the implementer
Success criteria
Out of scope