Skip to content

Releases: TheStack-ai/zclean

v0.2.2 — Doctor & Cumulative Stats

31 Mar 01:08

Choose a tag to compare

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@latest

v0.2.1 — Stability & Tests

31 Mar 00:45

Choose a tag to compare

Stability Fixes

  • node-ai-path pattern tightened — No longer flags every node process in AI directories. Now requires /mcp/, /agent/, or /server/ in the path.
  • Batch limit warning visible — When maxKillBatch is exceeded, the warning is now displayed to the user.
  • Field naming unified — Internal rss/mem mismatch resolved.

Test Suite (58 tests)

  • process-tree: Tree construction, orphan detection, ancestor traversal, cycle protection
  • patterns: AI_TOOL_DIRS (14 dirs), aiPathRequired false positive (7 cases) + true positive (5 cases)
  • killer: Rate limiting, warning generation
  • scanner: ProcessTree integration, tmux orphan bug fix, aiPathRequired filter
node --test test/*.test.js  # 58 pass, 0 fail, ~300ms

Docs

  • README updated with maxKillBatch, customAiDirs config options
  • Supported Tools table expanded

Upgrade

npx @thestackai/zclean@latest

v0.2.0 — 70x Faster, Expanded AI Tool Detection

31 Mar 00:26

Choose a tag to compare

What's New

⚡ 70x Faster Scanning

  • In-memory ProcessTree replaces per-process execSync calls
  • Single ps call 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.tsignored (not AI-related)
  • tsx .claude/mcp-server/index.tsdetected (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 npx failures)
  • NVM node bin path auto-detected for launchd environment

Upgrade

npx @thestackai/zclean@latest

Full Changelog

v0.1.0...v0.2.0