Do you ever ask your AI coding assistant to delete bad code instead of writing more?
by•
Spent weeks prompting AI to add new features only to find duplicate functions and messy files everywhere in the repo.
Now every friday i ask it to find redundant logic and unused files so i can clear them out. Keeping the codebase small makes it way easier to manage.
Do you schedule regular cleanup sessions for your AI code or do you wait until things break?
43 views
Replies
I’ve noticed that adding features is easy, but keeping the codebase clean takes real discipline. My workflow would definetly benefit from making cleanup a regular habit.
i like the idea of asking AI to review the repo with a different goal. My usual prompts focus on adding features, so a dedicated maintenance prompt could catch things I miss.
I never thought to use AI for deletion. I always thought it would be too risky. How do you verify the suggestions before you delete?
I spend hours cleaning up after copilot. Why did I never think to just ask it to clean up its own mess.
An assistant cleaned up an unused calculation branch, but replaced the logic with a hardcoded return. A report carried a confident number that nobody had actually measured, and it took a day to find out it was a placeholder. Now it only deletes entire files, never prunes within them.