rust-profiling

rust-profiling is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 86 tokens per session (1,749 once invoked), scanned B, original, MIT.

A guide to measuring Rust program performance and binary size with flamegraphs, benchmarks, and code-size analysis. A flamegraph shows where a program spends its running time.

In plain words
What is it for?
Use it to create flamegraphs, write Criterion benchmarks, inspect monomorphization bloat with cargo-llvm-lines, and analyze binary size with cargo-bloat.
Why use it?
It replaces guesswork with measurements that show which functions, types, or generated code are responsible for slow execution or large binaries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is perf record -g -F 999 ./target/release-with-debug/myapp args.

Good fit Use it to create flamegraphs, write Criterion benchmarks, inspect monomorphization bloat with cargo-llvm-lines, and analyze binary size with cargo-bloat.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills
agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/rust-profiling

Made for: Claude Code, Codex.

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 rust-profiling

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rust-profiling/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rust-profiling)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rust-profiling"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rust-profiling/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 rust-profiling

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rust-profiling"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rust-profiling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,749 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket warn 18 Mar 2026
  • Snyk warn 21 Feb 2026
How audits are shown
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.00086 $0.01749
Opus 5 $0.00043 $0.00874
Sonnet 5 $0.00017 $0.00350
Haiku 4.5 $0.00009 $0.00175

Measured 9d ago against content hash 9d226fe69499, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

rust-profiling scanned grade B with 1 finding 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 9d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo sh -c 'echo 1 > /proc/sys/kernel/perf_event_paranoid'
skills/rust/rust-profiling/SKILL.md · 245 lines

How it starts

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

Rust Profiling

Purpose

Guide agents through Rust performance profiling: flamegraphs via cargo-flamegraph, binary size analysis, monomorphization bloat measurement, Criterion microbenchmarks, and interpreting profiling results with inlined Rust frames.

Triggers

  • "How do I generate a flamegraph for a Rust program?"
  • "My Rust binary is huge — how do I find what's causing it?"
  • "How do I write Criterion benchmarks?"
  • "How do I measure monomorphization bloat?"
  • "Rust performance is worse than expected — how do I profile it?"
  • "How do I use perf with Rust?"

Workflow

1. Build for profiling

# Release with debug symbols (needed for readable profiles)
# Cargo.toml:
[profile.release-with-debug]
inherits = "release"
debug = true

cargo build --profile release-with-debug

# Or quick: release + debug info inline
CARGO_PROFILE_RELEASE_DEBUG=true cargo build --release

2. Flamegraphs with cargo-flamegraph

# Install
cargo install flamegraph

# Linux: uses perf (requires perf_event_paranoid ≤ 1)
sudo sh -c 'echo 1 > /proc/sys/kernel/perf_event_paranoid'
cargo flamegraph --bin myapp -- arg1 arg2

# macOS: uses DTrace (requires sudo)
sudo cargo flamegraph --bin myapp -- arg1 arg2

# Profile tests
cargo flamegraph --test mytest -- test_filter

# Profile benchmarks
cargo flamegraph --bench mybench -- --bench

# Output
# Generates flamegraph.svg in current directory
# Open in browser: firefox flamegraph.svg

Custom flamegraph options:

# More samples
cargo flamegraph --freq 1000 --bin myapp

# Filter to specific threads
cargo flamegraph --bin myapp -- args 2>/dev/null

# Using perf directly for more control
perf record -g -F 999 ./target/release-with-debug/myapp args
perf script | stackcollapse-perf.pl | flamegraph.pl > out.svg

3. Binary size analysis with cargo-bloat

# Install
cargo install cargo-bloat

# Show top functions by size
cargo bloat --release -n 20

# Show per-crate size breakdown
cargo bloat --release --crates

# Include only specific crate
cargo bloat --release --filter myapp

# Compare before/after a change
cargo bloat --release --crates > before.txt
# make changes
cargo bloat --release --crates > after.txt
diff before.txt after.txt

Read the full file on GitHub · 245 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 245 lines · 86 tokens per session scan B 9d226fe69499

Subscribe to this mod's changes

rust-profiling is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (203 stars, last pushed 2mo ago), licensed MIT. It adds 86 tokens to every session and 1,749 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

rust-patterns

Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications.

affaan-m/ECC · 28 tokens

omh-rust

This is a Hermes-native rust workflow skill.

rlaope/oh-my-hermes · 69 tokens

rust-project

Modern Rust project architecture guide for 2025. Use when creating Rust projects (CLI, web services, libraries). Covers workspace structure, error handling, async patterns, and idiomatic Rust best practices.

majiayu000/spellbook · 43 tokens

gcs-rust-download-object-api

Fix "DownloadObjectRequest not found" error in google-cloud-storage Rust crate. Use when: (1) Trying to download objects from GCS using the Rust SDK, (2) Looking for a download request type in http::objects::download module, (3) Compile error about missing type. The downloadobject method uses GetObjectRequest from the…

divinevideo/divine-mobile · 91 tokens

solana-toolkit-guide

Guide to the Solana Wallet Toolkit — vanity address generation with multi-threaded search, official Solana Labs libraries, Rust and TypeScript implementations. Includes wallet generation, custom address prefixes, and OG names on the blockchain.

nirholas/three.ws · 50 tokens

windows-compat

Audit and harden this Rust repo (code-graph-mcp) for Windows correctness: path-spelling drift between producers, the 32,767-char command-line cap, index-key mismatches, and path predicates that assume one ecosystem's layout. Use whenever touching code that builds, compares, prints, or stores a filesystem path; that…

sdsrss/code-graph-mcp · 165 tokens