Skip to main content
Agent skill

Ios Memgraph Leaks

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.

All install options
Quick install · Personal (~/.claude/skills)Project / Cursor / Desktop →
mkdir -p ~/.claude/skills/ios-memgraph-leaks && curl -fsSL 'https://raw.githubusercontent.com/omarshahine/HomeClaw/main/.claude/skills/ios-memgraph-leaks/SKILL.md' -o ~/.claude/skills/ios-memgraph-leaks/SKILL.md

Get the complete skill folder, including its scripts and reference files.

When to use this skill

Use Ios Memgraph Leaks when an AI agent needs a reusable SKILL.md workflow for this job: 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.

When not to use it

Skip Ios Memgraph Leaks when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
One-line install (Claude Code)
mkdir -p ~/.claude/skills/ios-memgraph-leaks && curl -fsSL 'https://raw.githubusercontent.com/omarshahine/HomeClaw/main/.claude/skills/ios-memgraph-leaks/SKILL.md' -o ~/.claude/skills/ios-memgraph-leaks/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/ios-memgraph-leaks/SKILL.md. For a shared project, commit the folder at .claude/skills/ios-memgraph-leaks/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Ios Memgraph Leaks skill for this task: Use Ios Memgraph Leaks when this documented workflow matches the task. Confirm any required inputs or files before making changes.

What supports this recommendation?

70/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
77/100
Practical detail
68/100
Source evidence
61/100
Source signals
72/100
Model compatibility evidence
  • claudeinferred

    The skill text mentions Claude or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.

  • chatgptuntested

    No model-specific signal or recorded compatibility test was found.

  • geminiuntested

    No model-specific signal or recorded compatibility test was found.

  • copilotuntested

    No model-specific signal or recorded compatibility test was found.

  • llamauntested

    No model-specific signal or recorded compatibility test was found.

  • perplexityuntested

    No model-specific signal or recorded compatibility test was found.

  • mistraluntested

    No model-specific signal or recorded compatibility test was found.

  • grokuntested

    No model-specific signal or recorded compatibility test was found.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

# 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

1. Build, launch, and drive the exact flow that should release objects. 2. Capture a memgraph from the running simulator process with `scripts/capture_sim_memgraph.sh`. 3. Summarize leaks with `scripts/summarize_memgraph_leaks.py`. 4. For each app-owned leaked type, inspect ownership with `leaks --traceTree=<address> <file.memgraph>` and grouped leak evidence. 5. Make the smallest root-cause patch, then recapture the same flow on the same simulator when possible. 6. 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:

```bash SKILL_DIR="<absolute path to this loaded skill folder>" SIM="<simulator-udid>" BUNDLE_ID="<app.bundle.identifier>" MEMGRAPH_DIR="$(mktemp -d "${TMPDIR:-/tmp}/codex-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:

```bash "$SKILL_DIR/scripts/summarize_memgraph_leaks.py" \ /path/to/app.memgraph \ --trace-limit 5 \ --out /path/to/leak-summary.md ```

Use `--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 `traceTree` ownership path or an isolated reproduction. - For unreachable/self-cycle leaks, `traceTree` may have no root path; use `leaks --groupByType` plus 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.

Intended uses

  • Use Ios Memgraph Leaks when this documented workflow matches the task.

Implementation notes

  • Review the source instructions and adapt inputs before running the workflow.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.