CLI
larkx deadcode
Find truly unreachable code.
Usage
bash
larkx deadcodeExample output
bash
Detected frameworks: next
Dead code (unreachable from entry points):
Files (3):
src/utils/legacy.ts
src/components/UnusedButton.tsx
src/lib/old-helper.ts
Functions (5):
oldFormat, src/utils/legacy.ts:2
deprecatedHandler, src/api/v1.ts:45
...How it works
- Auto-detects entry points:
index.*,main.*, framework routes (Next.jspage.tsx, NestJS controllers, etc.), and anything inconfig.jsonentryPoints - BFS along all graph edges from each entry
- Anything not visited = dead
This is more accurate than "no incoming edges" because it accounts for framework conventions where files are loaded by routers, not imports.
See: Framework support