
dupehound
Finds the duplicate code your AI coding agent wrote twice.
About
dupehound is a fast, offline duplicate-code detector built for codebases where AI agents write most of the code. It fingerprints the structure of functions via tree-sitter parsing and winnowing, so it finds duplicates even after every identifier and literal has been renamed.
It ships three commands: scan reports every duplicate cluster plus a repo-level slop score, history charts duplication across the git log to pinpoint when it took off, and check gates CI and pre-commit by failing when a change duplicates existing code. A built-in MCP server exposes check and scan as tools that coding agents can call mid-edit to reuse existing code instead of rebuilding it. It runs locally with no network, API keys, or AI required, and is MIT licensed.
What it can do
- Structural duplicate detection across renamed code
- CI gate that fails on newly introduced duplicates
- Duplication history charted across git log
- MCP server for AI coding agents
Setup
Install via cargo install dupehound or Homebrew, then run dupehound scan in a repository.
Prerequisites
A git repository; Rust toolchain or Homebrew for installation.
Use cases
Works with
Trust score — 7/10
Scored 7/10 (metrics tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 110; Trending score 68/100 from researcher assessment.
Sources
Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.