⌨️StopFailure Hook
Also known as StopFailure
The event when a turn ends on an error. It is for logs and alerts.
Think of it like
It is like a smoke alarm. It cannot put the fire out, but it tells you.
Example
Jack's long overnight job hit a rate limit. His StopFailure hook sent him a phone alert, so he knew by breakfast.
Why it matters
A failed turn is silent if no one is watching. This makes it loud.
Definition
Example code
json
{
"hooks": {
"StopFailure": [
{ "matcher": "rate_limit", "hooks": [{ "type": "command", "command": "./notify-team.sh" }] }
]
}
}Common mistake
Key takeaways
- 1Instead of Stop. On an API error.
- 2Match the error. rate_limit and more.
- 3Output ignored. Alerts only.