Workflow Refactoring

Rename Safely

Workflow for renaming a function, variable, or file across the codebase

refactoringnamingsafety
CLAUDE.md

When renaming a symbol across the codebase:

  1. Use your IDE’s rename refactoring tool if available — it catches references across files.
  2. If renaming manually, search the entire codebase for the old name: source code, tests, config files, documentation, scripts.
  3. Rename in all locations. Don’t leave the old name as an alias or re-export.
  4. Check for string references: API routes, database column names, serialized keys, error messages that reference the old name.
  5. Run the full test suite to catch any missed references.
  6. Run the build to catch type errors and missing imports.
  7. Search once more for the old name to confirm it’s fully removed.

Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.

get crystl