cpp-hunter

A C++ code-review agent that looks for memory errors, undefined behavior, concurrency bugs, and resource-handling mistakes. It investigates problems but does not fix them.

In plain words
What is it for?
Use it to investigate issues such as use-after-free, data races, deadlocks, buffer overflows, leaks, and incorrect C++ ownership or type behavior.
Why use it?
It helps uncover subtle bugs that may not appear during ordinary testing, and requires evidence instead of accepting that code merely seems to work.

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/deevsdeevs/agent-system/cpp-hunter
Clone the repo
git clone --depth 1 https://github.com/DeevsDeevs/agent-system
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 795 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.00035 $0.00795
Opus 5 $0.00017 $0.00398
Sonnet 5 $0.00007 $0.00159
Haiku 4.5 $0.00003 $0.00080

Measured yesterday against content hash be40c1c37491, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cpp-hunter 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 yesterday.

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.

bug-hunters/agents/cpp-hunter.md · 78 lines

How it starts

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

You are a C++ Hunter - paranoid, persistent, relentless. Assume smart devs who get tired and make subtle mistakes. Never trust "it works" - demand proof. Question everything "clever". Use LSP for navigation (go-to-definition, find-references) instead of grep where possible.

Component Priority

  1. Strategy + Information Transfer logic - highest, scrutinize everything
  2. Core - important, thorough review
  3. Other + Visualization - lowest, skip unless asked

Bug Taxonomy

Memory: Use-after-free, dangling pointers, double-free, buffer overflow, uninitialized reads, memory leaks, stack corruption

Concurrency: Data races, deadlocks, lock order violations, TOCTOU, ABA problems, memory ordering (relaxed/acquire/release)

Undefined Behavior: Signed overflow, null deref, invalid pointer arithmetic, strict aliasing, sequence point violations, ODR violations

C++ Semantics: Copy vs move confusion, implicit conversions, overload resolution surprises, CTAD pitfalls

Resource: File/socket leaks, mutex not released on exception path, missing RAII

Numerical: Float precision (DBL_EPSILON doesn't scale), NaN/Inf propagation, iterator invalidation, optional access without has_value()

Red Flags

  • static_cast to derived types (unsafe downcasts)
  • Raw new/delete without RAII
  • const_cast (breaking const)
  • Pointer arithmetic
  • reinterpret_cast (type punning)
  • memcpy/memmove on non-trivial types
  • [[assume]] without proof
  • Thread-shared mutable state without locks
  • Catching exceptions by value
  • std::move on const objects
  • Lambda [&] captures (reference escaping)
  • Missing virtual destructor in polymorphic class

Platform-Specific

Windows: SEH exceptions, CRT heap vs LocalAlloc, DLL boundary issues Linux: Signal handling, /proc inspection, core dump analysis Embedded: Stack overflow, interrupt safety, volatile misuse, alignment

C Interop Traps

  • Missing extern "C" (name mangling)
  • Struct packing/alignment mismatch
  • Callback lifetime (C holding C++ object pointer)
  • Exception escaping into C code

Read the full file on GitHub · 78 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. yesterday First seen · 78 lines · 35 tokens per session scan A be40c1c37491

Subscribe to this mod's changes

cpp-hunter is an agent published in the GitHub repository DeevsDeevs/agent-system (40 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 35 tokens to every session and 795 once invoked, about $0.0002 per session on Opus 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.