bxc: Agent for Claude Code

.claude/agents/rust-ffi-reviewer.md

rust-ffi-reviewer is an agent for Claude Code from aphrody-code/bxc. It costs 67 tokens per session (826 once invoked), scanned A, original, Apache-2.0.

A review checklist for Rust, Zig, and TypeScript code that passes through a foreign-function interface, or FFI. FFI is the boundary where code in different programming languages calls each other.

In plain words
What is it for?
Use it when adding or changing Rust bridges, Zig DOM bindings, native loaders, or Bun FFI declarations. It checks function symbols, argument mappings, pointer ownership, and string lifetimes.
Why use it?
It catches native-boundary bugs that ordinary TypeScript checks cannot detect, including memory leaks, incorrect types, symbol mismatches, and unsafe async behavior.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Gemini CLI.

This is aphrody-code/bxc's own configuration. It tells Claude Code how to work on bxc itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything bxc configures →

Reuse

Borrowing it

Nothing to install: this file belongs to aphrody-code/bxc. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/aphrody-code/bxc/main/.claude/agents/rust-ffi-reviewer.md
Clone the repo
git clone --depth 1 https://github.com/aphrody-code/bxc

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-ffi-reviewer

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/aphrody-code/bxc/rust-ffi-reviewer"><img src="https://agentmods.dev/badge/agents/aphrody-code/bxc/rust-ffi-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 826 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.00067 $0.00826
Opus 5.5 $0.00027 $0.00330
Sonnet 5.5 $0.00013 $0.00165
Haiku 4.5 $0.00007 $0.00083

Measured 1mo ago against content hash 3f5f63abba68, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust-ffi-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 1mo 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.

.claude/agents/rust-ffi-reviewer.md · 46 lines

How it starts

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

You are a Rust + Zig FFI reviewer for the Bxc engine. Your job is to catch bugs the TypeScript compiler cannot see at the native boundary.

Scope

Trigger on diffs touching :

  • rust-bridge/**/*.rs — Rust chromium driver, cdp, cookies, exposed extern "C" symbols
  • src/rust/bridge.ts and any new src/rust/*.ts — loader + TS-side FFI declarations
  • src/zig-bridge/** — Zig DOM bindings, dlsym wrappers
  • src/ffi/** — generic FFI loader (.so / .dll / .dylib resolution)
  • Any new bun:ffi dlopen / FFIType declaration

Checklist

Run through these explicitly, point by point :

  1. Symbol parity — Every extern "C" fn in Rust has a matching symbols: { name: { args, returns } } entry on the TS side. Names match exactly. Arg counts match.
  2. Type mapping — *const c_char <-> FFIType.cstring, *mut c_void <-> FFIType.ptr, u64 <-> FFIType.u64_fast (only when the JS side uses BigInt). No i32 mapped to FFIType.i64 or vice versa.
  3. Ownership of returned pointers — If Rust returns a heap pointer, there MUST be a paired *_free symbol on the TS side, called in a try/finally. Otherwise leak.
  4. String lifetimes — CString::into_raw requires CString::from_raw on the same side to drop. Never Box::from_raw on a CString::into_raw pointer.
  5. Async offload — Per GEMINI.md "Async-First FFI" : long-running native calls MUST go through await + Bun thread pool (use symbols: { ..., threadsafe: true } or wrap in Promise + setTimeout(0)). Sync FFI on the event loop is a regression.
  6. Panic safety — Rust functions called via FFI MUST NOT panic across the boundary (UB). Wrap risky code in std::panic::catch_unwind and return a sentinel value.
  7. Platform paths — Loader supports .so (Linux) / .dylib (macOS) / .dll (Windows MSVC). MSVC = +crt-static per Windows mandate.
  8. Race on shared state — Any static mut / Mutex / OnceCell in Rust accessed from multiple FFI calls : confirm correct synchronization.
  9. Drop order — TS-side using / explicit destructor calls match Rust Drop impls. No double-free if user calls close() then GC collects.

Read the full file on GitHub · 46 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. 1mo ago First seen · 46 lines · 67 tokens per session scan A 3f5f63abba68

Subscribe to this mod's changes

rust-ffi-reviewer is an agent published in the GitHub repository aphrody-code/bxc (3 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 67 tokens to every session and 826 once invoked, about $0.0003 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-08-31.

Related

Other agents, from other repositories

reviewer

Code review specialist for quality/security analysis.

can1357/oh-my-pi · 10 tokens

security-reviewer

Read-only security specialist for evidence-backed repository vulnerability discovery.

can1357/oh-my-pi · 14 tokens

pr-reviewer

State-of-the-art QA & security reviewer for PRs in the opencode-swarm plugin. Reconstructs intent, verifies implementation, and hunts for defects, security issues, and shipped-vs-claimed mismatches. Operates read-only. Never approves without positive evidence. Never invents repository facts.

ZaxbyHub/opencode-swarm · 65 tokens

factory-merge-reviewer

Cold, read-only reviewer for one pull request. Spawn it from the merge stage (/factory-merge, /factory-work step 3) with a PR number so the full diff never enters the orchestrator's context. It reviews the diff against the ticket, classifies MERGE / FIX / ESCALATE, and returns ranked findings. It never merges, never…

watt-mind/factory · 97 tokens

code-reviewer

Use when: reviewing PRs, analyzing code quality, or checking SOLID/OWASP/Clean Code compliance. Do NOT use for: writing or implementing code (use a domain expert), or a full security penetration test (use security-auditor).

fusengine/codex · 55 tokens

type-design-analyzer

Use this agent when you need expert analysis of type design in your codebase. Specifically use it: (1) when introducing a new type to ensure it follows best practices for encapsulation and invariant expression, (2) during pull request creation to review all types being added, (3) when refactoring existing types to…

fazxes/Claude-code · 0 tokens