Knip

Finds unused files, exports, types, and dependencies in JavaScript and TypeScript projects. Knip analyzes your entire project's import/export graph to identify what isn't used anywhere — dead code files, exported functions nobody imports, npm dependencies listed in package.json but never required, and unlisted dependencies that are used but not declared. Particularly valuable for large codebases that have accumulated technical debt from deleted features or refactored code.

Evaluated Mar 06, 2026 (0d ago) v5.x
Homepage ↗ Repo ↗ Developer Tools dead-code unused typescript javascript exports dependencies files linting cleanup
⚙ Agent Friendliness
68
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
86
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
82
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
90
Secret Handling
100

Local analysis tool — no network access. Reduces security surface by identifying unused dependencies. ISC licensed.

⚡ Reliability

Uptime/SLA
100
Version Stability
82
Breaking Changes
78
Error Recovery
85
AF Security Reliability

Best When

You have a mature TypeScript/JavaScript codebase with accumulated dead code and want a systematic way to identify and safely remove it.

Avoid When

Your project uses heavy dynamic code patterns (dynamic require, eval, plugins) that Knip can't statically analyze.

Use Cases

  • Remove dead code from large TypeScript projects by identifying unused exports, files, and class members that can be safely deleted
  • Audit npm dependencies to find packages listed in package.json but never actually imported — reducing security surface and install times
  • Identify unlisted dependencies that are used but not in package.json — 'phantom dependencies' that work by accident via transitive dependencies
  • Clean up TypeScript monorepos by finding workspace packages that export types or functions nobody consumes across all packages
  • Run in CI to prevent dead code accumulation by failing builds when new unused exports or dependencies are introduced

Not For

  • Runtime dead code detection — Knip analyzes static imports only; dynamic requires or runtime-evaluated imports may appear as unused
  • Non-JavaScript/TypeScript projects — Knip is JS/TS ecosystem only
  • Projects using non-standard module resolution — Knip relies on TypeScript module resolution; unusual bundler configurations may produce false positives

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
No
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Local CLI tool — no authentication.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Knip is ISC open source. Free for personal and commercial use.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Knip produces false positives for exports used via dynamic patterns — exported functions used in test setup files, plugin systems, or dynamic requires appear as unused; configure ignore patterns in knip.json
  • Entry point configuration is critical — Knip needs to know the project entry points to trace the import graph correctly; missing entry points cause legitimate exports to appear unused
  • Knip may report exports from libraries published as npm packages — if your repo IS the library, mark all public API exports as 'entry' exports or configure them as public
  • TypeScript path aliases (tsconfig paths like '@/components') require knip.json configuration with matching TypeScript config to resolve correctly
  • Knip analysis of large monorepos can take several minutes — first run on a big codebase may seem hung; add --reporter=progress to see progress
  • Configuration changes (adding plugins for specific tools like Astro, Remix) dramatically reduce false positives — use the correct plugin for your framework

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Knip.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered