Skip to content
View original post on X: Lydia Hallie ✨
Published

Lydia Hallie explains Claude Stop hook exit codes

AILydia Hallie explains that Claude retries a failed check when a Stop hook exits with code 2, using the hook’s stderr. Exit code 1 is non-blocking, so Claude finishes even if the check failed.
Lydia Hallie ✨Verified on X
@lydiahallie
View on X

You can use a Stop hook to have Claude try again when a check fails, but make sure it exits with code 2!

Exit 2 sends Claude back to retry with the hook's stderr, exit 1 is non-blocking so Claude just finishes even when the check failed

Source details

Lydia Hallie ✨ · x.comPublished · added here

Original title: You can use a Stop hook to have Claude try again when a check fails, but make sure it exits with code 2!