跳到正文
X · Lydia Hallie·· 22 天前AI 评分38

Claude 的 Stop hook 用 exit code 2 让检查失败后重试,exit 1 不阻塞

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

AI 导读

Claude 的 Stop hook 可在检查失败时让 Claude 重试,但必须让 hook 以 exit code 2 退出:exit 2 会把 Claude 送回重试并带上 hook 的 stderr。exit 1 是非阻塞的,即使检查失败 Claude 也会直接结束。

打开原文x.com
博主
Lydia Hallie ✨@lydiahallie

粉丝 19万

Claude Code @AnthropicAI @ClaudeDevs

互动数据
浏览
6.3万
点赞
1192
评论
105
分享
49
收藏
630

数字来自平台,为最近一次抓取时的数据。

来源:X · Lydia Hallie · x.com