ios-memgraph-leaks
Skill2 starsChanged 6 months agoMITView on GitHub
Capture, inspect, compare, and root-cause iOS memory graph leaks using Apple's leaks and memgraph tools. Use when debugging leaked iOS objects, simulator memgraphs, retain-cycle suspicions, memory growth after navigation/logout/account changes, or when asked to prove an iOS leak fix with before/after memgraph evidence.
5 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- MMACABRE/SKILLSedited, first seen Nov 8, 2026
- openai/pluginsedited, first seen Oct 13, 2026
- tarunyadav1/ios-app-lifecycleedited, first seen Oct 8, 2026
- omarshahine/HomeClawedited, first seen Sep 29, 2026
- robinebers/skillsedited, first seen Jun 25, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- openai/plugins★ 7.8k94% same
- omarshahine/HomeClaw★ 19197% same
- robinebers/skills★ 4894% same
- MMACABRE/SKILLS★ 194% same
- tarunyadav1/ios-app-lifecycle★ 194% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
10 rules. 7 are common, 0 are distinctive, and 3 are very specific to this project.
7
Common
Most of the 5 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill to prove iOS leaks from a live simulator process or an existing .memgraph.
- Common: line 19
Do not claim a leak fix from a smaller memgraph alone.
- Common: line 23
Prefer capturing from the simulator already used for the reproduction.
- Very specific: line 37
Do not derive SKILL_DIR from the target app repo's pwd.
- Very specific: line 39
If the process cannot be found, confirm the bundle identifier and use xcrun simctl spawn "$SIM" launchctl list to inspect running labels.
- Common: line 58
Treat lazy or deferred allocation as a scope reduction, not a leak fix, unless the original eager allocation itself violated the intended …
- Common: line 61
Do not claim success just because total leak count went down.
- Common: line 63
Prefer deleting the retaining edge over adding broad cleanup code.
- Common: line 74
before/after evidence when a fix was made
- Common: line 76
If the memgraph shows only framework/runtime noise, say that and recommend the next narrower capture rather than inventing an app leak.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
iOS Memgraph Leaks
Use this skill to prove iOS leaks from a live simulator process or an existing .memgraph. Pair it with ../ios-debugger-agent/SKILL.md when the task also needs simulator build, install, launch, UI driving, logs, or screenshots.
Core Workflow
- Build, launch, and drive the exact flow that should release objects.
- Capture a memgraph from the running simulator process with
scripts/capture_sim_memgraph.sh. - Summarize leaks with
scripts/summarize_memgraph_leaks.py. - For each app-owned leaked type, inspect ownership with
leaks --traceTree=<address> <file.memgraph>and grouped leak evidence. - Make the smallest root-cause patch, then recapture the same flow on the same simulator when possible.
- Report proof: before/after leak counts, disappeared root types, remaining leaks, memgraph paths, and test/build results.
Do not claim a leak fix from a smaller memgraph alone. A credible fix explains the ownership path that kept the object alive and shows that the same path or type disappears after the patch.
Capture
Prefer capturing from the simulator already used for the reproduction. Resolve the simulator UDID and app bundle identifier, then capture the running app:
SKILL_DIR="${CLAUDE_PLUGIN_ROOT}/skills/ios-memgraph-leaks"
SIM="<simulator-udid>"
BUNDLE_ID="<app.bundle.identifier>"
MEMGRAPH_DIR="$(mktemp -d "${TMPDIR:-/tmp}/claude-ios-memgraph.XXXXXX")"
"$SKILL_DIR/scripts/capture_sim_memgraph.sh" \
--udid "$SIM" \
--bundle-id "$BUNDLE_ID" \
--out-dir "$MEMGRAPH_DIR"Do not derive SKILL_DIR from the target app repo's pwd; installed plugins usually live outside the app being debugged. Store captures in a run-specific temp or user-chosen folder, not under SKILL_DIR.
If the process cannot be found, confirm the bundle identifier and use xcrun simctl spawn "$SIM" launchctl list to inspect running labels.
Summarize
Summarize an existing memgraph:
"$SKILL_DIR/scripts/summarize_memgraph_leaks.py" \
/path/to/app.memgraph \
--trace-limit 5 \
--out /path/to/leak-summary.mdUse --trace-limit sparingly. Trace trees are useful root-cause evidence, but large memgraphs can produce noisy output. If a trace tree says Found 0 roots referencing, treat it as an unreachable/self-retained leak candidate and use the summary's grouped leak tree or leaks --groupByType <file.memgraph> to identify the retained fields and payload chain.
Root Cause Rules
- Identify the first app-owned leaked type in the leak output or trace.
- Determine the intended lifetime: process, session, account, view, request, or task.
- Treat lazy or deferred allocation as a scope reduction, not a leak fix, unless the original eager allocation itself violated the intended lifetime.
- Prove retain-cycle claims with either a
traceTreeownership path or an isolated reproduction. - For unreachable/self-cycle leaks,
traceTreemay have no root path; useleaks --groupByTypeplus source verification to find the self-retaining edge. - Do not claim success just because total leak count went down; prove the specific type or path disappeared.
- Separate real root-cause branches from candidate/noise branches.
- Prefer deleting the retaining edge over adding broad cleanup code.
Report
A useful leak report includes:
- the exact flow and simulator/app build
- the memgraph and summary paths
- app-owned leaked types and counts
- at least one ownership path, or grouped leak tree evidence when the object is unreachable from roots
- the smallest proposed or applied retaining-edge fix
- before/after evidence when a fix was made
If the memgraph shows only framework/runtime noise, say that and recommend the next narrower capture rather than inventing an app leak.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

