← Explore all skills

WEB PERFORMANCE / Microsoft

Heap Snapshot Analysis

Investigates memory leaks from V8 heap snapshots: parsing multi-hundred-megabyte .heapsnapshot files, comparing before/after object deltas, and tracing retainer paths while skipping the weak edges and debugger artifacts that produce false suspects.

“Analyze V8 heap snapshots to investigate memory leaks and retention issues. Use when given .heapsnapshot files, asked to compare before/after snapshots, asked to find what retains objects, or investigating why objects survive GC. Provides snapshot parsing, comparison, retainer-path helpers, and scratchpad scripts.”

01 / THE REASONING

Why this made the selection.

  • Bakes anti-bias discipline into the workflow: the analyst is told to start fresh and ignore prior investigation notes so stale suspects cannot steer the current analysis.
  • Names the false retainers that waste whole investigations — DevTools debugger global handles, WeakMap backing arrays — and mandates skipping weak edges when tracing retention, which is the single most common heap-analysis error.
  • The bundled helpers are sized to reality: Buffer-based extraction for snapshots above the JSON.parse string limit and a streaming path for files beyond Node’s roughly 2 GiB Buffer ceiling.

02 / THE REVIEW RECORD

What we actually inspected.

Source review has boundaries.
A clear record is more useful than a “safe” badge.

Material inspected

  • .github/skills/heap-snapshot-analysis/SKILL.md
  • helpers and scratchpad directory listing
  • LICENSE.txt

Our findings

  • The helpers directory ships parseSnapshot and streamSnapshot modules matching the SKILL.md instructions, and the scratchpad directory exists for dated per-run findings.
  • The edge table marks weak edges as skippable and explains why — WeakMap entries appear in retainer paths but do not prevent collection.
  • The false-retainer section distinguishes debugger-induced retention from application-owned leaks before any fix is proposed, including the observability debug flag that retains all watched objects.

Not established by this review

  • No .heapsnapshot file was parsed and no retainer path was traced; the helpers were inspected as listings, not executed.
  • The VS Code retention patterns were not verified against the current source tree.
  • Not executed: it was not installed or run.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

Add a skill to your workflow.

Upstream setup instructions ↗

DOCUMENTED COMMAND

npx skills add microsoft/vscode/.github/skills/heap-snapshot-analysis --skill heap-snapshot-analysis

Run in your terminal to choose your AI tools, project or global scope, and installation method. This short command follows the current upstream version; the review covers the revision shown above.

Optional: install the reviewed revision

Keeps the original source and installer version where recorded, while leaving your AI tools and installation scope for you to choose.

npx skills add https://github.com/microsoft/vscode/tree/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis --skill heap-snapshot-analysis
  1. Install the complete skill directory including the helpers and scratchpad layout; the SKILL.md alone cannot parse snapshots.
  2. Export before/after snapshots from DevTools or the VS Code profiler, then point the skill at them.

Before you start

  • Node.js/npm for the installer and helper scripts
  • An agent that supports the Agent Skills format
  • Captured .heapsnapshot files and a leak scenario to investigate

04 / FOLLOW THE EVIDENCE

The source trail.

Our notes are separate from the original resource.
Check upstream before adopting a new version.

  1. https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis/SKILL.md

    Supports: summary, upstreamDescription, whySelected, bestFor, limitations, review, access

  2. https://github.com/microsoft/vscode/tree/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis

    Supports: review, install, limitations

  3. Upstream license ↗Checked

    https://github.com/microsoft/vscode/blob/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/LICENSE.txt

    Supports: license

  4. https://github.com/vercel-labs/skills/blob/7407f3893ad4dceab546ac002c3ef806e4000c73/README.md

    Supports: install

  5. https://raw.githubusercontent.com/microsoft/vscode/3a7c8e0181efe20e985490ab60dc5f434b48e5eb/.github/skills/heap-snapshot-analysis/SKILL.md

    Supports: upstreamDescription, bestFor, review.reviewedAt, review.notTested

Evidence & Ask