| name | cleanup-claude-agents |
| description | Kill idle/orphaned Claude subagent processes while preserving active sessions and critical infrastructure |
Cleanup Claude Agents
GSD ๋๋ Agent tool ์ฌ์ฉ ํ ๋์ ๋๋ ์ ํด Claude ์๋ธ์์ด์ ํธ ํ๋ก์ธ์ค๋ฅผ ์ ๋ฆฌํฉ๋๋ค.
Overview
Claude Code๋ GSD planner/executor/verifier ๋ฑ์ ์๋ธ์์ด์ ํธ๋ฅผ ์์ฑํ๋ฉฐ, ์ด ํ๋ก์ธ์ค๋ค์ด ์์
์๋ฃ ํ์๋ ์ข
๋ฃ๋์ง ์๊ณ ๋จ์์๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. ์ด ์คํฌ์ ์ ํด ์๋ธ์์ด์ ํธ๋ง ์ ๋ณ์ ์ผ๋ก ์ข
๋ฃํฉ๋๋ค.
Execution
1. ํํฉ ํ์
ps aux | grep '[c]laude' | grep -c '--disallowedTools'
2. ์๋ธ์์ด์ ํธ ํ๋ก์ธ์ค ์ข
๋ฃ
ps aux | grep '[c]laude' | grep '--disallowedTools' | awk '{print $2}' | xargs kill -15
3. ์์ฌ orphan ํ๋ก์ธ์ค ์ ๋ฆฌ
ps aux | grep '[c]laude' | grep '--output-format' | awk '{print $2}' | xargs kill -15
Preservation Targets (DO NOT KILL)
| Process | Identification | Reason |
|---|
| Interactive sessions | --dangerously-skip-permissions ๋๋ TTY attached | ์ฌ์ฉ์๊ฐ ์ง์ ์ฌ์ฉ ์ค |
| claude-mem worker | worker-service.cjs | MCP ๋ฉ๋ชจ๋ฆฌ ์๋น์ค |
| MCP servers | thedotmack plugin, claude-mem | ํ๋ฌ๊ทธ์ธ ์ธํ๋ผ |
| chroma-mcp | chroma-mcp | ๋ฒกํฐ DB MCP ์๋ฒ |
| Claude.app helpers | Chrome native host processes | ๋ธ๋ผ์ฐ์ ํ์ฅ |
Termination Targets
| Target | Flag | Description |
|---|
| GSD subagents | --disallowedTools | planner, executor, verifier ๋ฑ |
| Orphaned agents | --output-format | ์ ์ ์ข
๋ฃ๋์ง ์์ ์์ด์ ํธ |
Safety
- ์ข
๋ฃ ์ ์คํ ์ค์ธ GSD ์์
์ด ์๋์ง ํ์ธํ์ธ์
kill -15 (SIGTERM)์ ์ฌ์ฉํ์ฌ graceful shutdown์ ํ์ฉํฉ๋๋ค
- SIGTERM์ผ๋ก ์ข
๋ฃ๋์ง ์๋ ๊ฒฝ์ฐ์๋ง
kill -9 (SIGKILL) ์ฌ์ฉ
- ํ์ฌ ๋ํ ์ค์ธ ์ธํฐ๋ํฐ๋ธ ์ธ์
์ ์ ๋ ์ข
๋ฃํ์ง ๋ง์ธ์