binary-loop

Reduces Rust release binary size iteratively using cargo-bloat measurements and bounded changes.

4.4k|154|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/fallow-rs/fallow --skill binary-loop
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: binary-loop
Source: https://github.com/fallow-rs/fallow/tree/main/.agents/skills/binary-loop
Command: npx skills add https://github.com/fallow-rs/fallow --skill binary-loop

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust release binaries often grow large due to dependencies, monomorphization, features, and codegen settings, and shrinking them without breaking behavior requires a disciplined, measurement-driven process.

Core Features & Use Cases

  • Measurement-driven iteration: Captures release binary size and cargo-bloat evidence before and after each change.
  • Bounded optimization steps: Targets one contributor at a time (dependency, monomorphization, feature, or codegen) and keeps changes only when size improves and verification passes.
  • Use Case: While maintaining the Fallow CLI, you notice the release binary has grown after adding dependencies. Use this Skill to identify the largest contributors with cargo-bloat, apply bounded changes, and stop when remaining candidates have poor tradeoffs.

Quick Start

Use the binary-loop skill to reduce the release binary size of this Rust project while preserving all features and supported targets.

Frequently Asked Questions about binary-loop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce Rust binary size with cargo-bloat?

Run cargo-bloat on a release build to identify the largest dependencies and functions, then apply one bounded change at a time such as trimming features or reducing monomorphization. Rebuild with identical release settings and keep the change only if size improves and verification passes.

What causes large Rust release binaries?

The main contributors are heavy dependencies, generic code monomorphization, enabled crate features, and codegen configuration. cargo-bloat measurements show which of these dominates so you can target the biggest contributor first.

Can I shrink a Rust binary without breaking features?

Yes, by making bounded changes and verifying after each rebuild. The loop explicitly forbids trading away supported targets or public behavior without explicit scope, and any change that fails verification is discarded.

When should I stop optimizing binary size?

Stop when the size target is met or when remaining candidates have poor tradeoffs, such as requiring removal of features or supported platforms. After stopping, run a review pass to confirm the final state.

Why did my binary size change not reduce the release build?

Size changes only count when measured with identical release settings, so differences in profiles, features, or target flags can mask results. Rebuild with the same configuration and compare cargo-bloat evidence before deciding to keep or revert the change.