dead-code — Claude Code skill: find unused code
A skill that finds unused functions and dead code with TLDR static analysis. Runs on demand, whenever a codebase needs a cleanup pass.
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a claude-codeWhat dead-code does
The skill runs TLDR analysis over a codebase and reports dead functions: the total count, how many are never called, and the file and line for each one. Point it at the whole project or a single directory.
Under the hood it calls tldr dead. Pick a language with --lang (python, typescript) and set entry points with --entry. By default main, cli, test_*, *_test, setup, teardown and handlers like @app.route are excluded from the analysis; pass your own names as a list to the same flag. Bash is the only tool the skill is allowed to use.
It replaces the session-start-dead-code hook. That hook ran on its own but added 3 seconds to session startup, so this version trades automatic runs for manual invocation. Works on Windows, Mac and Linux, WSL included.
What it helps with
- find functions nothing calls anymore
- strip old code before a refactor
- check a directory for unreachable methods
- drop legacy helpers after a module rewrite
- size up how much dead code a project carries
Example prompts for the agent
- scan the project for dead code
- find unused functions in src/
- check src/ for dead code, entry points are main and api_handler
How to install dead-code
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a claude-code2Manually: put the files in place
~/.claude/skills/dead-code/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/dead-code/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a codex2Manually: put the files in place
.agents/skills/dead-code/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a cursor2Manually: put the files in place
.cursor/skills/dead-code/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install parcadei/Continuous-Claude-v3 dead-code2Manually: put the files in place
.github/skills/dead-code/SKILL.md1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a gemini-cli2Platform CLI
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/dead-codeManually: put the files in place
.devin/skills/dead-code/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about dead-code
How do I install dead-code in Claude?
Run npx skills add parcadei/Continuous-Claude-v3 --skill dead-code -a claude-code. The skill lands in ~/.claude/skills/dead-code/SKILL.md.
What does dead-code do?
It finds unused functions and dead code through TLDR static analysis, listing the file and line for every hit.
How is the skill different from the session-start-dead-code hook?
The hook ran the analysis automatically at session start and cost 3 seconds of startup time. The skill does the same work, but only when you ask for it.
Source text
SKILL.md · MIT
--- name: dead-code description: Find unused functions and dead code in the codebase allowed-tools: [Bash] keywords: [dead code, unused, cleanup, refactor, unreachable] --- # Dead Code Detection Find unused functions and dead code using TLDR static analysis. ## Quick Start ```bash # 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). ```bash # 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 ```bash # 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 ```bash # Impact analysis (who calls this?) tldr impact func_name . # Architecture layers tldr arch src/ # Full codebase structure tldr structure . --lang python ```
© parcadei · MIT · parcadei/Continuous-Claude-v3