Skip to content
Skill

Knip

Runs knip to find and clean up unused files, dependencies and exports

Knip is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
5
Last commit
License
MIT
Listing updated

Similar skills

About Knip

This skill has the agent run knip, a static analysis tool for JavaScript and TypeScript projects, to locate dead code, unused files, unused dependencies and unused exports. It walks through a configuration-first process: the agent checks the project's package.json and any existing knip config, reads the configuration hints knip prints, adjusts settings such as plugins and entry patterns, and re-runs until false positives drop before removing anything.

The skill gives guidance on deletion safety. Clearly orphaned files and unused dependencies can be removed directly, while files that may be entry points, dynamically imported, or part of a public API should be confirmed with the user first. It also covers a production-only mode, optional auto-fix flags, and troubleshooting steps for knip errors. It notes that unused imports and variables inside files are outside knip's scope and belong to a linter such as ESLint or Biome.

Knip must be available in the project, either globally through npx or installed as a dev dependency using the package manager that matches the lockfile. The skill is written for codebases that use Node-based tooling.

When your agent uses it

Run knip to find and remove unused files, dependencies, and exports. Use for cleaning up dead code and unused dependencies.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (6 KB) on GitHub on 2 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the better-supabase plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add ScaleDockHQ/better-supabase
/plugin install better-supabase@better-supabase

Or copy only this skill to ~/.claude/skills/knip:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/knip &&
cp -R "$tmp/.agents/skills/knip" ~/.claude/skills/knip &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/knip inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/knip to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/knip &&
cp -R "$tmp/.agents/skills/knip" ~/.agents/skills/knip &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/knip inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/knip to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/knip &&
cp -R "$tmp/.agents/skills/knip" ~/.cursor/skills/knip &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/knip inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/ScaleDockHQ/better-supabase.git --path .agents/skills/knip

Or copy the folder to ~/.gemini/skills/knip yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/knip:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/knip &&
cp -R "$tmp/.agents/skills/knip" ~/.copilot/skills/knip &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/knip inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git

Then copy better-supabase/.agents/skills/knip into your agent's skills folder as knip. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Configuration-first workflow
Adjusts knip settings and reads configuration hints before acting on reported issues.
Prioritized cleanup order
Works through unused files, dependencies, devDependencies, exports and types in a set sequence.
Deletion safety levels
Separates high-confidence removals from changes that need user confirmation first.
Configuration best practices
Guides use of plugins, entry patterns and ignoreExportsUsedInFile while avoiding broad ignore patterns.
Production mode and auto-fix
Covers the --production flag and the --fix options, including optional file removal.
Error handling guidance
Lists steps to take when knip exits with an error or fails to load a file.

Good for

  • Find unused npm dependencies in a TypeScript project
  • Remove dead files that nothing imports
  • Clean up unused exports across a codebase
  • Tune knip config to reduce false positives
  • Run knip in production mode to skip test and config files

Knip FAQ

How do I install the knip tool this skill uses?

The skill checks whether knip runs through npx and otherwise suggests installing it as a dev dependency with npm, pnpm, yarn or bun, matching the lockfile in the project.

Does Knip remove unused imports or variables?

No. The skill states that knip does not handle unused imports or variables inside files and recommends ESLint or Biome for that.

Will the agent delete files automatically?

Only high-confidence orphaned files are treated as safe to remove. Entry points, config files and public API files require asking the user first, and file deletion needs the --allow-remove-files flag.

Which commands does Knip run?

It runs npx knip, npx knip --production, npx knip --fix and npx knip --reporter json, among others.

How do I install Knip in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/knip to use it in all your projects, or to .claude/skills/knip in one project. Or install the better-supabase plugin, which includes it: /plugin marketplace add ScaleDockHQ/better-supabase, then /plugin install better-supabase@better-supabase.

Does Knip run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Knip?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Knip?

The closest alternatives to Knip are Dead code cleanup edho ferdian, Antfu, Code simplifier, Vue ci and Kb lint.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from ScaleDockHQ/better-supabase

  1. Apply the CommonMark 0.31.2 spec when parsing or rendering Markdown

    • Open source
    • 5 GitHub stars
    • Files and documents
  2. Publish Agent Cards and run agent-to-agent calls over the A2A 1.0 protocol

    • Open source
    • 5 GitHub stars
    • Developer tools
  3. Lets an agent stream runs, tool calls and shared state to user-facing apps over AG-UI 1.0

    • Open source
    • 5 GitHub stars
    • Developer tools
  4. Lets an AI agent drive Chrome or Chromium through a fast browser automation CLI

    • Open source
    • 5 GitHub stars
    • Browser automation
  5. Guides an agent to write, review and validate SKILL.md skills against the Agent Skills

    • Open source
    • 5 GitHub stars
    • Developer tools
  6. Write, place, migrate and review AGENTS.md instruction files for coding agents

    • Open source
    • 5 GitHub stars
    • Developer tools