Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Valgrind

$ valgrind Community Low Risk
Valgrind · Code & DevOps · GPL-2.0-or-later · linux

valgrind instruments compiled binaries to catch memory leaks, invalid reads/writes, and data races (memcheck, helgrind) or profile cache/call graphs (callgrind). It supports non-interactive execution with --error-exitcode=1 and structured --xml=yes --xml-file=..., though macOS/ARM64 support is absent.

FCRS-1.0 Score
64 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
brew install valgrind
CLI vs MCP Decision CLI Only

Local Linux dynamic binary instrumentation framework; no MCP equivalent.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 15 / 25

Non-interactive with --error-exitcode=1 and --xml=yes --xml-file=..., but emits XML or verbose stderr text rather than JSON and slows execution 10x–30x.

  • Supports --xml=yes for memcheck structured output
  • No JSON output; stderr mixes target output with Valgrind logs unless redirected
Trust & Safety 18 / 25

Zero network/credential exposure; executes the target binary locally in an instrumented JIT VM.

  • Local binary analysis; target program side effects still apply
Setup & Portability 9 / 15

Standard on Linux (x86_64/arm64), but lacks official support on modern macOS (especially Apple Silicon) and native Windows.

  • Primarily Linux-only in practice; macOS support lags/unmaintained
Utility & Efficiency 11 / 15

Gold standard for uninstrumented binary leak checking on Linux, though ASan/UBSan are 10x faster when recompiling is possible.

  • Requires no recompilation, though 10–30x runtime slowdown applies
Maintenance & Lineage 6 / 10

Long-standing GPLv2 project hosted at valgrind.org (sourceware.org), releasing annually for Linux architectures.

  • Mature open-source project on sourceware.org
Docs & Verifiability 5 / 10

Extensive HTML manual and --help, though output interpretation and suppression files take expertise.

  • Detailed official manual at valgrind.org

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No credentials required; executes local ELF binaries under dynamic instrumentation.

Side Effects
Read-Only Local Write
Cost & Quotas

GPL-2.0-or-later open-source GNU/Linux analysis suite; free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Valgrind Agent Rules
- Always pass `--error-exitcode=1 --leak-check=full` when gating CI or C/C++ fixes.
- Use `--xml=yes --xml-file=<path>` for structured parsing and `--quiet` to avoid verbose stderr banners.
- Do not expect `valgrind` to run on macOS Apple Silicon or native Windows; use Linux or ASan/LSan instead.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check a binary for memory leaks with fail exit code
valgrind --tool=memcheck --leak-check=full --error-exitcode=1 --quiet ./build/app

Runs ./build/app under memcheck, suppresses banner noise, and exits 1 if memory errors are found.

Controlled Writes & Previews

Run memcheck and emit XML diagnostics
valgrind --tool=memcheck --leak-check=full --xml=yes --xml-file=valgrind.xml ./build/app

Writes machine-parseable memcheck XML error reports to valgrind.xml.

Strengths for Agents

  • + Detects leaks, use-after-free, and uninitialized reads without recompiling binaries.
  • + --error-exitcode=1 and --xml=yes --xml-file=... enable deterministic CI checks.

Caveats & Pitfalls

  • ! Effectively Linux-only on modern hardware (unsupported on macOS Apple Silicon and native Windows).
  • ! 10x–30x execution slowdown and no native JSON output.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI