Doppelscan

•

Detect structural code duplication across codebases and generate parameter-aware refactoring templates for developers and coding agents.

Doppelscan is a fast, syntax-aware duplicate code finder engineered specifically for developers and AI coding agents. Powered by Rust and tree-sitter, it identifies structurally identical code fragments even when variable names, literals, or small statements differ. Beyond basic clone detection, Doppelscan reconstructs what a shared helper function should look like by identifying parameter candidates, local renames, and a ready-to-use template body. Built to run as both a standalone CLI and an MCP server, it integrates seamlessly into CI/CD pipelines and interactive agent sessions like Claude Code to automate DRY refactoring and stop code bloat.

主要功能

01Syntax-aware clone detection using tree-sitter to find structural duplicates despite altered names and literals
02Automated helper template synthesis identifying extractable parameters, local renames, and template bodies
03Near-duplicate matching to spot functions with minor additions, deletions, or statement edits
04Baseline tracking and regression checks to prevent new duplication from passing CI/CD pipelines
05Native Model Context Protocol (MCP) server support enabling AI coding agents to analyze and refactor code directly
060 GitHub stars

使用案例

01Empowering AI coding assistants like Claude Code to inspect and refactor duplicate logic via MCP tool calling
02Gating pull requests in CI pipelines to reject newly introduced code duplication using baseline diffs
03Auditing large repositories across dozens of languages to uncover high-impact refactoring opportunities