Skip to content

code_impact

code_impact answers the question: what breaks if I touch this?

It walks the call graph forward from a symbol and scores every dependent by severity. Use it before any refactor, rename, or deletion.

code_impact(name="UserService", depth=3)
ParameterTypeDefaultDescription
namestringrequiredFunction, class, or module name
depthnumber2How many hops to follow

Returns a severity-ranked list:

CRITICAL auth_middleware — directly wraps UserService.validate
HIGH POST /api/users — calls UserService.create
HIGH GET /api/profile — calls UserService.findById
MEDIUM UserService.test.ts — 14 test cases reference this class
LOW user_helper.ts — utility wrapper, 1 caller

Severities:

  • CRITICAL — direct dependency, failure guaranteed
  • HIGH — called by an API route or auth path
  • MEDIUM — test coverage or indirect dependency
  • LOW — utility or wrapper with limited reach
# Before renaming processPayment:
code_impact(name="processPayment", depth=3)
→ CRITICAL: payment_webhook — listens for payment events
→ HIGH: OrderService.checkout — calls this directly
→ HIGH: /api/orders POST — entry point
→ MEDIUM: payment.test.ts — 8 tests

Use depth=1 for immediate callers only. depth=3 for the full blast radius.