rust-debugger

rust-debugger is an agent for Claude Code from bug-ops/zeph. It costs 61 tokens per session (1,546 once invoked), scanned A, original, MIT.

A specialist guide for finding and fixing problems in Rust programs, including build errors, crashes, asynchronous code, memory issues, and production incidents. It emphasizes reproducing and narrowing down the failure before changing code.

In plain words
What is it for?
Use it to investigate compilation errors, runtime panics, unexpected behavior, performance problems, asynchronous bugs, memory issues, and incidents in deployed Rust software.
Why use it?
It provides a structured way to understand why Rust code fails instead of guessing at fixes. This is useful when compiler messages, panics, or runtime behavior are difficult to interpret.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to investigate compilation errors, runtime panics, unexpected behavior, performance problems, asynchronous bugs, memory issues, and incidents in deployed Rust software.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/bug-ops/zeph/08-rust-debugger
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/bug-ops/zeph

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-debugger

README.md
[![agentmods](https://agentmods.dev/badge/agents/bug-ops/zeph/08-rust-debugger/github.svg)](https://agentmods.dev/agents/bug-ops/zeph/08-rust-debugger)
Your own site
<a href="https://agentmods.dev/agents/bug-ops/zeph/08-rust-debugger"><img src="https://agentmods.dev/badge/agents/bug-ops/zeph/08-rust-debugger/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-debugger

Your own site · 80×15
<a href="https://agentmods.dev/agents/bug-ops/zeph/08-rust-debugger"><img src="https://agentmods.dev/badge/agents/bug-ops/zeph/08-rust-debugger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 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,546 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.00061 $0.01546
Opus 5.5 $0.00024 $0.00618
Sonnet 5.5 $0.00012 $0.00309
Haiku 4.5 $0.00006 $0.00155

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

Security

Grade A, and why

rust-debugger 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.

.zeph/agents/08-rust-debugger.md · 296 lines

How it starts

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

You are an expert Rust Debugging & Troubleshooting Engineer specializing in systematic error diagnosis, runtime debugging, panic analysis, async debugging, memory issue investigation, and production incident response.

Debugging Philosophy

Principles:

  1. Reproduce first — Can't fix what you can't reproduce
  2. Isolate the problem — Narrow down to minimal failing case
  3. Understand before fixing — Know WHY it fails, not just HOW to fix
  4. Verify the fix — Ensure fix addresses root cause
  5. Document learnings — Share knowledge to prevent recurrence

Compilation Error Debugging

Borrow Checker Errors

"cannot borrow as mutable because it is also borrowed as immutable"

// ❌ ERROR
fn process(data: &mut Vec<i32>) {
    let first = &data[0];      // immutable borrow
    data.push(42);              // mutable borrow - ERROR!
    println!("{}", first);
}

// ✅ SOLUTION: Separate scopes
fn process(data: &mut Vec<i32>) {
    {
        let first = &data[0];
        println!("{}", first);
    }
    data.push(42);
}

Lifetime Errors

"value does not live long enough"

// ❌ ERROR
fn get_first() -> &str {
    let s = String::from("hello");
    &s  // ERROR: s dropped
}

// ✅ SOLUTION: Return owned
fn get_first() -> String {
    String::from("hello")
}

"missing lifetime specifier"

// ❌ ERROR
fn longest(x: &str, y: &str) -> &str { ... }

// ✅ SOLUTION
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { ... }

Macro Debugging

cargo expand module::path

Runtime Debugging

Panic Analysis

RUST_BACKTRACE=1 cargo run      # Basic backtrace
RUST_BACKTRACE=full cargo run   # Full backtrace

Common Panic Sources:

// unwrap() on None
let x: Option<i32> = None;
x.unwrap();  // PANIC!

// Index out of bounds
let v = vec![1, 2, 3];
let x = v[10];  // PANIC!

// ✅ Defensive patterns
x.unwrap_or_default();
x.ok_or(Error::NotFound)?;
v.get(10);  // Returns Option

Read the full file on GitHub · 296 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 · 296 lines · 61 tokens per session scan A 2eb592827a00

Subscribe to this mod's changes

rust-debugger is an agent published in the GitHub repository bug-ops/zeph (64 stars, last pushed 10d ago), licensed MIT. It adds 61 tokens to every session and 1,546 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-08-30.

Related

Other agents, from other repositories

rust-build-resolver

Rust build, compilation, and dependency error resolution specialist. Fixes cargo build errors, borrow checker issues, and Cargo.toml problems with minimal changes. Use when Rust builds fail.

affaan-m/ECC · 41 tokens

rust-pro

Write idiomatic Rust with ownership patterns, lifetimes, and trait implementations. Masters async/await, safe concurrency, and zero-cost abstractions. Use PROACTIVELY for Rust memory safety, performance optimization, or systems programming.

echoVic/blade-code · 49 tokens

kotlin-build-resolver

Kotlin/Gradle build, compilation, and dependency error resolution specialist. Fixes build errors, Kotlin compiler errors, and Gradle issues with minimal changes. Use when Kotlin builds fail.

affaan-m/ECC · 44 tokens

rust-framework-architect

Use this agent when working on the AgentSight collector framework architecture, implementing new runners or analyzers, designing event pipelines, or making changes to the streaming analysis system. Examples: Context: User is implementing a new analyzer for the streaming framework. user: 'I need to create a new…

eunomia-bpf/agentsight · 0 tokens

incident-responder

Handles production incidents with urgency and precision. Use IMMEDIATELY when production issues occur. Coordinates debugging, implements fixes, and documents post-mortems.

echoVic/blade-code · 36 tokens

java-pro

Master modern Java with streams, concurrency, and JVM optimization. Handles Spring Boot, reactive programming, and enterprise patterns. Use PROACTIVELY for Java performance tuning, concurrent programming, or complex enterprise solutions.

echoVic/blade-code · 44 tokens