Skip to content

Introduction

Necro finds anti-pattern code and proposes LLM-assisted fixes. This first release focuses on the hardest axis to get right: dead code in TypeScript.

The name is forensic. Findings are triaged into tiers; each one ships an evidence chain — an autopsy declaring cause of death. Code that only tests keep alive is on life support (test-only). Removing dead code (planned --fix) is exhumation.

Dead code means “unreachable from any entry point.” Pure-static tools must make a binary alive/dead call, and when they’re unsure they either flag good code (false positive, the trust-killer) or stay silent (false negative).

Necro’s edge is refusing to guess. It adds a third maybe tier and quarantines ambiguous code — dynamic imports, reflection, public API — with reasons, instead of falsely killing it.

  • Finds unreferenced TypeScript symbols using the compiler API (via ts-morph), not text matching — so it follows re-exports, type-only imports, and barrel files.
  • Classifies every finding as certain / likely / maybe, ships an evidence chain per finding, and surfaces the test-only verdict.
  • Reads your real test-runner config and folds lcov coverage into the verdict.
  • Analyzes beyond dead code: complexity detectors, CRAP × churn risk hotspots, and Type-2 duplication.
  • Acts on findings: fix safely removes certain-dead code; triage and refactor bring an opt-in LLM layer (refactors verified in a scratch worktree).
  • Exposes a read-only MCP server so AI agents can call necro’s verdicts and verify their own edits.

SARIF output, --fail-on build gating, more framework plugins (Next.js, NestJS), monorepo workspace edges, and Python support are on the roadmap — not yet available.