Skip to content

Memory Leak Debugger for Qwen Code

Guides an agent to capture and compare heap snapshots to find memory leaks in the Qwen Code CLI

Stars
28,880
Licence
Apache-2.0
Files
3 files

What it does

When installed, the agent follows a step-by-step method for finding memory leaks in the Qwen Code command-line tool. It starts the tool in a tmux terminal session, sends a signal to save memory snapshots at several points, and uses the chrome-devtools command-line tool to compare which object types grow over time and what keeps them alive. It then suggests likely root causes and how to verify a fix.

Great for

  • Contributors to the Qwen Code CLI who suspect high or growing memory use
  • Engineers who want a repeatable heap-snapshot workflow for a Node.js CLI

Skip it if

  • Users of Qwen Code who only want to use the tool; this is a maintainer workflow for the repository's source code
  • Debugging memory issues in unrelated Node.js apps, since paths, commands and the worked example are specific to this repo (the general technique could be adapted with effort)

Try asking

  • “Our Qwen Code CLI memory keeps climbing during long sessions, can you find the leak?”
  • “Take heap snapshots while I use the CLI and tell me which classes are growing”
  • “Trace the retainer chain for PerformanceMeasure objects in the CLI”
Step-by-step guide: how to use Memory Leak Debugger for Qwen CodeInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 3 original files, the Apache-2.0 licence and an attribution note.

    memory-leak-debug.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip memory-leak-debug.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip memory-leak-debug.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Review the commands before running them; the skill starts a dev server, sends kill -USR2 signals to a process, and can delete *.heapsnapshot files in the working directory
  • Take at least three snapshots under the same workload so the growth trend is clear
  • Keep the snapshot files out of version control, as they can be large and may contain sensitive in-memory data

What's inside

  • examples/react-reconciler-performance-measure-leak.md
  • scripts/find-leaf-node.sh
  • SKILL.md

Redistributed unmodified from QwenLM/qwen-code under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.