AIHOT·· 1 小时前AI 评分48
Claude Code 用 Stop hook 让检查失败自动重试的技巧:关键在 exit code 2
Claude Code Stop hook 技巧:用 exit code 2 让 Claude 在检查失败时自动重试
AI 导读
Lydia Hallie 分享了用 Claude Code 的 Stop hook 让 Claude 在检查失败后自动重试的技巧,关键是让 hook 以 exit code 2 退出。exit 2 会把 hook 的 stderr 返回给 Claude 从而触发重试,而 exit 1 是非阻塞的,检查失败时 Claude 也会直接结束。
来源:AIHOT · x.com