Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
laurigates avatar

Cargo Machete

  • 66 installs
  • 49 repo stars
  • Updated August 4, 2026
  • laurigates/claude-plugins

Helps with ai & agent building tasks.

About

cargo-machete is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.

  • cargo-machete
  • AI & Agent Building
  • AI-coding skill

Cargo Machete by the numbers

  • 66 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #6,006 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/laurigates/claude-plugins --skill cargo-machete

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs66
repo stars49
Last updatedAugust 4, 2026
Repositorylaurigates/claude-plugins

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

cargo-machete - Unused Dependency Detection

Detect and remove unused dependencies in Rust projects using cargo-machete.

When to Use This Skill

Use this skill when...Use X instead when...
Auditing for unused dependenciesChecking for outdated deps -- use cargo outdated
Cleaning up Cargo.tomlAuditing security vulnerabilities -- use cargo audit
Optimizing build times by removing bloatChecking license compliance -- use cargo deny
Verifying deps in CINeed nightly-accurate analysis -- use cargo +nightly udeps

Context

  • Cargo.toml: !find . -maxdepth 1 -name \'Cargo.toml\'
  • Workspace: !grep -q '\[workspace\]' Cargo.toml
  • cargo-machete installed: !cargo machete --version
  • Machete config: !find . -maxdepth 1 -name \'.cargo-machete.toml\'
  • Workspace members: !grep -A 20 '^\[workspace\]' Cargo.toml

Execution

Execute this unused dependency analysis:

Step 1: Verify installation

Check if cargo-machete is installed (see Context above). If not installed, install it:

cargo install cargo-machete

Step 2: Run dependency analysis

Run cargo-machete with metadata for detailed output:

# Single crate
cargo machete --with-metadata

# Workspace (if Context shows workspace)
cargo machete --workspace --with-metadata

Step 3: Evaluate results

Review the output and classify each finding:

FindingAction
Genuinely unused dependencyRemove with --fix or manually
Proc-macro dependency (e.g., serde derive)Add machete:ignore comment
Build.rs-only dependencyMove to [build-dependencies]
Re-exported dependencyAdd machete:ignore comment with explanation

Step 4: Apply fixes

For confirmed unused dependencies, auto-remove them:

cargo machete --fix

For false positives, add ignore annotations in Cargo.toml:

serde = "1.0"  # machete:ignore - used via derive macro

Or create .cargo-machete.toml for project-wide ignores:

[ignore]
dependencies = ["serde", "log"]

Step 5: Verify build

After removing dependencies, confirm everything still compiles:

cargo check --all-targets
cargo test --no-run

False Positive Handling

ScenarioSolution
Proc-macro deps (e.g., serde derive)machete:ignore comment
Build.rs-only depsMove to [build-dependencies]
Re-exported depsmachete:ignore comment with explanation
Example/bench-only depsVerify in [dev-dependencies]

Comparison with cargo-udeps

Featurecargo-machetecargo-udeps
AccuracyGoodExcellent
SpeedVery fastSlower
Rust versionStableRequires nightly
False positivesSomeFewer

Use cargo-machete for fast CI checks. Use cargo-udeps for thorough audits:

cargo +nightly udeps --workspace --all-features

Agentic Optimizations

ContextCommand
Quick checkcargo machete
Detailed checkcargo machete --with-metadata
Workspace checkcargo machete --workspace --with-metadata
Auto-fixcargo machete --fix
Verify after fixcargo check --all-targets
Accurate check (nightly)cargo +nightly udeps --workspace

Quick Reference

FlagDescription
--with-metadataShow detailed output with versions and locations
--fixAuto-remove unused dependencies from Cargo.toml
--workspaceCheck all workspace members
-p <crate>Check specific workspace member
--exclude <crate>Exclude specific workspace member

Troubleshooting

ProblemSolution
Proc macro flagged as unusedAdd machete:ignore comment in Cargo.toml
Build.rs dep flaggedMove to [build-dependencies]
Re-exported dep flaggedAdd machete:ignore with explanation
Need more accuracyUse cargo +nightly udeps

For CI integration patterns, configuration file examples, pre-commit setup, and Makefile integration, see REFERENCE.md.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.