knip

Installation
SKILL.md

Knip Code Cleanup

Run knip to find and remove unused files, dependencies, and exports from this codebase.

Setup

  1. Check if knip is available:

    • Run npx knip --version to test
    • If it fails or is very slow, check if knip is in package.json devDependencies
    • If not installed locally, install with npm install -D knip (or pnpm/yarn/bun equivalent based on lockfile present)
  2. Knip does NOT remove unused imports/variables inside files — that's a linter's job. Knip finds unused files, dependencies, and exports across the project.

Workflow

Always follow this configuration-first workflow. Even for simple "run knip" or "clean up codebase" prompts, configure knip properly before acting on reported issues.

Step 1: Understand the project

Related skills
Installs
408
GitHub Stars
345
First Seen
Jan 20, 2026