valgrind

valgrind is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 96 tokens per session (1,482 once invoked), scanned A, original, MIT.

A guide to Valgrind, a collection of tools for finding memory errors, checking leaks, simulating cache use, and profiling function calls.

In plain words
What is it for?
Use Memcheck for memory errors and leaks, Cachegrind for cache analysis, Callgrind for call graphs, and Massif for heap profiling.
Why use it?
It helps diagnose bugs such as use-after-free, corrupted memory, uninitialised reads, and inefficient memory or cache behaviour.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

not rated 310repo +7 14d ago A scan Socket: passSnyk: passSkillSpector: pass 96 tokens original MIT

Good fit Use Memcheck for memory errors and leaks, Cachegrind for cache analysis, Callgrind for call graphs, and Massif for heap profiling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/valgrind
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.

Any agent
npx skills add mohitmishra786/low-level-dev-skills --skill valgrind
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

Made for: Claude Code, Codex.

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 valgrind

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/valgrind/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/valgrind)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/valgrind"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/valgrind/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for valgrind

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/valgrind"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/valgrind.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,482 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00096 $0.01482
Opus 5.5 $0.00038 $0.00593
Sonnet 5.5 $0.00019 $0.00296
Haiku 4.5 $0.00010 $0.00148

Measured 3mo ago against content hash 70a5bb899a60, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

valgrind 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 3mo 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/profilers/valgrind/SKILL.md · 161 lines

How it starts

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

Valgrind

Purpose

Guide agents through Valgrind tools: Memcheck for memory errors, Cachegrind for cache simulation, Callgrind for call graphs, and Massif for heap profiling.

Triggers

  • "My program has a memory leak / use-after-free"
  • "I can't use ASan — can I use Valgrind instead?"
  • "How do I profile cache behaviour without perf?"
  • "How do I visualize call graphs with Callgrind?"
  • "How do I profile heap allocation patterns?"
  • "Valgrind reports errors in third-party code I can't fix"

Workflow

1. Memcheck — memory error detection

Compile with -g -O1 for best results. -O0 is also fine; avoid -O2+ which can produce false positives.

valgrind --tool=memcheck \
         --leak-check=full \
         --show-leak-kinds=all \
         --track-origins=yes \
         --error-exitcode=1 \
         ./prog [args]

Key flags:

Flag Default Effect
--leak-check=full summary Full leak details
--show-leak-kinds=all definite Show all leak kinds
--track-origins=yes no Show where uninit values came from (slow)
--error-exitcode=N 0 Exit N if errors found (CI integration)
--log-file=file stderr Save report to file
--suppressions=file none Suppress known FPs
--gen-suppressions=yes no Print suppression directives for errors
--max-stackframe=N 2000000 Increase for deep stacks
--malloc-fill=0xAB off Fill allocated memory (detect uninit use)
--free-fill=0xCD off Fill freed memory (detect use-after-free)

2. Understanding Memcheck output

==12345== Invalid read of size 4
==12345==    at 0x4007A2: foo (main.c:15)
==12345==    by 0x400846: main (main.c:30)
==12345==  Address 0x5204040 is 0 bytes after a block of size 40 alloc'd
==12345==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==12345==    by 0x40074B: main (main.c:25)
  • Invalid read/write: out-of-bounds access; check array bounds
  • Use of uninitialised value: read before write; use --track-origins=yes
  • Invalid free / double free: mismatched malloc/free; check ownership
  • Definitely lost: reachable via no pointers; clear leak
  • Indirectly lost: lost through a chain; usually means one root leak
  • Possibly lost: might be pointing into the middle of a block; often FP with custom allocators

Read the full file on GitHub · 161 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3mo ago First seen · 161 lines · 96 tokens per session scan A 70a5bb899a60

Subscribe to this mod's changes

valgrind is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (310 stars, last pushed 14d ago), licensed MIT. It adds 96 tokens to every session and 1,482 once invoked, about $0.0004 per session on Opus 5.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-09-03.

Related

valgrind compared with skills from other repositories

valgrind next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
valgrindmohitmishra786/low-level-dev-skillsSkill31014d agoMITA96Claude Code, Codex
push-notification-testerteam-telnyx/aiSkill232todayMITA55Claude Code
log-analyzermoonlight-lupin/agent-skillsSkill1375d agoMITA52Claude Code, Codex
debugmoonlight-lupin/agent-skillsSkill1375d agoMITA104Claude Code, Codex
organic-traffic-drop-diagnosiscoupler-io/skillsSkill452d agoMITA187Claude Code
tiktok-ads-conversion-tracking-and-pixel-auditcoupler-io/skillsSkill452d agoMITA107Claude Code
error-handlerEliasOulkadi/shokuninSkill1122mo agoMITA125Claude Code