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.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "node",
"args": ["./scripts/validate-write.js", "--strict", "--no-secrets"]
}
]
}
]
}
}