Claude should grep all references before renaming, removing, or refactoring code
Problem
When Claude renames a function, removes a variable, or refactors a component, it often edits only the file it's looking at. It misses callers, listeners, event handlers, and shared state in other files. This causes broken builds and silent bugs that take long debugging sessions to find.
Proposed solution
Before any rename, removal, or refactor, Claude should automatically grep the entire project for all references to the symbol being changed. This should be default behavior, not something users have to ask for.
Specifically:
- Before renaming:
grepthe old name project-wide, update all references - Before removing:
grepto find all callers/importers, confirm nothing depends on it - Before refactoring:
grepto find all usages, understand the full blast radius
Grepping takes ~50ms on most projects. The cost of not doing it is broken builds and multi-hour debugging sessions.
Why this matters
Cross-file interactions are the #1 source of AI-introduced bugs. A single-file view misses callers, listeners, and shared state. This is the single highest-leverage behavioral change for code quality.
🤖 Generated with Claude Code
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