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.
Available after the catalog security scan passes.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM lists this project for discovery and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
# Add to your Claude Code skills
git clone https://github.com/EL4CTEO/shrink-anythingGuides for using ai agents skills like shrink-anything.
See how shrink-anything compares with popular alternatives.
Coding agents write code faster than anyone deletes it. Functions nothing calls, files nothing imports, packages nothing uses, images nothing shows: your agent reads all of it, your CI builds it, your users download it.
shrink-anything finds it, deletes it, and runs your own tests after every cut. What passes stays. What breaks is put back. One command, fully reversible.
Every line it removes is a line your agent stops reading on the next task. The report counts that too: on the demo app, 46% fewer tokens to read.
npm i -g @el4cteo/shrink-anything # or: cargo install shrink-anything
shrink-anything go --agent claude -- npm test # or: -- pytest / cargo test / go test ./... / anything that fails when your app is broken
Or step by step:
| command | what it does |
|---|---|
scan |
lists what could go. Changes nothing |
cut -- <check> |
deletes what's dead and runs your check: what passes stays, what breaks is put back |
task --agent claude |
hands the judgment calls (duplicates, public methods) to your agent, and keeps its work only if the check agrees |
weigh dist |
where the weight of a build is: by kind of file, the heaviest files, what's in there twice |
verify |
runs your check now, against the test count from before the first cut |
undo |
takes the last cut back, byte for byte (--all for every cut) |
report |
markdown + SVG card for your PR |
doctor |
what's 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 whatever you use.
Nothing in that code mentions secretly_used: a test reaches it through a name it reads from a data file. The cut broke that test, so it was put back, alone.
shrink-anything undo restores every file byte for byte.--aggressive.The proof is as strong as your check. A project with no tests gets a scan, not a cut you should trust.
| how it decides | where | |
|---|---|---|
| dead code | every mention of the name is inside its own definition. Any other mention anywhere (another file, a string, a template, a config) keeps it | 19 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 | an image, font or sound no code, config or README names; the same file stored twice | any project |
| duplicates | the same code twice, whatever it's called and however it's laid out | 19 languages, merged by your agent |
It counts names instead of building a call graph. A count can only miss dead code, never invent it, and it works the same in every language.
The demo projects in examples/, each with planted dead code. Run them yourself.
| project | before | after |
|---|---|---|
| TypeScript cart | 106 lines, 5 files, 3 dependencies | 58 lines, 3 files, 1 dependency (−45%) |
| Python shop | 142 lines, 8 files | 86 lines, 7 files (−39%) |
| Go store | 89 lines | 55 lines (−38%) |
| Static site (build output) | 913 KB | 398 KB (−56%) |
On real projects expect less per run and more over time: the safe cuts go on their own, the rest is a reviewed list.
shrink-anything weigh dist # where the weight is
shrink-anything cut --size dist -- "npm run build && npm test" # cut, rebuild, weigh again
--size takes a build folder or a binary and reports it before and after. Fewer dependencies and less code mean a smaller bundle; unused assets are cut like dead code. Assets in a folder served as it is (public/, static/) need --aggressive: a page outside your repo may link to them.
/plugin marketplace add EL4CTEO/shrink-anything, then /plugin install shrink-anything@shrink-anything and /shrink-anything:shrink npm testclaude mcp add shrink-anything -- shrink-anything mcp. 8 tools: shrink_scan, shrink_cut, shrink_task, shrink_verify, shrink_undo, shrink_report, shrink_weigh, shrink_status.skills/shrink-anything teaches any agent the loop.Dead code and duplicates: Python · JavaScript · TypeScript · Rust · Go · Java · Kotlin · C# · C · C++ · PHP · Ruby · Swift · Dart · Lua · Luau · Elixir · Shell. Every other text file (HTML, Vue, Svelte, YAML, SQL, templates…) is read for mentions, so a function used only from a template stays.
A language is one entry in a table (src/lang.rs): how its comments and strings look, how a block ends, what a definition looks like. Adding one is a pull request of about twenty lines.
In a library, public names belong to its users, so they're kept. shrink-anything guesses per language (a published package.json, a lib.rs, no package main) and says what it guessed. Override with --lib or --app.
MIT
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 50 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. SkillsLLM 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!