Skip to content

code_imports

code_imports returns every file that imports the given symbol or module. This is distinct from code_callers — it shows module-level dependencies, not function-level call relationships.

code_imports(name="AuthService")
code_imports(name="prisma")
code_imports(name="UserDTO", include_code=true)
ParameterTypeDefaultDescription
namestringrequiredExport or module name to find importers of
include_codebooleanfalseInclude the import statement from each file
AuthService imported by 6 files:
src/controllers/auth.ts
src/controllers/admin.ts
src/middleware/auth.ts
src/services/session.ts
tests/auth.test.ts
tests/integration/login.test.ts
  • Find every file affected by a module change
  • Understand the dependency footprint of a shared service
  • Before deleting or renaming an export — see who uses it
ToolAnswers
code_callersWhich functions call AuthService.login?
code_importsWhich files import the AuthService module?

Use code_imports for module-level dependency analysis. Use code_callers for function-level call analysis.