---
description: When you are about to remove function or file contents
alwaysApply: false
---
# Rule: Check Before Deleting Code

Never mindlessly delete functions, variables, classes etc. Follow these steps:
- First ask yourself: "Why do I need to delete it? What will happen if it's not there?"
- Check if there are instantiations of the class or calls to a function.
- Even when you see that there is not a single instantiation of the class or call to a function - ask the user with the proposal to delete it, explain your analysis and tell why you think it's safe to delete it.
- Even if the user agrees - add a tag "deleted def func_x" on the commit.