Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Knip

Find and fix unused dependencies, exports and files in TypeScript/JavaScript projects.

Linting and formattingNPM

GitHubWebsite

1. License

License from npm.

github.com/webpro-nl/knip

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Knip does

Knip starts from entry points it reads off the frameworks and tools in your repo, including monorepos, and reports the files, exports and npm dependencies nothing reaches; builders who used it say it finds a lot, but some of the "unused" list is still wrong.

Knip popularity

77 / 100
Gid Score, #157 overall
34.2M
downloads a week, npm
12.7K
GitHub stars
154
agent projects use it
Knip: downloads per weeknpm, knip 34,249,826
Knip: GitHub starswebpro-nl/knip 12,715

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Knip is used

  • Knip is a dependency in 154 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (3.2% of the 4,867 JavaScript/TypeScript ones), #6 of 83 in linting and formatting.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 321; those are left out of every share on this page.
  • The most used alternative in our scan is ESLint (2,282 projects).
  • Projects that use it most often also use Vitest (63.6%), TypeScript (90.9%), Playwright (JavaScript) (50.0%).
  • It is more common in projects set up for OpenAI Codex (8.5%) than for GitHub Copilot (2.4%).

By coding agent

116 projects, 3.5%
74 projects, 2.4%
66 projects, 2.7%
40 projects, 8.5%
28 projects, 5.9%
26 projects, 7.6%
8 projects, 2.9%
6 projects, 5.4%

Often used with

In 63.6% of its projects
In 90.9% of its projects
In 50.0% of its projects
In 32.5% of its projects
In 35.7% of its projects
In 29.2% of its projects
In 33.1% of its projects
In 33.8% of its projects

Knip in practice

Strengths

Entry points come from your actual stack

Knip does not ask you to list every root file. It works out entry points from the frameworks and tooling it detects, and the site says this applies in monorepos too.

A large plugin catalogue

The maintainers list 190+ plugins, covering tools from Astro and Cypress to GitHub Actions and Webpack. Each plugin teaches Knip where that tool's files and dependencies are used.

One command for a first pass

Josh Goldberg ran <code>npx knip</code> on a Next.js package with a two-line config. It reported unused files, dependencies, devDependencies, unlisted dependencies, exports and exported types.

Per-workspace config for monorepos

In an Nx repo, John James used a <code>workspaces</code> map to give each app or package its own <code>ignoreDependencies</code> list, and skipped a whole workspace with <code>ignoreWorkspaces</code>.

Watch out for

Expect false positives on a first scan

In one Nx monorepo, about 40% of the packages Knip flagged were actually in use. The builder treated the list as a hint and checked each removal with builds and tests.

Indirect usage slips past it

The same builder found Knip weak where a package is used only by name in config files, in scripts, in CI or through plugin discovery. Those packages needed entries in the ignore list.

Deleting dead code may not shrink the bundle

Goldberg removed everything Knip flagged in the Centered app. The bundle barely changed, and a Lighthouse audit showed the same score.

More about Knip

Funding
  • GitHub Sponsors: https://github.com/webpro
  • Open Collective: https://opencollective.com/knip
  • 13 GitHub sponsors

See all

Packages around it
  • vitest: Unit test runner
  • @playwright/test: End-to-end browser tests
  • typescript: Type checker and compiler
  • husky: Git hooks
  • @testing-library: Component testing helpers
  • lint-staged: Run checks on staged files
More in Linting and formatting

Alternatives

Knip This page

ISCGid 7734.2M/wk

ESLint

Linter that finds and fixes JavaScript code patterns based on AST analysis.

MITGid 87216M/wk

Biome

Fast web toolchain providing linting, formatting and code quality all in one.

MIT OR Apache-2.0Gid 8230.3M/wk

Compare Knip with another tool

Get started

Install it.

npm install knip

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Knip
- Start with a plain `npx knip` (or `yarn dlx knip`) run before writing any config, and read the report by category: files, dependencies, devDependencies, unlisted dependencies, exports, types.
- Treat every "unused" item as a hint. Remove it, then run build, test, lint and e2e, and boot the owning app before you commit.
- If a removal breaks something, restore the package and add it to `ignoreDependencies` with a one-line comment explaining why, for example "referenced by name in jest config" or "scripts only".
- In monorepos, put workspace-specific ignores under `workspaces` in the config instead of one global list, and use `ignoreWorkspaces` for packages such as a shared ESLint config.
- When framework detection misses entry points, set `entry` explicitly (for a Next.js pages app: `pages/**/*.tsx`) and use `ignore` for public assets referenced by URI.
- Add Knip to CI as a report first. Tune the ignore list for a while, then fail the build on new unused dependencies.