Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/mathisk2095/jko-claude-plugins/rust-hardengit clone --depth 1 https://github.com/mathisk2095/jko-claude-pluginsWrote 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/commands/mathisk2095/jko-claude-plugins/rust-harden)<a href="https://agentmods.dev/commands/mathisk2095/jko-claude-plugins/rust-harden"><img src="https://agentmods.dev/badge/commands/mathisk2095/jko-claude-plugins/rust-harden.svg" alt="Measured on agentmods" 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 | $0.00034 | $0.00797 |
| Opus 5 | $0.00017 | $0.00398 |
| Sonnet 5 | $0.00007 | $0.00159 |
| Haiku 4.5 | $0.00003 | $0.00080 |
Grade A, and why
rust-harden 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Harden
Systematically harden the target Rust code against production failures. This is the defensive pass — every change reduces crash risk.
Preparation
- Find the workspace root: run
cargo locate-project --workspace --message-format plain 2>/dev/null | xargs dirname. - Identify the target: use the
targetargument, or default to the workspace'ssrc/. - Determine if this is a library or application crate (check for
lib.rsvsmain.rs).
Hardening Steps
Execute these in order. For each finding, make the fix directly — don't just report it.
Step 1: Eliminate Panic Sources
Run in the shell:
rg --type rust '\.(unwrap|expect)\(' src/ --glob '!*test*' -n
For each match:
- If the unwrap is on a
Result: replace with?and add.context("description")if anyhow is available - If the unwrap is on an
Option: replace with.ok_or_else(|| Error::...)then? - If it's genuinely an invariant (e.g., after a length check): change to
.expect("reason: invariant X holds because Y")with a clear explanation
Step 2: Document Unsafe Blocks
Run in the shell:
rg --type rust -B1 'unsafe \{' src/ -n | head -50
For each unsafe block without a preceding // SAFETY: comment, add one explaining:
- What invariant is being upheld
- Why it is safe in this context
- Under what conditions it would become unsound
Step 3: Check Overflow Protection
Read Cargo.toml and check if [profile.release] has overflow-checks = true. If not, add it:
[profile.release]
overflow-checks = true
Evidence: CVE-2018-1000810 (std str::repeat) — silent integer overflow in release build. Debug builds panic, release builds silently wrap.
Step 4: Replace Indexing with Safe Access
Run in the shell:
rg --type rust '\[\w+\]' src/ --glob '!*test*' -n | head -30
For array/slice indexing x[i] in non-test code, evaluate whether .get(i) with proper error handling is safer. Slice indexing is potentially the main source of panics in non-trivial Rust programs.
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.
- 4d ago First seen · 91 lines · 34 tokens per session scan A bc1483dfda5b
rust-harden is a command published in the GitHub repository mathisk2095/jko-claude-plugins (3 stars, last pushed 6d ago), licensed MIT. It adds 34 tokens to every session and 797 once invoked, about $0.0002 per session on Opus 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-31.
Other commands, from other repositories
python-dev
Start Python development workflow with architecture, implementation, review, and testing phases.
setup
Set up rust-analyzer LSP integration and install all cargo tools required by the hooks in this project.
dare-rust-workspace
Decisão e migração de Cargo workspace multi-crate para projetos Rust/Axum. Cobre dois cenários.
embeddable
Generate a custom Embeddable panel that can be placed on Kibana Dashboards, with factory registration, input/output types, and React rendering.
mcp-config
Generate a .mcp.json configuration file that connects Claude Code to Elasticsearch and Kibana MCP servers alongside this plugin, enabling live cluster access during plugin development.
saved-object
Generate a custom Saved Object type with registration, mappings, migrations, CRUD service, and management integration for a Kibana plugin.