waf-detector: Agent for Claude Code

.claude/agents/performance-optimizer.md

performance-optimizer is an agent for Claude Code from ammarion/waf-detector. It costs 60 tokens per session (687 once invoked), scanned A, original, Apache-2.0.

A performance-review helper for Rust programs, especially applications that send and receive data over networks.

In plain words
What is it for?
Use it to profile execution speed, reduce memory usage, improve async operations, and optimize concurrent network processing.
Why use it?
It helps find slow code, high memory use, inefficient asynchronous work, and limits in concurrent processing.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: names the ExitPlanMode tool.

This is ammarion/waf-detector's own configuration. It tells Claude Code how to work on waf-detector 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 waf-detector configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/ammarion/waf-detector/main/.claude/agents/performance-optimizer.md
Clone the repo
git clone --depth 1 https://github.com/ammarion/waf-detector

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 performance-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/ammarion/waf-detector/performance-optimizer/github.svg)](https://agentmods.dev/agents/ammarion/waf-detector/performance-optimizer)
Your own site
<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.

agentmods 80×15 button for performance-optimizer

Your own site · 80×15
<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>
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 687 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.00060 $0.00687
Opus 5.5 $0.00024 $0.00275
Sonnet 5.5 $0.00012 $0.00137
Haiku 4.5 $0.00006 $0.00069

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

Security

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.

.claude/agents/performance-optimizer.md · 69 lines

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:

  1. 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
  2. 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, or cargo-profiling when appropriate
  3. Implement Optimizations:

    • Use lazy_static or once_cell for 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 Arc and Rc for shared immutable data
    • Use Cow (Clone on Write) for potentially mutable data
    • Implement streaming parsers for large responses
  4. Measure and Validate Improvements:

    • Conduct before/after benchmarks with consistent test data
    • Compare memory usage using tools like valgrind or heaptrack
    • 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
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. 1mo ago First seen · 69 lines · 60 tokens per session scan A 4315a348c831

Subscribe to this mod's changes

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.

Related

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.

affaan-m/ECC · 41 tokens

rust-general-engineer

Rust development: features, debugging, code review, performance. Modern Rust 2024 edition patterns.

notque/vexjoy-agent · 25 tokens

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.

bug-ops/zeph · 60 tokens

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…

bug-ops/zeph · 61 tokens

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.

nwiizo/ccswarm · 48 tokens

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).

acaprino/daodan · 73 tokens