Dev & Engineering ✓ Microsoft · Official

Memory Leak Audit

Systematically find and fix listener, lifecycle, and disposable leaks in VS Code code.

52/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex · Claude Code
Stars
★ 194k
Last updated
11d ago
License
MIT
memory-leakdisposable-managementevent-listenerstypescript
+3dom-handlerslifecycle-managementtest-validation

What does this skill do, and when should you use it?

This skill supports VS Code code review and fixes for memory leaks, with emphasis on event listeners, DOM handlers, lifecycle callbacks, and disposable ownership. Its six-step checklist covers DOM events, one-time events, repeated method calls, model lifetimes, pooled resources, and test validation. It focuses on addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose patterns. It is a good fit for leak-focused engineering work, although the source does not document a standalone installer or executable audit script.

It instructs an agent to inspect DOM event registration, one-time events, listeners created by repeatedly called methods, model-tied DisposableStores, disposal ownership for pooled objects, and disposable leak checks in test suites. It flags raw .onload, .onclick, addEventListener(), unsuitable this._register() usage, and missing model cleanup, then recommends the corresponding disposable patterns. After a fix, it can check listener counts before and after repeated operations, confirm that object counts stabilize, and, for chat-related leaks, run npm run perf:chat-leak --messages 20 --verbose.

Good fit
  • A developer reviews a search, toggle, or initialization method that may add another listener every time it runs.
  • A developer investigates a reported DOM-handler or extension-icon leak where listener counts keep increasing.
  • A developer implements onWillDispose or onDidClose lifecycle handling and needs resources to follow the model lifetime.
  • A developer maintains list or tree pools and must scope each pooled item's listeners to that item rather than to the pool.
  • A developer writes tests that create disposable objects and needs automatic suite-level leak validation.

How do you install this skill?

Before you use it
  • Do not apply the absolute rules mechanically; verify object lifetime, event semantics, and ownership in the local context.
  • The cited PR validation claims were not independently verified from the supplied material and should not be treated as proven test results.
  • Listener-count checks and the chat leak script require the repository's actual environment, dependencies, and build conditions; static review is not execution.
  • The skill does not define an output format, failure diagnosis, or rollback procedure, leaving those responsibilities to the user.
Before you start
Your agent needs
  • Shell / CLI
Install first
  • npm for the optional chat-specific leak verification

The skill is located at .github/skills/memory-leak-audit/SKILL.md in the microsoft/vscode repository. The source only identifies it as one of 61 bundled skills and does not document a standalone installation command or package; load this SKILL.md in an Agent Skills-compatible client. The repository as a whole is licensed under MIT.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/microsoft/vscode.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/.github/skills/memory-leak-audit" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • Audit this code for memory leaks and disposable issues, especially event listeners, DOM handlers, repeated calls, model lifecycle, and test cleanup.

In a review or repair task, ask: "Audit this code for memory leaks and disposable issues, especially event listeners, DOM handlers, repeated calls, model lifecycle, and test cleanup." Have the agent follow the six-step checklist and verify that listener and object counts remain stable after repeated operations. For a chat-specific check, request npm run perf:chat-leak --messages 20 --verbose; the skill notes that this uses the chat-perf skill.

What are this skill's strengths and limitations?

Pros
  • Provides an ordered six-step checklist covering DOM events, one-time events, repeated calls, model lifetimes, pooled resources, and tests.
  • Includes concrete bad-versus-good TypeScript examples.
  • Names specific patterns: addDisposableListener, Event.once, MutableDisposable, DisposableStore, and onWillDispose.
  • Defines post-fix checks for listener counts, object-count stabilization, and chat heap growth.
Limitations
  • The guidance is centered on VS Code-style disposables and event patterns; broader framework or runtime coverage is not evidenced.
  • It provides no standalone audit script, test suite, or report format; the agent performs the review using the instructions.
  • A standalone installation method is not documented.
  • Chat leak verification depends on npm and the separately referenced chat-perf skill, whose contents are not included here.

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
Memory Leak Audit this page ✓ Microsoft · Official 52 · Use with care ★ 194k 11d ago MIT
OpenChamber Change Discipline 52 · Use with care ★ 12k 11d ago MIT
VS Code Configuration Policy Maintainer ✓ Microsoft · Official 59 · Recommended ★ 194k 11d ago MIT
PinMe Worker Auth API Integration 59 · Recommended ★ 3.7k 3mo ago MIT
Vibeyard UI Development Skill 56 · Use with care ★ 1.4k 1mo ago MIT

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Use with care
52/ 100 5-point scale 2.6 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust17 / 25 · 3.4/5

The skill provides code-review guidance only and requests no credentials, network access, or elevated privileges. Its recommendations generally promote disposal and lifecycle isolation. It does not specify user confirmation, sensitive-data handling, rollback, or external-side-effect boundaries, and the cited PR claims are not directly verified in the supplied material, so points are deducted.

2Reliability8 / 20 · 2.0/5

The six-step checklist, examples, and verification section are internally readable, and the repository shows related chat leak scripts and CI workflows. However, the skill does not define handling for abnormal input, ambiguous framework semantics, failed tests, or unavailable dependencies; several rules are absolute, and key paths were not statically reproducible, so the score remains below the static ceiling.

3Adaptability10 / 15 · 3.3/5

