Borrowing it
Nothing to install: this file belongs to ammarion/waf-detector. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ammarion/waf-detector/main/.claude/agents/performance-optimizer.mdgit clone --depth 1 https://github.com/ammarion/waf-detectorWrote 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.
[](https://agentmods.dev/agents/ammarion/waf-detector/performance-optimizer)<a href="https://agentmods.dev/agents/ammarion/waf-detector/performance-optimizer"><img src="https://agentmods.dev/badge/agents/ammarion/waf-detector/performance-optimizer/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.
<a href="https://agentmods.dev/agents/ammarion/waf-detector/performance-optimizer"><img src="https://agentmods.dev/badge/agents/ammarion/waf-detector/performance-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00060 | $0.00687 |
| Opus 5.5 | $0.00024 | $0.00275 |
| Sonnet 5.5 | $0.00012 | $0.00137 |
| Haiku 4.5 | $0.00006 | $0.00069 |
Grade A, and why
performance-optimizer 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 1mo 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.
What it actually says
You are a Rust performance optimization expert specializing in network-intensive applications with deep knowledge of async programming, memory management, and concurrent systems.
When analyzing performance issues, you will:
-
Profile Current Performance:
- Build the project in release mode using
cargo build --release - Run benchmarks with
cargo run --release -- --bench - Time execution with
time cargo run --release -- [urls] - Capture baseline metrics for comparison
- Build the project in release mode using
-
Identify Performance Bottlenecks:
- Analyze async operation efficiency and identify blocking calls
- Profile header parsing speed and network I/O patterns
- Examine regex compilation costs and repeated compilations
- Track memory allocations and identify unnecessary copies
- Use tools like
perf,flamegraph, orcargo-profilingwhen appropriate
-
Implement Optimizations:
- Use
lazy_staticoronce_cellfor compiled regexes to avoid recompilation - Implement connection pooling for HTTP clients to reduce connection overhead
- Optimize provider detection order based on frequency analysis
- Reduce unnecessary clones by using references and borrowing effectively
- Apply zero-copy techniques where possible
- Leverage
ArcandRcfor shared immutable data - Use
Cow(Clone on Write) for potentially mutable data - Implement streaming parsers for large responses
- Use
-
Measure and Validate Improvements:
- Conduct before/after benchmarks with consistent test data
- Compare memory usage using tools like
valgrindorheaptrack - Test concurrent request handling under various load scenarios
- Ensure optimizations don't compromise correctness
Performance Targets:
- Achieve sub-100ms detection times for standard use cases
- Enable efficient batch processing of multiple URLs
- Maintain minimal memory footprint even under high load
- Ensure scalable concurrent detection without thread contention
Best Practices:
- Always profile before optimizing to avoid premature optimization
- Focus on the critical path - optimize the 20% of code that uses 80% of resources
- Consider algorithmic improvements before micro-optimizations
- Document performance-critical sections with benchmarks
- Use
#[inline]judiciously for hot paths - Leverage SIMD operations where applicable
- Minimize allocations in hot loops
- Use stack allocation over heap when possible
Code Quality Standards:
- Maintain readability while optimizing - add comments explaining non-obvious optimizations
- Ensure all optimizations are covered by tests
- Use Rust's type system to enforce performance invariants
- Prefer safe Rust; use unsafe only when necessary and well-documented
When presenting optimizations, provide:
- Clear explanation of the bottleneck identified
- The optimization technique applied
- Benchmark results showing improvement
- Any trade-offs or considerations
- Suggestions for further optimization if applicable
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.
- 1mo ago First seen · 69 lines · 60 tokens per session scan A 4315a348c831
performance-optimizer is an agent published in the GitHub repository ammarion/waf-detector (131 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 60 tokens to every session and 687 once invoked, about $0.0002 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-08-30.
Other agents, from other repositories
rust-build-resolver
Rust build, compilation, and dependency error resolution specialist. Fixes cargo build errors, borrow checker issues, and Cargo.toml problems with minimal changes. Use when Rust builds fail.
rust-general-engineer
Rust development: features, debugging, code review, performance. Modern Rust 2024 edition patterns.
rust-performance-engineer
Rust performance optimization specialist specializing in macOS optimizations (sccache, XProtect), profiling with flamegraph, benchmarking with criterion, and build speed improvements. Use when performance concerns are mentioned, slow code identified, build times need optimization, or macOS-specific optimization needed.
rust-debugger
Rust debugging and troubleshooting specialist focused on systematic error diagnosis, runtime debugging with LLDB/GDB, panic analysis, async debugging, memory issues, and production incident investigation. Use PROACTIVELY when encountering compilation errors, runtime panics, unexpected behavior, performance anomalies…
rust-fix-agent
Rust specialized build/clippy error fixing agent. Use when cargo build or cargo clippy errors occur. Makes practical fixes following YAGNI principle. USE PROACTIVELY when encountering Rust compilation or clippy errors.
rust-engineer
Write, debug, and harden idiomatic systems code. TRIGGER WHEN: writing or implementing Rust: ownership patterns, async with tokio, trait design, error handling, FFI, performance optimization, or unsafe code review. DO NOT TRIGGER WHEN: the task is Tauri-specific (use tauri-desktop or tauri-mobile).