rust-for-linux

rust-for-linux is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 110 tokens per session (3,311 once invoked), scanned B, original, MIT.

A guide to writing Linux kernel modules and device drivers in Rust. It covers the kernel's Rust interfaces, building modules outside the kernel source tree, and testing with KUnit, Linux's kernel unit-testing framework.

In plain words
What is it for?
Use it to create Rust modules, write miscellaneous or platform drivers, handle kernel locks and initialization, build out-of-tree code, and test it with KUnit.
Why use it?
Kernel code runs with high privileges and must follow strict rules for memory, locking, and registration. The guide helps developers set up the toolchain and determine when Rust support exists for a Linux subsystem.

Skill for Claude CodeCodex

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

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./tools/testing/kunit/kunit.py run --make_options LLVM=1 \.

Good fit Use it to create Rust modules, write miscellaneous or platform drivers, handle kernel locks and initialization, build out-of-tree code, and test it with KUnit.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills
agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/rust-for-linux

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-for-linux

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rust-for-linux"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rust-for-linux.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,311 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00110 $0.03311
Opus 5.5 $0.00044 $0.01324
Sonnet 5.5 $0.00022 $0.00662
Haiku 4.5 $0.00011 $0.00331

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

Security

Grade B, and why

rust-for-linux 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 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo insmod hello_rust.ko count=4
skills/kernel-dev/rust-for-linux/SKILL.md · 340 lines

How it starts

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

Rust for Linux

Purpose

Guide agents through writing Linux kernel code in Rust (examples checked against Linux 7.3): toolchain setup, the kernel crate, pin-init, out-of-tree modules, misc and platform drivers, and testing with KUnit.

Triggers

  • "How do I write a Linux kernel module in Rust?"
  • "make rustavailable says Rust is not available"
  • "How does pin-init / try_pin_init! work for a kernel mutex?"
  • "How do I build an out-of-tree Rust kernel module?"
  • "Is there a Rust abstraction for this subsystem yet?"
  • "How do I test kernel Rust code with KUnit?"

Workflow

1. Status and when to use Rust

Rust stopped being experimental in Linux 7.0 (April 2026). In-tree users include the Android Binder driver, the Nova (NVIDIA) and Tyr (Arm Mali) GPU drivers, the null block driver, several PHY drivers and the DRM panic QR generator. Rust is still not enabled by default.

New driver?
├── Subsystem has Rust abstractions (rust/kernel/<subsystem>.rs)?
│   ├── Yes → Rust is a good fit; follow samples/rust/ for the pattern
│   └── No  → C driver, or write the abstraction first (upstream review needed)
└── Touching an existing C driver → stay in C; Rust is per-module, not per-function

Abstractions change between releases. Check rust/kernel/ and samples/rust/ in the tree you build against rather than copying code written for another version.

2. Toolchain setup

Tool Minimum for 7.3 (scripts/min-tool-version.sh)
rustc 1.85.0 (1.95 powerpc, 1.96 s390)
bindgen 0.71.1 (bindgen-cli)
LLVM/Clang 17.0.1
# Rust toolchain plus the standard library source (core is rebuilt for the kernel)
rustup component add rust-src
cargo install --locked bindgen-cli

# Clang/LLVM build of the kernel (mixed GCC + Rust builds are still experimental)
make LLVM=1 rustavailable     # explains exactly what is missing

# Enable Rust: General setup → Rust support (CONFIG_RUST=y)
make LLVM=1 menuconfig
make LLVM=1 -j"$(nproc)"

# Editor support: writes rust-project.json for rust-analyzer
make LLVM=1 rust-analyzer

Read the full file on GitHub · 340 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. 9d ago First seen · 340 lines · 110 tokens per session scan B 6b743d9cf004

Subscribe to this mod's changes

rust-for-linux is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (304 stars, last pushed 10d ago), licensed MIT. It adds 110 tokens to every session and 3,311 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-21.

Related

rust-for-linux compared with skills from other repositories

rust-for-linux next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rust-for-linuxmohitmishra786/low-level-dev-skillsSkill30410d agoMITB110Claude Code, Codex
wasmTheBeardedBearSAS/claude-craftSkill10813d agoMITA43Claude Code
analyzing-rust-malware-internalsmeltedinhex/analyst-ai-packSkill253d agoApache-2.0A67Claude Code, Codex
signalk-wasm-pluginsailingnaturali/claude-skillsSkill34d agoMITA114Claude Code
raspberry-pi-rust-embeddedhamzabellouch/agent-skillsSkill81mo agoMITA72Claude Code, Codex
codesysalivirgo/Major-AI-SkillsSkill6yesterdayMITB27Claude Code
nightrunakillness/jeo-skillsSkill62todayMITA186Claude Code