knip

Identify unused dependencies, files, and exports in JavaScript and TypeScript projects.

3|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/lucasgrow/some-skills --skill knip-lucasgrow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: knip
Source: https://github.com/lucasgrow/some-skills/tree/main/knip
Command: npx skills add https://github.com/lucasgrow/some-skills --skill knip-lucasgrow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps identify and remove dead code, unused dependencies, and unreferenced exports in JavaScript and TypeScript projects, leading to cleaner and more maintainable codebases.

Core Features & Use Cases

  • Unused Dependency Detection: Identifies packages in package.json that are not imported or used.
  • Unused File Detection: Finds files within your project that are not imported or referenced.
  • Unused Export Detection: Locates exports from modules that are never imported elsewhere.
  • Use Case: Before a major release, use this Skill to clean up your project by removing stale dependencies and unused code, reducing bundle size and potential security vulnerabilities.

Quick Start

Use knip to analyze your project for unused dependencies and code.

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 JavaScript project?

To find unused dependencies and dead code in a JavaScript project, you can analyze your codebase to identify unused packages, unreferenced files, and unimported exports. This requires a Node.js environment and project configuration.

What is the best way to detect unreferenced exports in TypeScript?

Detecting unreferenced exports in TypeScript involves scanning modules to locate exported members that are never imported elsewhere. This cleanup process helps reduce bundle size and maintain a cleaner codebase before releases.

Do I need a specific configuration file to check for unused files in Node.js?

Yes, checking for unused files requires project configuration via a `.knip.json` or `knip.config.js` file. You must set up this configuration in your Node.js environment before running the analysis.

Can I automate code cleanup for a major release by removing unused packages?

Yes, you can automate code cleanup for a major release by identifying and removing stale dependencies and unused code. This process reduces bundle size and eliminates potential security vulnerabilities.

What types of unused code can be identified during a refactoring effort?

During a refactoring effort, you can identify three types of unused code: unused dependencies in `package.json`, unimported project files, and unreferenced module exports. This leads to a more maintainable codebase.

Why should I remove unused dependencies from my JavaScript codebase?

Removing unused dependencies from your JavaScript codebase leads to cleaner, more maintainable projects. It effectively reduces your final bundle size and mitigates potential security vulnerabilities associated with stale packages.