with one click
safe-rm
Safely delete files / directories without asking for permission
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Safely delete files / directories without asking for permission
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Use the Xero MCP server — obtain/refresh OAuth2 bearer tokens, troubleshoot authentication, and pick up other operational notes for working with Xero MCP tools. Use when Xero MCP tools fail with authentication errors, when the bearer token has expired (tokens last ~30 min), before starting any Xero workflow, or for general guidance on Xero MCP usage.
General Xero browser automation notes. Use when automating any Xero page with agent-browser — covers non-standard UI patterns, waiting, and dropdown menus.
Size the agent-browser Chromium window to fill its current screen, leaving a configurable bottom margin for the desktop panel. Use before any agent-browser automation that needs the full screen visible without elements overlapping or scrolling off (e.g. Xero, dense web apps).
Review all unreviewed documents in Hubdoc. Use when reviewing, processing or publishing Hubdoc receipts and bills.
Convert XLSX spreadsheets (single or multi-sheet) to CSV files you can read and grep. Use whenever you need to process an .xlsx report from Xero, Cryptio, bank exports, or any tool that delivers spreadsheet output.
Create Claude Code slash commands, OpenCode command files, and Pi prompt templates that delegate to the right subagent or skill. Use when creating new commands or refactoring existing ones to follow platform conventions.
| name | safe-rm |
| description | Safely delete files / directories without asking for permission |
Whenever deletion of files or directories is required, this is quicker than usual methods which typically require asking the user for permission.
This skill is particularly useful when:
It runs the ai-safe-rm script which has an intelligent git-aware backup
strategy. Use -r flag for directories.
For files:
Tracked in git, unmodified: Files are deleted directly (can be recovered from git)
Tracked in git, modified: Files are moved to
.safe-rm/<path>/<filename>.<hash>.<ext> (e.g., README.b72ae922.md)
or .safe-rm/<path>/<filename>.<hash> (e.g., LICENSE.88fdc130) to
preserve the modified version
Not tracked in git: Files are moved to
.safe-rm/<path>/<filename>.<hash>.<ext> or .safe-rm/<path>/<filename>.<hash>
for safety
For directories (requires -r flag):
All files unmodified tracked: Directory is deleted directly with
rm -rf (can be recovered from git)
Contains modified tracked or untracked files: The script recurses through the directory, applying the file logic to each file individually. Only modified/untracked files are backed up, while unmodified tracked files are deleted. Empty directories are removed after processing.
The <hash> is the first 8 characters of the MD5 sum of the file
content, ensuring unique backups of different versions.
Only use this skill for files/directories within the current git repository.
For files outside the repository:
rm or rm -rf directlyPre-check before calling:
Before running ai-safe-rm, verify all paths are within the repo:
# Verify path is inside current repo
git rev-parse --is-inside-work-tree && realpath --relative-to="$(git rev-parse --show-toplevel)" /path/to/file | grep -q '^[^.]' && echo "Inside repo" || echo "Outside repo"
When you need to delete files or directories as part of a refactoring or cleanup task:
Identify the files/directories to delete
Call ai-safe-rm [-r] <file1> <file2> ... to safely remove them
-r flag when deleting directories-r, attempting to delete a directory will errorThe script will output what action was taken for each file/directory
This skill does NOT require user permission for deletion because:
.safe-rm/The .safe-rm/ directory should be added to .gitignore
Backed up files can be restored manually if needed from .safe-rm/
All examples assume files are within the current git repository:
# Delete a single file
ai-safe-rm src/old-component.ts
# Delete multiple files
ai-safe-rm src/legacy/*.js
# Delete a directory
ai-safe-rm -r ./old-feature
# Delete multiple directories and files
ai-safe-rm -r ./tests/deprecated ./legacy src/unused.ts
For files outside the repository, use rm directly:
# Delete file outside repo
rm /home/user/.cache/temp-file.txt
# Delete directory outside repo
rm -rf /tmp/build-artifacts/