rust-async-safety-reviewer

rust-async-safety-reviewer is an agent for Claude Code from wenlan-app/wenlan. It costs 59 tokens per session (1,102 once invoked), scanned A, original, Apache-2.0.

A read-only reviewer for Rust asynchronous code using Tokio, Axum, and libsql. It looks for concurrency problems such as locks held during waiting, unsafe shared state, cancellation issues, and leaked resources.

In plain words
What is it for?
Use it after changes to asynchronous tasks, web handlers, database connections, channels, locks, or Send and Sync boundaries.
Why use it?
Asynchronous code can fail through timing and shared-state problems that ordinary code review or tests may not expose. The reviewer flags these risks without changing the code.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it after changes to asynchronous tasks, web handlers, database connections, channels, locks, or Send and Sync boundaries.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/wenlan-app/wenlan/rust-async-safety-reviewer
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.

Clone the repo
git clone --depth 1 https://github.com/wenlan-app/wenlan

Made for: Claude Code.

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-async-safety-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/wenlan-app/wenlan/rust-async-safety-reviewer/github.svg)](https://agentmods.dev/agents/wenlan-app/wenlan/rust-async-safety-reviewer)
Your own site
<a href="https://agentmods.dev/agents/wenlan-app/wenlan/rust-async-safety-reviewer"><img src="https://agentmods.dev/badge/agents/wenlan-app/wenlan/rust-async-safety-reviewer/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-async-safety-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/wenlan-app/wenlan/rust-async-safety-reviewer"><img src="https://agentmods.dev/badge/agents/wenlan-app/wenlan/rust-async-safety-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,102 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.00059 $0.01102
Opus 5.5 $0.00024 $0.00441
Sonnet 5.5 $0.00012 $0.00220
Haiku 4.5 $0.00006 $0.00110

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

Security

Grade A, and why

rust-async-safety-reviewer 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/agents/rust-async-safety-reviewer.md · 114 lines

How it starts

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

Rust Async Safety Reviewer

You audit Rust async code in the wenlan workspace for concurrency hazards. You are read-only — never Edit, Write, or modify state. Produce findings as a structured report.

Scope

  • tokio runtime usage (spawn, blocking, channels)
  • axum 0.8 handler patterns (extractors, state, middleware)
  • libsql 0.9 connection / transaction handling
  • Send + Sync bounds on shared state
  • Mutex / RwLock / RefCell hazards
  • Cancellation safety
  • Resource leaks (file handles, DB connections, JoinHandle)

Hazards to Flag

1. Lock held across .await

// BAD — MutexGuard not Send, but held across await
let guard = state.mutex.lock().unwrap();
let result = some_async_op().await;  // ← hazard
guard.process(result);

Fix: drop guard before await, or use tokio::sync::Mutex.

2. std::sync::Mutex in async context

std::sync::Mutex can deadlock if held across await. Prefer tokio::sync::Mutex for cross-await locks, parking_lot::Mutex for short critical sections never crossing await.

3. libsql Connection cloned vs Arc-shared

libsql Connection is not cheap to clone. For multi-handler access, wrap in Arc<Connection>. Verify against crates/wenlan-core/src/ connection-init code.

4. Blocking syscalls in async context

std::fs, std::thread::sleep, blocking I/O = block runtime worker. Use tokio::fs, tokio::time::sleep, or wrap in tokio::task::spawn_blocking.

5. Missing Send + Sync bounds

tokio::spawn requires Future: Send + 'static. Inferred bounds can fail when state has non-Send types (Rc, RefCell, raw pointers).

6. JoinHandle leaks

tokio::spawn without storing JoinHandle = fire-and-forget. Failures silent. Either store and await, or use JoinSet for group lifecycle.

7. axum extractor ordering

State<T> must come AFTER Path<T>, Query<T>, Json<T> in handler signature per axum 0.8. Wrong order = compile error sometimes silently masked by feature flags.

8. Cancellation safety

select! branches may be cancelled. Operations between locks and DB writes that aren't cancel-safe can leave state inconsistent. Check tokio::select! arms touching DB.

Read the full file on GitHub · 114 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. 4d ago First seen · 114 lines · 59 tokens per session scan A 092cfdab4076

Subscribe to this mod's changes

rust-async-safety-reviewer is an agent published in the GitHub repository wenlan-app/wenlan (82 stars, last pushed yesterday), licensed Apache-2.0. It adds 59 tokens to every session and 1,102 once invoked, about $0.0002 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-10-11.

Related

Other agents, from other repositories

rust-async-safety-reviewer

Reviews Rust async code for tokio + libsql + axum concurrency hazards. Use after changes touching tokio::spawn, axum handlers, libsql connection usage, or any Send/Sync boundaries. Read-only — produces findings, does not edit.

7xuanlu/wenlan · 59 tokens

eval-skew-reviewer

Reviews diffs that add or change a write-time enrichment feature / retrieval channel for training-serving skew — verifies the feature is wired into the ONE canonical ingest path AND the eval seed AND the seed liveness contract, so it can't ship "merged-but-inert". Use after changes touching ingest enrichment, a new…

7xuanlu/wenlan · 90 tokens

streaming-reviewer

Streaming / event-driven pre-implementation reviewer. Outputs threat model TM-{slug}.md and signs off delivery-guarantee + ordering decisions before senior-dev claims tasks.

avelikiy/great_cto · 38 tokens

error-handling-reviewer

Hunts for swallowed errors, silent failures, and broken error propagation chains in changed code.

OutSystems/outsystems-mcp · 24 tokens

challenger

Use when: before the lead reports a root-cause conclusion, a 'done/verified' claim, an irreversible action about to run (commit/deploy/rm/push), or a 2nd-time fix — in APEX or plain conversation; also every eLicit round and Verify gate. Do NOT use for: code correctness/lint/types/API usage (sniper's job), or as a veto…

fusengine/agents · 92 tokens

code-explorer

Deep code understanding expert using AST knowledge graph. Use when exploring unfamiliar code, tracing complex relationships, or understanding module architecture.

sdsrss/code-graph-mcp · 28 tokens