Detects duplicate and near-duplicate functions across your codebase using semantic embeddings. Works cross-language — can find a Python function that does the same thing as a JavaScript function. Similarity threshold controls how strict the matching is.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
threshold | number | No | 0.7 | Similarity threshold (0.0 to 1.0). Lower values find looser matches. |
limit | number | No | 20 | Maximum number of duplicate pairs to return |
uri | string | No | workspace | Scope the search to a specific file or directory |
Are there any duplicate functions in this codebase?
Scans the workspace with the default 0.7 threshold and returns up to 20 duplicate pairs.
Find near-exact duplicate functions — threshold 0.9 or higher.
Uses threshold: 0.9 to find functions that are almost identical (e.g., copy-pasted with minor renaming).
Find functions in the Python backend that duplicate logic from the TypeScript frontend.
The semantic embedding approach naturally works across languages — no special configuration needed.
Check src/handlers/ for duplicate functions.
Sets uri to scope the search to the handlers directory.
Returns a list of duplicate pairs, each containing:
Threshold interpretation:
| Score | Meaning |
|---|---|
| 0.95–1.0 | Near-exact duplicate — likely copy-pasted |
| 0.85–0.95 | Very similar — same logic with minor differences |
| 0.7–0.85 | Renamed clone — same structure, different names |
| 0.5–0.7 | Similar purpose — may or may not be true duplicates |
threshold: 0.7 for a broad scan, then increase to 0.85 if there are too many resultsformatDate() in JavaScript will match a format_date() in Python if they do the same thingstellarion_compare_symbols to do a deep side-by-side comparison of a specific duplicate pairlimit and uri to keep output manageable