Clean Deadcode
Workflow
- •
Determine the dead code analysis tool to use:
- •Check project config files (AGENTS.md, CLAUDE.md, README, Makefile, etc.) for tooling conventions
- •If not found, ask the user which tool to use
- •
Run the tool and collect results.
- •
Categorize findings by severity:
- •SAFE: Unused utilities, helpers, test files
- •CAUTION: API routes, components (may have external consumers)
- •DANGER: Config files, main entry points (never delete)
- •
Generate a report at
.reports/dead-code-analysis.mdwith all findings and their categories. - •
Delete SAFE items only. For each deletion:
- •Apply the change
- •Run the test suite
- •Roll back if tests fail
- •
Summarize cleaned items and any CAUTION items for user review.
Hard Rule
Never delete code without running tests after each change.