find_semantic_duplicates
Detect duplicate functions in a codebase using AST hashing for exact copies or embedding similarity for conceptual clones.
Instructions
Find duplicate functions. method='ast' (fast, hash-based, catches copy-paste) or 'embedding' (Nomic cosine, catches conceptual clones, tagged sim=min..mean per cluster).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "find_semantic_duplicates"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | ast (default, fast, exact) or embedding (slower, catches conceptual clones). Embedding reuses the symbol_vectors index from search_codebase(semantic=True) — first call triggers a ~2min reindex. | |
| project | No | Project name/path (default: active). | |
| min_lines | No | Skip functions shorter than this (default 2). Applies to method='ast'. | |
| max_groups | No | Max duplicate groups to return (default 10). Raise for full audit. | |
| min_similarity | No | Cosine threshold for method='embedding' (default 0.90). Lower = more recall + more noise. |