knip

Detect unused code, dependencies, exports, and types in JavaScript and TypeScript projects.

6|2|Updated Jan 6, 2026
One-click install
npx skills add https://github.com/acaprino/claude-code-daodan --skill knip-acaprino
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: knip
Source: https://github.com/acaprino/claude-code-daodan/tree/main/plugins/typescript-development/skills/knip
Command: npx skills add https://github.com/acaprino/claude-code-daodan --skill knip-acaprino

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Knip automatically detects and reports unused code across a JavaScript/TypeScript project, helping you maintain lean codebases.

Core Features & Use Cases

  • Dead code detection: Identify unused files, dependencies, exports, types, and enum members.
  • Framework and tool support: Plugin system for React, Next.js, Vue, Svelte, Vitest, Jest, Playwright, and more.
  • CI-ready: Exit codes for failing builds and actionable remediation suggestions.

Quick Start

Run Knip in your repository to scan for dead code and generate a report.

Frequently Asked Questions about knip

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find unused dependencies and dead code in a TypeScript project?

You can find unused dependencies and dead code in a TypeScript project by running Knip, which automatically detects unused files, exports, types, and dependencies to help maintain a lean codebase.

Can I detect unused exports and types in a monorepo?

Yes, you can detect unused exports and types in a monorepo. Knip supports monorepos and provides automatic entry-point detection along with plugin-based integration for frameworks and test runners.

Does dead code detection work with Next.js, Vue, and Svelte?

Dead code detection works with Next.js, Vue, and Svelte using a plugin system. It also integrates with React, Vitest, Jest, and Playwright to identify unused code across your project.

How do I fail a CI build when unused files are detected?

To fail a CI build when unused files are detected, you can use Knip's CI-ready exit codes. It reports unused code and dependencies with actionable remediation suggestions to improve CI hygiene.

What is the best way to remove unused enum members and dead code in JavaScript?

The best way to remove unused enum members and dead code in JavaScript is to use Knip, which automatically identifies and reports unused enum members, files, and exports for cleanup.

Why does Knip report a dependency as unused?

Knip reports a dependency as unused when automatic entry-point detection and plugin integration determine it is not referenced anywhere in your project's code, exports, or types.