Lydia Hallie ✨· @lydiahallie · X·· 18 天前AI 评分64
AI 导读
在使用 Stop hook 触发 Claude 自动重试时,检查脚本必须以退出码 exit 2 退出。退出码为 2 时会把 hook 的 stderr 错误信息回传给 Claude,促使其读取错误后重新编辑并重试直到测试通过;若使用退出码 1,流程为非阻塞,即使检查失败 Claude 也会直接终止流程。
正文 · 原文
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 https://t.co/s8Yzl8uykg
来源:Lydia Hallie ✨ · x.com