1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16{ "hooks": { "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "file_path=$(jq -r '.tool_input.file_path'); if [[ \"$file_path\" == *.rs ]]; then rustfmt \"$file_path\" 2>/dev/null || true; fi" } ] } ] } }