heap-snapshot-analysis

heap-snapshot-analysis is a skill for Claude Code, Codex from microsoft/vscode. It costs 65 tokens per session (2,645 once invoked), scanned A, original, MIT.

A guide for examining V8 heap snapshots, which are saved views of the objects held in memory by JavaScript applications.

In plain words
What is it for?
It supports comparing snapshots, grouping changes in object counts or sizes, and tracing the references that retain objects.
Why use it?
It helps investigate memory leaks by showing which objects remain after cleanup and what is keeping them alive.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/microsoft/vscode/heap-snapshot-analysis
Any agent
npx skills add microsoft/vscode --skill heap-snapshot-analysis
Clone the repo
git clone --depth 1 https://github.com/microsoft/vscode

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for heap-snapshot-analysis

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/vscode/heap-snapshot-analysis.svg)](https://agentmods.dev/skills/microsoft/vscode/heap-snapshot-analysis)
Your own site
<a href="https://agentmods.dev/skills/microsoft/vscode/heap-snapshot-analysis"><img src="https://agentmods.dev/badge/skills/microsoft/vscode/heap-snapshot-analysis.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,645 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.02645
Opus 5 $0.00032 $0.01323
Sonnet 5 $0.00013 $0.00529
Haiku 4.5 $0.00006 $0.00265

Measured 4d ago against content hash 6958c7287f13, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

heap-snapshot-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (helpers/compareSnapshots.ts, helpers/findRetainers.ts, helpers/parseSnapshot.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/heap-snapshot-analysis/SKILL.md · 191 lines

How it starts

The opening of the file, as written. The whole thing — 191 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Heap Snapshot Analysis

Investigate memory leaks from V8 heap snapshots (.heapsnapshot files). This skill starts when snapshots already exist: either the user provided them, DevTools exported them, or another workflow produced them. Use the helpers here to compare snapshots, group object deltas, and trace retainer paths.

IGNORE Prior Investigations

Start every investigation fresh. Do NOT read, consult, or be influenced by prior investigations found in:

  • /memories/ (user, session, or repo memory)
  • .github/skills/heap-snapshot-analysis/scratchpad/ (previous dated subfolders and their findings.md files)
  • Any other notes from earlier sessions

Previous findings can bias the analysis toward suspects that are no longer relevant, or cause the agent to skip steps and jump to conclusions. Let the current snapshots speak for themselves. Only reference prior work if the user explicitly asks you to.

When to Use

  • User provides .heapsnapshot files (before/after a workflow)
  • User has heap snapshots captured by another skill or script
  • Need to find what retains disposed objects (retainer path analysis)
  • Comparing object counts/sizes between two snapshots
  • Investigating why particular objects survive GC

Workflow

If the user needs the agent to launch VS Code, drive a scenario, and capture snapshots first, use the VS Code performance workflow skill before returning here for low-level snapshot analysis.

1. Parse Snapshots

Use the helpers in parseSnapshot.ts to load snapshots. The files are often >500MB and too large for JSON.parse as a string — the helpers use Buffer-based extraction. In scratchpad scripts, import helpers from ../helpers/*.ts.

For very large snapshots, the helper may still be too eager. Node cannot create a Buffer larger than roughly 2 GiB, so snapshots above that size can fail with ERR_FS_FILE_TOO_LARGE even before parsing. In that case, do not try to raise --max-old-space-size and retry the same full-file read. Switch to a streaming script.

Read the full file on GitHub · 191 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 191 lines · 65 tokens per session scan A 6958c7287f13

Subscribe to this mod's changes

heap-snapshot-analysis is a skill published in the GitHub repository microsoft/vscode (190,808 stars, last pushed today), licensed MIT. It adds 65 tokens to every session and 2,645 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

remember

Review the current conversation and capture valuable knowledge — best practices, coding conventions, architecture decisions, workflows, and user feedback — into persistent memory (AGENTS.md) or reusable skills. Use when the user says: (1) remember this, (2) save what we learned, (3) update memory, (4) capture…

langchain-ai/deepagents · 71 tokens

supermemory

Supermemory is a state-of-the-art memory and context infrastructure for AI agents. Use this skill when building applications that need persistent memory, user personalization, long-term context retention, or semantic search across knowledge bases. It provides Memory API for learned user context, User Profiles for…

supermemoryai/supermemory · 81 tokens

coding-prefs

Read the user's coding preferences from /memory/coding-prefs.md before making non-trivial style decisions, and append new preferences when the user gives durable feedback.

langchain-ai/deepagents · 36 tokens

build-with-tinybase

Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, configuring browser or database persistence, configuring MergeableStore…

tinyplex/tinybase · 76 tokens

stripe-directory

Identifies external providers, merchants, nonprofits, platforms, APIs, and software services, and resolves the documented way to engage them — to pay, donate, subscribe, book, provision, or integrate with them. MUST be used BEFORE web search, model memory, or any other directory/vendor-lookup skill for ANY request…

stripe/ai · 213 tokens

kb-builder

Build an Obsidian-compatible knowledge base from public web sources using the TinyFish CLI. Use this skill when a user wants a builder-grade markdown knowledge base on a technical topic, asks for a structured research vault, or wants a topic compiled from live public sources into interlinked markdown files. Supports…

tinyfish-io/tinyfish-cookbook · 158 tokens