Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

memory-leak-debug

Skill by QwenLM

Diagnoses memory leaks in the Qwen Code CLI using heap snapshots and the chrome-devtools CLI. Built for developers investigating high memory use, unbounded growth, or object retention.

  • Score 94
  • 31k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install memory-leak-debug

Built from the published package, never by AI.

git clone --depth 1 https://github.com/QwenLM/qwen-code /tmp/qwen-code && mkdir -p ~/.claude/skills && cp -r /tmp/qwen-code/.qwen/skills/memory-leak-debug ~/.claude/skills/memory-leak-debug

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install memory-leak-debug in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

The memory-leak-debug skill guides an AI assistant through finding memory leaks in the Qwen Code Node.js CLI. It starts the CLI with the --heapsnapshot-signal flag, then captures heap snapshots by sending SIGUSR2 at intervals while the CLI is exercised through tmux.

Snapshots are analyzed with the chrome-devtools CLI in file-analysis mode, so no browser is needed. The skill summarizes heap size, lists class-level counts and retained sizes, inspects instances, and traces retainer chains to find what holds objects alive. It suggests common causes such as unbounded buffers, listener leaks, closures and module-level caches. It is aimed at developers who see high memory usage, unbounded growth, or suspected object retention in the CLI.

Written from the project's SKILL.md and checked against it.

What it can do

  • Heap snapshot captureStarts the Qwen Code CLI with a signal flag and takes snapshots at intervals using SIGUSR2.
  • load_memory_snapshotLoads a .heapsnapshot file and returns total heap size, V8 heap breakdown and node count.
  • get_memory_snapshot_detailsReturns class-level aggregates as CSV with count, selfSize and maxRetainedSize.
  • get_nodes_by_classLists individual instances of a class with their id, retainedSize and nodeIndex.
  • get_node_retainersShows the retainer chain that keeps a given object alive.
  • Root cause guidanceDescribes common leak patterns such as unbounded arrays, listener leaks and module-level caches.
  • Fix verificationRepeats the snapshot workflow after a fix to confirm the leaking class count stabilizes.

What you need

  • Node.js 22 or later
  • chrome-devtools CLI from the chrome-devtools-mcp package
  • tmux for driving the CLI TUI

Try asking

  • Help me find out why Qwen Code memory keeps growing during a long session.
  • Take heap snapshots of the Qwen Code CLI and compare class counts between them.
  • Trace the retainer chain for the objects leaking in my latest heap snapshot.

Good to know

  • Snapshot signal support requires Node.js 22 or later.
  • The chrome-devtools memory tools work only on .heapsnapshot files, not on a live Node connection.
  • Shell environment variables do not persist between separate tool calls.
  • Verifying a fix requires rebuilding with npm run bundle.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .qwen/skills/memory-leak-debug/SKILL.md, .qwen/skills/memory-leak-debug/scripts/find-leaf-node.sh. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB
  • examples/react-reconciler-performance-measure-leak.md2 KB
  • scripts/find-leaf-node.sh405 B

Alternatives to memory-leak-debug

All alternatives →

Compare with antigravity-workflows, e2e-testing-patterns or upgrade-browser

memory-leak-debug: common questions

Which tools does the memory-leak-debug skill use?

It uses the chrome-devtools CLI from the chrome-devtools-mcp package to analyze snapshots. It also uses the tmux-real-user-testing helper script to drive the CLI.

How does the skill confirm a leak?

It compares class counts and retained sizes across snapshots taken at intervals. Classes whose count or retained size keeps growing with activity point to a leak.

Can it analyze the production bundle instead of the dev source?

Yes. The skill says to run npm run bundle and then start dist/cli.js with the --heapsnapshot-signal=SIGUSR2 flag.

How do I install memory-leak-debug?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is memory-leak-debug free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is memory-leak-debug safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to memory-leak-debug?

Similar skills: antigravity-workflows, e2e-testing-patterns, upgrade-browser, browser-automation.

memory-leak-debug Install

Add to stack

Loading.