finding-dead-code

Identify dead code with caller evidence and removal plans.

8|5|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/axiomantic/spellbook --skill finding-dead-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: finding-dead-code
Source: https://github.com/axiomantic/spellbook/tree/main/skills/finding-dead-code
Command: npx skills add https://github.com/axiomantic/spellbook --skill finding-dead-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams identify dead or unused code by requiring concrete evidence of usage (callers) before marking items as alive, thereby improving maintainability and reducing technical debt.

Core Features & Use Cases

  • End-to-end dead code verification: scans the entire codebase for potential dead code and proves its status with caller evidence.
  • Write-only detection: identifies setters or storages updated without any reads.
  • Transitive dead code and removal planning: groups orphaned code, suggests safe deletions, and provides an implementation plan.

Quick Start

Start by running a full git-safe dead-code analysis on the repository to identify truly unused code.

Frequently Asked Questions about finding-dead-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find dead code in a repository without false positives?

Dead code detection requires verifying exact callers and demanding concrete usage evidence before marking items as alive. This approach scans the entire codebase, including tests, to distinguish truly unused code from active items and reduce false positives.

What is transitive dead code and how is it identified?

Transitive dead code consists of functions or modules only called by other already-dead code. Identification groups these orphaned items together by tracing the call graph, ensuring that cascading unused code is safely detected and planned for removal.

Can static analysis detect write-only dead code?

Static analysis can detect write-only dead code by identifying variables, setters, or storages that are updated but never read. This requires thorough provenance tracking across the repository to prove no read paths exist.

How do I safely remove unused code from a Git repository?

Safe removal involves generating an evidence-rich report with a deletion plan and post-removal verification commands. Enforcing Git safety and performing iterative re-scans ensures dependencies remain intact after the dead code is deleted.

Does dead code analysis cover test and auxiliary code?

Dead code analysis applies across the entire repository, including test and auxiliary code. Scanning these directories is essential because items appearing unused in production logic may actually be invoked by test suites.