remove-unused-dependencies — Claude Code command
remove-unused-dependencies audits selected dependencies inside an approved package and lockfile scope, then checks imports, tests, builds, and packaging before removal.
AGPL-3.0-or-later ★ 96 updated 2026-10-18
/plugin marketplace add legioncodeinc/vibe-coding-tools
/plugin install repository-modernization-tools@wasp-nestWhat remove-unused-dependencies does
The command reviews manually selected dependency removals across the affected packages and workspaces. It checks package names, aliases, subpaths, CLI entries, dynamic loading, tool configuration, generated entry points, scripts, tests, optional branches, public types, peer dependencies, and consumer-facing contracts. Each item is retained, marked unresolved, or prepared as a removal candidate with file and line evidence.
It records the baseline revision, dirty paths, workspace boundaries, package-manager details, existing checks, and their results before editing. Afterward, it inspects the complete manifest and lockfile diff and repeats import, type, test, build, and package checks under matching conditions. A direct declaration can be removed while a transitive instance remains, so that case is tracked separately.
The command is listed for Claude Code and Codex. In Claude Code, it is installed through repository-modernization-tools. Audit approval does not authorize deletion: the package scope and affected files must be approved first, and dynamic or peer usage prevents a behavior-preserving removal.
What it helps with
- audit selected dependencies across affected workspaces
- trace dynamic imports and framework registrations
- verify manifest and lockfile changes
- compare baseline and candidate build checks
- record transitive instances that remain
Example prompts for the agent
- Run
/repository-modernization-tools:remove-unused-dependenciesfor the approved package scope and inspect every proposed removal. - Check whether
lodashcan be removed, including aliases, dynamic loading, tests, builds, and public consumers. - Compare the baseline and candidate results for
package-name, then report the exact manifest and lockfile diff.
How to install remove-unused-dependencies
1Plugin marketplace
/plugin marketplace add legioncodeinc/vibe-coding-tools/plugin install repository-modernization-tools@wasp-nest2Manually: put the files in place
.claude/commands/remove-unused-dependencies.mdCall it with /remove-unused-dependencies. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/remove-unused-dependencies.mdCall it with /prompts:remove-unused-dependencies. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/remove-unused-dependencies.prompt.mdManually: put the files in place
.gemini/commands/remove-unused-dependencies.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about remove-unused-dependencies
How do I install remove-unused-dependencies in Claude Code?
Add the marketplace with /plugin marketplace add legioncodeinc/vibe-coding-tools, install the plugin with /plugin install repository-modernization-tools@wasp-nest, then use .claude/commands/remove-unused-dependencies.md.
What does remove-unused-dependencies do?
It examines approved dependency-removal candidates, checks static and dynamic usage, and compares the proposed change with imports, lockfiles, tests, builds, types, and package contracts.
Can it prove that a dependency disappeared from the final artifact?
No. Removing a direct declaration can leave transitive instances. Artifact, vulnerability, and shipped-code claims require separate measured evidence.