← ClaudeAtlas

rescue-dead-codelisted

Finds code a legacy project probably no longer uses: unreferenced files, exports and functions, unused dependencies, feature flags stuck on or off, constant conditions and commented-out blocks. Rates each finding high, medium or low confidence with the evidence, writes rescue/dead-code.md, and proposes deletion in small, separately revertible batches. Never deletes anything without explicit confirmation. Use when the user says "find dead code", "what can we delete", "is this file still used", "remove unused code", "clean up old feature flags", "unused dependencies", or "shrink this codebase".
vivekbhange-hub/legacy-rescue-skill · ★ 0 · AI & Automation · score 75
Install: claude install-skill vivekbhange-hub/legacy-rescue-skill
# rescue-dead-code Every line in a legacy codebase costs reading time, upgrade work and false leads during an incident. Some of it does nothing. This skill finds the likely-dead parts, proves or disproves each one with evidence, and proposes deletion in batches small enough that a wrong call is a one-commit revert. It is conservative by design: a text search cannot see reflection, routing by convention, templates or code called from outside the repo, so the default answer for anything uncertain is "leave it and log it". ## Inputs - `$ARGUMENTS`: path to scan, default `.`. - `rescue/map.md` if present: entry points and frameworks change what "unreferenced" means. - Production evidence if the user can share it: access logs, APM endpoint lists, job run logs. This is the only thing that turns "probably dead" into "dead". ## Output - `rescue/dead-code.md`: findings by category with confidence and evidence, then a deletion proposal in batches. - Code changes only after the user approves a specific batch, one batch per commit. ## Steps 1. **Run the scanner.** ``` python3 "${CLAUDE_SKILL_DIR}/dead_code_scan.py" . --output rescue/dead-code-scan.md ``` It reports commented-out code blocks (comment runs that look like code, not prose), constant conditions (`if (false)`, `if 0:`, `#if 0`, `if True:`; `while (true)` loops are ignored) and orphan files (source files whose name no other file mentions). Use `--min-block 5` for less noise and `--skip <dir>` for