The rule
Know the callers before you change the callee. Any edit to code that more than one place depends on gets a dependency check before the diff, not a review comment after it. Silent breakage in a shared module costs more than the fix was worth.
When to run it
Before touching anything that looks like a hub rather than a leaf: shared services, core routing, a library imported from three or more places. If you are not sure whether a file is a hub, that uncertainty is the answer. Check first.
The play
- Identify the exact symbol you are about to change, not just the file. A function called from three sites is a different risk from the file that happens to contain it.
- Get the real caller list from a code-graph tool or a search, not from memory or a stale mental model. (We use a code-graph index when it is fresh and plain search when it is not.)
- Read the actual call sites. A one-line summary misses type coercion, ordering assumptions and error-handling contracts.
- Classify the risk honestly: low (one caller, isolated), medium (a few callers in the same layer), high or critical (cross-cutting, many callers, or anything touching auth, money or data integrity).
- On high or critical, stop and say so before going on. Describe the blast radius to whoever is waiting on the change, and get a clear go-ahead.
- After the edit, run the same query again. The caller list you checked going in should still be the caller list that exists coming out.
Where it breaks
"It's just one function", said about a function nine call sites depend on. And trusting an index that has gone stale: a dependency graph built before today's commits is wrong with full confidence, which is worse than admitting you do not know.