finds.dev

asottile/dead

dead simple python dead code detection

View on GitHub

★ 397PythonMITupdated Jul 2026

// the take

dead is a minimal Python dead code detector by Anthony Sottile that uses AST parsing to find definitions with no references. It's a single-file tool with no config beyond regexes for file/test inclusion, and it plugs into pre-commit. For small-to-medium Python codebases where you want a quick, low-ceremony check.

Single-file implementation means you can read the whole thing in 10 minutes and understand exactly what it does. Pre-commit integration works well — zero config for the common case. The `# dead: disable` escape hatch is simple and doesn't require learning a DSL. Actively maintained (last push July 2026) despite the self-deprecating README.

The false positive rate on anything using interfaces, metaclasses, or magic methods will frustrate you fast — the author admits this upfront. It's pure AST analysis with no type information, so dynamic attribute access and `getattr` patterns will produce noise. No way to suppress categories of false positives beyond line-level comments, which gets tedious on a large codebase. Vulture, the obvious alternative, has more configurability and confidence scoring — dead gives you nothing to tune.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
397
Forks
14
Language
Python
License
MIT
Last commit
15 Jul 2026

// nearby

If dead isn't quite it.

All repos →