rust

rust is a skill for Claude Code, Codex from xobotyi/cc-foundry. It costs 72 tokens per session (3,888 once invoked), scanned B, original, MIT.

A Rust language guide covering ownership, borrowing, errors, concurrency, tooling, and documentation. Rust is a programming language that checks many memory and type rules while compiling.

In plain words
What is it for?
It is for writing, reviewing, refactoring, debugging, and understanding Rust code.
Why use it?
It gives the agent project conventions for solving Rust problems without bypassing the language's safety model.

Skill for Claude CodeCodex

Part of the rust plugin — 2 skills shipped together

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.

agentmods
npx agentmods add skills/xobotyi/cc-foundry/rust
Any agent
npx skills add xobotyi/cc-foundry --skill rust
Clone the repo
git clone --depth 1 https://github.com/xobotyi/cc-foundry

Made for: Claude Code, Codex.

Or install rust, the plugin that ships this one along with the rest of its 2 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/xobotyi/cc-foundry/rust.svg)](https://agentmods.dev/skills/xobotyi/cc-foundry/rust)
Your own site
<a href="https://agentmods.dev/skills/xobotyi/cc-foundry/rust"><img src="https://agentmods.dev/badge/skills/xobotyi/cc-foundry/rust.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,888 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00072 $0.03888
Opus 5 $0.00036 $0.01944
Sonnet 5 $0.00014 $0.00778
Haiku 4.5 $0.00007 $0.00389

Measured yesterday against content hash d1efcbdf4f3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

rust scanned grade B 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 yesterday.

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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

- Cite the specific violation (file:line and the rule), then show the corrected code inline. Do not lecture in the
plugins/rust/skills/rust/SKILL.md · 226 lines

How it starts

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

Rust

Lean on the type system and the borrow checker. They are the design surface, not an obstacle. When the compiler rejects code, the ownership model is wrong — restructure who owns and who borrows rather than reaching for .clone(), Rc, or unsafe to silence it. Make illegal states unrepresentable: encode invariants in types so the wrong code fails to compile instead of failing at runtime. A fight with the borrow checker is a design review the compiler is giving you for free.

Route to Reference

Read the reference before doing focused work in its area; SKILL.md alone is sufficient for routine code.

  • Idioms and ownership patterns${CLAUDE_SKILL_DIR}/references/idioms.md borrowing/ownership restructuring, impl Trait vs generics vs dyn, iterator adapters, match/if let/let else, newtype and builder patterns, From/Into/TryFrom, the as_/to_/into_ cost cheat-table
  • Error handling${CLAUDE_SKILL_DIR}/references/errors.md Result/Option/?, thiserror enum templates, anyhow .context(), the panic/unwrap/expect policy, error-type design (Display/Error/Send/Sync)
  • Anti-patterns${CLAUDE_SKILL_DIR}/references/anti-patterns.md AI-produced anti-patterns mapped to the Clippy lints that catch them, with the idiomatic fix for each
  • API design${CLAUDE_SKILL_DIR}/references/api-guidelines.md the Rust API Guidelines C-* checklist, RFC 430 naming, #[non_exhaustive], #[must_use], common-trait derives, sealed traits, builders
  • Parallelism${CLAUDE_SKILL_DIR}/references/parallelism.md threads, scoped threads, rayon, Send/Sync, channels, shared state (Arc/Mutex) — the CPU-bound multicore path
  • Async${CLAUDE_SKILL_DIR}/references/async.md the Future/executor model, Tokio, the compiler-invisible footgun checklist (blocking in async, holding !Send across .await), "do you even need async?"
  • Project structure${CLAUDE_SKILL_DIR}/references/structure.md mod.rs-free layout, cargo workspaces, the [lints]/[workspace.lints] table, profiles, features, MSRV
  • Toolchain${CLAUDE_SKILL_DIR}/references/toolchain.md the fmt/clippy/nextest/deny verification gates, rust-analyzer configuration, recommended compiler and Clippy lint sets
  • Edition 2024${CLAUDE_SKILL_DIR}/references/edition-2024.md Rust 2024 edition specifics and migration via cargo fix --edition
  • Documentation${CLAUDE_SKILL_DIR}/references/documentation.md rustdoc conventions, doctests, missing_docs, intra-doc links, semver-checks

Read the full file on GitHub · 226 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. yesterday First seen · 226 lines · 72 tokens per session scan B d1efcbdf4f3c

Subscribe to this mod's changes

rust is a skill published in the GitHub repository xobotyi/cc-foundry (20 stars, last pushed 2d ago), licensed MIT. It adds 72 tokens to every session and 3,888 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (strips warnings and disclaimers). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.