{
 "kind": "tool",
 "slug": "knip",
 "path": "tools/knip/",
 "name": "Knip",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Linting and formatting",
   "tools/lint-format/"
  ]
 ],
 "lead": "Find and fix unused dependencies, exports and files in TypeScript/JavaScript projects.",
 "chips": [
  {
   "label": "Linting and formatting",
   "path": "tools/lint-format/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install knip"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/webpro-nl/knip"
  },
  {
   "label": "Website",
   "href": "https://knip.dev"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "ISC",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/webpro-nl/knip"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 23, 2026",
   "note": "Latest GitHub release Nov 22, 2026. ",
   "src": "https://github.com/webpro-nl/knip"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "154 projects",
   "status": "info",
   "sub": "#6 of 83 in its category",
   "note": "Dependency in 154 public GitHub projects set up for AI coding agents that we scanned (2.5%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Knip does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Knip popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "77",
       "of": "/ 100",
       "l": "Gid Score, #157 overall"
      },
      {
       "n": "34.2M",
       "l": "downloads a week, npm"
      },
      {
       "n": "12.7K",
       "l": "GitHub stars"
      },
      {
       "n": "154",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Knip is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "116 projects, 3.5%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "74 projects, 2.4%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "66 projects, 2.7%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "40 projects, 8.5%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "28 projects, 5.9%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "26 projects, 7.6%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "8 projects, 2.9%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "6 projects, 5.4%",
       "v": "Roo Code",
       "path": "agents/roo-code/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 63.6% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 90.9% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "Playwright (JavaScript)",
       "path": "tools/playwright-test/"
      },
      {
       "l": "In 32.5% of its projects",
       "v": "lint-staged",
       "path": "tools/lint-staged/"
      },
      {
       "l": "In 35.7% of its projects",
       "v": "Husky",
       "path": "tools/husky/"
      },
      {
       "l": "In 29.2% of its projects",
       "v": "Turborepo",
       "path": "tools/turbo/"
      },
      {
       "l": "In 33.1% of its projects",
       "v": "jsdom",
       "path": "tools/jsdom/"
      },
      {
       "l": "In 33.8% of its projects",
       "v": "Testing Library",
       "path": "tools/testing-library/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Knip in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Entry points come from your actual stack",
       "v": "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."
      },
      {
       "l": "A large plugin catalogue",
       "v": "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."
      },
      {
       "l": "One command for a first pass",
       "v": "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."
      },
      {
       "l": "Per-workspace config for monorepos",
       "v": "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>."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Expect false positives on a first scan",
       "v": "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."
      },
      {
       "l": "Indirect usage slips past it",
       "v": "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."
      },
      {
       "l": "Deleting dead code may not shrink the bundle",
       "v": "Goldberg removed everything Knip flagged in the Centered app. The bundle barely changed, and a Lighthouse audit showed the same score."
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Knip",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/webpro",
        "Open Collective: https://opencollective.com/knip",
        "13 GitHub sponsors"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "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"
       ]
      },
      {
       "title": "More in Linting and formatting",
       "path": "tools/lint-format/",
       "items": [
        {
         "text": "Prettier",
         "path": "tools/prettier/"
        },
        {
         "text": "oxlint",
         "path": "tools/oxlint/"
        },
        {
         "text": "oxfmt",
         "path": "tools/oxfmt/"
        },
        {
         "text": "stylelint",
         "path": "tools/stylelint/"
        },
        {
         "text": "ESLint Import Resolver TypeScript",
         "path": "tools/eslint-import-resolver-typescript/"
        },
        {
         "text": "oxlint-tsgolint",
         "path": "tools/oxlint-tsgolint/"
        },
        {
         "text": "Black",
         "path": "tools/black/"
        },
        {
         "text": "svelte-check",
         "path": "tools/svelte-check/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Knip",
       "me": true,
       "facts": [
        "ISC",
        "Gid 77",
        "34.2M/wk"
       ]
      },
      {
       "name": "ESLint",
       "why": "Linter that finds and fixes JavaScript code patterns based on AST analysis.",
       "path": "tools/eslint/",
       "facts": [
        "MIT",
        "Gid 87",
        "216M/wk"
       ]
      },
      {
       "name": "Biome",
       "why": "Fast web toolchain providing linting, formatting and code quality all in one.",
       "path": "tools/biomejs/",
       "facts": [
        "MIT OR Apache-2.0",
        "Gid 82",
        "30.3M/wk"
       ]
      }
     ],
     "more": "Compare Knip with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install knip"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Knip\n- 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.\n- Treat every \"unused\" item as a hint. Remove it, then run build, test, lint and e2e, and boot the owning app before you commit.\n- 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\".\n- 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.\n- 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.\n- Add Knip to CI as a report first. Tune the ignore list for a while, then fail the build on new unused dependencies.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm knip"
  ],
  [
   "Category",
   "Linting and formatting"
  ],
  [
   "License",
   "ISC"
  ],
  [
   "Latest version",
   "knip@6.41.0, October 9, 2026"
  ],
  [
   "On GitHub since",
   "October 2022"
  ],
  [
   "Gid Score",
   "77.1"
  ],
  [
   "Rank in category",
   "#6 of 83"
  ],
  [
   "GitHub",
   "webpro-nl/knip"
  ],
  [
   "Last change",
   "Nov 23, 2026"
  ]
 ],
 "good": [
  "Used by TanStack, as listed by the source; we have not checked each one."
 ],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/webpro-nl.png"
}