Sunday, November 29, 2026

shrink-anything

★430Worth testing
MCP

A local tool deletes code nothing else calls, and keeps the cut only if your own tests still pass.

shrink-anything

Why it matters

shrink-anything is a Rust command-line tool, MIT, release v0.1.1 on November 25. Point it at a repo and a command that fails when the app breaks, such as npm test or pytest. It looks for a name nothing else mentions, a file nothing imports, a dependency nothing uses, and an image or font nothing names. A cut stays only if that command exits 0 and at least as many tests run as before. The test files themselves are never edited.

A coding agent will add a helper and never call it. You will not open every unused file before the next release. A guess-and-delete pass is how a quiet bug lands. This runs the check you already trust, and restores the cut that breaks it.

How it works

Install it with npm or cargo. A scan lists candidates and changes nothing. go, or cut, deletes in batches and runs your command after each batch. A failing batch is split until the one breaking cut is found and restored. Public methods, library exports, and framework-registered classes are skipped unless you pass the aggressive flag, or you hand that judgment to Claude or Codex. That edit stays only if the same check passes. With no tests, treat the result as a list, not a deletion. It counts names instead of building a call graph, so a dead function with an odd mention can be missed. A name something else mentions is left alone.

rust-anything ports the slow functions and leaves the rest. safe-anything reports a risky line and does not change the app. This removes what nothing else names, and undo restores the last cut byte for byte. The before-and-after table in the README is demo apps with planted dead code, not a number for your repo. The repo was created on November 23.

Capabilities

MCP
  • MCP server / client support

Similar tools

agentsdead-coderustcli
Source ↗

Via github

X