find-dead-code

Detect and remove dead code from Python backends using Vulture and coverage analysis.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/weside-ai/claude-code-plugin --skill find-dead-code-weside-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: find-dead-code
Source: https://github.com/weside-ai/claude-code-plugin/tree/main/we/skills/find-dead-code
Command: npx skills add https://github.com/weside-ai/claude-code-plugin --skill find-dead-code-weside-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires vulture, and includes scripts (resource) components.

What problem does it solve?

This Skill automates the detection and removal of dead code from Python backends, helping developers reduce codebase size and maintain cleaner code.

Core Features & Use Cases

  • Method-Level Detection: Identifies methods with zero production callers.
  • Test-Only Reference Detection: Finds code executed by tests but not used in production.
  • Coverage-Based Detection: Utilizes pytest-cov to detect files with 0% coverage.
  • Vulture Static Analysis: Uses Vulture to find dead code with high confidence.
  • Test Cleanup & Quality Gate: Ensures tests remain clean and functional after code removal.
  • Use Case: A developer uses this Skill to clean up unused functions in a Python backend, improving code quality and reducing maintainability overhead.

Quick Start

Run the 'find-dead-code' skill to automatically detect and remove dead code from your Python backend.

Frequently Asked Questions about find-dead-code

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

FAQPage Schema
How do I find dead code in a Python backend?

You can find dead code in a Python backend by running static analysis to detect methods with zero production callers, test-only references, and files with 0% coverage. This process identifies unused functions for safe removal.

What is the best way to detect unused Python functions?

The best way to detect unused Python functions is combining Vulture static analysis with coverage-based detection. This identifies high-confidence dead code and highlights methods executed only by tests but absent from production logic.

Does dead code detection work with pytest coverage data?

Dead code detection works with pytest coverage data by utilizing pytest-cov to find files with 0% coverage. This coverage-based detection pinpoints completely untested modules, signaling they may be unused dead code.

Do I need Vulture installed to automate Python code cleanup?

You need Python and Vulture installed to automate Python code cleanup using this approach. Vulture performs the static analysis required to find dead code with high confidence alongside method-level and coverage-based detection.

How do I ensure tests remain clean after removing dead code?

To ensure tests remain clean after removing dead code, the process includes a test cleanup and quality gate. This verifies that your test suite stays functional and validates code quality immediately after unused functions are deleted.

What are the limitations of using static analysis for dead code detection?

A limitation of static analysis for dead code detection is that it may miss dynamically called code. Relying solely on Vulture can produce false positives, which is why combining it with coverage-based detection ensures higher accuracy.