Code Impact Analysis
What it does
Builds a verified impact set before changing shared behavior, public interfaces, state stores, routes, API DTOs, database models, feature flags, or memory/transcription flows.
When to use
Use this before any refactor or behavior change where missing one caller could break the product.
How to run
- Locate the definition with Serena or
rg. - Find exact callsites with
rg. - Find type-aware references with Serena.
- Ask CGC for callers, callees, and complexity.
- Use Semble to find similar patterns that exact search may miss.
- Decide the minimum edit set.
- Run focused tests, typecheck, or app verification.
Useful commands:
rg -n "symbolName\\(" .
uvx --from semble==0.2.0 semble search "similar usage of symbolName" .
cgc analyze callers symbolName --context "$(basename "$PWD")"
cgc analyze calls symbolName --context "$(basename "$PWD")"
cgc analyze complexity --limit 20 --context "$(basename "$PWD")"
Constraints
- If
rgand Serena disagree, inspect both results. Generated code, dynamic dispatch, and framework magic can explain the difference. - If CGC disagrees with
rgor Serena, treat CGC as incomplete until verified. - If Semble finds a pattern outside exact symbol search, inspect it before concluding the impact set is small.
- If a change crosses modules or user-facing workflows, add or update tests near the affected behavior.
- Stop and ask for direction only when unrelated dirty user changes block a safe edit, the change requires a product decision, or no reasonable verification is possible.