Was pair programming with AI. It deleted my configs twice.
First thought: Add confirmation prompts
Reality: I kept hitting yes without reading
Second thought: Restrict permissions
Reality: Too annoying for daily work
Final decision: alias rm='trash'
Now AI can rm -rf all day. Files go to trash, not void.
Command for macOS:
alias rm='trash'
Add to ~/.zshrc to make permanent.
edit: Here is an another alternative
rm() {
echo "WARNING: rm → trash (safer alternative)" >&2
trash "$@"
}
Top comments (1)
I created a more complicated version of this. It only intercepts rm from AI tools, so if you run rm yourself it still deletes normally by default (it's a setting). github.com/forethought-studio/ai-t...