unsafe-checker — Claude Code skill: what it does, how to install
Reviews unsafe Rust blocks and FFI boundaries, tracking required SAFETY comments and catching common causes of undefined behavior.
npx skills add actionbook/rust-skills --skill unsafe-checker -a claude-codeWhat unsafe-checker does
The skill inspects .rs files across your codebase using Read, Grep, and Glob. It monitors unsafe blocks, raw pointers, union declarations, #[repr(C)] attributes, and FFI bindings to audit low-level memory operations.
It enforces documentation standards by demanding // SAFETY: explanations above dangerous blocks and /// # Safety sections on public unsafe functions. Bypassing the borrow checker simply to silence compiler errors is explicitly treated as invalid. The checks target pointer alignment, initialization status, aliasing violations, and correct Send or Sync concurrency contracts.
Outdated idioms get flagged with modern replacements. It catches mem::uninitialized() in favor of MaybeUninit, recommends NonNull over raw pointer math, and warns against dangling pointers when calling .as_ptr() on temporary CString instances.
What it helps with
- catch potential undefined behavior across
unsafecode blocks - verify FFI signatures and external C function bindings
- enforce mandatory
// SAFETY:and/// # Safetydocumentation - replace deprecated constructs like
mem::uninitialized()withMaybeUninit
Example prompts for the agent
- Review the unsafe blocks in
src/ffi.rsfor alignment violations and required SAFETY comments. - Scan the crate for deprecated
mem::zeroedcalls and update them toMaybeUninit. - Audit C interface bindings in
src/bindings.rsfor memory layout and ABI issues.
How to install unsafe-checker
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill unsafe-checker -a claude-code2Manually: put the files in place
~/.claude/skills/unsafe-checker/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/unsafe-checker/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill unsafe-checker -a codex2Manually: put the files in place
.agents/skills/unsafe-checker/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill unsafe-checker -a cursor2Manually: put the files in place
.cursor/skills/unsafe-checker/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install actionbook/rust-skills unsafe-checker2Manually: put the files in place
.github/skills/unsafe-checker/SKILL.md1Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill unsafe-checker -a gemini-cli2Platform CLI
gemini skills install https://github.com/actionbook/rust-skills --path skills/unsafe-checkerManually: put the files in place
.devin/skills/unsafe-checker/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add actionbook/rust-skills --skill unsafe-checker -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about unsafe-checker
How do I install unsafe-checker in Claude Code?
Run npx skills add actionbook/rust-skills --skill unsafe-checker -a claude-code. You can also place the skill file into ~/.claude/skills/unsafe-checker/SKILL.md.
What does the unsafe-checker skill inspect?
It reviews low-level Rust code for undefined behavior, checking pointer alignment, aliasing, data races, and enforcing mandatory // SAFETY: comments.
Which crates does unsafe-checker recommend for FFI?
It suggests bindgen for C to Rust, cbindgen for Rust to C, PyO3 for Python integrations, and napi-rs for Node.js.