Find and remove unreachable/unused code safely. Use during cleanup or before a refactor.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Find and remove unreachable/unused code safely. Use during cleanup or before a refactor.
when_to_use
cleanup, "remove unused", before refactoring, dead branches
targets
["*"]
Kill Dead Code
Prove it's dead - no references (grep the symbol across the repo, including dynamic/string usage and tests). Unused export ≠ dead if it's a public API.
Check it's not feature-flagged off (dead today, alive when the flag flips).
Delete it AND its now-orphaned tests, imports, and config.
Run the full suite + a build. Dead code removal should change behavior in exactly zero ways.
Bias to delete: every line someone has to read is a cost. But never delete what you can't prove is unreachable - say "I think X is unused, confirm?" instead of guessing.