Skip to content
Tech News
← Back to articles

New open-source tool treepeat detects duplicate code via Tree-sitter parsing

read original more articles
GoKawiil Brief

A developer released treepeat, a Python-installable tool that scans codebases for duplicate and near-duplicate code using Tree-sitter AST analysis and locality-sensitive hashing. It offers three normalization modes ranging from exact duplicate detection to loose structural similarity matching, and currently supports 15 languages including Python, JavaScript, Go, Rust and Java. The creator describes it as a proof of concept and is soliciting community contributions to expand language support.

Why It Matters

GoKawiil's interpretation of the reporting above, not reported fact.

By comparing code at the level of meaningful language constructs like functions and classes rather than raw text lines, the tool could catch copy-pasted or lightly modified logic that traditional line-based diff or duplication checkers miss. Its CI-friendly SARIF output suggests it could be integrated into automated code review pipelines, though as an early-stage project its accuracy and language coverage remain limited.

Key Takeaways

Source: github.com, 2026-09-22

Published there as: “Show HN: Code similarity detection using Tree-sitter”

Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.