rust-sanitizers-miri

rust-sanitizers-miri is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 91 tokens per session (1,818 once invoked), scanned A, original, MIT.

A guide to using AddressSanitizer, ThreadSanitizer, MemorySanitizer, UBSan, and Miri to detect memory errors, data races, and undefined behavior in Rust. Miri checks certain operations by running code in an interpreter.

In plain words
What is it for?
Use it to run sanitizers on Rust tests, investigate memory and thread errors, and check unsafe code with Miri.
Why use it?
It provides ways to validate unsafe code and find runtime or compile-time safety problems that ordinary tests may miss.

Skill for Claude CodeCodex

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

Good fit Use it to run sanitizers on Rust tests, investigate memory and thread errors, and check unsafe code with Miri.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/rust-sanitizers-miri
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 rust-sanitizers-miri
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 rust-sanitizers-miri

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rust-sanitizers-miri"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rust-sanitizers-miri.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,818 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 15 Sept 2026
  • Snyk pass 15 Sept 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.00091 $0.01818
Opus 5.5 $0.00036 $0.00727
Sonnet 5.5 $0.00018 $0.00364
Haiku 4.5 $0.00009 $0.00182

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

Security

Grade A, and why

rust-sanitizers-miri 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 11d 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/rust-sanitizers-miri/SKILL.md · 202 lines

How it starts

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

Rust Sanitizers and Miri

Purpose

Guide agents through runtime safety validation for Rust: ASan/TSan/MSan/UBSan via RUSTFLAGS, Miri for compile-time UB detection in unsafe code, and interpreting sanitizer reports.

Triggers

  • "How do I run AddressSanitizer on Rust code?"
  • "How do I use Miri to check my unsafe Rust?"
  • "How do I run ThreadSanitizer on a Rust program?"
  • "My unsafe Rust might have UB — how do I detect it?"
  • "How do I interpret a Rust ASan report?"
  • "Can I run Rust sanitizers on stable?"

Workflow

1. Sanitizers in Rust (nightly required)

Rust sanitizers require nightly and a compatible platform:

# Install nightly
rustup toolchain install nightly
rustup component add rust-src --toolchain nightly

# AddressSanitizer (Linux, macOS)
RUSTFLAGS="-Z sanitizer=address" \
    cargo +nightly test -Zbuild-std \
    --target x86_64-unknown-linux-gnu

# ThreadSanitizer (Linux)
RUSTFLAGS="-Z sanitizer=thread" \
    cargo +nightly test -Zbuild-std \
    --target x86_64-unknown-linux-gnu

# MemorySanitizer (Linux, requires all-instrumented build)
RUSTFLAGS="-Z sanitizer=memory -Zsanitizer-memory-track-origins" \
    cargo +nightly test -Zbuild-std \
    --target x86_64-unknown-linux-gnu

# UndefinedBehaviorSanitizer
RUSTFLAGS="-Z sanitizer=undefined" \
    cargo +nightly test -Zbuild-std \
    --target x86_64-unknown-linux-gnu

-Zbuild-std rebuilds the standard library with the sanitizer, which is necessary for accurate results.

2. Stable sanitizer workaround

For stable Rust, use the cross tool with a Docker image that has sanitizers pre-configured, or run cargo test inside a Docker container with a nightly image.

Alternatively, for simpler UB checking without nightly:

# cargo-sanitize (wrapper)
cargo install cargo-sanitize
cargo sanitize address

3. Interpreting ASan output in Rust

==12345==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000050
READ of size 4 at 0x602000000050 thread T0
    #0 0x401234 in myapp::module::function /src/main.rs:15
    #1 0x401567 in myapp::main /src/main.rs:42

0x602000000050 is located 0 bytes after a 40-byte region allocated at:
    #0 0x... in alloc::alloc::alloc ...
    #1 0x... in myapp::create_buffer /src/main.rs:10

Read the full file on GitHub · 202 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. 11d ago Changed · +4 lines c0d4f31168c6
  2. 2mo ago First seen · 198 lines · 91 tokens per session scan A d675d032b8ca

Subscribe to this mod's changes

rust-sanitizers-miri is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (308 stars, last pushed 11d ago), licensed MIT. It adds 91 tokens to every session and 1,818 once invoked, about $0.0004 per session on Opus 5.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

rust-sanitizers-miri compared with skills from other repositories

rust-sanitizers-miri next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rust-sanitizers-mirimohitmishra786/low-level-dev-skillsSkill30811d agoMITA91Claude Code, Codex
rust-projectmajiayu000/spellbookSkill301yesterdayMITA43Claude Code, Codex
gcs-rust-download-object-apidivinevideo/divine-mobileSkill263todayMPL-2.0A91Claude Code, Codex
windows-compatsdsrss/code-graph-mcpSkill1027d agoMITA165Claude Code, Codex
rustnimadorostkar/Claude-Skills-collectionSkill412d agoMITA74Claude Code
bevy-migration-0-18-to-0-19shinyobjectz/raea-skillsSkill38yesterdayApache-2.0A166Claude Code
rust-docsrewrite-rs/skillsSkill3410d agoBSD-3-ClauseA93Claude Code, Codex