# How to make Claude retry after a hook fails

> Original title: exit 1 can also mean that the hook itself errored (eg a missing dependency or a bug in the hook script)

- Source: Lydia Hallie
- Published: 2026-11-13T18:43:38.000Z
- Bad Influence: https://badinfluence.news/items/pq1c0sz1vsfrui85txtvfkpt3
- Original: https://x.com/lydiahallie/status/2121313050745872778

## Summary

Lydia Hallie says Claude hooks should exit with code 2 to request a retry; exit code 1 can indicate the hook itself errored, such as from a missing dependency or script bug. She recommends sending error output to stderr so Claude can see what went wrong.

## Post

exit 1 can also mean that the hook itself errored (eg a missing dependency or a bug in the hook script)

so exit with 2 when you want Claude to retry, and send the output to stderr so it can see what went wrong. something like "[your command] >&2 || { echo failed; exit 2; }"
