find_duplicates
Identify near-identical pattern keys for consolidation by comparing token overlap and prefix matching. Suggests merges for formatting drift after bulk imports without performing changes.
Instructions
Detect near-identical pattern keys that should probably be merged.
Compares every pattern against every other using token overlap and
prefix matching. Flags candidate pairs above the threshold so you
can apply alias_pattern() to consolidate them. Read-only — this
tool suggests merges but never performs them.
A common use case: after a bulk import_patterns() or import_claude_md(),
call this to catch formatting drift (spacing, casing, punctuation).
Args:
threshold: Similarity cutoff, 0.0 to 1.0. Default 0.75. Lower
thresholds (0.5) over-suggest; higher (0.9) under-suggest.
Start at default and tune per your noise tolerance.
Returns:
Dict with keys: "duplicates" (list of {pattern_a, pattern_b,
similarity}), "count" (int), "hint" pointing to alias_pattern
as the next step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| threshold | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||