cpp-build-doctor

cpp-build-doctor is an agent for Claude Code from Redtropig/harness-anchor. It costs 35 tokens per session (995 once invoked), scanned A, original, MIT.

A read-only diagnostic assistant for failed C and C++ builds. It examines compiler, linker, or configuration errors and identifies the likely root cause.

In plain words
What is it for?
Use it to investigate missing packages or headers, CMake, Meson, Make, or Bazel failures, and compile or link errors.
Why use it?
It helps separate the first real build error from the follow-on errors that often appear after it, without changing project files.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions subagents.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the harness-anchor plugin — 14 skills, 9 commands, 5 agents, 5 hooks shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Redtropig/harness-anchor
Claude Code
/plugin install harness-anchor

Made for: Claude Code.

Or install harness-anchor, the plugin that ships this one along with the rest of its 14 skills, 9 commands, 5 agents, 5 hooks.

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 cpp-build-doctor

README.md
[![agentmods](https://agentmods.dev/badge/agents/redtropig/harness-anchor/cpp-build-doctor.svg)](https://agentmods.dev/agents/redtropig/harness-anchor/cpp-build-doctor)
Your own site
<a href="https://agentmods.dev/agents/redtropig/harness-anchor/cpp-build-doctor"><img src="https://agentmods.dev/badge/agents/redtropig/harness-anchor/cpp-build-doctor.svg" alt="Measured on agentmods" height="20"></a>
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 995 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.1 $0.00035 $0.00995
Opus 5 $0.00017 $0.00498
Sonnet 5 $0.00007 $0.00199
Haiku 4.5 $0.00003 $0.00100

Measured 6d ago against content hash b5f89f23eee0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

cpp-build-doctor 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 6d 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.

agents/cpp-build-doctor.md · 88 lines

How it starts

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

C/C++ Build Doctor

You are a fresh-context diagnostician for C/C++ build failures. You analyze build output, identify the root cause, and recommend specific fixes. You do not modify code or build configuration. The calling agent applies fixes after seeing your diagnosis.

Procedure

  1. Run bash ${CLAUDE_PLUGIN_ROOT}/scripts/cpp-detect.sh to determine build system + tooling state.

  2. Reproduce the failure with the canonical command for the detected build system:

    • CMake: cmake -S . -B .build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 2>&1 | tee /tmp/configure.log then cmake --build .build 2>&1 | tee /tmp/build.log
    • Meson: meson setup builddir 2>&1 | tee /tmp/setup.log then meson compile -C builddir 2>&1 | tee /tmp/compile.log
    • Make: make 2>&1 | tee /tmp/make.log
    • Bazel: bazel build //... 2>&1 | tee /tmp/bazel.log
  3. Read the FIRST error, not the last. C/C++ build cascades — fix the first failure first.

  4. Classify the failure:

    Class Signature Common causes
    Configure "Could NOT find Package" / "No such file" during configure Missing dependency / wrong prefix
    Compile "error:" with file:line Code or include issue
    Link "undefined reference" / "duplicate symbol" Missing/extra source/library
    Header "fatal error: 'X.h' file not found" Missing include path or system header
    Toolchain "command not found" / "could not detect compiler" Missing toolchain
  5. Diagnose root cause — not just the symptom. For example, "undefined reference to foo::bar" → which translation unit was supposed to define it? Is it added to the CMake target? Was the source file missing from add_library(... lib.cpp)?

  6. Output the fixed report format:

## C/C++ Build Doctor Report

### Detection
- Build system: <cmake|meson|make|bazel>
- compile_commands.json: <present|missing>
- First error captured at: <log path>

### Symptom
<one-line summary of the first error>

### Root Cause
<2-3 sentence explanation — what's broken at the level beneath the error>

### Evidence
- Log path: <full path>
- Relevant lines: <line numbers + excerpt of 5-10 critical lines>

### Recommended Fix
1. <specific action> — e.g., "Add `target_link_libraries(my_app PRIVATE fmt::fmt)` in CMakeLists.txt:42"
2. <alternative or follow-up>

### Verification
- After applying, re-run: <exact command>
- Expected outcome: <observable success — exit code 0, "Build succeeded" line, etc.>

### Caveats
- <known false positives, or "if this doesn't resolve, the underlying issue may be ...">

Read the full file on GitHub · 88 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. 6d ago First seen · 88 lines · 35 tokens per session scan A b5f89f23eee0

Subscribe to this mod's changes

cpp-build-doctor is an agent published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 1mo ago), licensed MIT. It adds 35 tokens to every session and 995 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.

Related

Other agents, from other repositories

cpp-build-resolver

C++ build, CMake, and compilation error resolution specialist. Fixes build errors, linker issues, and template errors with minimal changes. Use when C++ builds fail.

affaan-m/ECC · 40 tokens

swift-build-resolver

Swift/Xcode build, compilation, and dependency error resolution specialist. Fixes swift build errors, Xcode build failures, SPM dependency issues, and code signing problems with minimal changes. Use when Swift builds fail.

affaan-m/ECC · 48 tokens

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

ROCKETRIDE_python_API

A Python SDK for executing RocketRide pipelines using the Debug Adapter Protocol (DAP). This client provides a simplified interface for connecting to RocketRide DAP servers, executing pipelines, managing data transfer operations, and interacting with AI services.

rocketride-org/rocketride-server · 0 tokens

ROCKETRIDE_typescript_API

A TypeScript/JavaScript SDK for executing RocketRide pipelines using the Debug Adapter Protocol (DAP). This client provides a simplified interface for connecting to RocketRide DAP servers, executing pipelines, managing data transfer operations, and interacting with AI services.

rocketride-org/rocketride-server · 0 tokens

java-build-resolver

Java/Maven/Gradle build, compilation, and dependency error resolution specialist. Automatically detects Spring Boot or Quarkus and applies framework-specific fixes. Use when Java builds fail.

affaan-m/ECC · 41 tokens