rust

rust is a skill for Claude Code, Codex from miles990/claude-software-skills. It costs 8 tokens per session (3,040 once invoked), scanned A, original, MIT.

A guide to Rust programming, including ownership, borrowing, lifetimes, traits, and asynchronous code. Ownership is Rust's system for deciding which part of a program controls each value and when it can be released.

In plain words
What is it for?
Use it when writing or reviewing Rust functions, references, mutable data, traits, and asynchronous programs.
Why use it?
It helps you understand Rust's rules for safe memory use and avoid invalid data access.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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/miles990/claude-software-skills/rust
Any agent
npx skills add miles990/claude-software-skills --skill rust
Clone the repo
git clone --depth 1 https://github.com/miles990/claude-software-skills

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin rust/plugin install rust after adding the marketplace above.

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/miles990/claude-software-skills/rust.svg)](https://agentmods.dev/skills/miles990/claude-software-skills/rust)
Your own site
<a href="https://agentmods.dev/skills/miles990/claude-software-skills/rust"><img src="https://agentmods.dev/badge/skills/miles990/claude-software-skills/rust.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,040 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00008 $0.03040
Opus 5 $0.00004 $0.01520
Sonnet 5 $0.00002 $0.00608
Haiku 4.5 $0.00001 $0.00304

Measured 6d ago against content hash 886e54700d35, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

rust 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 6d 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.

programming-languages/rust/SKILL.md · 548 lines

How it starts

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

Rust

Overview

Rust programming patterns including ownership, lifetimes, traits, and async programming.


Ownership and Borrowing

Basic Ownership

fn main() {
    // Ownership transfer (move)
    let s1 = String::from("hello");
    let s2 = s1; // s1 is moved to s2
    // println!("{}", s1); // Error: s1 is no longer valid

    // Clone for deep copy
    let s3 = String::from("hello");
    let s4 = s3.clone();
    println!("{} {}", s3, s4); // Both valid

    // Copy types (stack-only data)
    let x = 5;
    let y = x; // Copy, not move
    println!("{} {}", x, y); // Both valid
}

// Ownership and functions
fn takes_ownership(s: String) {
    println!("{}", s);
} // s is dropped here

fn makes_copy(x: i32) {
    println!("{}", x);
} // x goes out of scope, nothing special

fn gives_ownership() -> String {
    String::from("hello")
}

fn takes_and_gives_back(s: String) -> String {
    s
}

Borrowing

// Immutable borrow
fn calculate_length(s: &String) -> usize {
    s.len()
} // s goes out of scope but doesn't drop the value

// Mutable borrow
fn append_world(s: &mut String) {
    s.push_str(" world");
}

fn main() {
    let s = String::from("hello");

    // Multiple immutable borrows OK
    let r1 = &s;
    let r2 = &s;
    println!("{} {}", r1, r2);

    // Mutable borrow (only one at a time)
    let mut s2 = String::from("hello");
    let r3 = &mut s2;
    r3.push_str(" world");
    println!("{}", r3);

    // Cannot have mutable and immutable at same time
    let mut s3 = String::from("hello");
    let r4 = &s3;
    // let r5 = &mut s3; // Error!
    println!("{}", r4);
}

Lifetimes

// Explicit lifetime annotations
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
    if x.len() > y.len() { x } else { y }
}

// Struct with lifetime
struct Excerpt<'a> {
    part: &'a str,
}

impl<'a> Excerpt<'a> {
    fn level(&self) -> i32 {
        3
    }

    fn announce_and_return(&self, announcement: &str) -> &str {
        println!("Attention: {}", announcement);
        self.part
    }
}

// Multiple lifetimes
fn complex<'a, 'b>(x: &'a str, y: &'b str) -> &'a str
where
    'b: 'a, // 'b outlives 'a
{
    x
}

// Static lifetime
fn static_string() -> &'static str {
    "I live forever"
}

Read the full file on GitHub · 548 lines

Files

What ships with it

2 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. 6d ago First seen · 548 lines · 8 tokens per session scan A 886e54700d35

Subscribe to this mod's changes

rust is a skill published in the GitHub repository miles990/claude-software-skills (20 stars, last pushed 7mo ago), licensed MIT. It adds 8 tokens to every session and 3,040 once invoked, about $0.0000 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-30.

Related

Other skills, from other repositories

rust-review

Rust Code Review: Reviews Rust code for ownership patterns, lifetime management, unsafe usage, error handling with Result/Option, concurrency safety, and idiomatic Rust patterns. Covers async Rust (tokio/async-std), trait design, macro hygiene, and performance. Use when the user wants a review of Rust code, mentions…

camilooscargbaptista/cto-toolkit · 100 tokens

rust-docs

Comprehensive Rust 1.97.0 reference covering all language features: ownership, borrowing, lifetimes, types, variables, control flow, functions, closures, structs, enums, traits, generics, error handling, collections, strings, concurrency, async/await, modules, packages, macros, attributes, smart pointers, unsafe Rust…

pledgeandgrow/pledge-skills · 130 tokens

rust-systems-programming

Complete guide for Rust systems programming including ownership, borrowing, concurrency, async programming, unsafe code, and performance optimization.

manutej/luxor-claude-marketplace · 28 tokens

toolchains-rust-core

Core Rust toolchain conventions — ownership/borrowing patterns, error handling, async with tokio, and idiomatic project structure for the rust-engineer agent.

bobmatnyc/claude-mpm-agents · 37 tokens

rust

Use when building Axum applications, implementing type-safe handlers, working with SQLx, setting up error handling with thiserror, or writing Rust backend services.

MadAppGang/claude-code · 33 tokens

code-reviewer-rust

Auto-route to this skill if project contains.

buiphucminhtam/forgewright · 5 tokens