Workflow Maintenance

Code Cleanup Pass

Systematic pass to clean up a file or module

maintenancecleanupquality
CLAUDE.md

When doing a cleanup pass on a file:

  1. Remove dead code: unused imports, unreachable branches, commented-out blocks.
  2. Remove unused variables and parameters.
  3. Fix naming: rename unclear variables and functions to describe their purpose.
  4. Reduce nesting: add guard clauses and early returns.
  5. Extract long functions into smaller, focused helpers.
  6. Add or fix types where they’re missing or wrong.
  7. Run the tests after each change to verify nothing broke.
  8. 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.

get crystl