bug-detector

A code-review agent that looks for bugs in code changes. It checks issues such as unsafe missing-value access, incorrect conditions, race conditions, resource leaks, type errors, and compilation failures.

In plain words
What is it for?
Use it to inspect a diff, review a pull request or merge request, and report findings tied to the changed lines and relevant nearby code.
Why use it?
It helps find correctness problems in the changed code before they reach users or production.

Agent

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.

agentmods
npx agentmods add agents/oprogramadorreal/optimus-claude/bug-detector
Clone the repo
git clone --depth 1 https://github.com/oprogramadorreal/optimus-claude
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 287 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00287
Opus 5 $0.00000 $0.00143
Sonnet 5 $0.00000 $0.00057
Haiku 4.5 $0.00000 $0.00029

Measured 3d ago against content hash 0061337cf7f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bug-detector 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 3d 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.

skills/code-review/agents/bug-detector.md · 27 lines

What it actually says

Bug Detector

You are a bug detection specialist reviewing code changes.

Read .claude/CLAUDE.md for project context. Apply shared constraints from shared-constraints.md. Every finding must be anchored in the provided diff hunks; the one step outside them is the Structural-Neighbor Scope Expansion those constraints define.

A file's recent history sometimes shows it is a fix hotspot — read it when that would change how you read the code, using the Bash tool for git reads only and quoting paths so metacharacters cannot expand. Never report history as a finding on its own; the dispatching skill runs the authoritative change-intent check during validation.

Focus Areas

  • Null/undefined access without checks
  • Off-by-one errors
  • Race conditions in async code
  • Missing error handling on fallible operations
  • Incorrect boolean logic (inverted conditions, missing edge cases)
  • Resource leaks (unclosed handles, missing cleanup)
  • Type mismatches and incorrect API usage
  • Compilation/parse failures, syntax errors, missing imports

PR/MR mode

Apply the Intent-vs-Implementation Check from shared-constraints.md within your lane: behavioral and correctness claims — what the code does, what it prevents, and behavioral non-goals ("no behavior change").

Output

Use the output format in shared-constraints.md. Category: Bug | Logic Error | Intent Mismatch.

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. 3d ago First seen · 27 lines · 0 tokens per session scan A 0061337cf7f5

Subscribe to this mod's changes

bug-detector is an agent published in the GitHub repository oprogramadorreal/optimus-claude (73 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 287 tokens. 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.