aicoolies logo
Knip logo
Knip logo

Knip

Find unused files, dependencies, and exports in JavaScript and TypeScript projects

open sourceupdated Apr 21, 2026

Knip is an open-source CLI tool that detects unused files, dependencies, devDependencies, and exports in JavaScript and TypeScript codebases. It analyzes the full dependency graph to identify dead code that accumulates over time — especially relevant for AI-generated codebases where unused artifacts pile up faster than manual cleanup can handle. With over 10,800 GitHub stars, it has become a standard code hygiene tool in the JS/TS ecosystem.

Knip is a dead code detection tool built specifically for the JavaScript and TypeScript ecosystem. It performs whole-project analysis to find files that no other file imports, dependencies listed in package.json that no code actually uses, devDependencies that build scripts and test configs never reference, and named exports that nothing consumes. Unlike linters that check individual files in isolation, Knip builds a complete dependency graph of the entire project to make globally informed decisions about what is truly unused.

The tool understands the configuration formats of major frameworks and build tools including Next.js, Vite, Jest, ESLint, TypeScript, Storybook, and dozens of others. This means it recognizes that a dependency referenced only in a jest.config.ts is a used devDependency, not an unused one. The plugin system can be extended for custom configuration formats. Output formats include human-readable summaries, JSON for CI integration, and fix mode that can automatically remove identified dead code.

Knip has gained particular relevance in the era of AI-assisted development where coding agents generate code rapidly but rarely clean up after themselves. The accumulation of unused files, orphaned exports, and phantom dependencies degrades build times, increases bundle sizes, and creates confusion for both human and AI developers navigating the codebase. With over 10,800 GitHub stars and 100+ contributors, Knip is MIT licensed and has become an essential part of modern JavaScript project maintenance.

Pricing

Free and open-source under MIT license

Platforms

Any platform with Node.js (CLI tool)

Categories

Tags

Use Cases

Related Tools

computed discovery: shared active categories · kept separate from editor-verified Alternatives

MCPJam logo

MCPJam Inspector

Test and debug MCP servers before they ship

Open-source platform for inspecting, debugging and regression-testing MCP servers, MCP Apps and ChatGPT apps, with OAuth and protocol conformance for local and CI workflows.

freemiumOpen SourceTelemetry
MCP for Unity logo

MCP for Unity

Open-source MCP bridge between AI assistants and the Unity Editor

MCP for Unity is CoplayDev’s MIT-licensed bridge between MCP-compatible AI assistants and the Unity Editor. It exposes tools for assets, scenes, GameObjects, scripts, tests, profiling, and build-oriented workflows. The community project supports Unity 2021.3 LTS through 6.x and is explicitly not affiliated with Unity Technologies.

Open Source
XcodeBuildMCP logo

XcodeBuildMCP

Sentry-maintained MCP server and CLI for Xcode builds, simulators, and tests

XcodeBuildMCP is a Sentry-maintained, MIT-licensed MCP server and CLI for agent-assisted iOS and macOS development. It lets MCP-compatible coding agents run Xcode build and test workflows, manage simulators, inspect failures, and work through Homebrew, npm, or on-demand client configuration, with documented Sentry telemetry controls for teams that need an opt-out.

Open SourceTelemetry
iFixAi logo

iFixAi

Open-source diagnostic for AI operational misalignment

iFixAi is an Apache-2.0 diagnostic tool for scoring AI agents and models against operational-misalignment risks such as hallucination, manipulation, sabotage, sandbagging, and oversight evasion.

Open Source
Inspect AI parent UK AISI mark

Inspect AI

UK AI Security Institute framework for LLM safety evaluations

Inspect AI is an MIT-licensed framework from the UK AI Security Institute for running large language model evaluations, including tool use, multi-turn dialogue, model-graded scoring, and reusable evaluation tasks.

Open Source
Safari MCP Server parent Safari mark

Safari MCP Server

Apple's Safari-native MCP server for web debugging agents

Safari MCP Server is Apple's safaridriver-based MCP server in Safari Technology Preview, giving compatible coding agents local access to Safari page content, console logs, network requests, screenshots, JavaScript evaluation, interactions, viewport controls, and accessibility/performance checks.

freeTelemetry

FAQ

What is Knip?

Knip is an open-source CLI tool that detects unused files, dependencies, devDependencies, and exports in JavaScript and TypeScript codebases. It analyzes the full dependency graph to identify dead code that accumulates over time — especially relevant for AI-generated codebases where unused artifacts pile up faster than manual cleanup can handle. With over 10,800 GitHub stars, it has become a standard code hygiene tool in the JS/TS ecosystem.

Is Knip free?

Yes — Knip is open source and free to use. Free and open-source under MIT license

Is Knip open source?

Yes — Knip is open source.

What are the best Knip alternatives?

The top editor-verified Knip alternatives are Biome, DeepSource, SonarQube.