krilliac/agent-workbench/memory-hunt
Claude Code and agent skill by krilliac/agent-workbench
- community
Checking that the SKILL.md file is still in the repository.
Track down C++ memory leaks, corruption, and heap misuse with ASAN, Application Verifier, and UMDH heap snapshots. TRIGGER when the user says "memory leak", "leak detected", "heap grows over time", "DLL_PROCESS_DETACH leak", "ASAN leak report", "Application Verifier fires", "double free", "invalid heap free", "vld reports". DO NOT TRIGGER for crashes at fault (use cpp-crash-triage) or stack overflows (usually recursion depth). Covers Windows-specific tooling -- heap snapshots via DebugDiag, UMDH baseline+diff, Application Verifier heap page -- plus ASAN on clang-cl builds.
Install
npx vskill@latest install krilliac/agent-workbench/memory-huntSKILL.md
The same SKILL.md was published earlier as krilliac/agent-workbench/memory-hunt.
memory-hunt
Classify first
- True leak: RSS grows unbounded.
- Fragmentation: RSS grows, working set stable.
- Cached: pool intentionally holds; not a leak.
- DLL unload leak: at teardown only, not real growth.
Tools
ASAN (clang-cl)
Rebuild, then ASAN_OPTIONS=detect_leaks=1:leak_check_at_exit=1. Ship a lsan.supp to filter DirectX/vendored DLL globals.
UMDH (MSVC / any Windows)
Sort by delta; top offenders are your leak.
Application Verifier + !heap
For corruption. Enable Heaps test, run in WinDbg, !heap -x <addr> on failing address.
VLD
#include <vld.h> in main.cpp for MSVC Debug. Fine for early-dev; slows Debug 3x.
Systemic leak sites
- Shader hot-reload:
ID3DBlobnotRelease()d before map overwrite. UseComPtr. - Jobs: shared_ptr cycles from lambda captures.
- Reflection registry: plugin unload leaves entries pinned.
- Asset cache: strong refs everywhere; introduce
weak_ptrwhere cache isn't owner.
Method
- Reproducer with a single asset/scene.
- Snapshot at t=0 and t=+5 min steady state.
- Diff, group by alloc site, ignore <MB.
- Top allocator -> caller chain -> fix.
- Re-snapshot; if a new site tops the list, you fixed a real leak.
the engine allocator hook
If the engine has engine::alloc::hook_new, inject CaptureStackBackTrace -> ring buffer -> dump at leak time = 100% leak-site info with no external tool.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/memory-hunt/SKILL.md
Popularity
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/krilliac/agent-workbench/memory-hunt)