返回精选
Lydia Hallielydiahallie2026-11-14 02:434 天前

Claude Code Stop hook 技巧:用 exit code 2 让 Claude 在检查失败时自动重试

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

AI 导读

Lydia Hallie 分享一个 Claude Code 使用技巧:用 Stop hook 让 Claude 在检查失败后自动重试,关键是让 hook 以 exit code 2 退出。exit 2 会把 hook 的 stderr 返回给 Claude 触发重试,exit 1 则是非阻塞的,即使检查失败 Claude 也会直接结束。

来源:Lydia Hallie · x.com

事件后续1

查看事件全部

看完资讯,聊聊你的企业

留下联系方式,我会亲自联系你。

WECHAT

添加我的微信

长按或选中下方微信号复制。