knip

Identify and remove unused files, imports, and exports from JavaScript/TypeScript projects.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mattdowney/ai-skills --skill knip-mattdowney
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: knip
Source: https://github.com/mattdowney/ai-skills/tree/main/knip
Command: npx skills add https://github.com/mattdowney/ai-skills --skill knip-mattdowney

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Knip helps teams automatically identify and remove unused files, dead imports, and unnecessary dependencies to reduce bundle sizes and simplify maintenance.

Core Features & Use Cases

  • Detects unused files, imports, and exports to prune dead code across single projects or monorepos.
  • Recommends safe cleanup strategies for dependencies and orphaned assets to minimize risk.
  • Use Case: You want a lean repository for faster builds and easier onboarding.

Quick Start

Install knip locally and run a dry-run to see suggested cleanups before applying changes.

Frequently Asked Questions about knip

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

FAQPage Schema
How do I find and remove unused imports and dead code in a JavaScript project?

To find and remove dead code, you can use a static analysis tool to identify unused files, imports, and exports. This Skill automates that process by recommending safe cleanup strategies for JavaScript and TypeScript projects to help you prune dead code.

What is the best way to prune unused dependencies and orphaned assets during refactoring?

Pruning unused dependencies during refactoring requires identifying what is truly dead. This Skill detects unused files, imports, and exports, then recommends safe cleanup strategies for dependencies and orphaned assets to minimize risk and simplify maintenance.

Does this dead code cleanup tool work with monorepos?

Yes, this dead code cleanup tool works with monorepos. It detects unused files, imports, and exports to prune dead code across single projects or monorepos, helping you maintain a lean repository for faster builds and easier onboarding.

How do I run a dry-run to check for unused files before applying changes?

You can run a dry-run to check for unused files by installing knip locally and executing the command. This allows you to see suggested cleanups and review unused files, imports, and exports before actually applying any changes to your codebase.

Do I need a local config to identify unused exports in my TypeScript codebase?

Yes, you need a local config to identify unused exports. This Skill requires knip to be installed locally and configured via package.json or a local config file to enable automated cleanup of unused files and dead imports in your TypeScript codebase.