Analyzes $ARGUMENTS to identify commented-out code and unused symbols using graph-based analysis. Symbols are considered used if they are referenced internally or reachable via exports in package.json (including subpath exports). Detects both 1st-degree unused symbols and 2nd-degree unused symbols (symbols only used by unused code).
Analyzes code to identify commented-out blocks and unused symbols using graph-based dependency analysis.
/plugin marketplace add alvis/.claude/plugin install coding@alvisAnalyzes $ARGUMENTS to identify commented-out code and unused symbols using graph-based analysis. Symbols are considered used if they are referenced internally or reachable via exports in package.json (including subpath exports). Detects both 1st-degree unused symbols and 2nd-degree unused symbols (symbols only used by unused code).
What this command does NOT do:
When to REJECT:
ultrathink: you'd perform the following steps
Analyze Requirements
Identify Applicable Workflows & Standards
Delegation Decision
Risk Assessment
Workflow Compliance
Primary Implementation
Launch 2 parallel agents using Task tool:
Agent 1: Commented Code Finder
// followed by code patterns/* ... */ containing code{/* ... */}Agent 2: Unused Symbol Detector
Standards Enforcement
Edge Case Handling
Workflow-Based Verification
Graph Validation
Automated Testing
Quality Assurance
Side Effect Validation
Output Format:
[✅/❌] Command: $ARGUMENTS
## Summary
- Files analyzed: [count]
- Commented code blocks: [count]
- 1st-degree unused symbols: [count]
- 2nd-degree unused symbols: [count]
- Unreachable exports: [count]
- Test file unused symbols: [count]
## Commented-Out Code
### [file-path]
- Line [X-Y]: [Type of code] - [Brief description]
## 1st-Degree Unused Symbols
### [file-path]
- Line [X]: [Symbol type] '[name]' - Not used internally, not in exports
- Line [Y]: [Symbol type] '[name]' - Not referenced anywhere
## 2nd-Degree Unused Symbols (only used by unused code)
### [file-path]
- Line [X]: [Symbol type] '[name]' - Only used by: [unused-symbol-1], [unused-symbol-2]
- Line [Y]: [Symbol type] '[name]' - Only used by: [unused-symbol-3]
## Unreachable Exports
### [file-path]
- Line [X]: Export '[name]' - Not in package.json exports (including subpath exports)
- Line [Y]: Export '[name]' - Not used internally and not in exports
## Test File Unused Symbols
### [file-path]
- Line [X]: [Symbol type] '[name]' - Not used within test files
## Recommendations
- Consider removing [X] blocks of commented code
- Review [Y] 1st-degree unused symbols for deletion
- After removing 1st-degree symbols, [Z] 2nd-degree symbols will also become removable
- Update package.json exports or remove [W] unreachable exports
- Clean up [V] unused test symbols
## Next Steps
- Review findings with team
- Create cleanup tickets prioritizing 1st-degree unused symbols
- Update export configuration for unreachable exports
- Consider cascading cleanup for 2nd-degree unused symbols
/find-unused "src/"
# Builds symbol dependency graph for src/ directory
# Returns commented code, 1st-degree and 2nd-degree unused symbols
# Includes test file analysis
/find-unused "src/components/Button.tsx"
# Analyzes single file with graph-based detection
# Shows which unused symbols would cascade to other symbols
# Useful for focused cleanup
/find-unused "packages/ui-library"
# Analyzes library package with export path validation
# Checks exports against package.json (including subpath exports)
# Identifies unreachable public APIs
# Shows 2nd-degree unused symbols that depend on unused exports
/find-unused "src/" --exclude="*.test.ts"
# Analyzes src/ excluding test files
# Graph-based analysis of production code only
# Still checks export reachability in package.json
/find-unused "."
# Analyzes entire project with full symbol graph
# May take longer for graph construction and indexing
# Comprehensive report with cascading unused symbol detection
# Shows complete dependency chains for cleanup planning