claude.nagdy.me

Pre-commit validation hook

A project settings hook that runs lint and tests before Claude creates a commit.

json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "if": "Bash(git commit*)",
        "hooks": [
          {
            "type": "command",
            "command": "npm run lint && npm run test",
            "timeout": 30
          }
        ]
      }
    ]
  }
}
View Full Module