Skip to content
Back to skills

Detecting Dead Code

ASecurity

Identifies unreachable functions, unused variables, and abandoned code in binary programs. Use when optimizing binary size, analyzing code coverage, or investigating abandoned functionality.

  • 666 stars
  • 0 votes
  • 0 copies
  • 12 views
  • Added February 8, 2026
code-qualitygosecurity

Security analysis

A100/100

Scanned February 10, 2026

npx -y skills add majiayu000/claude-skill-registry --skill detecting-dead-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Detecting Dead Code?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Detecting Dead Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-detecting-dead-code/badge)](https://www.skillsdirectory.com/skills/majiayu000-detecting-dead-code)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: detecting-dead-code
description: Identifies unreachable functions, unused variables, and abandoned code in binary programs. Use when optimizing binary size, analyzing code coverage, or investigating abandoned functionality.
---

# Dead Code Detection

## Detection Workflow

1. **Build call graph**: Use `disasm` to build control flow, identify all functions, map function call relationships
2. **Identify entry points**: Find main/entry functions, locate exported functions, identify callback registrations, map interrupt handlers
3. **Trace reachability**: Perform forward reachability analysis from entry points, mark all reachable functions and blocks, identify unreachable code
4. **Analyze dead code**: Categorize dead code types, assess security implications, identify potential vulnerabilities, estimate size reduction

## Key Patterns

- Unreachable functions: functions with no callers, functions only called from dead code, functions after infinite loops, functions after exit() calls
- Unreachable blocks: basic blocks after return statements, code after unconditional jumps, blocks with no incoming edges, code guarded by always-false conditions
- Unused data: global variables never referenced, string constants never used, data sections with no references, debug symbols in production builds
- Conditional dead code: code in always-false branches, debug-only code in release builds, platform-specific code for other platforms, feature flags permanently disabled

## Output Format

Report with: id, type, subtype, severity, confidence, location, dead_code_type, reason, callers, references, size_estimate, security_implications, potential_vulnerabilities, recommendation.

## Severity Guidelines

- **MEDIUM**: Dead code containing security vulnerabilities
- **LOW**: Dead code with no security impact

## See Also

- `patterns.md` - Detailed detection patterns and exploitation scenarios
- `examples.md` - Example analysis cases and code samples
- `references.md` - CWE references and mitigation strategies

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.