{ "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "file=$(jq -r '.tool_input.file_path // empty'); if [ -n \"$file\" ] && [ \"${file##*.}\" = \"py\" ]; then python3 -m py_compile \"$file\"; fi" } ] } ], "Stop": [ { "hooks": [ { "type": "command", "command": "cd \"$CLAUDE_PROJECT_DIR\" && python3 -m py_compile run.py generator.py" } ] } ] } }