AU-07: A hook deletes a whole directory that must not be deleted
Area: Permissions · Severity: high · Catalogue version 1.104.0
Why it matters
The hook runs by itself, and a command such as “rm -rf ~” removes all files of the person or the project without anyone being asked.
Before (example)
Example: a clean-up hook deletes the whole project directory.
How to fix it
Name exactly the folder the script should delete, for example a build folder inside the project.
After (example)
Before: rm -rf ~
After: rm -rf "$CLAUDE_PROJECT_DIR/build/cache"Check it yourself
Open your hook commands and the scripts they call and search for deletions such as rm -rf that name the root, the home directory, the project folder or a system path.