knip

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

Updated Jan 17, 2026
One-click install
npx skills add https://github.com/AndyMarigoldLabs/continuous-funding --skill knip-andymarigoldlabs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: knip
Source: https://github.com/AndyMarigoldLabs/continuous-funding/tree/main/frontend/.claude/skills/knip
Command: npx skills add https://github.com/AndyMarigoldLabs/continuous-funding --skill knip-andymarigoldlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers clean a codebase by identifying and removing unused files, dependencies, and exports to reduce bloat and maintenance overhead.

Core Features & Use Cases

  • Auto-detect unused files by static/graph analysis to prune dead code paths.
  • Identify unused dependencies and devDependencies in package.json for safer removal.
  • Remove unused exports from modules to simplify public APIs.
  • Use Case: Before a release, run knip to shrink the codebase and improve maintenance.

Quick Start

Run npx knip to scan the project. Review the output categories and, if appropriate, run npx knip --fix --allow-remove-files to automatically delete unused files, dependencies, and exports.

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

You can find and remove unused dependencies by running npx knip to analyze your project, then executing npx knip --fix --allow-remove-files to automatically delete the unused files, dependencies, and exports.

What is the best way to clean dead code before a release?▼

The best way to clean dead code before a release is to run a graph analysis tool that identifies unused files, dependencies, and exports, shrinking the codebase to reduce maintenance overhead and bloat.

Does knip work with TypeScript monorepos?▼

Yes, knip targets both JavaScript and TypeScript projects, including monorepos, using static graph analysis to prune dead code paths and simplify public APIs across the entire codebase.

Can I automatically delete unused exports and files?▼

Yes, you can automatically delete unused exports and files by running the tool with the --fix and --allow-remove-files flags, which executes automated fixes to remove the identified dead code.

What are the limitations of using automated fixes for dead code removal?▼

When using automated fixes for dead code removal, limitations include the risk of deleting dynamically referenced files, so you should always review the analysis output categories before running the --fix command.