观点 / 方法普通
Claude Code 员工讲解 hook 退出码用法:exit 2 才能让 Claude 重试
原始标题:exit 1 can also mean that the hook itself errored (eg a missing dependency or a bug in the hook script)
内容摘要
Lydia Hallie 说明 Claude Code 中 exit 1 也可能表示 hook 本身出错(如缺依赖或脚本 bug)。想让 Claude 重试应退出码用 2,并把输出写到 stderr,例如 "[your command] >&2 || { echo failed; exit 2; }"。
内容分类AI 观点与方法
内容层级普通情报
发布时间(北京时间)
本站收录时间(北京时间)
信息来源X:Lydia Hallie(Anthropic,Claude Code) (@lydiahallie)
站内情报编号intel-bbbef42014655840f8fd2361