List the clones of one file
get_file_clonesFind duplicate code for a specific file by listing all clones that include it, showing other files with shared code segments.
Instructions
List every clone from the last scan that involves one file, so you know which other files share code with it. Use it before refactoring, splitting or deleting a file, or after editing it (re-scan first with check_current_directory). Returns {file, clones, returned, duplications[]} where each duplication has 'format', 'fileA', 'startA', 'endA', 'fileB', 'startB', 'endB', 'lines', 'tokens' and 'kind', biggest clone first; the requested file may appear as fileA or fileB. A path that was not part of the scan returns clones 0. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The file to inspect, either relative to the scan root exactly as paths appear in other tool results (e.g. 'src/cart.js') or absolute | |
| limit | No | Maximum number of clones to include in the response. 'clones' always carries the untruncated total, so a small limit still tells you how much was found. |