AGI Hunt· lydiahallie·· 1 小时前AI 评分31
Claude Code hook 补充:exit 1 可能是脚本报错,重试须用 exit 2
Claude Code hook 补充:exit 1 可能是脚本自身报错,重试要用 exit 2
AI 导读
Claude Code 的 Stop hook 中,exit 1 可能表示脚本自身出错,要求 Claude 重试时应使用 exit 2。Lydia Hallie 建议将命令输出重定向至 stderr,并在失败时执行 `echo failed` 与 `exit 2`,让 Claude 看到失败原因并触发重试。
来源:AGI Hunt · agihunt.info