# Treepeat – Code similarity detection using Tree-sitter

treepeat is a tool that finds similarities in your codebase. Find duplicate code blocks meaningful to the language (classes/functions), not just lines. Find near-duplicates: ignore whitespace, strings, high level AST nodes such as function and names. Find structurally similar code: anonymize identi…

- **Page:** https://magpie.gallery/i/treepeat-code-similarity-detection-using-tree-sitt-2qc1
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** code-similarity, duplicate-code, tree-sitter, ast, cli

## Source

Web · 91awebsi: Treepeat – Code similarity detection using Tree-sitter

- **Original:** https://news.ycombinator.com/item?id=49804359

> treepeat is a tool that finds similarities in your codebase. Find duplicate code blocks meaningful to the language (classes/functions), not just lines. Find near-duplicates: ignore whitespace, strings, high level AST nodes such as function and names. Find structurally similar code: anonymize identifiers, constants, etc. Pull requests welcome: This is very much an proof of concept - I'm happy with it, but I haven't supported very many languages at present. Languages supported: astro, bash, css, go, html, javascript, lua, markdown (plus codeblocks), python, sql, typescript, java, kotlin, rust, yaml https://github.com/dsummersl/treepeat

## GitHub projects

- https://github.com/dsummersl/treepeat

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
