cargo-machete

cargo-machete is a skill for Claude Code from martineserios/thebrana. It costs 19 tokens per session (1,149 once invoked), scanned A, original, MIT.

A Rust dependency checker that finds packages listed in Cargo.toml but not used by the project. Rust is a programming language, and Cargo.toml is its dependency configuration file.

In plain words
What is it for?
Use it to audit dependencies, clean up Cargo.toml, and check unused packages in Rust workspaces or CI.
Why use it?
It helps keep unused libraries out of the codebase, reducing dependency clutter and possible build overhead.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

Part of the brana plugin — 53 skills, 4 commands, 14 agents shipped together

Good fit Use it to audit dependencies, clean up Cargo.toml, and check unused packages in Rust workspaces or CI.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/martineserios/thebrana/cargo-machete
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add martineserios/thebrana --skill cargo-machete
Clone the repo
git clone --depth 1 https://github.com/martineserios/thebrana

Made for: Claude Code.

Or install brana, the plugin that ships this one along with the rest of its 53 skills, 4 commands, 14 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cargo-machete

README.md
[![agentmods](https://agentmods.dev/badge/skills/martineserios/thebrana/cargo-machete/github.svg)](https://agentmods.dev/skills/martineserios/thebrana/cargo-machete)
Your own site
<a href="https://agentmods.dev/skills/martineserios/thebrana/cargo-machete"><img src="https://agentmods.dev/badge/skills/martineserios/thebrana/cargo-machete/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cargo-machete

Your own site · 80×15
<a href="https://agentmods.dev/skills/martineserios/thebrana/cargo-machete"><img src="https://agentmods.dev/badge/skills/martineserios/thebrana/cargo-machete.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,149 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.01149
Opus 5.5 $0.00008 $0.00460
Sonnet 5.5 $0.00004 $0.00230
Haiku 4.5 $0.00002 $0.00115

Measured 3mo ago against content hash f111b8812a80, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cargo-machete scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

system/skills/cargo-machete/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 dependencies Checking for outdated deps -- use cargo outdated
Cleaning up Cargo.toml Auditing security vulnerabilities -- use cargo audit
Optimizing build times by removing bloat Checking license compliance -- use cargo deny
Verifying deps in CI Need 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:

Finding Action
Genuinely unused dependency Remove with --fix or manually
Proc-macro dependency (e.g., serde derive) Add machete:ignore comment
Build.rs-only dependency Move to [build-dependencies]
Re-exported dependency Add 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

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 154 lines · 19 tokens per session scan A f111b8812a80

Subscribe to this mod's changes

cargo-machete is a skill published in the GitHub repository martineserios/thebrana (3 stars, last pushed yesterday), licensed MIT. It adds 19 tokens to every session and 1,149 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

cargo-machete compared with skills from other repositories

cargo-machete next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cargo-machetemartineserios/thebranaSkill3yesterdayMITA19Claude Code
cloudflare-workers-multi-langsecondsky/claude-skillsSkill2572d agoMITA45Claude Code
windows-compatsdsrss/code-graph-mcpSkill1027d agoMITA165Claude Code, Codex
rust-testingxobotyi/cc-foundrySkill23yesterdayMITA70Claude Code
rust-build-optimizationbahayonghang/my-ai-cli-toolkitSkill17yesterdayMITA147Claude Code
rust-doctorarthjean/rust-doctorSkill2314d agoApache-2.0A49Claude Code, Codex
rust-expertpersonamanagmentlayer/pclSkill461mo agoApache-2.0A60Claude Code