remove_dead_code
Remove dead code symbols from source files after verifying they are unused. Preview with dry-run, then apply to delete and handle orphaned imports.
Instructions
Safely remove a dead symbol from its file. Verifies the symbol is actually dead (multi-signal detection or zero incoming edges) before removal. Warns about orphaned imports in other files. Dry-run by default — preview the plan, then re-call with dry_run: false to apply. Destructive when applied — deletes code from source files. Use get_dead_code first to identify candidates. Returns JSON: { success, removed: { symbol_id, file }, orphanedImports }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Preview changes without applying (default: true). Set to false to apply. | |
| symbol_id | Yes | Symbol ID to remove (from get_dead_code results) |