Cmux Debugging Guide
manaflow-ai/cmux
Covers debug logging, the Debug menu, profiling rules and runtime pitfalls for working on the cmux macOS terminal app.
Walks through capturing and comparing V8 heap snapshots to find memory leaks in the Qwen Code Node.js CLI, using tmux and the chrome-devtools CLI.
$ npx skills add QwenLM/qwen-code --skill memory-leak-debug -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install QwenLM/qwen-code memory-leak-debug --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.qwen/skills/memory-leak-debug .claude/skills/memory-leak-debug && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "memory-leak-debug" agent skill from https://github.com/QwenLM/qwen-code/tree/main/.qwen/skills/memory-leak-debug into .claude/skills/memory-leak-debug/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-leak-debug", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/QwenLM/qwen-code/tree/main/.qwen/skills/memory-leak-debugType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add QwenLM/qwen-code --skill memory-leak-debug -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install QwenLM/qwen-code memory-leak-debug --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.qwen/skills/memory-leak-debug .agents/skills/memory-leak-debug && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "memory-leak-debug" agent skill from https://github.com/QwenLM/qwen-code/tree/main/.qwen/skills/memory-leak-debug into .agents/skills/memory-leak-debug/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-leak-debug", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add QwenLM/qwen-code --skill memory-leak-debug -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install QwenLM/qwen-code memory-leak-debug --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.qwen/skills/memory-leak-debug .cursor/skills/memory-leak-debug && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "memory-leak-debug" agent skill from https://github.com/QwenLM/qwen-code/tree/main/.qwen/skills/memory-leak-debug into .cursor/skills/memory-leak-debug/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-leak-debug", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/QwenLM/qwen-code.git --path .qwen/skills/memory-leak-debug--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add QwenLM/qwen-code --skill memory-leak-debug -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install QwenLM/qwen-code memory-leak-debug --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.qwen/skills/memory-leak-debug .gemini/skills/memory-leak-debug && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "memory-leak-debug" agent skill from https://github.com/QwenLM/qwen-code/tree/main/.qwen/skills/memory-leak-debug into .gemini/skills/memory-leak-debug/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-leak-debug", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install QwenLM/qwen-code memory-leak-debugInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add QwenLM/qwen-code --skill memory-leak-debug -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .github/skills && cp -r skills-src/.qwen/skills/memory-leak-debug .github/skills/memory-leak-debug && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "memory-leak-debug" agent skill from https://github.com/QwenLM/qwen-code/tree/main/.qwen/skills/memory-leak-debug into .github/skills/memory-leak-debug/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-leak-debug", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add QwenLM/qwen-code --skill memory-leak-debug -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install QwenLM/qwen-code memory-leak-debug --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/QwenLM/qwen-code.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.qwen/skills/memory-leak-debug .opencode/skills/memory-leak-debug && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "memory-leak-debug" agent skill from https://github.com/QwenLM/qwen-code/tree/main/.qwen/skills/memory-leak-debug into .opencode/skills/memory-leak-debug/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "memory-leak-debug", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
memory-leak-debugWalks through capturing and comparing V8 heap snapshots to find memory leaks in the Qwen Code Node.js CLI, using tmux and the chrome-devtools CLI.
The agent starts the CLI under tmux with a heap-snapshot signal flag set, so it can drive the terminal UI from one pane and trigger snapshots from another without losing the session. It walks the process tree to find the real Node PID, since running through npm and tsx creates a chain of parent processes, and the PID discovery differs when profiling a built bundle directly.
Snapshots are taken at intervals with a kill signal, written to the working directory, and then loaded into the chrome-devtools CLI daemon for comparison of retained object sizes between the baseline and after-activity snapshots. A bundled script finds the leaf Node process in a tmux session, and an example walks through diagnosing a leak traced to the React reconciler's performance measurement.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 55ee50d. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Shell), which the agent can run.
Shell commands in SKILL.md call:
npmbashnodeFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Qwen Code Memory Leak Debugger loads about 1.3k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 494 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from QwenLM/qwen-code at commit 55ee50d, republished under its Apache-2.0 licence (© QwenLM). 494 words, ~1,319 tokens.
.claude/skills/memory-leak-debug/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Diagnose memory leaks in the Qwen Code Node.js CLI by capturing heap snapshots
and analyzing retained object sizes via chrome-devtools CLI tooling.
chrome-devtools CLI (from chrome-devtools-mcp package). If not found,
install with: npm i chrome-devtools-mcp@latest -g after user confirmation.
See https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/cli.md--heapsnapshot-signal support)Use tmux so you can interact with the TUI and trigger snapshots from another pane. Use the tmux-real-user-testing helper script:
HELPER=.qwen/skills/tmux-real-user-testing/scripts/tmux-real-user-log.sh
eval "$(bash "$HELPER" start memleak . \
env QWEN_CODE_NO_RELAUNCH=true NODE_OPTIONS=--heapsnapshot-signal=SIGUSR2 \
npm run dev)"
echo "SESSION=$SESSION OUTDIR=$OUTDIR"The eval exports SESSION and OUTDIR. Note: shell environment does not
persist across separate tool calls — save the session name from the output and
use it explicitly in subsequent commands.
Notes:
npm run dev runs from TypeScript source via tsx — no build step needed and
changes to core/cli are reflected immediately.QWEN_CODE_NO_RELAUNCH=true prevents the CLI from spawning a child process,
so PID management is simpler.NODE_OPTIONS propagates the flag through npm → tsx → node.Get the PID of the actual node process. With npm run dev, there's a process
chain (npm → node scripts/dev.js → tsx → node CLI), so walk the tree to the
innermost node child:
NODE_PID=$(bash .qwen/skills/memory-leak-debug/scripts/find-leaf-node.sh "<session-name>")To profile the production bundle instead (e.g., verifying tree-shaking):
npm run bundle first, then use
env QWEN_CODE_NO_RELAUNCH=true node --heapsnapshot-signal=SIGUSR2 dist/cli.js
as the command. Since node is the direct pane process, PID discovery is simpler:
NODE_PID=$(tmux list-panes -t "<session-name>" -F '#{pane_pid}')Drive the TUI via tmux (see tmux-real-user-testing skill for patterns). Take snapshots at intervals to compare:
kill -USR2 $NODE_PID # snapshot 1 (baseline)
# ... use the CLI via tmux send-keys ...
kill -USR2 $NODE_PID # snapshot 2 (after activity)
# ... more activity ...
kill -USR2 $NODE_PID # snapshot 3 (confirm growth trend)Snapshots are written to the CLI's working directory as
Heap.<timestamp>.<pid>.<seq>.heapsnapshot.
chrome-devtools start --experimentalMemory --headless --no-usage-statisticsThis starts the daemon in file-analysis mode — no browser or live Node
connection is needed. The memory tools work entirely on .heapsnapshot files.
chrome-devtools load_memory_snapshot /abs/path/to/snapshot.heapsnapshotReturns total heap size, V8 heap breakdown, node count.
chrome-devtools get_memory_snapshot_details /abs/path/to/snapshot.heapsnapshotOutput is CSV: uid, className, count, selfSize, maxRetainedSize.
Compare across snapshots to find classes whose count or retained size grows unboundedly.
chrome-devtools get_nodes_by_class /abs/path/to/snapshot.heapsnapshot <uid>Where <uid> is from the get_memory_snapshot_details output. Returns
individual instances with their id, retainedSize, and nodeIndex.
chrome-devtools get_node_retainers /abs/path/to/snapshot.heapsnapshot <nodeId>Where <nodeId> is the id field from get_nodes_by_class. Shows what holds
the object alive — follow the chain to find the root retention path.
Common patterns:
performance.measure() → measureEntryBuffer).The retainer chain tells you what holds the object; the class aggregate growth rate tells you how fast it leaks.
After applying the fix:
npm run bundleHELPER=.qwen/skills/tmux-real-user-testing/scripts/tmux-real-user-log.sh
bash "$HELPER" finish "<session-name>" "<outdir>"
chrome-devtools stop
rm *.heapsnapshot # if no longer neededSee examples/react-reconciler-performance-measure-leak.md for the ink 7
upgrade leak that caused ~143 MB retention from PerformanceMeasure objects.
© QwenLM, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (scripts) in .qwen/skills/memory-leak-debug of QwenLM/qwen-code.
Open the folder on GitHubat commit 55ee50d
Qwen Code Memory Leak Debugger next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Qwen Code Memory Leak Debugger this skillQwenLM/qwen-code | 28k | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Cmux Debugging Guidemanaflow-ai/cmux | 28k | 1 repos | ~1.1k | Automated safety check: Pass | Custom licence | |
| AO Desktop App LauncherOrchestratorInc/agent-orchestrator | 13k | — | ~2.4k | Automated safety check: Pass | Apache-2.0 | |
| Electron Heap Snapshot Analysiskeybase/client | 9.3k | — | ~875 | Automated safety check: Pass | BSD-3-Clause | |
| Issue Fixmono/SkiaSharp | 5.6k | — | ~5.1k | Automated safety check: Pass | MIT | |
| PlotJuggler 4 Perf ProfilingPlotJuggler/PlotJuggler | 6.2k | — | ~1.6k | Automated safety check: Notes | MPL-2.0 |
manaflow-ai/cmux
Covers debug logging, the Debug menu, profiling rules and runtime pitfalls for working on the cmux macOS terminal app.
OrchestratorInc/agent-orchestrator
Launches, restarts and troubleshoots the real AO Electron desktop app from a checkout, with isolated or real local data and checks for stale processes.
keybase/client
Analyzes V8, Chrome and Electron .heapsnapshot files with Node scripts to find memory leaks, detached DOM nodes and the retainer paths that keep objects alive.
mono/SkiaSharp
Fix bugs in SkiaSharp C bindings. An agent skill from mono/SkiaSharp.
PlotJuggler/PlotJuggler
Guides CPU profiling of PlotJuggler 4 on Linux with perf: count first, record cheaply with LBR, then read per-thread, flat, flamegraph or time-window views.
keybase/client
Analyzes Chrome or Electron DevTools Performance trace exports with Python scripts to find where render time actually goes, without opening DevTools.
QwenLM/qwen-code
Reproduces a feature from Codex or Claude Code in Qwen Code by running the reference agent under capture, reading the traces, then implementing matching behavior.
QwenLM/qwen-code
Guides end-to-end testing of the Qwen Code CLI in headless mode with real model calls, MCP test servers and inspection of raw API traffic.
QwenLM/qwen-code
Scheduled CI skill that scans a repository for small, certain docs, test and code hygiene issues and fixes them on one branch with a commit per finding.
QwenLM/qwen-code
Builds a rebranded Qwen Code desktop package from the Tauri shell using only a brand id and a logo, with sensible derived defaults.
QwenLM/qwen-code
Drives Qwen Code in a real tmux session the way a user would and saves a readable step-by-step transcript of each screen for maintainers to review.
QwenLM/qwen-code
Runs a reference agent (Codex or Claude Code) and Qwen Code on the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Works with
Categories
Walks through capturing and comparing V8 heap snapshots to find memory leaks in the Qwen Code Node.js CLI, using tmux and the chrome-devtools CLI. The agent starts the CLI under tmux with a heap-snapshot signal flag set, so it can drive the terminal UI from one pane and trigger snapshots from another without losing the session. It walks the process tree to find the real Node PID, since running through npm and tsx creates a chain of parent processes, and the PID discovery differs when profiling a built bundle directly.
Qwen Code Memory Leak Debugger fits situations like: investigating high or growing memory usage in the Qwen Code CLI; comparing heap snapshots before and after a suspected leaking action; verifying that a production bundle's memory behavior matches the dev build.
Run `npx skills add QwenLM/qwen-code --skill memory-leak-debug -a claude-code`. Or copy the skill folder (.qwen/skills/memory-leak-debug in QwenLM/qwen-code) into .claude/skills/memory-leak-debug in your project. Claude Code loads it when a task matches its description.
Run `npx skills add QwenLM/qwen-code --skill memory-leak-debug -a codex`. Or copy the skill folder (.qwen/skills/memory-leak-debug in QwenLM/qwen-code) into .agents/skills/memory-leak-debug in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add QwenLM/qwen-code --skill memory-leak-debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/memory-leak-debug, .gemini/skills/memory-leak-debug, .github/skills/memory-leak-debug and .opencode/skills/memory-leak-debug in your project.
Going by SKILL.md and its folder, Qwen Code Memory Leak Debugger needs a shell for the scripts in its folder and the command-line tools its instructions call (npm, bash and node). Our summary lists: Node.js 22 or newer; chrome-devtools CLI (chrome-devtools-mcp package); tmux.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Qwen Code Memory Leak Debugger is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Qwen Code Memory Leak Debugger: Cmux Debugging Guide (manaflow-ai/cmux, 28k stars), AO Desktop App Launcher (OrchestratorInc/agent-orchestrator, 13k stars), Electron Heap Snapshot Analysis (keybase/client, 9.3k stars) and Issue Fix (mono/SkiaSharp, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
QwenLM (a GitHub organization) maintains it in QwenLM/qwen-code, which has 28,370 GitHub stars. The repository holds 41 skills in this directory. The repository was last updated on October 9, 2026.
Source: QwenLM/qwen-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.