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)Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | required | Function, class, or module name |
depth | number | 2 | How many hops to follow |
Output
Section titled “Output”Returns a severity-ranked list:
CRITICAL auth_middleware — directly wraps UserService.validateHIGH POST /api/users — calls UserService.createHIGH GET /api/profile — calls UserService.findByIdMEDIUM UserService.test.ts — 14 test cases reference this classLOW user_helper.ts — utility wrapper, 1 callerSeverities:
- 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
Example
Section titled “Example”# 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 testsUse depth=1 for immediate callers only. depth=3 for the full blast radius.