{ "hooks": { "PreToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *package-lock.json) echo 'package-lock.json is managed by npm; run npm install instead of editing it directly' >&2; exit 2 ;; esac" } ] } ], "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *.ts) cd \"$CLAUDE_PROJECT_DIR\" && npm run typecheck --silent >&2 || exit 2 ;; esac" } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "cd \"$CLAUDE_PROJECT_DIR\" && { npm run typecheck --silent && npm test; } >&2 || exit 2" } ] } ] } }