rustc-basics

rustc-basics is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 83 tokens per session (1,648 once invoked), scanned A, original, MIT.

A guide to Rust compiler settings and output. It covers Cargo build profiles, optimization, link-time optimization, generated assembly, intermediate code, and compilation errors.

In plain words
What is it for?
Use it to configure release builds, choose target platforms, inspect assembly or MIR, reduce binary size, and diagnose Rust compilation issues.
Why use it?
It helps you balance compile speed, executable size, runtime performance, and useful compiler diagnostics.

Skill for Claude CodeCodex

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

not rated 205repo +8 2mo ago A scan Socket: passSnyk: passSkillSpector: pass 83 tokens original MIT

Good fit Use it to configure release builds, choose target platforms, inspect assembly or MIR, reduce binary size, and diagnose Rust compilation issues.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/rustc-basics
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 mohitmishra786/low-level-dev-skills --skill rustc-basics
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

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 rustc-basics

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rustc-basics/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rustc-basics)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rustc-basics"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rustc-basics/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 rustc-basics

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rustc-basics"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rustc-basics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,648 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. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 21 Feb 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00083 $0.01648
Opus 5 $0.00042 $0.00824
Sonnet 5 $0.00017 $0.00330
Haiku 4.5 $0.00008 $0.00165

Measured 9d ago against content hash 1fa7517fa571, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

rustc-basics 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 9d 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/rust/rustc-basics/SKILL.md · 197 lines

How it starts

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

rustc Basics

Purpose

Guide agents through Rust compiler invocation: RUSTFLAGS, Cargo profile configuration, build modes, MIR and assembly inspection, monomorphization, and common compilation error patterns.

Triggers

  • "How do I configure a release build in Rust for maximum performance?"
  • "How do I see the assembly output for a Rust function?"
  • "What is monomorphization and why is it making my compile slow?"
  • "How do I enable LTO in Rust?"
  • "My Rust binary is too large — how do I shrink it?"
  • "How do I read Rust MIR output?"

Workflow

1. Choose a build mode

# Debug (default) — fast compile, no optimization, debug info
cargo build

# Release — optimized, no debug info by default
cargo build --release

# Check only (fastest, no codegen)
cargo check

# Build for specific target
cargo build --release --target aarch64-unknown-linux-gnu

2. Cargo.toml profile configuration

[profile.release]
opt-level = 3          # 0-3, "s" (size), "z" (aggressive size)
debug = false          # true = full, 1 = line tables only, 0 = none
lto = "thin"           # false | "thin" | true (fat LTO)
codegen-units = 1      # 1 = max optimization, higher = faster compile
panic = "abort"        # "unwind" (default) | "abort" (smaller binary)
strip = "symbols"      # "none" | "debuginfo" | "symbols"
overflow-checks = false # default true in debug, false in release

[profile.release-with-debug]
inherits = "release"
debug = true           # release build with debug symbols
strip = "none"

[profile.dev]
opt-level = 1          # Speed up debug builds slightly
Setting Impact
lto = true (fat) Best optimization, slowest link
lto = "thin" Good optimization, parallel link
codegen-units = 1 Best inlining, slower compile
panic = "abort" Removes unwind tables, smaller binary
opt-level = "z" Aggressive size reduction

3. RUSTFLAGS

# Set for a single build
RUSTFLAGS="-C target-cpu=native" cargo build --release

# Enable all target CPU features
RUSTFLAGS="-C target-cpu=native -C target-feature=+avx2,+bmi2" cargo build --release

# Control codegen at invocation level
RUSTFLAGS="-C opt-level=3 -C codegen-units=1 -C lto=on" cargo build --release

Read the full file on GitHub · 197 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. 9d ago First seen · 197 lines · 83 tokens per session scan A 1fa7517fa571

Subscribe to this mod's changes

rustc-basics is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (205 stars, last pushed 2mo ago), licensed MIT. It adds 83 tokens to every session and 1,648 once invoked, about $0.0004 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

omh-rust

This is a Hermes-native rust workflow skill.

rlaope/oh-my-hermes · 69 tokens

rust-project

Modern Rust project architecture guide for 2025. Use when creating Rust projects (CLI, web services, libraries). Covers workspace structure, error handling, async patterns, and idiomatic Rust best practices.

majiayu000/spellbook · 43 tokens

solana-toolkit-guide

Guide to the Solana Wallet Toolkit — vanity address generation with multi-threaded search, official Solana Labs libraries, Rust and TypeScript implementations. Includes wallet generation, custom address prefixes, and OG names on the blockchain.

nirholas/three.ws · 50 tokens

windows-compat

Audit and harden this Rust repo (code-graph-mcp) for Windows correctness: path-spelling drift between producers, the 32,767-char command-line cap, index-key mismatches, and path predicates that assume one ecosystem's layout. Use whenever touching code that builds, compares, prints, or stores a filesystem path; that…

sdsrss/code-graph-mcp · 165 tokens

gpui-toolkit

Use when building or modifying GPUI applications in the gpui-toolkit workspace, especially when choosing reusable toolkit crates, composing UI, adding components, charts, themes, layouts, audio controls, mobile surfaces, or validation coverage. Prefer existing toolkit APIs over custom one-off implementations.

pierreaubert/gpui-toolkit · 60 tokens

custom-allocators

Use when implementing pool/slab/arena allocators, tuning jemalloc/mimalloc/tcmalloc, writing a Rust GlobalAlloc, or benchmarking allocator performance and fragmentation.

OutlineDriven/outline-driven-development · 39 tokens