Pre-commit validation hook
A project settings hook that runs lint and tests before Claude creates a commit.
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"if": "Bash(git commit*)",
"hooks": [
{
"type": "command",
"command": "npm run lint && npm run test",
"timeout": 30
}
]
}
]
}
}