Skip to content

code_diff_context

code_diff_context combines a git diff with caller impact analysis. It shows what changed and — critically — which other functions are affected by those changes. A single call replaces git diff followed by manual code_callers lookups for every changed function.

code_diff_context()
code_diff_context(base="HEAD~3")
code_diff_context(base="main", include_callers=false)
ParameterTypeDefaultDescription
basestringHEAD~1Base ref to diff against
include_callersbooleantrueInclude callers of changed functions
Changed functions (2):
PaymentService.charge src/services/payment.ts
+ Added retry logic for transient failures
Callers (3):
OrderService.checkout — CRITICAL
SubscriptionService.renew — HIGH
payment.test.ts — MEDIUM
AuthService.validate src/middleware/auth.ts
~ Modified token expiry check
Callers (5):
every authenticated route — CRITICAL
  • Before committing — understand the full blast radius of your changes
  • Code review — instantly see what a PR touches beyond the diff itself
  • After a merge — verify no unexpected functions were affected