rust-perf

rust-perf is a skill for Claude Code, Codex from KalarisLabs/Skill-Doctor. It costs 63 tokens per session (1,019 once invoked), scanned A, original, Apache-2.0.

Guidance for improving the speed, memory use, and compiled size of a Rust scanning program. It also defines performance targets that must not be presented as measured results without benchmark output.

In plain words
What is it for?
Use it when optimizing scans, memory usage, binary size, file access, rule compilation, or benchmarks in Rust.
Why use it?
It prevents unsafe optimization claims and keeps performance work from weakening correctness, repeatability, or offline operation.

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 /usr/bin/time -v ./target/release/skill-doctor scan-all ./tests/fixtures --offline --deterministic.

Good fit Use it when optimizing scans, memory usage, binary size, file access, rule compilation, or benchmarks in Rust.

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/KalarisLabs/Skill-Doctor
agentmods
npx agentmods add skills/kalarislabs/skill-doctor/rust-perf

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kalarislabs/skill-doctor/rust-perf"><img src="https://agentmods.dev/badge/skills/kalarislabs/skill-doctor/rust-perf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,019 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.00063 $0.01019
Opus 5.5 $0.00025 $0.00408
Sonnet 5.5 $0.00013 $0.00204
Haiku 4.5 $0.00006 $0.00102

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

Security

Grade A, and why

rust-perf 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.

skills/rust-perf/SKILL.md · 71 lines

How it starts

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

Rust performance

Load this before optimizing. Do not sacrifice invariants (determinism, additive-only, no mandatory LLM) for speed.

Pre-registered targets (§7.3) — not measured results

Treat these as the optimization budget. Write them into benches as assert ceilings once harness exists. Until then, design so they are reachable. Never publish a number as measured unless sd-bench/RESULTS.md was produced by the harness on a tagged release.

Metric Target
Throughput (offline L1, warm cache off) ≥ 2,000 skills/min
Peak RSS < 40 MB
Install one binary, ~12 MB, zero runtime deps
Cold install → first result < 15 s

Parity with Cisco/NVIDIA on synthetic TPR is the detection claim; adoption is this table. Competitors cannot move install footprint without leaving Python.

What to optimize (in order)

  1. Do not compile YARA at scan time. build.rs once. Scan = match.
  2. mmap skill files with memmap2 when size > ~64 KiB. Keep small files on the stack/heap.
  3. Zero extra alloc on the miss path. A clean skill should not build a Vec<Finding> of zeros then throw it away — return empty slice / SmallVec.
  4. Rayon over files and engines, not over lines inside one 2 KB SKILL.md.
  5. Sorted walk once. Determinism and perf: ignore/walkdir → collect → sort → process.
  6. Canonical digest over sorted (path, content) pairs; hash streaming, not a giant concatenated String.
  7. No tokio, no async, no reqwest on the default path. Async startup cost kills cold-install.
  8. Binary size: default features slim. LTO=thin in release profile. strip = true. Avoid tokio+reqwest+openssl in the default binary (use rustls only if L4 is on). Target ~12 MB stripped musl.
  9. RSS: do not hold every file's bytes after L1 on that file finishes. Drop mmaps per file. Global caches are digest → findings, bounded.
  10. Ruleset is embedded bytes, not a temp directory of .yar files at runtime.

Read the full file on GitHub · 71 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. 1mo ago First seen · 71 lines · 63 tokens per session scan A 3e49ec7ce4ea

Subscribe to this mod's changes

rust-perf is a skill published in the GitHub repository KalarisLabs/Skill-Doctor (13 stars, last pushed yesterday), licensed Apache-2.0. It adds 63 tokens to every session and 1,019 once invoked, about $0.0003 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-09-11.