← Back to Leaderboard
SEL4CTEO

EL4CTEO/shrink-anything

Rust CLI and MCP server for test-gated removal of dead code and unused assets

View on GitHub ↗
Engineering Health (Methodology)
A · 87/100
Maintenance Activity
● Updated 3d ago
Latest Release
v0.1.1
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption12/25
Release Cadence20/20
License Clarity20/20
MCPCLI
Total Stars
★ 479
24h Growth
+9
7d Growth
+262
Forks
31

GitHub Star History

Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.

EL4CTEO/shrink-anything Star History (2026-11-22 - 2026-12-01) DAILY STAR HISTORY (10-DAY D1 TELEMETRY) +478 in 9d · avg +53/day 506 253 0 2026-11-22: ★ 12026-11-23: ★ 682026-11-24: ★ 2172026-11-25: ★ 2952026-11-26: ★ 3572026-11-27: ★ 4032026-11-28: ★ 4242026-11-29: ★ 4372026-11-30: ★ 4702026-12-01: ★ 479 ★ 479 11-22 11-26 12-01

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

shrink-anything is a Rust CLI whose binary entry point is src/main.rs. It looks for names mentioned only within their own definitions rather than building a whole-program call graph. It also reads templates, configuration, and other text files for references. Language rules live in src/lang.rs; manifest dependencies include clap for CLI parsing, ignore for file traversal, aho-corasick and regex for matching, and toml_edit for TOML editing.

scan is read-only. cut applies candidate edits in batches and validates changed files with the language runtime's parser where supported. It keeps a batch only if the project check exits successfully and the observed test count does not drop below baseline. Failing batches are split to isolate and restore breaking edits. The same binary runs the MCP server via shrink-anything mcp; judgment calls can go to Claude, Codex, or another command that reads a prompt on stdin.

Key Capabilities & Differentiators

The v0.1.1 feature table and language list cover 18 languages for dead-code and duplicate detection, including TypeScript, Python, Rust, Go, C#, and Lua/Luau. Dead-file analysis covers a narrower set: Python, JS/TS, PHP, Ruby, Dart, and Lua/Luau. Dependency checks span npm, pnpm, Yarn, Bun, Cargo, pip, and Go modules. Asset scanning looks for unreferenced media and duplicate files; weigh dist breaks down build output by file kind and identifies heavy or duplicate files.

Duplicate consolidation is delegated to an agent rather than handled as an automatic deletion. verify reruns the project check against the original test-count baseline, while report produces Markdown and an SVG card for a pull request. With deliberately planted dead code, the TypeScript demo went from 106 to 58 lines and from three dependencies to one; the static-site build went from 913 KB to 398 KB. These examples illustrate the workflow, not typical savings for production repositories.

Trade-offs & Limitations

The advantage over a language-specific linter or unused-dependency checker is the workflow: one pass can surface several kinds of removal candidates and apply test-gated edits with rollback. The trade-off is precision. Textual mentions can preserve truly dead code, and computed references or convention-loaded entry points can evade matching. Library mode preserves public names, and --lib or --app can override the inferred mode. Risky candidates are generally deferred to an agent or require --aggressive; assets served directly from folders such as public/ or static/ need that flag for removal.

The test-count floor helps catch a drop in the number of tests run, but it does not prove that the same tests ran or that they covered the affected behavior. Narrow unit suites are particularly weak evidence for deleting framework-discovered code or runtime assets. Batch splitting can also multiply test runs when checks are slow or flaky. Start with scan-only output in under-tested projects, and add build or integration checks before accepting deletions that affect runtime behavior.

Hardware & Deployment Guide

Install locally with npm i -g @el4cteo/shrink-anything or cargo install shrink-anything. The Cargo manifest uses edition 2024 and requires Rust 1.88 or later for source builds. For a conservative first run, use doctor to inspect available parsers, package managers, and agents, review scan, and then run shrink-anything cut -- npm test or substitute an equivalent project check. The baseline check must pass before cuts begin.

CLI, built-in MCP, and a Claude Code plugin are available integration paths. The core workflow does not require model inference; it depends on the project's toolchain and validation command. Parser checks cover Python, Node, Ruby, PHP, Lua, and Bash when the corresponding parser is available. Version 0.1.1 fixed false dead-code reports and cuts for non-ASCII identifiers by aligning mention and definition tokenization on Unicode \w. It also fixed retention for dynamic prefixes and folder paths containing non-ASCII letters.

Batch rollback: A failing cut batch is bisected so individual breaking edits can be isolated and restored.
Verification: Acceptance requires exit status 0 and no drop in the observed test count; verify rechecks the original baseline.
Ecosystem coverage: Dependency scans cover npm, pnpm, Yarn, Bun, Cargo, pip, and Go modules; dead-file scanning is narrower.
Agent integration: MCP exposes scanning, cutting, task handoff, verification, undo, reporting, build weighing, and status.
Build analysis: weigh dist groups output by file kind and identifies the heaviest and duplicate files.
Reversibility: undo restores the latest cut byte for byte; undo --all restores all recorded cuts.
Best For

Maintainers of applications or mixed-language repositories with reliable build and test commands who want to review and apply reversible cleanup batches, with optional agent help.

Skip If

Critical behavior is poorly tested, runtime discovery dominates, or you need authoritative symbol-level reachability analysis. In those cases, use scan for triage or prefer a language-specific analyzer.

Reviewed on 2026-11-28 · Grounded in GitHub README, root file tree & releasesMethodologyReport inaccuracy

Quick Start & Installation

MCPCLI
npm i -g @el4cteo/shrink-anything      # or: cargo install shrink-anything

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
shrink-anything ★479+262RustMITRust CLI and MCP server for test-gated removal of dead code and unused assets
qwen-code31.1k+141TypeScriptApache-2.0TypeScript coding agent with swappable models and MCP for repository-scale work
gemini-cli109.5k+442TypeScriptApache-2.0A Node.js terminal agent for enterprise Gemini coding workflows and MCP tools
cc-haha15.7k+146TypeScript—Local-first Electron workbench for coding agents, Git worktrees, and MCP

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/EL4CTEO/shrink-anything.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

EL4CTEO/shrink-anything Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about shrink-anything

How does the tool fit into Claude Code, and can I use it without an agent?

Register the built-in server with claude mcp add shrink-anything -- shrink-anything mcp. Use shrink_scan to inspect candidates without editing, then invoke the cut and verification tools with a project check you trust. MCP is optional: the CLI can run directly, and judgment calls can be handed off through .shrink/TASK.md without launching an agent from the CLI.

Does cleanup require GPU or VRAM, and what determines runtime cost?

The standalone Rust CLI does not require a GPU or a local model. End-to-end resource use depends on the repository and the parser, build, and test commands involved. Failed batches can trigger repeated checks, so time a representative run before making cleanup a routine CI job. An optional coding agent has its own runtime requirements.

Can a company run or redistribute it under the MIT license?

Yes. MIT permits commercial use and local operation. If you redistribute the tool or substantial portions of it, retain the copyright and license notices. A separately invoked coding agent or hosted service has its own terms and data-handling rules.

When should I choose this over a language-specific dead-code analyzer?

Start with a language-specific analyzer if you mainly need more precise symbol or import diagnostics in one ecosystem. Choose shrink-anything when you need to triage code, files, dependencies, and assets together and want test-gated edits with rollback. The tools are complementary: a passing check cannot replace semantic analysis or coverage of dynamic entry points.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining EL4CTEO/shrink-anything? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature EL4CTEO/shrink-anything on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare