claude.nagdy.me

Exec form hook with args array

Use the args field to spawn a process directly without a shell. Avoids escaping issues and is more secure.

json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "node",
            "args": ["./scripts/validate-write.js", "--strict", "--no-secrets"]
          }
        ]
      }
    ]
  }
}
View Full Module