Skip to content

hooks-config.json

来自 cli/templates/level-2/

json
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Bash",
      "hooks": [
        {"type": "command", "command": ".claude/hooks/pre-bash-firewall.sh"},
        {"type": "command", "command": ".claude/hooks/pre-bash-dep-guard.sh"}
      ]
    }],
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [
        {"type": "command", "command": ".claude/hooks/post-edit-format.sh"},
        {"type": "command", "command": ".claude/hooks/post-write-size-guard.sh"}
      ]
    }],
    "PreCompact": [{
      "matcher": "auto",
      "hooks": [
        {"type": "command", "command": ".claude/hooks/pre-compact-preserve.sh"}
      ]
    }]
  }
}

面向个人开发者的 AI 辅助编程工程化方案