Skip to content
Back to skills

Shrink Anything

ASecurity

Make a codebase smaller without changing what it does - remove dead code, dead files, unused dependencies and duplicated code in any mix of languages, keeping each cut only if the project's own tests still pass. Use when the user wants less code, a lighter app or bundle, fewer dependencies, a cleanup after AI-generated or legacy code, or asks what in the repo is unused.

  • 499 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 24, 2026
developmentrustgoapi

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add EL4CTEO/shrink-anything --skill shrink-anything --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Shrink Anything?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Shrink Anything
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/el4cteo-shrink-anything/badge)](https://www.skillsdirectory.com/skills/el4cteo-shrink-anything)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: shrink-anything
description: Make a codebase smaller without changing what it does - remove dead code, dead files, unused dependencies and duplicated code in any mix of languages, keeping each cut only if the project's own tests still pass. Use when the user wants less code, a lighter app or bundle, fewer dependencies, a cleanup after AI-generated or legacy code, or asks what in the repo is unused.
---

# shrink-anything

The `shrink-anything` CLI finds what can go, deletes what it can prove dead, and runs the project's check after every cut.
You handle what needs judgment. The same steps are MCP tools: `shrink_scan`, `shrink_cut`, `shrink_task`, `shrink_verify`,
`shrink_undo`, `shrink_report`, `shrink_weigh`, `shrink_status` (stdio server: `shrink-anything mcp`).

## Loop

1. **Find the check**: the command that fails when the project is broken (`npm test`, `pytest`, `cargo test`, `go test ./...`).
   It must pass before you start. A weak check proves little: prefer the full test suite, and add the type-check or build
   when there is one (`shrink-anything cut -- "npm run build && npm test"`).
2. **Scan**: `shrink-anything scan` (add `--all` for every candidate and why; `--json` for machine output). Changes nothing.
3. **Cut**: `shrink-anything cut -- <check>`. It removes the safe candidates in a batch, runs the check, bisects to the cut
   that breaks it and puts only that one back. Cutting can orphan more code, so it repeats.
   Add `--size dist` (or a binary) to weigh a build output before and after.
   Or one shot: `shrink-anything go --agent claude -- <check>` (also `codex`, or any command that reads a prompt on stdin).
4. **The rest is yours**: read `.shrink/TASK.md` (or `shrink-anything task` / `task --agent …`).
   - *Duplicates*: keep one copy, make the others use it.
   - *Probably dead*: nothing mentions it, but something could reach it without naming it (a framework convention, reflection,
     a public API). Look for that way in. Delete only if there is none; otherwise leave it and say why.
5. **Verify** after each group of edits: `shrink-anything verify`. If it fails, fix the edit or put it back.
6. **Report**: `shrink-anything report`. Tell the user lines, files, dependencies and tokens before and after,
   and how to undo (`shrink-anything undo`, or `--all`). Optional: `weigh dist`, `status`, `doctor`.

Mode: `--lib` keeps public names (library); `--app` treats the repo as an application. Default is guessed per language.

## Don't

- Don't edit, delete or skip a test to make the check pass. `verify` fails when fewer tests run than before the first cut.
- Don't rewrite code for style. The goal is fewer lines doing the same thing, with the smallest diff.
- Don't use `--aggressive` on a library without asking: its public names are someone else's to call.
- Don't trust a cut the check can't see. If the project has no tests for an area, say so instead of deleting from it.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.