Agent skill

Rust Profiling

by diodeme in diodeme/Gold-Band

Rust profiling skill for performance analysis. An agent skill from diodeme/Gold-Band.

AGPL-3.0Auto-check: notesDevelopment

Install Rust Profiling

skills CLI
$ npx skills add diodeme/Gold-Band --skill rust-profiling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install diodeme/Gold-Band rust-profiling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/diodeme/Gold-Band.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/rust-profiling .claude/skills/rust-profiling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
rust-profiling
GitHub stars
143
Used in
1 other repo
Token cost
~1.7k tokens
SKILL.md length
201 words
Files
2 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Rust profiling skill for performance analysis. An agent skill from diodeme/Gold-Band.

  • Works in 7 steps: Build for profiling → Flamegraphs with cargo-flamegraph → Binary size analysis with cargo-bloat → …
  • Generating flamegraphs from Rust binaries
  • SKILL.md covers Purpose, Triggers, Workflow and Related skills
  • Calls cargo and sh

What it does

Rust Profiling is an agent skill from diodeme/Gold-Band. Rust profiling skill for performance analysis. Use when generating flamegraphs from Rust binaries, measuring monomorphization bloat with cargo-llvm-lines, analysing binary size with cargo-bloat, microbenchmarking with Criterion, or interpreting inlined frames in profiles. Activates on queries about cargo flamegraph, cargo-bloat, cargo-llvm-lines, Criterion benchmarks, Rust performance profiling, or binary size analysis.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/cargo-flamegraph-setup.md`).

It sits in Development, covering Performance optimization. It works with Rust. The repository describes itself as: Desktop app for harness engineering, loop engineering, graph engineering—and whatever comes next in local AI-agent workflows. The licence is AGPL-3.0.

When your agent uses it

  • Generating flamegraphs from Rust binaries
  • Measuring monomorphization bloat with cargo-llvm-lines
  • Analysing binary size with cargo-bloat
  • Microbenchmarking with Criterion

Example prompts

  • “/rust-profiling”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Build for profiling
  2. Flamegraphs with cargo-flamegraph
  3. Binary size analysis with cargo-bloat
  4. Monomorphization bloat with cargo-llvm-lines
  5. Criterion microbenchmarks
  6. perf with Rust (Linux)
  7. heaptrack / DHAT for allocations

What it can do on your machine

Read from SKILL.md and the folder at commit 75622ac. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo
    • sh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Rust Profiling loads about 1.7k tokens when it runs, and up to ~2.9k if it reads all its reference files. Until then it costs about 110 tokens; SKILL.md has 201 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~110
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:45
    sudo sh -c 'echo 1 > /proc/sys/kernel/perf_event_paranoid'
  • NoteRuns commands with sudoSKILL.md:49
    sudo cargo flamegraph --bin myapp -- arg1 arg2

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from diodeme/Gold-Band at commit 75622ac, republished under its AGPL-3.0 licence (© diodeme). 201 words, ~1,655 tokens.

Download SKILL.mdSave it as .claude/skills/rust-profiling/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
rust-profiling
description
Rust profiling skill for performance analysis. Use when generating flamegraphs from Rust binaries, measuring monomorphization bloat with cargo-llvm-lines, analysing binary size with cargo-bloat, microbenchmarking with Criterion, or interpreting inlined frames in profiles. Activates on queries about cargo flamegraph, cargo-bloat, cargo-llvm-lines, Criterion benchmarks, Rust performance profiling, or binary size analysis.

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
bash
# 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
bash
# 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:

bash
# 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
bash
# 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

Typical output:

 File  .text    Size    Crate Name
 2.4%   3.0% 47.0KiB      std <std macros>
 1.8%   2.3% 35.5KiB   myapp myapp::heavy_module::process
 1.2%   1.5% 23.1KiB    serde serde::de::...
4. Monomorphization bloat with cargo-llvm-lines
bash
# Install
cargo install cargo-llvm-lines

# Show LLVM IR line counts (proxy for monomorphization)
cargo llvm-lines --release | head -40

# Filter to your crate only
cargo llvm-lines --release | grep '^myapp'

Typical output:

   Lines      Copies  Function name
   85330           1  [LLVM passes]
    7761          92  core::fmt::write
    4672          11  myapp::process::<impl MyTrait for T>
    3201          47  <alloc::vec::Vec<T> as core::ops::Drop>::drop

High Copies count = monomorphization expansion. Fix:

rust
// Before: generic, gets monomorphized for every T
fn process<T: AsRef<[u8]>>(data: T) -> usize {
    do_work(data.as_ref())
}

// After: thin generic wrapper + concrete inner
fn process<T: AsRef<[u8]>>(data: T) -> usize {
    fn inner(data: &[u8]) -> usize { do_work(data) }
    inner(data.as_ref())
}
5. Criterion microbenchmarks
toml
# Cargo.toml
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }

[[bench]]
name = "my_bench"
harness = false
rust
// benches/my_bench.rs
use criterion::{black_box, criterion_group, criterion_main, Criterion, BenchmarkId};

fn bench_process(c: &mut Criterion) {
    // Simple benchmark
    c.bench_function("process 1000 items", |b| {
        let data: Vec<i32> = (0..1000).collect();
        b.iter(|| process(black_box(&data)))  // black_box prevents optimization
    });
}

fn bench_sizes(c: &mut Criterion) {
    let mut group = c.benchmark_group("process_sizes");

    for size in [100, 1000, 10000].iter() {
        let data: Vec<i32> = (0..*size).collect();
        group.bench_with_input(
            BenchmarkId::from_parameter(size),
            &data,
            |b, data| b.iter(|| process(black_box(data))),
        );
    }
    group.finish();
}

criterion_group!(benches, bench_process, bench_sizes);
criterion_main!(benches);
bash
# Run all benchmarks
cargo bench

# Run specific benchmark
cargo bench --bench my_bench

# Run with filter
cargo bench -- process_sizes

# Compare with baseline (save/load)
cargo bench -- --save-baseline before
# make changes
cargo bench -- --baseline before

# View HTML report
open target/criterion/report/index.html
6. perf with Rust (Linux)
bash
# Record
perf record -g ./target/release-with-debug/myapp args
perf record -g -F 999 ./target/release-with-debug/myapp args  # higher freq

# Report
perf report                     # interactive TUI
perf report --stdio --no-call-graph | head -40   # text

# Annotate specific function
perf annotate myapp::hot_function

# stat (quick counters)
perf stat ./target/release/myapp args

Rust-specific perf tips:

  • Build with debug = 1 (line tables only) for faster builds with line-level attribution
  • Use RUSTFLAGS="-C force-frame-pointers=yes" for better call graphs without DWARF unwinding
  • Disable ASLR for reproducible addresses: setarch $(uname -m) -R ./myapp
7. heaptrack / DHAT for allocations
bash
# heaptrack (Linux)
heaptrack ./target/release/myapp args
heaptrack_print heaptrack.myapp.*.zst | head -50

# DHAT via Valgrind
valgrind --tool=dhat ./target/debug/myapp args
# Open dhat-out.* with dh_view.html

For flamegraph setup and Criterion configuration, see references/cargo-flamegraph-setup.md.

  • Use skills/rust/rustc-basics for build configuration (debug symbols, profiles)
  • Use skills/profilers/linux-perf for perf fundamentals
  • Use skills/profilers/flamegraphs for reading and interpreting flamegraph SVGs
  • Use skills/profilers/valgrind for allocation profiling with massif/DHAT

© diodeme, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/rust-profiling of diodeme/Gold-Band.

  • SKILL.md
  • references/cargo-flamegraph-setup.md

Open the folder on GitHubat commit 75622ac

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in diodeme/Gold-Band, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Rust Profiling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Rust Profiling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Rust Profiling this skilldiodeme/Gold-Band1431 repos~1.7kAutomated safety check: NotesAGPL-3.0
Samplyvortex-data/vortex3.2k—~2.7kAutomated safety check: PassApache-2.0
Investigate User Bugcristicretu/diri424—~1.2kAutomated safety check: PassApache-2.0
Cppcrazyguitar/cppcheatsheet290—~1.8kAutomated safety check: PassMIT
ProfilingShopify/rubydex363—~2.3kAutomated safety check: NotesCustom licence
Oxc Lint Rule Performance Reviewoxc-project/oxc23k—~1.1kAutomated safety check: PassMIT

Similar skills

  • Samply

    vortex-data/vortex

    Analyze Samply Firefox-profiler output, record focused profiles, summarize hot threads/stacks, inspect symbolication, and compare profile evidence before and after a performance change.

    3.2k GitHub stars~2.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Investigate User Bug

    cristicretu/diri

    Investigate a bug a specific diri user hit (crash, hang, slowness, memory leak, blank or garbled terminal, spawn/resume/remote failure, copy/paste not working) from diri's telemetry with the…

    424 GitHub stars~1.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Cpp

    crazyguitar/cppcheatsheet

    Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics.

    290 GitHub stars~1.8k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Profiling

    Shopify/rubydex

    Official

    Profile Rubydex indexer performance — CPU flamegraphs, memory usage, phase-level timing.

    363 GitHub stars~2.3k tokensUpdated 5 days ago
    DevelopmentAuto-check: notes
  • Review guidance for the speed of Oxc linter rules written in Rust: narrow node-kind checks, cheap tests first, deferred diagnostics and the smallest possible iteration.

    23k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Profile the native Rust wado binary (compile/serve/run) for host-side bottlenecks — CPU with a sampling profiler, memory with the span trace's RSS and valgrind DHAT.

    116 GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check: notes

More from diodeme/Gold-Band

All 11 skills in this repo
  • Rust Async Patterns

    diodeme/Gold-Band

    Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns.

    143 GitHub starsUsed in 9 repos~3.1k tokens
    Auto-check passed
  • Memory Leak Debugging

    diodeme/Gold-Band

    Diagnoses and resolves memory leaks in JavaScript/Node.js applications.

    143 GitHub stars~712 tokensUpdated 7 days ago
    Auto-check passed
  • Git Changelog

    diodeme/Gold-Band

    Create and localize user-facing release notes from an explicit Git change range.

    143 GitHub stars~1.4k tokensUpdated 7 days ago
    Auto-check passed
  • Git PR

    diodeme/Gold-Band

    Prepare, review, publish, or update a complete GitHub pull request for the current repository, including local commit readiness, safe push strategy, semantic title validation, repository-native PR…

    143 GitHub stars~1.5k tokensUpdated 7 days ago
    Auto-check passed
  • Stitch Design

    diodeme/Gold-Band

    Unified entry point for Stitch design work. An agent skill from diodeme/Gold-Band.

    143 GitHub starsUsed in 1 repo~925 tokens
    Auto-check passed
  • Memory Leak Audit

    diodeme/Gold-Band

    Audit code for memory leaks and disposable issues. An agent skill from diodeme/Gold-Band.

    143 GitHub stars~1.3k tokensUpdated 7 days ago
    Auto-check passed

Works with

Categories

Questions about Rust Profiling

What does Rust Profiling do?

Rust profiling skill for performance analysis. An agent skill from diodeme/Gold-Band. Rust Profiling is an agent skill from diodeme/Gold-Band. Rust profiling skill for performance analysis.

When should I use Rust Profiling?

Rust Profiling fits situations like: generating flamegraphs from Rust binaries; measuring monomorphization bloat with cargo-llvm-lines; analysing binary size with cargo-bloat; microbenchmarking with Criterion.

How do I install Rust Profiling in Claude Code?

Run `npx skills add diodeme/Gold-Band --skill rust-profiling -a claude-code`. Or copy the skill folder (.agents/skills/rust-profiling in diodeme/Gold-Band) into .claude/skills/rust-profiling in your project. Claude Code loads it when a task matches its description.

How do I install Rust Profiling in Codex?

Run `npx skills add diodeme/Gold-Band --skill rust-profiling -a codex`. Or copy the skill folder (.agents/skills/rust-profiling in diodeme/Gold-Band) into .agents/skills/rust-profiling in your project. Codex loads it when a task matches its description.

Can I use Rust Profiling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add diodeme/Gold-Band --skill rust-profiling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/rust-profiling, .gemini/skills/rust-profiling, .github/skills/rust-profiling and .opencode/skills/rust-profiling in your project.

What does Rust Profiling need to run?

Going by SKILL.md and its folder, Rust Profiling needs the command-line tools its instructions call (cargo and sh).

Does Rust Profiling access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Rust Profiling safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Rust Profiling use?

Rust Profiling is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Rust Profiling use?

About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Rust Profiling?

Skills that share tags, products or a category with Rust Profiling: Samply (vortex-data/vortex, 3.2k stars), Investigate User Bug (cristicretu/diri, 424 stars), Cpp (crazyguitar/cppcheatsheet, 290 stars) and Profiling (Shopify/rubydex, 363 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Rust Profiling?

diodeme (a GitHub user) maintains it in diodeme/Gold-Band, which has 143 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 30, 2026.

Source: diodeme/Gold-Band on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.