dead-code
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.zipInstalls 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 codebaseKey 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
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 pointstest_*,*_test- Test functionssetup,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.
| Approach | Pros | Cons |
|---|---|---|
| Hook (removed) | Automatic | Slowed startup by 3s |
| Skill (this) | On-demand, fast | Manual 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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| dead-code (this skill) | 1 | 6mo | Review | Intermediate |
| ast-grep-find | 3 | 7mo | Review | Intermediate |
| naming-analyzer | 2 | 6mo | Review | Beginner |
| codex-code-review | 1 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
ast-grep-find
parcadei
AST-based code search and refactoring via ast-grep MCP
naming-analyzer
davila7
Suggest better variable, function, and class names based on context and conventions.
codex-code-review
tyrchen
Perform comprehensive code reviews using OpenAI Codex CLI. This skill should be used when users request code reviews, want to analyze diffs/PRs, need security audits, performance analysis, or want automated code quality feedback. Supports reviewing staged changes, specific files, entire directories, or git diffs.
lsp-extract-function
blackwell-systems
Extract a selected code block into a named function. Primary path uses the language server's extract-function code action; falls back to manual extraction when no code action is available. Validates captured variables, scope shadowing, and compilation after extraction.
clean-code
RepairYourTech
Applies battle-tested clean code principles to writing, reviewing, and refactoring code. Covers naming, functions, comments, error handling, class design, and the critical difference between clever code and clear code.
checking-changes
streamlit
Validates all code changes before committing by running format, lint, type, and unit test checks. Use after making backend (Python) or frontend (TypeScript) changes, before committing or finishing a work session.