跳到正文
原文
AGI Hunt· OkPermission1689·· 14 天前精选AI 评分65

用 PreToolUse 钩子让 Claude Code 在 git push --force 前先请示

AI 导读

一位并行运行多个 Claude Code 会话的开发者用 PreToolUse 钩子拦截每条 Bash 命令,由桌面应用返回 allow/block/ask,遇到 ask 时弹通知让 Claude 等待确认。

推荐理由

作者给出用 PreToolUse 钩子拦截并解包 Bash 命令的具体做法,可供并行运行多个 Claude Code 会话的开发者参考。

来源:AGI Hunt · agihunt.info