scan_repo
Scan a repository’s source files for dead code, duplicates, oversized modules, and dependencies to gather findings before planning code changes.
Instructions
Scan source files for dead code, duplicates, oversized modules, and dependencies. Use when: you need repository-wide findings before planning changes. Don't use when: you only need source lines from a known file (use get_chunk instead).
Returns {summary, dead_code, duplicates, god_files, dep_graph, subprojects}. Summary includes file/symbol/line counts, languages, parse_failures and unscanned-source counts. Findings carry file paths and 1-indexed lines; dep_graph has nodes, {from, to} edges, circular paths, external_imports, unresolved_relative_imports and package_imports counts. A missing/non-directory root or a path-validation failure returns error, empty findings/graph and a zero summary, without subprojects. Lists are capped at 200 items, duplicate groups at 50 and their locations at 10; shortened lists gain _total, with truncated listing shortened top-level/graph lists. Summary counts remain complete. In a nonempty Git index, only tracked files are analysed; outside Git, all eligible files are.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| languages | No | Optional case-insensitive language filter: python, javascript, typescript, go, kotlin. Default null (or []) scans all supported languages; unknown names are ignored. Example: ['python', 'typescript']. | |
| root_path | Yes | Existing source directory to scan; prefer an absolute path, e.g. /work/app. Relative paths resolve from the server working directory. | |
| include_tests | No | Defaults to true. Currently accepted for compatibility but does not filter test files: both true and false include them. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| summary | Yes | ||
| dead_code | Yes | ||
| dep_graph | Yes | ||
| god_files | Yes | ||
| truncated | No | ||
| duplicates | Yes | ||
| subprojects | No | ||
| dead_code_total | No | ||
| god_files_total | No | ||
| duplicates_total | No | ||
| subprojects_total | No |