Trigger scenarios are clear and cover listeners, lifecycle events, repeated calls, pooled objects, and tests. Non-fit cases, input/output format, audit boundaries, and semantic exceptions are not clearly defined. Chinese-language support is absent, but the core function does not depend entirely on unreachable overseas services, so only partial points are deducted.

4Convention7 / 15 · 2.3/5

The document has useful progressive structure with usage conditions, ordered checks, examples, and a quick-reference table. Repository context supplies MIT licensing, version information, and official maintenance provenance. The skill lacks installation or dependency notes, named ownership, an update path, changelog, FAQ, and explicit known limitations, warranting a mid-level score.

5Effectiveness6 / 15 · 2.0/5

The guidance can directly help a reviewer identify common disposable leaks and suggests concrete repair patterns such as MutableDisposable, Event.once, and DisposableStore. Repository context also exposes a chat memory-leak script and CI entry point. The skill does not define a standard review output or patch format, requires case-specific judgment, and has no statically verified representative outputs, so points are deducted.

6Verifiability4 / 10 · 2.0/5

The skill names PRs, code patterns, and repository scripts, while the supplied workflow provides auditable CI definitions for chat memory-leak checks. It lacks committed tests mapped to the skill's six key paths, pinned supporting evidence, and independent reproduction; no execution was performed in this review, so verifiability is limited.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 20, 2026 Reviewed revision 5b3e1be7be9e Review evidence[1][2][3][4][5][6][7][8][9][10][11]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Does this skill scan an entire repository and produce a report automatically?
The source provides no scanning script or report format. It supplies review rules, code examples, and verification steps for an agent to apply.
What code is it intended for?
It explicitly targets code involving event listeners, DOM handlers, lifecycle callbacks, repeated method calls, model lifetimes, and disposable objects in VS Code.
Does using it require network access?
The SKILL.md does not require network access. It mentions npm run perf:chat-leak for chat verification, but does not state that this command needs a network connection.
Can it guarantee that a leak is fixed?
No. It prescribes listener, object-count, test, and optional chat checks, but provides no formal guarantee.

More skills from this repository

All from microsoft/vscode

Dev & Engineering ✓ Microsoft · Official

VS Code Configuration Policy Maintainer

Standardize VS Code policy registration, export, and validation.

★ 194k FS 59 Recommended 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Unit Test Runner

Run VS Code repository unit tests by file, test name, or compiled-output glob.

★ 194k FS 55 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Chat Customizations Editor Skill

Guides developers through safe changes and testing for VS Code’s chat customization management UI.

★ 194k FS 52 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

V8 Heap Snapshot Analyzer

Trace V8 heap retention paths to diagnose leaks and GC-surviving objects.

★ 194k FS 40 Not recommended 11d ago
Dev & Engineering ✓ Microsoft · Official

Tool Rename Compatibility Check

Protect existing prompts and tool configurations when built-in tools are renamed.

★ 194k FS 63 Recommended 11d ago
Dev & Engineering ✓ Microsoft · Official

Run Command Builder

Configure and update commands shown in a VS Code Agent Session's Run button.

★ 194k FS 48 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Hygiene Checks

Catch VS Code commit-blocking style and hygiene issues before the work is declared complete.

★ 194k FS 48 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Smoke Test Failure Diagnosis

Diagnose and validate intermittent VS Code Electron smoke-test failures in Azure DevOps.

★ 194k FS 45 Not recommended 11d ago
Dev & Engineering ✓ Microsoft · Official

Anthropic SDK Upgrade Assistant

Upgrade Anthropic SDK packages methodically while checking API changes, compilation, and Claude-focused tests.

★ 194k FS 43 Not recommended 11d ago
Dev & Engineering ✓ Microsoft · Official

Context7 Project Bootstrapper

Build a complete VS Code project scaffold using current library documentation.

★ 194k FS 36 Not recommended 11d ago
Dev & Engineering ✓ Microsoft · Official

GitHub Copilot SDK Upgrade Assistant

Upgrade and validate @github/copilot in the VS Code Copilot Chat project.

★ 194k FS 28 Not recommended 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Chat Performance Lab

Benchmark chat rendering and detect memory growth across VS Code builds.

★ 194k FS 53 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Agents Window Sessions

Safely implement and repair VS Code Agents window features.

★ 194k FS 56 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

Component Fixtures for Screenshot Testing

Create stable, theme-aware VS Code component fixtures for isolated screenshot testing.

★ 194k FS 53 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Telemetry Error Fix Guide

Trace unhandled telemetry errors to invalid-data producers instead of masking the crash site.

★ 194k FS 52 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

VS Code Integration Test Runner

Run and filter VS Code repository integration tests with the correct platform scripts.

★ 194k FS 52 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

Session Code Review

Review the current session's code changes and place actionable findings directly on the relevant lines.

★ 194k FS 51 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

Copilot Session Troubleshooter

Explain unexpected Copilot CLI behavior from session-log evidence.

★ 194k FS 51 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

Branch Merge Assistant

Safely merges session work from a topic branch back into its base branch.

★ 194k FS 49 Use with care 11d ago
Dev & Engineering ✓ Microsoft · Official

Git Branch Sync

Safely sync an upstream branch or publish the current session branch to a remote.

★ 194k FS 49 Use with care 11d ago

Related skills