跳到正文
𝕏 Lydia Hallie ✨(x.com)·· 9 天前品質評分58
重點導讀

想讓 Claude Code 在檢查失敗後再試一次,Stop hook 必須以退出碼 2 結束,Claude 才會收到錯誤訊息並重試。

若使用退出碼 1,檢查雖然失敗,Claude 仍會直接結束。

AI 伴隨問答

自備 Key 深度分析

針對這篇報導有疑問?可直接點選快捷問題或向 AI 追問背景脈絡與技術細節:

Lydia Hallie ✨
Lydia Hallie ✨@lydiahallie
·9 天前
𝕏

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

推文來源 · X (Twitter)在 X 參與討論

讀者討論

理性交流 · 即時討論