Scan a project folder to get a report of every duplicated code block so you know what to refactor.
Add jscpd to a CI pipeline to automatically fail builds when copy-paste duplication exceeds a threshold.
Embed the core detection library into your own code quality tool without bundling the full CLI.
Use the jscpd agent skill to let Claude or Copilot detect duplicates and refactor them automatically.
Installed via npm, no external services or infrastructure required to run a basic scan.
jscpd is a tool that scans your source code and finds blocks that have been copied and pasted from one place to another. Copy-pasted code is a common problem in software projects because it creates duplicate logic that must be updated in multiple places whenever something changes. This tool helps developers identify those duplicates so they can consolidate the code into a single reusable piece. The tool supports over 150 programming languages and file formats, so it works on almost any codebase regardless of what language it is written in. You point it at a folder or file pattern, and it produces a report listing every duplicated block it found, along with where each copy appears. Reports can be formatted as HTML, as a badge for a README, or as plain text for use in automated pipelines. There is also a server mode that exposes an API endpoint so other tools can send code snippets and receive duplication results. For developers who use AI coding assistants such as Claude or Copilot, jscpd includes an agent skill that teaches the assistant how to run the tool and then refactor the detected duplicates. This can be added with a single command and gives the assistant context about what jscpd does and how to interpret its output. The library is split into several packages so you can use just the core detection logic in your own tool without pulling in the full command-line interface. The detection algorithm is based on Rabin-Karp, a well-established method for finding repeated substrings efficiently. For very large repositories where memory is a concern, a LevelDB-backed storage option is available. jscpd is installed via npm, the standard package manager for JavaScript and TypeScript projects. It is actively maintained, used by several well-known code quality platforms, and available under an open-source license.
← kucherenko on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.