by EL4CTEO
Less code, same tests passing: delete the dead code, files, dependencies and assets in any codebase, and keep each cut only if your own tests still pass.
# Add to your Claude Code skills
git clone https://github.com/EL4CTEO/shrink-anythingGuides for using ai agents skills like shrink-anything.
shrink-anything is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by EL4CTEO. Less code, same tests passing: delete the dead code, files, dependencies and assets in any codebase, and keep each cut only if your own tests still pass. It has 454 GitHub stars.
shrink-anything's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/EL4CTEO/shrink-anything" and add it to your Claude Code skills directory (see the Installation section above).
shrink-anything is primarily written in Rust. It is open-source under EL4CTEO on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh shrink-anything against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
shrink-anything finds dead code, files, dependencies and assets, deletes them, and runs your own tests after every cut. What passes stays, what breaks is put back. Fully reversible.
Less code also means less for your agent to read: on the demo app, 46% fewer tokens.
npm i -g @el4cteo/shrink-anything # or: cargo install shrink-anything
shrink-anything go --agent claude -- npm test # or pytest, cargo test, go test ./..., any check that fails when the app breaks
Or step by step:
| command | what it does |
|---|---|
scan |
lists what could go, changes nothing |
cut -- <check> |
deletes what's dead, runs your check, puts back what breaks |
task --agent claude |
hands judgment calls (duplicates, public methods) to your agent; keeps its work only if the check passes |
weigh dist |
where a build's weight is: by file kind, heaviest files, duplicates |
verify |
runs your check against the test count from before the first cut |
undo |
restores the last cut byte for byte (--all for every cut) |
report |
markdown + SVG card for your PR |
status · doctor |
current state · installed parsers, package managers, agents |
--agent takes claude, codex, or any command that reads a prompt on stdin. Without it, hand .shrink/TASK.md to any agent.
undo restores every file byte for byte.--aggressive.No tests means a scan, not a cut you should trust.
| rule | where | |
|---|---|---|
| dead code | every mention of the name is inside its own definition | 18 languages |
| dead files | no other file names it | Python, JS/TS, PHP, Ruby, Dart, Lua/Luau |
| unused dependencies | nothing imports it or runs its commands | npm, pnpm, yarn, bun, Cargo, pip, Go modules |
| dead weight | images, fonts, sounds nothing names; files stored twice | any project |
| duplicates | the same code twice, however it's named or laid out | 18 languages, merged by your agent |
It counts names instead of building a call graph, so it can miss dead code but never invent it.
Languages: Python, JavaScript, TypeScript, Rust, Go, Java, Kotlin, C#, C, C++, PHP, Ruby, Swift, Dart, Lua, Luau, Elixir, Shell. Other text files (HTML, Vue, Svelte, YAML, SQL, templates) are read for mentions. Adding a language is ~20 lines in src/lang.rs.
Libraries keep their public names. The mode is guessed per language and printed; override with --lib or --app.
Demo projects in examples/, with planted dead code:
| project | before | after |
|---|---|---|
| TypeScript cart | 106 lines, 5 files, 3 deps | 58 lines, 3 files, 1 dep (−45%) |
| Python shop | 142 lines, 8 files | 86 lines, 7 files (−39%) |
| Go store | 89 lines | 55 lines (−38%) |
| Static site (build) | 913 KB | 398 KB (−56%) |
shrink-anything weigh dist
shrink-anything cut --size dist -- "npm run build && npm test"
Assets in folders served as-is (public/, static/) need --aggressive.
/plugin marketplace add EL4CTEO/shrink-anything, /plugin install shrink-anything@shrink-anything, then /shrink-anything:shrink npm testclaude mcp add shrink-anything -- shrink-anything mcp. Tools: shrink_scan, shrink_cut, shrink_task, shrink_verify, shrink_undo, shrink_report, shrink_weigh, shrink_status.skills/shrink-anythingMIT