stuck
하는 일
컴퓨터에서 다른 Qwen Code 프로세스를 찾아, CPU 사용량이 높거나 정지 상태인 등 멈춤의 징후를 확인한 뒤 진단 보고서를 작성합니다. Qwen Code 세션이 응답하지 않는 사람을 위한 스킬입니다.
사용하는 경우
- ✓컴퓨터의 다른 Qwen Code 세션이 멈췄거나 매우 느린 것 같을 때.
- ✓이유가 분명하지 않은데 Qwen Code 프로세스가 CPU나 메모리를 많이 쓸 때.
- ✓특정 프로세스 ID 하나에 대해서만 진단하고 싶을 때.
스킬 링크
https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/skills/bundled/stuck/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“다른 Qwen Code 창이 멈춘 것 같아요. 멈췄는지 확인하고, 무엇이 잘못됐는지 알려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 Qwen Code 프로세스를 찾고, CPU 사용량과 상태를 샘플링한 뒤, 디버그 로그를 확인합니다. 가능성이 높은 원인을 보고서로 보여 주며, 현재 세션은 건드리지 않습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
/stuck — diagnose frozen/slow Qwen Code sessions
The user thinks another Qwen Code session on this machine is frozen, stuck, or very slow. Investigate and present a diagnostic report.
What to look for
Scan for other Qwen Code processes (excluding the current one — exclude the PID you see running this prompt). Since Qwen Code is a Node.js CLI (#!/usr/bin/env node), the process name (comm column) is always node (or bun if run with Bun). Identify Qwen Code sessions by looking at the command column for a script path inside a directory whose name starts with qwen-code (matches qwen-code/, qwen-code-dev/, worktree clones, etc.) — anchored to the start of the path or after / so unrelated names like analyze-qwen-code/ don't false-match — or a bin invocation ending in /qwen (the global symlink). Avoid loose qwen-code substring matching: it false-positives on plugin brokers that merely pass a qwen-code path as --cwd.
Signs of a stuck session:
- High CPU (>=90%) sustained — likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.
- Process state
D/U(uninterruptible sleep) — often an I/O hang. Linux usesD, macOS/BSD usesU. Thestatecolumn inpsoutput; first character matters (ignore modifiers like+,s,<). - Process state
T(stopped) — user probably hit Ctrl+Z by accident. - Process state
Z(zombie) — parent isn't reaping. - Very high RSS (>=4GB) — possible memory leak making the session sluggish.
- State
Swith low CPU — the most common hang signature: a hung HTTPS request to the model API. Not a process-level red flag on its own, but combined with the user reporting "stuck", treat it as a strong signal to run the network check in step 3. - Stuck child process — a hung
git,node, or shell subprocess can freeze the parent. Checkpgrep -P <pid>(thenps -pfor state — see step 3) for each session.
Argument validation
If the user gave an argument, treat it as a PID only if it consists entirely of digits 0-9. Anything else — letters, whitespace, punctuation — fails the check, in which case treat it as a free-text symptom description (guidance for the report only, never substituted into shell commands). The strict digit-only whitelist is safer than enumerating shell metacharacters.
Investigation steps
Preamble — resolve the runtime base directory. Required for both paths below (sidecar enumeration in step 1, debug log lookup in step 3, and the PID fast path). The base directory is taken from (in priority order): QWEN_RUNTIME_DIR env var, the advanced.runtimeOutputDir setting, QWEN_HOME env var, and finally ~/.qwen.
RUNTIME_DIR="${QWEN_RUNTIME_DIR:-}"
[ -z "$RUNTIME_DIR" ] && command -v jq >/dev/null && RUNTIME_DIR=$(jq -r '.advanced.runtimeOutputDir // empty' "${QWEN_HOME:-$HOME/.qwen}/settings.json" 2>/dev/null)
# `advanced.runtimeOutputDir` may be `~/...` or relative; mirror Storage.resolvePath() before using in globs
[ -n "$RUNTIME_DIR" ] && RUNTIME_DIR="${RUNTIME_DIR/#\~/$HOME}"
[ -n "$RUNTIME_DIR" ] && case "$RUNTIME_DIR" in /*) ;; *) RUNTIME_DIR="$(cd "$RUNTIME_DIR" 2>/dev/null && pwd)" || RUNTIME_DIR="" ;; esac
RUNTIME_DIR="${RUNTIME_DIR:-${QWEN_HOME:-$HOME/.qwen}}"
(If jq isn't installed, the settings layer is silently skipped — the env-var / default fallback covers the common case.)
Fast path for targeted diagnosis — if a digit-only PID argument was given, skip step 1 enumeration. Validate that the PID is a live current-user Qwen Code process before dumping any details:
kill -0 <pid> 2>/dev/null || { echo "PID <pid> is dead, or owned by another user"; exit 0; }
ps -p <pid> -o command= -ww 2>/dev/null | grep -qE '((^|/)qwen-code[^ /]*/[^ ]*\.(js|ts|mjs|cjs)( |$)|/qwen( |$))' || { echo "PID <pid> is yours but is not a Qwen Code process — refusing to dump details"; exit 0; }
If either guard prints, stop the diagnostic and surface the message verbatim. Otherwise, gather stats and the sidecar mapping, then jump to step 3:
ps -p <pid> -o pid=,pcpu=,rss=,etime=,state=,comm=,command= -ww
grep -El '"pid"[[:space:]]*:[[:space:]]*<pid>\b' "$RUNTIME_DIR"/projects/*/chats/*.runtime.json 2>/dev/null
Note: as in step 2, the command= column may include credentials passed as CLI args (e.g., --openai-api-key=sk-…). Redact such values to *** before quoting them in the report.
-E is required so \b is interpreted as word boundary (BSD `g
자주 묻는 질문
멈춘 프로세스를 중지하나요?
이 스킬은 진단용이며 보고서를 제공합니다. 프로세스 종료를 기본 단계로 설명하지 않습니다.
잘못된 프로세스를 건드리지 않으려면 어떻게 하나요?
Qwen Code 설치 경로와 실행 파일 이름을 기준으로 맞추고, 검사를 실행 중인 세션은 제외합니다.
특정 프로세스 하나만 확인할 수 있나요?
네. 프로세스 ID를 주면 그 프로세스에 집중해 진단합니다.
상세 정보
작성자의 원본 설명
Diagnose frozen, stuck, or slow Qwen Code sessions on this machine. Scans for problematic processes, high CPU/memory usage, hung subprocesses, and debug logs. Use /stuck or /stuck <PID> to focus on a specific process.
repo: QwenLM/qwen-code
인기도
- GitHub 스타
- 29k
- 순위
- #9787
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
codegraph
29k에이전트가 색인된 코드베이스를 호출 그래프, 의존성, 죽은 코드, 핫스팟, 의미 검색으로 분석하도록 돕습니다.
qwen-code-claw
29k에이전트가 코드베이스 이해, 버그 수정, 리팩터링, 새 프로젝트 생성 같은 코딩 작업을 Qwen Code에 맡기도록 돕습니다.
structured-debugging
29k에이전트가 어려운 버그를 디버깅하는 단계별 방법을 가르칩니다. 가설을 세우고, 대상 확인을 추가하고, 시험해서 실제 원인을 찾은 뒤 고칩니다.
tmux-real-user-testing
29k에이전트가 tmux 안에서 실제 사용자처럼 터미널 앱을 테스트하고, 각 동작마다 화면 캡처가 담긴 읽기 쉬운 로그를 저장하도록 돕습니다.