Analyze a .memgraph file
analyzeMemgraphAnalyzes a .memgraph file to detect retain cycles, providing a structured summary with diagnosis and optional full retain chains.
Instructions
[mg.memory] Run leaks(1) against a .memgraph file (exported from Xcode Memory Graph Debugger) and return a structured summary: header info, totals, top-level ROOT CYCLE blocks with chain length, plain-English diagnosis. Set fullChains: true to also include the full nested retain forest.
Pipeline: → classifyCycle (named-antipattern + fix hint) → reachableFromCycle (scope blame to a single root). The response includes suggestedNextCalls so the agent can chain without re-reasoning.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to a `.memgraph` file (export from Xcode Memory Graph Debugger). | |
| fullChains | No | When true, include the full nested retain chains in the response. Default false returns only top-level ROOT CYCLE summaries to keep payloads small. | |
| verbosity | No | Class-name verbosity. `compact` (default) drops module prefixes, collapses nested SwiftUI ModifiedContent into `+N modifiers`, and truncates deep generics with a hash placeholder. `normal` keeps more detail. `full` returns Swift demangled names verbatim. | compact |
| maxClassesInChain | No | Cap on how many unique class names to surface per cycle's `classesInChain` array. Default 10 — enough to identify app-level types without flooding the response. |