with one click
find-unused
// Identify commented-out code, unused symbols, and unused test helpers using LSP-based analysis. Use when cleaning up dead code, finding orphaned functions, or optimizing codebase size.
// Identify commented-out code, unused symbols, and unused test helpers using LSP-based analysis. Use when cleaning up dead code, finding orphaned functions, or optimizing codebase size.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | find-unused |
| description | Identify commented-out code, unused symbols, and unused test helpers using LSP-based analysis. Use when cleaning up dead code, finding orphaned functions, or optimizing codebase size. |
Analyzes codebase to identify commented-out code blocks, unused exports, unused functions, and unused test helpers. Uses parallel analysis agents for comprehensive coverage.
What this command does NOT do:
When to REJECT:
ultrathink: you'd perform the following steps
Parse Arguments
Discover Files
Launch three parallel analysis agents (Commented Code / Unused Exports / Unused Test Helpers). See references/parallel-analysis.md for the full three-agent decomposition, including the hierarchical LSP phases (file-level → symbol-level → test helpers) and the test-only production code detector. See references/lsp-operations.md for the LSP→task mapping and reference-classification rules each agent relies on.
Commented Code Agent
Unused Exports Agent
Unused Test Helpers Agent
Merge Findings
Prioritize
Output Format:
[✅] Command: find-unused $ARGUMENTS
## Summary
- Path scanned: [path]
- Files analyzed: [count]
- Commented blocks: [count]
- Unused exports: [count]
- Unused test helpers: [count]
## Findings
### 🔴 Unused Exports (High Priority)
- [file:line] `exportName` - No references found
- [file:line] `exportName` - Only internal use
### 🟡 Commented Code Blocks (Medium Priority)
- [file:line] - [N] lines of commented code
- [file:line] - [N] lines of commented code
### 🟢 Unused Test Helpers (Low Priority)
- [file:line] `helperName` - No test references
- [file:line] `fixtureName` - Unused fixture
## Recommendations
1. Review unused exports for potential removal
2. Delete or restore commented code blocks
3. Clean up unused test helpers
## Next Steps
- Review findings manually
- Remove confirmed dead code
- Update tests if needed
/find-unused
# Analyzes all code in current directory
/find-unused "src/services/"
# Focuses analysis on services directory
/find-unused "src/" --exclude="*.test.ts"
# Excludes test files from analysis
/find-unused "nonexistent/"
# Error: Path 'nonexistent/' does not exist
# Suggestion: Check path with 'ls' or use '.' for current directory