What problem does it solve?
Knip identifies and helps remove dead code by locating unused files, dependencies, devDependencies, exports, and types in a codebase to reduce bloat and maintenance surface area.
Core Features & Use Cases
- Detection: Run knip to produce a categorized report of unused files, dependencies, devDependencies, exports, and types.
- Automated Fixes: Use knip's --fix and --allow-remove-files options to automatically remove high-confidence issues.
- Safety Workflow: Classify items into auto-delete versus needs-clarification, ask about uncertain items in a single batch, and re-run to verify cleanup.
- Use Cases: Useful for single-package repos and monorepos preparing for refactors, releases, or dependency audits.
Quick Start
Run npx knip to generate a report, classify uncertain items for confirmation, and apply safe fixes with npx knip --fix --allow-remove-files while respecting existing knip config and workspace flags.