Releases: TheStack-ai/zclean
Releases · TheStack-ai/zclean
v0.2.2 — Doctor & Cumulative Stats
New: zclean doctor
Self-diagnosis command that checks if zclean is properly set up and running:
$ zclean doctor
Config: ~/.zclean/config.json
Hook: Claude Code SessionEnd registered
Scheduler: launchd agent loaded
Last run: 4m ago
Stats: 18 cleaned all time, 12 this week
All checks passed.
Checks: config file, Claude Code hook, launchd/systemd scheduler (loaded?), last run time (warns if >2h ago), cumulative stats.
Kill Feedback with Cumulative Stats
After cleaning zombies, zclean now shows weekly and all-time totals:
Killed 3 zombie processes:
KILLED PID 26413 mcp-server 367 MB
KILLED PID 62830 agent-browser 200 MB
KILLED PID 26221 npm-exec 142 MB
Memory freed: 709 MB
This week: 12 cleaned, 4.2 GB freed
All time: 18 cleaned, 6.8 GB freed
Upgrade
npx @thestackai/zclean@latestv0.2.1 — Stability & Tests
Stability Fixes
node-ai-pathpattern tightened — No longer flags everynodeprocess in AI directories. Now requires/mcp/,/agent/, or/server/in the path.- Batch limit warning visible — When
maxKillBatchis exceeded, the warning is now displayed to the user. - Field naming unified — Internal
rss/memmismatch resolved.
Test Suite (58 tests)
process-tree: Tree construction, orphan detection, ancestor traversal, cycle protectionpatterns: AI_TOOL_DIRS (14 dirs), aiPathRequired false positive (7 cases) + true positive (5 cases)killer: Rate limiting, warning generationscanner: ProcessTree integration, tmux orphan bug fix, aiPathRequired filter
node --test test/*.test.js # 58 pass, 0 fail, ~300msDocs
- README updated with
maxKillBatch,customAiDirsconfig options - Supported Tools table expanded
Upgrade
npx @thestackai/zclean@latestv0.2.0 — 70x Faster, Expanded AI Tool Detection
What's New
⚡ 70x Faster Scanning
- In-memory
ProcessTreereplaces per-processexecSynccalls - Single
pscall builds complete process tree — all checks via O(1) memory lookup - 4 seconds → 57ms for 100 processes
🎯 Expanded AI Tool Detection
- New patterns:
claude --session-id,codex-sandbox,aider,gemini-cli - AI tool directory detection framework (
AI_TOOL_DIRS) for future tool support - User-extensible via
config.customAiDirs
🛡️ Zero False Positives
- Generic patterns (
tsx,npx,vite,esbuild,webpack,next dev) now require AI tool path context tsx watch server.ts→ ignored (not AI-related)tsx .claude/mcp-server/index.ts→ detected (AI-related orphan)
🐛 Bug Fixes
- tmux orphan detection: Orphaned processes (PPID=1) are no longer skipped by the tmux/screen check
- CPU spin wait removed: Sleep-based wait replaces 100% CPU busy-loops during kill
- Kill rate limiting:
maxKillBatch(default 20) prevents killing too many processes at once
📦 Installer Improvements
- macOS launchd plist uses absolute binary path (no more
npxfailures) - NVM node bin path auto-detected for launchd environment
Upgrade
npx @thestackai/zclean@latest