Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

1 line
770 B
JSON

{"content": "{\n \"description\": \"Create automatic backup of files before any Edit operation for safety. This hook creates a timestamped backup copy (filename.backup.timestamp) of any existing file before Claude modifies it. Provides a safety net to recover previous versions if needed. Only backs up existing files, includes error suppression to handle edge cases gracefully.\",\n \"hooks\": {\n \"PreToolUse\": [\n {\n \"matcher\": \"Edit\",\n \"hooks\": [\n {\n \"type\": \"command\",\n \"command\": \"if [[ -f \\\"$CLAUDE_TOOL_FILE_PATH\\\" ]]; then cp \\\"$CLAUDE_TOOL_FILE_PATH\\\" \\\"$CLAUDE_TOOL_FILE_PATH.backup.$(date +%s)\\\" 2>/dev/null || true; fi\"\n }\n ]\n }\n ]\n }\n}"}