Files
claudetools/docs/archives/zombie-process-debugging/check_zombie_processes.ps1
Mike Swanson 06f7617718 feat: Major directory reorganization and cleanup
Reorganized project structure for better maintainability and reduced
disk usage by 95.9% (11 GB -> 451 MB).

Directory Reorganization (85% reduction in root files):
- Created docs/ with subdirectories (deployment, testing, database, etc.)
- Created infrastructure/vpn-configs/ for VPN scripts
- Moved 90+ files from root to organized locations
- Archived obsolete documentation (context system, offline mode, zombie debugging)
- Moved all test files to tests/ directory
- Root directory: 119 files -> 18 files

Disk Cleanup (10.55 GB recovered):
- Deleted Rust build artifacts: 9.6 GB (target/ directories)
- Deleted Python virtual environments: 161 MB (venv/ directories)
- Deleted Python cache: 50 KB (__pycache__/)

New Structure:
- docs/ - All documentation organized by category
- docs/archives/ - Obsolete but preserved documentation
- infrastructure/ - VPN configs and SSH setup
- tests/ - All test files consolidated
- logs/ - Ready for future logs

Benefits:
- Cleaner root directory (18 vs 119 files)
- Logical organization of documentation
- 95.9% disk space reduction
- Faster navigation and discovery
- Better portability (build artifacts excluded)

Build artifacts can be regenerated:
- Rust: cargo build --release (5-15 min per project)
- Python: pip install -r requirements.txt (2-3 min)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-18 20:42:28 -07:00

29 lines
1.3 KiB
PowerShell

# Check for zombie/orphaned processes during Claude Code sessions
# This script identifies processes that may be consuming memory
Write-Host "[INFO] Checking for zombie processes..."
Write-Host ""
# Check for Python processes
$pythonProcs = Get-Process | Where-Object {$_.ProcessName -like '*python*'}
Write-Host "[PYTHON] Found $($pythonProcs.Count) Python processes"
if ($pythonProcs.Count -gt 0) {
$pythonProcs | Select-Object ProcessName, Id, @{Name='MemoryMB';Expression={[math]::Round($_.WorkingSet64/1MB,2)}}, StartTime | Format-Table -AutoSize
}
# Check for Node processes
$nodeProcs = Get-Process | Where-Object {$_.ProcessName -like '*node*'}
Write-Host "[NODE] Found $($nodeProcs.Count) Node processes"
if ($nodeProcs.Count -gt 0) {
$nodeProcs | Select-Object ProcessName, Id, @{Name='MemoryMB';Expression={[math]::Round($_.WorkingSet64/1MB,2)}}, StartTime | Format-Table -AutoSize
}
# Check for agent-related processes (background tasks)
$backgroundProcs = Get-Process | Where-Object {$_.CommandLine -like '*agent*' -or $_.CommandLine -like '*Task*'}
Write-Host "[BACKGROUND] Checking for agent/task processes..."
# Total memory summary
$totalMem = (Get-Process | Measure-Object WorkingSet64 -Sum).Sum
Write-Host ""
Write-Host "[SUMMARY] Total system memory in use: $([math]::Round($totalMem/1GB,2)) GB"