Need a customized project? We build it to your exact requirements.Contact us on WhatsApp

File Backup

Hook development-tools 16 lines

Automatically backup files before editing. Creates timestamped backups in a .backups directory when files are modified.

file-backup.jsonPreview
{
  "description": "Automatically backup files before editing. Creates timestamped backups in a .backups directory when files are modified.",
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "if [[ -n \"$CLAUDE_TOOL_FILE_PATH\" && -f \"$CLAUDE_TOOL_FILE_PATH\" ]]; then mkdir -p .backups && cp \"$CLAUDE_TOOL_FILE_PATH\" \".backups/$(basename \"$CLAUDE_TOOL_FILE_PATH\").$(date +%Y%m%d_%H%M%S).bak\"; fi" …

You are seeing the first 50 words. Purchase the Claude Skills Pack to see the full hook and download it.

Buy the pack · $19.98

More in development-tools