RIPDPI: Agent for Claude Code

.claude/agents/perf-profiler.md

perf-profiler is an agent for Claude Code from po4yka/RIPDPI. It costs 34 tokens per session (781 once invoked), scanned A, original, BSD-3-Clause.

A Rust performance profiler that measures benchmark speed and investigates where a program spends CPU time. It uses Criterion benchmarks, flamegraphs, and analysis of compiled-code size caused by generic Rust code.

In plain words
What is it for?
Use it to run benchmarks, compare current results with the main branch, create CPU flamegraphs, and investigate sustained-load or peak-throughput problems.
Why use it?
It helps find throughput regressions and identify slow parts of native Rust code instead of relying on guesses. Comparisons with saved baselines show whether performance changed.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is po4yka/RIPDPI's own configuration. It tells Claude Code how to work on RIPDPI itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything RIPDPI configures →

Reuse

Borrowing it

Nothing to install: this file belongs to po4yka/RIPDPI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/po4yka/RIPDPI/main/.claude/agents/perf-profiler.md
Clone the repo
git clone --depth 1 https://github.com/po4yka/RIPDPI

Made for: Claude Code.

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 perf-profiler

README.md
[![agentmods](https://agentmods.dev/badge/agents/po4yka/ripdpi/perf-profiler/github.svg)](https://agentmods.dev/agents/po4yka/ripdpi/perf-profiler)
Your own site
<a href="https://agentmods.dev/agents/po4yka/ripdpi/perf-profiler"><img src="https://agentmods.dev/badge/agents/po4yka/ripdpi/perf-profiler/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 perf-profiler

Your own site · 80×15
<a href="https://agentmods.dev/agents/po4yka/ripdpi/perf-profiler"><img src="https://agentmods.dev/badge/agents/po4yka/ripdpi/perf-profiler.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 781 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.00034 $0.00781
Opus 5.5 $0.00014 $0.00312
Sonnet 5.5 $0.00007 $0.00156
Haiku 4.5 $0.00003 $0.00078

Measured yesterday against content hash 4996072959f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

perf-profiler 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 yesterday.

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.

.claude/agents/perf-profiler.md · 93 lines

How it starts

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

You are a performance profiling specialist for the RIPDPI project (Rust workspace at native/rust/).

Confirm package names with cargo metadata --manifest-path native/rust/Cargo.toml --locked --no-deps before invoking profiling tools; do not infer historical aggregate packages.

Benchmark Infrastructure

  • Criterion benchmarks: derive every [[bench]] target from native/rust/crates/ripdpi-bench/Cargo.toml before selecting a benchmark.
  • Soak tests: scripts/ci/run-rust-native-soak.sh (stability under sustained load)
  • Load tests: scripts/ci/run-rust-native-load.sh (peak throughput measurement)

Profiling Workflow

1. Run Criterion Benchmarks

cd native/rust
cargo bench --locked --package ripdpi-bench -- --output-format bencher

Compare against baseline:

cargo bench --locked --package ripdpi-bench -- --save-baseline current
cargo bench --locked --package ripdpi-bench -- --baseline main --compare

2. Generate Flamegraphs

# CPU flamegraph for a specific benchmark
cargo flamegraph --locked --package ripdpi-bench --bench relay_throughput -- --bench --profile-time 10

# For Android targets (simpleperf)
# Requires device/emulator with debuggable build

Flamegraph output: native/rust/flamegraph.svg

3. Monomorphization Bloat

cd native/rust
cargo llvm-lines --locked --package ripdpi-proxy-runtime --release 2>/dev/null | head -30

Flag functions with >1000 copies or >10000 lines of LLVM IR.

4. Binary Size Analysis

cd native/rust
cargo bloat --locked --package ripdpi-android --profile android-jni -n 20
cargo bloat --locked --package ripdpi-android --profile android-jni --crates

Cross-reference with native-verifier baseline in scripts/ci/verify_native_sizes.py.

5. Cache Performance (Linux host only)

perf stat -e cache-misses,cache-references,instructions,cycles \
  cargo bench --locked --package ripdpi-bench -- --test relay_throughput

Analysis Guidelines

Read the full file on GitHub · 93 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. yesterday First seen · 93 lines · 34 tokens per session scan A 4996072959f5

Subscribe to this mod's changes

perf-profiler is an agent published in the GitHub repository po4yka/RIPDPI (85 stars, last pushed yesterday), licensed BSD-3-Clause. It adds 34 tokens to every session and 781 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-11-07.

Related

perf-profiler compared with agents from other repositories

perf-profiler next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
perf-profilerpo4yka/RIPDPIAgent85yesterdayBSD-3-ClauseA34Claude Code
rust-build-resolveraffaan-m/ECCAgent299kyesterdayMITA41Claude Code, Kiro
rust-general-engineernotque/vexjoy-agentAgent448todayMITA25Claude Code
rust-performance-engineerbug-ops/zephAgent664d agoMITA60Claude Code
rust-debuggerbug-ops/zephAgent664d agoMITA61Claude Code
rust-cli-expertwildcard/caroAgent40yesterdayAGPL-3.0A0Claude Code
rust-build-resolverloulanyue/awesome-claude-notesAgent2711mo agoMITA41Claude Code