Failure Evidence Guard
A deterministic fail-open PostToolUseFailure observer that classifies a tool failure and adds a small corrective receipt without copying raw error or command content.
Runs on
Scope
$npx @youdede/toolkit add failure-evidence-guard --target claude-code
What it does
Normalize failed tool calls into bounded, non-sensitive evidence for the next model step.
When it fires
- implementation
- operations
- incident
How it behaves
Classify a failed tool call and inject a bounded, content-safe failure receipt.
It does not retry, repair, rerun, or reinterpret the failed operation.
It does not copy raw commands, tool inputs, stack traces, or error text into added context.
It does not claim that a failure category establishes the root cause.
It does not block the session when evidence cannot be normalized.
Configuration
targets/claude-code/failure-evidence-guard.mjs
- Version
- 1.0.0
- Requires
- node
- Licence
- RiskThis observer normalizes failed tool calls into bounded, non-sensitive evidence for the next model step; it cannot block the event or mutate the inspected state.
- Low
- ModeHow it works: fixed rules, model instructions, or both.
- Deterministic only
- Behaviour
- Observes, does not intervene
- On failure
- Allows and continues
- LatencyThe entrypoint handles one intercepted event to normalize failed tool calls into bounded, non-sensitive evidence for the next model step without deferred work.
- Immediate
- Data retentionWhether data remains after use and who manages its storage.
- Not retained
Often used with
All in Operations