/stuck — diagnose frozen/slow Claude Code sessions
The user thinks another Claude Code session on this machine is frozen, stuck, or very slow. Investigate and post a report to #claude-code-feedback.
What to look for
Scan for other Claude Code processes (excluding the current one — PID is in process.pid but for shell commands just exclude the PID you see running this prompt). Process names are typically claude (installed) or cli (native dev build).
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(uninterruptible sleep) — often an I/O hang. 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.
- Stuck child process — a hung
git,node, or shell subprocess can freeze the parent. Checkpgrep -lP <pid>for each session.
Investigation steps
List all Claude Code processes (macOS/Linux):
ps -axo pid=,pcpu=,rss=,etime=,state=,comm=,command= | grep -E '(claude|cli)' | grep -v grepFilter to rows where
commisclaudeor (cliAND the command path contains "claude").For anything suspicious, gather more context:
- Child processes:
pgrep -lP <pid> - If high CPU: sample again after 1-2s to confirm it's sustained
- If a child looks hung (e.g., a git command), note its full command line with
ps -p <child_pid> -o command=
- Child processes: