knip

Identify and remove unused files, dependencies, and exports in a codebase.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps identify and remove unused files, dependencies, and exports in a codebase, reducing bloat and maintenance effort.

Core Features & Use Cases

  • Static cleanup: Detect unused code, assets, and packages, suggesting removals to streamline projects.
  • Impact-safe pruning: Focuses on safe deletions, with guidance to verify before removal.
  • Use Case: When refactoring a large project, run this Skill to prune dead exports and unused dependencies, then clean up the codebase.

Quick Start

Run the knip command against your project to generate a cleanup report and perform safe removals according to the configured rules.

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 dependencies in a Node.js project?

To remove unused dependencies in a Node.js project, you can run a static analysis tool to generate a cleanup report identifying unused files, dependencies, and exports for safe pruning.

What is dead code and how does it affect codebase maintenance?

Dead code refers to unused files, exports, and dependencies that add bloat and increase maintenance effort. Identifying and removing them streamlines the project and reduces ongoing technical overhead.

Can I safely prune dead exports during a large refactoring project?

Yes, you can safely prune dead exports during refactoring by using static analysis to suggest impact-safe removals, though you should verify the cleanup report before finalizing deletions.

Do I need a specific environment to run unused file and dependency cleanup?

You need a local Node.js environment with npm or yarn installed, along with a configuration file to drive the rules for safe cleanup and dependency pruning across your repositories.

What's the best way to automate dependency pruning across repositories?

Automating dependency pruning across repositories involves running configured static analysis commands against your projects to detect unused packages and dead code, generating reports for streamlined maintenance.