safe-file-removal

Rename target files to .obsolete for reversible deletion.

4|1|Updated Sep 17, 2025
One-click install
npx skills add https://github.com/phamhung075/4genthub-hooks --skill safe-file-removal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safe-file-removal
Source: https://github.com/phamhung075/4genthub-hooks/tree/main/skills/safe-file-removal
Command: npx skills add https://github.com/phamhung075/4genthub-hooks --skill safe-file-removal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use safe-rm to remove files by renaming them to .obsolete instead of permanently deleting. This makes deletions reversible, collision-safe, and hook-compliant.

Core Features & Use Cases

  • Reversible deletions: Restore files by renaming back from .obsolete.
  • Collision safe: Timestamp suffix when there is a collision.
  • Hook-safe: Works within pre-tool hook constraints.
  • Batch workflows: Support for bulk operations and recovery templates.

Quick Start

Run: ./.claude/bin/safe-rm [files or directories]. Then verify renamed files exist as [name].obsolete and recover with mv [name].obsolete [name].

Frequently Asked Questions about safe-file-removal

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely delete files without permanently removing them?

Safe file removal renames target files to .obsolete instead of permanently deleting them, making deletions reversible. Run ./.claude/bin/safe-rm [files or directories] to rename files, then restore by moving them back from .obsolete to their original names.

Can I recover files after removing them with safe-rm?

Yes, deletions are fully reversible. Files renamed to .obsolete can be restored by renaming them back to their original names using mv [name].obsolete [name], making this approach ideal for refactoring and cleanup workflows.

How does safe-rm handle naming collisions when removing files?

Safe-rm uses timestamp suffixes to create collision-safe renames when a .obsolete file already exists, preventing overwrites and ensuring each removal operation creates a unique, recoverable state.

What types of files and directories can I remove with safe-rm?

Safe-rm supports batch operations on multiple files and directories, including temporary build artifacts, deprecated code during refactoring, old tests, assets, and documentation—any content you want to clean up while preserving recoverability.

Does safe-rm work with pre-commit hooks and shell workflows?

Yes, safe-rm is hook-compliant and operates within pre-tool hook constraints, making it suitable for automated shell workflows and version control integration without interfering with existing hook logic.

Why use safe-rm instead of permanently deleting files?

Safe-rm provides reversibility for cleanup operations, reducing risk during refactoring and batch deletions. Collision-safe timestamped renames and status reporting give you control and visibility over what's being removed.