# protect-files.sh: PreToolUse on Edit|Write|MultiEdit ## Edit an ordinary Java file input : {"hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":"/src/main/java/com/ankurm/claudecode/orders/OrderService.java"}} stdout: (empty) stderr: (empty) exit : 0 ## Edit production config input : {"hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":"/src/main/resources/application-prod.properties"}} stdout: (empty) stderr: Blocked: /src/main/resources/application-prod.properties is production configuration. Ask the user to change it. exit : 2 ## Edit an existing migration input : {"hook_event_name":"PreToolUse","tool_name":"Edit","tool_input":{"file_path":"/src/main/resources/db/migration/V1__create_orders.sql"}} stdout: (empty) stderr: Blocked: /src/main/resources/db/migration/V1__create_orders.sql is an existing Flyway migration. Add a new V__*.sql file instead. exit : 2 ## Write over an existing migration input : {"hook_event_name":"PreToolUse","tool_name":"Write","tool_input":{"file_path":"/src/main/resources/db/migration/V1__create_orders.sql"}} stdout: (empty) stderr: Blocked: /src/main/resources/db/migration/V1__create_orders.sql is an existing Flyway migration. Add a new V__*.sql file instead. exit : 2 ## Write a new migration input : {"hook_event_name":"PreToolUse","tool_name":"Write","tool_input":{"file_path":"/src/main/resources/db/migration/V2__add_status.sql"}} stdout: (empty) stderr: (empty) exit : 0