What is biston?
biston is a structural clone detector and refactor suggester for Python. It parses your code with tree-sitter, normalizes each function into a canonical AST, and finds groups of functions that are structurally similar — even when local names, literals, and argument order differ. For each match it can also propose an anti-unified template with typed “holes” that you could extract into a shared helper.
Written in Rust and distributed as a Python package, biston runs fast enough to drop into CI pipelines.
Who it’s for
- Python teams tracking copy-paste drift across modules as a codebase grows.
- CI pipelines that want SARIF output wired into code-quality dashboards.
- AI coding agents (and the humans reviewing their PRs) where boilerplate tends to accumulate function by function.
Next
- How It Works — the pipeline, from discovery to anti-unified templates.
Machine-readable docs
Every page on this site is also served as raw Markdown, following the llms.txt convention:
llms.txt— compact index with links to every page as.md.llms-full.txt— all pages concatenated into a single document.
Drop either one into an LLM context window to give the model the full picture without scraping HTML.