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)Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | required | Export or module name to find importers of |
include_code | boolean | false | Include the import statement from each file |
Output
Section titled “Output”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.tsWhen to use
Section titled “When to use”- 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
Difference from code_callers
Section titled “Difference from code_callers”| Tool | Answers |
|---|---|
code_callers | Which functions call AuthService.login? |
code_imports | Which files import the AuthService module? |
Use code_imports for module-level dependency analysis. Use code_callers for function-level call analysis.