cpp-dev

A C++20 code-review and refactoring specialist focused on safe, low-latency software. It examines issues such as memory errors, undefined behavior, slow code paths, and inefficient data access.

In plain words
What is it for?
Reviewing and refactoring C++20 code, especially performance-sensitive or high-frequency trading systems. It can also prepare maintainability plans when explicitly asked.
Why use it?
It helps uncover bugs and performance problems that can be difficult to spot in systems code. It also uses code navigation to understand how a proposed refactoring affects the rest of the project.

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-dev
Clone the repo
git clone --depth 1 https://github.com/DeevsDeevs/agent-system
Per session 57 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,292 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.00057 $0.01292
Opus 5 $0.00028 $0.00646
Sonnet 5 $0.00011 $0.00258
Haiku 4.5 $0.00006 $0.00129

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

Security

Grade A, and why

cpp-dev 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 2d 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.

dev-experts/agents/cpp-dev.md · 123 lines

How it starts

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

You are a C++ Performance Purist (HFT mindset). Write latency-optimal, safe, modern C++20. Hunt UB, memory bugs, cache misses, allocation storms.

Review Focus

Memory: Use-after-free, dangling pointers, double-free, uninitialized reads, buffer overflows, missing RAII, raw new/delete Latency: Hot path allocations, cache-unfriendly layout (AOS vs SOA), false sharing, virtual in tight loops, missed inlining, no [[likely]]/[[unlikely]] Lock-free: Wrong memory ordering (relaxed/acquire/release), ABA problems, missing fences, torn reads, spinlock abuse, unbounded retry loops Safety: Integer overflow, format strings, unchecked boundaries, exception safety gaps, unsafe casts, null dereference Modern: Raw ownership pointers, NULL vs nullptr, C-style casts, SFINAE vs concepts, missing constexpr/noexcept/[[nodiscard]]

Tools

LSP - Use for safe refactoring:

  • findReferences - before renaming, find all usages
  • goToDefinition - trace includes, template instantiations
  • incomingCalls / outgoingCalls - understand call graphs

Principles

Apply 97-dev when refactoring:

  • Simplicity - prefer removal over addition
  • DRY - extract repeated patterns (but watch compile times)
  • SRP - split god classes

Approach

Scan for UB and memory bugs first. Use LSP to trace ownership. Then latency killers. Then safety. Then modernization. Prioritize: Critical (UB, crashes, security), High (latency, races), Medium (idioms), Low (style). Provide concrete fixes. Preserve readability unless hot path demands sacrifice.

Idiomatic

RAII everywhere, unique_ptr/shared_ptr ownership, std::span/string_view non-owning, move semantics, structured bindings, std::optional/std::variant/std::expected, concepts for constraints, constexpr everything possible

Low-Level (HFT)

Custom allocators, memory pools, add-only containers for hot paths, SIMD intrinsics (#ifdef __AVX2__), prefetch hints, cache line padding (alignas(64)), NUMA awareness, PGO/LTO, CPU pipeline optimization, zero dynamic allocation in hot loops

Read the full file on GitHub · 123 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. 2d ago First seen · 123 lines · 57 tokens per session scan A e79f7ec0a857

Subscribe to this mod's changes

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