language-rust

language-rust is a skill for Claude Code from lugassawan/swe-workbench. It costs 50 tokens per session (1,069 once invoked), scanned A, original, MIT.

A Rust coding guide covering ownership, borrowing, lifetimes, iterators, and error handling. These are Rust’s rules for managing memory safely without a garbage collector.

In plain words
What is it for?
Use it when designing Rust data structures, managing references, propagating errors, or writing synchronous and asynchronous code.
Why use it?
It helps resolve borrow-checker problems and avoid unclear ownership, unsafe error handling, and unnecessary lifetime complexity.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swe-workbench plugin — 60 skills, 25 commands, 22 agents, 4 hooks shipped together

Good fit Use it when designing Rust data structures, managing references, propagating errors, or writing synchronous and asynchronous code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lugassawan/swe-workbench/language-rust
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 lugassawan/swe-workbench --skill language-rust
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 60 skills, 25 commands, 22 agents, 4 hooks.

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 language-rust

README.md
[![agentmods](https://agentmods.dev/badge/skills/lugassawan/swe-workbench/language-rust.svg)](https://agentmods.dev/skills/lugassawan/swe-workbench/language-rust)
Your own site
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/language-rust"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/language-rust.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,069 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.00050 $0.01069
Opus 5 $0.00025 $0.00535
Sonnet 5 $0.00010 $0.00214
Haiku 4.5 $0.00005 $0.00107

Measured 4d ago against content hash 039bb0b4dba6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

language-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 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.

skills/language-rust/SKILL.md · 97 lines

How it starts

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

Rust

Ownership in one paragraph

Every value has one owner. Passing by value moves; borrow with & (shared, many) or &mut (exclusive, one). Shared and mutable references cannot coexist. Most "fights with the borrow checker" are a design smell — the data model mixed ownership and sharing.

Borrowing rules of thumb

  • &T when you only read.
  • &mut T when you mutate in place.
  • T (by value) when you consume — builders, transforming constructors.
  • Return owned types unless the caller clearly benefits from a borrow tied to a parameter's lifetime.

Lifetimes

  • Start without annotations; add them when the compiler asks.
  • 'static does not mean "lives forever" — it means "no non-static references inside". Prefer owned types over 'static juggling.
  • If a struct needs many lifetimes, consider owned data or Arc instead.

Error handling

  • Return Result<T, E>; use ? to propagate.
  • Library code: custom enum with thiserror.
  • Application code: anyhow::Error for ergonomics; add context with .with_context(|| "doing X").
  • Reserve panic! for invariant violations the caller cannot recover from.
#[derive(thiserror::Error, Debug)]
pub enum LoadError {
    #[error("io: {0}")] Io(#[from] std::io::Error),
    #[error("bad format: {0}")] Format(String),
}

Traits

  • Design around capability, not identity (Read, not IsFile).
  • Default methods let traits evolve without breaking implementors.
  • impl Trait in arguments → static dispatch, monomorphized, fast.
  • dyn Trait behind Box/& → dynamic dispatch, smaller binary, one code path.
  • Choose dyn for open-ended type sets or heterogeneous collections.

Iterators

Prefer iterator chains over indexed loops — usually faster, always clearer.

let total: u32 = orders.iter()
    .filter(|o| o.is_paid())
    .map(|o| o.total)
    .sum();
  • collect::<Vec<_>>() only when you need to materialize.
  • iter() borrows; into_iter() consumes; iter_mut() mutates in place.

Read the full file on GitHub · 97 lines

Files

What ships with it

1 file 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. 4d ago First seen · 97 lines · 50 tokens per session scan A 039bb0b4dba6

Subscribe to this mod's changes

language-rust is a skill published in the GitHub repository lugassawan/swe-workbench (2 stars, last pushed 2d ago), licensed MIT. It adds 50 tokens to every session and 1,069 once invoked, about $0.0003 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-09-03.

Related

Other skills, from other repositories

wasm

WebAssembly (WASM) integration, WASI, component model, Rust/Go to WASM compilation. Use when implementing WASM modules, browser/edge compute, or polyglot runtime.

TheBeardedBearSAS/claude-craft · 43 tokens

go-rust-reverse

Use for reverse engineering stripped Go and Rust binaries including runtime recognition, pclntab/moduel data recovery, panic strings, and idiomatic decompilation recovery.

zhaoxuya520/reverse-skill · 38 tokens

cloudflare-workers-multi-lang

Multi-language Workers development with Rust, Python, and WebAssembly. Use when building Workers in languages other than JavaScript/TypeScript, or when integrating WASM modules for performance-critical code.

secondsky/claude-skills · 45 tokens

language-idioms-refiner

Facilitate a structured conversation to define language-specific idioms and patterns for a repository. Produces a language-idioms.md document consumed by multiple atoms to adapt pseudocode defaults to the project's language. Use when setting up a new project, switching languages, or when the user says 'setup…

techygarg/lattice · 92 tokens

wasm-edge-computing-expert

Expert guide for WebAssembly (WASM) and Edge Computing. Covers WASI preview 2, Spin/Fermyon, Cloudflare Workers WASM, and high-performance browser computing / Panduan ahli untuk WebAssembly (WASM) dan Edge Computing. Mencakup WASI preview 2, Spin/Fermyon, Cloudflare Workers WASM, dan komputasi performa tinggi di…

roedyrustam/vibes-plug · 91 tokens

rust-dev

This skill should be used when working with Rust code, reviewing Rust code, managing Rust dependencies, creating Rust projects, or fixing Rust compilation errors. It provides strict coding standards (especially FAIL FAST error handling), workspace architecture guidance, dependency management automation, and common…

onsails/skills · 57 tokens