Skip to content

code_dead

code_dead returns functions that have zero callers in the graph. These are candidates for removal — code that is either truly dead or only reachable through dynamic dispatch (reflection, eval, external callers).

code_dead()
code_dead(path="src/utils")
code_dead(include_exports=true)
ParameterTypeDefaultDescription
pathstringLimit search to files matching this path
include_exportsbooleanfalseInclude exported functions that have no internal callers
Dead code candidates (5 found):
formatLegacyDate src/utils/date.ts:42 — 0 callers
migrateOldSchema src/db/migrations.ts:18 — 0 callers
debugDump src/debug/dump.ts:7 — 0 callers
  • After a large refactor — clean up leftover functions
  • Before a release — find code that was never wired up
  • Reducing bundle size — remove modules nothing imports

code_dead works from static analysis. Functions may have zero graph callers but still be:

  • Called by external packages or plugins
  • Invoked via reflection or dynamic dispatch
  • Entry points (main, exports, event handlers, CLI commands)

Always review results before deleting. Use code_impact to double-check a specific function before removal.