CLI

larkx deadcode

Find truly unreachable code.

Usage

bash
larkx deadcode

Example 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

  1. Auto-detects entry points: index.*, main.*, framework routes (Next.js page.tsx, NestJS controllers, etc.), and anything in config.json entryPoints
  2. BFS along all graph edges from each entry
  3. 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