Earlier this week I talked about the cost of dead code and why the common objections don't hold up. Today let's see this in practice.
Here's the scenario: six months ago, we removed the weekly digest email feature when we simplified our notification system. Now a client wants something similar, and we'd rather not start from scratch.
Instead of manually sifting through hundreds of commits, I opened Claude Code and gave it a prompt like this:
Search the git history of this project for the weekly digest email feature that was removed sometime in the last year. I need to understand how it was built: the mailable, the query that gathered the data, and the scheduling logic.
Within a minute, it ran a series of git commands on its own with a careful set of explicit permissions so it doesn't do anything crazy. At the end, I had a clear summary of how the old feature worked, along with the exact code snippets I needed to reference.
As an additional benefit, sometimes when I'm watching it work, I'll even pick up a tip on how to use git more effectively.
For example, are you using git bisect?
Claude Code does.
The whole process took 4 - 5 minutes, and I didn't need to remember any obscure git commands or precise commit messages.
And don't forget, if you're using a tool like Claude, it's constantly reading that commented out or dead code as well. So the few minutes to clean it up is good for the developers on the team and makes coding agents more efficient and focused as a bonus.
This additional tool on top of the already powerful git tool is even more reason to delete that dead code without worry.
Here to help,
Joel
P.S. A good code review process catches dead code before it accumulates. Learn how we can help with code reviews.