Code Cleanup Pass
Systematic pass to clean up a file or module
CLAUDE.md
When doing a cleanup pass on a file:
- Remove dead code: unused imports, unreachable branches, commented-out blocks.
- Remove unused variables and parameters.
- Fix naming: rename unclear variables and functions to describe their purpose.
- Reduce nesting: add guard clauses and early returns.
- Extract long functions into smaller, focused helpers.
- Add or fix types where they’re missing or wrong.
- Run the tests after each change to verify nothing broke.
- Don’t mix cleanup with behavior changes — keep the PR purely structural.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.