find_dead_code
Locate unused, orphaned, or unreferenced functions and classes in a repository AST. Use it during technical debt cleanup to identify dead code ready for safe removal.
Instructions
Finds unused, orphaned, or unreferenced functions and classes across the codebase AST. Excludes all, main, dunder methods, and test functions.
Behavior:
Read-only: Computes symbol reference counts; does NOT delete or modify any source code files.
Idempotent: Consistent dead code candidate discovery for the same repository state.
100% Offline: Local AST reference analysis.
Usage Guidelines:
When to use: Run during technical debt cleanup to locate deprecated, dead, or forgotten functions and classes ready for safe removal.
Sibling Routing: For copy-pasted duplicate logic blocks, use 'find_code_duplicity'. For general complexity and linting, use 'audit_codebase_quality'.
Returns: Markdown report listing candidate orphaned symbols with file paths, line numbers, and symbol types.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_root | No | Root directory of the repository to scan for unreferenced symbols (default: current directory). | . |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |