pkill-f-self-match
pkill -f Self-Match — Kill By PID, Not Pattern
Section titled “pkill -f Self-Match — Kill By PID, Not Pattern”pkill -f <pattern> and pgrep -f <pattern> match the invoking shell’s own command line when the pattern text appears in it, so they kill the caller’s own shell. Kill by captured PID (kill "$pid"), by child (pkill -P <pid>), by a unique path, or with a bracket pattern (pkill -f '[f]oo' matches foo, not its own literal [f]oo). Verify with pgrep -af '[f]oo' before killing. NEVER pkill -f node|bun|claude: it kills other sessions.
Prior art: skills/t1k-test-quality/references/hard-rules.md · skills/t1k-test/references/vitest-process-management.md.