This skill detects unreachable or deprecated code while allowing for exclusions to prevent false positives.

Install

mkdir -p .claude/skills/dead-code && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3753" && unzip -o skill.zip -d .claude/skills/dead-code && rm skill.zip

Installs to .claude/skills/dead-code

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Find unused functions and dead code in the codebase
51 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Scan codebase for unused functions
  • Exclude entry points and tests from analysis
  • Identify unreachable legacy code
  • Support multiple programming languages

How it works

It performs static analysis on the codebase to identify functions that are never called, excluding specified entry points.

Inputs & outputs

You give it
Codebase directory
You get back
List of unused functions and dead code locations

When to use dead-code

  • Cleaning up unused functions before deployment
  • Identifying dead legacy code
  • Verifying if a function is called anywhere in the project
  • Refactoring codebase by removing unreachable methods

About this skill

Dead Code Detection

Find unused functions and dead code using TLDR static analysis.

Quick Start

# Scan entire project
tldr dead .

# Scan specific directory
tldr dead src/

# Specify entry points (functions to exclude from analysis)
tldr dead . --entry main cli test_

# Specify language
tldr dead . --lang python
tldr dead . --lang typescript

Output Format

Dead code analysis:
  Total functions: 150
  Dead functions: 12

Unused functions:
  - old_helper (src/utils.py:42)
  - deprecated_func (src/legacy.py:15)
  - _unused_method (src/api.py:230)

Cross-Platform

Works on Windows, Mac, and Linux (including WSL).

# Windows (PowerShell)
tldr dead .

# Mac/Linux
tldr dead .

Entry Points

Functions matching entry patterns are excluded from dead code analysis:

  • main, cli - Application entry points
  • test_*, *_test - Test functions
  • setup, teardown - Fixtures
  • @app.route, @api.endpoint - Framework handlers
# Custom entry points
tldr dead src/ --entry main api_handler background_job

Integration

This skill replaces the session-start-dead-code hook with on-demand analysis.

ApproachProsCons
Hook (removed)AutomaticSlowed startup by 3s
Skill (this)On-demand, fastManual invocation

Related Commands

# Impact analysis (who calls this?)
tldr impact func_name .

# Architecture layers
tldr arch src/

# Full codebase structure
tldr structure . --lang python

When not to use it

  • When the project uses dynamic function calls that static analysis cannot detect
  • When false positives are unacceptable

Prerequisites

tldr tool installed

Limitations

  • Static analysis may produce false positives
  • Requires manual entry point configuration

How it compares

It provides on-demand dead code detection instead of slowing down project startup with automated hooks.

Compared to similar skills

dead-code side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
dead-code (this skill)16moReviewIntermediate
ast-grep-find37moReviewIntermediate
naming-analyzer26moReviewBeginner
codex-code-review17moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry