process-cleanup

Installation
SKILL.md

Process Cleanup

Detect and reap zombie processes using /bin/ps.

Background

A zombie (state Z) is a process that has exited but whose parent hasn't called wait() to collect its exit status. Zombies consume no CPU or memory, but they hold a PID slot and can accumulate. You can't kill a zombie — it's already dead. The only remedies are:

  1. Signal the parent with SIGCHLD so it reaps the child
  2. Kill the parent so init/launchd adopts and reaps the orphan

Important: use ps for process state queries

Always use ps (BSD) for process state queries. If ps is aliased, use /bin/ps to bypass it.

# List zombies
/bin/ps ax -o pid,state,ppid,user,command | awk '$2 ~ /Z/'
Related skills

More from paulrberg/dot-agents

Installs
1
GitHub Stars
4
First Seen
Apr 10, 2026