rust-harden

rust-harden is a skill for Claude Code, Codex from tozhax/plumbwork. It costs 117 tokens per session (3,962 once invoked), scanned A, original, MIT.

A guide for improving existing Rust code and designing new Rust crates. It focuses on ownership, error paths, asynchronous cancellation, and limiting unsafe code, with compiler and runtime checks.

In plain words
What is it for?
Use it to harden a Rust project, start a Rust crate, clean up ownership and panic handling, make asynchronous code safer, or narrow unsafe code.
Why use it?
It helps remove panic-prone code, unnecessary sharing and copying, cancellation bugs, and unsafe sections whose conditions are not clear or checked.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; mentions Gemini CLI.

Good fit Use it to harden a Rust project, start a Rust crate, clean up ownership and panic handling, make asynchronous code safer, or narrow unsafe code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tozhax/plumbwork/rust-harden
Install

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.

Any agent
npx skills add tozhax/plumbwork --skill rust-harden
Clone the repo
git clone --depth 1 https://github.com/tozhax/plumbwork

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tozhax/plumbwork/rust-harden"><img src="https://agentmods.dev/badge/skills/tozhax/plumbwork/rust-harden.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,962 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00117 $0.03962
Opus 5.5 $0.00047 $0.01585
Sonnet 5.5 $0.00023 $0.00792
Haiku 4.5 $0.00012 $0.00396

Measured 2d ago against content hash 664046a375f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust-harden scanned grade A with 1 finding 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 2d 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.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

* **vs. `~/.gemini/config/skills/rustify/SKILL.md`:** `rustify` ports C, C++, Go, Python, TS/JS, Ruby, or Java/Kotlin codebases into Rust and builds initial Foreign Function Interface (`FFI`) bridges against cross-langua

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/rust-harden/SKILL.md · 120 lines

How it starts

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

Rust Harden: Intra-Rust Ownership, Panic-Freedom & Unsafe Narrowing Discipline

Existing Rust crates frequently accumulate borrow-checker workarounds and latent runtime traps: defensive .clone() chains, single-owner state wrapped in Arc<Mutex<T>> or Rc<RefCell<T>>, production .unwrap() and .expect() panic paths, cancellation-unsafe tokio::select! branches, and oversized unsafe blocks lacking verified preconditions. rust-harden eliminates intra-Rust ownership, panic, concurrency, and memory-safety debt under compiler, linter, sanitizer, and formal proof gates.


1. Adjacent-Skill Boundaries & Mode Selection

  • vs. ~/.gemini/config/skills/rustify/SKILL.md: rustify ports C, C++, Go, Python, TS/JS, Ruby, or Java/Kotlin codebases into Rust and builds initial Foreign Function Interface (FFI) bridges against cross-language golden vectors. Once code compiles and runs as a Rust crate, hand off intra-Rust ownership cleanup, panic removal, async cancellation hardening, and unsafe narrowing to rust-harden.
  • vs. ~/.gemini/config/skills/refactoring/SKILL.md & ~/.gemini/config/skills/sweetspot/SKILL.md: Use refactoring for language-agnostic module splits or renames without Rust-specific ownership/lint/soundness goals, and use sweetspot when profiling and reducing measured wall-clock time, memory (RAM), binary size, or network bandwidth under the 3-Zone Gate.
  • vs. ~/.gemini/config/skills/harness/references/dependency-upgrade.md & ~/.gemini/config/skills/diagnosing-bugs/SKILL.md: Use dependency-upgrade for Cargo.toml version or Rust edition bumps (2021 -> 2024), and use diagnosing-bugs first when reproducing an active crash, deadlock, or failing test before hardening surrounding code.

Three Mutually Exclusive Operational Modes (Never Mix in One Changeset)

Bare /rust-harden invocations default to Mode 1 (--internal) unless the user explicitly passes --contract or --greenfield, or confirms contract tightening via ask_question. Explicit natural-language greenfield scaffolding prompts in workspaces with 0 existing Cargo.toml crates enter Mode 3 (--greenfield) directly (asking via ask_question only when an existing Cargo.toml crate is present and intent is ambiguous):

Read the full file on GitHub · 120 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 120 lines · 117 tokens per session scan A 664046a375f0

Subscribe to this mod's changes

rust-harden is a skill published in the GitHub repository tozhax/plumbwork (33 stars, last pushed 2d ago), licensed MIT. It adds 117 tokens to every session and 3,962 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-02.

Related

rust-harden compared with skills from other repositories

rust-harden next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rust-hardentozhax/plumbworkSkill332d agoMITA117Claude Code, Codex
rust-patternsaffaan-m/ECCSkill316k2d agoMITA28Claude Code, Kiro
update-v8-versionopeninterpreter/openinterpreterSkill69ktodayApache-2.0A86Codex
omh-rustrlaope/oh-my-hermesSkill6.3ktodayMITA19Claude Code
dd-code-generationDataDog/pupSkill1.1ktodayApache-2.0A16Claude Code
swiftidebosun-ai/swiftideSkill813yesterdayMITA43Claude Code, Codex
azure-keyvault-secrets-rustbenjaminasterA/antigravity-awesome-skillsSkill527yesterdayMITA0Claude Code, Codex