/ecc:refactor-cleanfrom ecc
Safely identifies and removes dead code with test verification after each deletion. Supports multiple language-specific analysis tools and categorizes findings by safety tier.
Ships in ecc. Installing the plugin adds it to Claude Code.
Safely identify and remove dead code with test verification at every step.
Run analysis tools based on project type:
| Tool | What It Finds | Command |
|---|---|---|
| knip | Unused exports, files, dependencies | npx knip |
| depcheck | Unused npm dependencies | npx depcheck |
| ts-prune | Unused TypeScript exports | npx ts-prune |
| vulture | Unused Python code | vulture src/ |
| deadcode | Unused Go code | deadcode ./... |
| cargo-udeps | Unused Rust dependencies | cargo +nightly udeps |
If no tool is available, use Grep to find exports with zero imports:
# Find exports, then check if they're imported anywhere
Sort findings into safety tiers:
| Tier | Examples | Action |
|---|---|---|
| SAFE | Unused utilities, test helpers, internal functions | Delete with confidence |
| CAUTION | Components, API routes, middleware | Verify no dynamic imports or external consumers |
| DANGER | Config files, entry points, type definitions | Investigate before touching |
For each SAFE item:
git checkout -- <file> and skip this itemBefore deleting CAUTION items:
import(), require(), __import__After removing dead code, look for:
Report results:
Dead Code Cleanup
──────────────────────────────
Deleted: 12 unused functions
3 unused files
5 unused dependencies
Skipped: 2 items (tests failed)
Saved: ~450 lines removed
──────────────────────────────
All tests passing PASS:
What the command file sets; muted values are Claude Code's defaults
Knip, TypeScript, Python, Go, Rust
dead-code, code-cleanup, refactoring, unused-code, code-quality
7-day visitors to each command page
npx claudepluginhub grantl1274/ecc_ --plugin ecc94 commands in this plugin
/asideAside CommandAnswer a quick side question without interrupting or losing context from the current task. Resume work automatically after answering./auto-updateAuto UpdatePull the latest ECC repo changes and reinstall the current managed targets./build-fixBuild and FixDetect the project build system and incrementally fix build/type errors with minimal safe changes./checkpointCheckpoint CommandCreate, verify, or list workflow checkpoints after running verification checks./code-reviewCode ReviewCode review — local uncommitted changes or GitHub PR (pass PR number/URL for PR mode)/cost-reportCost ReportGenerate a local Claude Code cost report from the ECC cost-tracker metrics log.79 plugins ship this exact command · first indexed Mar 30, 2026
Other plugins' commands for the same job