Find and fix duplicated code and unused dead code in the codebase. Extracts shared logic into reusable modules and removes code that is not referenced anywhere.
Clean up the codebase by removing duplication and dead code. If $ARGUMENTS is provided, focus on that file or directory. Otherwise, analyze the entire project.
Search for repeated logic across files — similar function bodies, copy-pasted blocks, repeated inline values, and duplicated patterns. For each instance:
Identify code that is not imported, called, or referenced anywhere:
Remove dead code entirely. Do not comment it out.