Rename Safely
Workflow for renaming a function, variable, or file across the codebase
CLAUDE.md
When renaming a symbol across the codebase:
- Use your IDE’s rename refactoring tool if available — it catches references across files.
- If renaming manually, search the entire codebase for the old name: source code, tests, config files, documentation, scripts.
- Rename in all locations. Don’t leave the old name as an alias or re-export.
- Check for string references: API routes, database column names, serialized keys, error messages that reference the old name.
- Run the full test suite to catch any missed references.
- Run the build to catch type errors and missing imports.
- 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.