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>
This commit is contained in:
2026-01-18 20:42:28 -07:00
parent 89e5118306
commit 06f7617718
96 changed files with 54 additions and 2639 deletions

View File

@@ -0,0 +1,93 @@
# Post-Reboot Testing Instructions
## What Was Fixed
**Commit:** 359c2cf - Fix zombie process accumulation and broken context recall
**5 Critical Fixes:**
1. Reduced periodic save from 1min to 5min (80% reduction)
2. Added timeout=5 to all subprocess calls (prevents hangs)
3. Removed background spawning (&) from hooks (eliminates orphans)
4. Added mutex lock to prevent overlapping executions
5. **CRITICAL:** Added UTF-8 encoding to log functions (enables context saves)
**Expected Results:**
- Before: 1,010 processes/hour, 3-7 GB RAM/hour
- After: ~151 processes/hour (85% reduction)
- Context recall: NOW WORKING (was completely broken)
---
## Testing Commands
### Step 1: Capture Baseline (Immediately After Reboot)
```powershell
cd D:\ClaudeTools
powershell -ExecutionPolicy Bypass -File monitor_zombies.ps1
```
**Note the TOTAL process count** - this is your baseline.
---
### Step 2: Work Normally for 30 Minutes
Just use Claude Code normally. The periodic save will run in the background every 5 minutes.
---
### Step 3: Check Results After 30 Minutes
```powershell
cd D:\ClaudeTools
powershell -ExecutionPolicy Bypass -File monitor_zombies.ps1
```
**Compare TOTAL counts:**
- Old behavior: ~505 new processes in 30min
- Fixed behavior: ~75 new processes in 30min (should see this)
---
### Step 4: Verify Context Saves Are Working
```powershell
Get-Content D:\ClaudeTools\.claude\periodic-save.log -Tail 20
```
**What to look for:**
- [OK] Context saved successfully (ID: ...)
- NO encoding errors (no "charmap" errors)
---
### Step 5: Test Context Recall on Restart
1. Close Claude Code window
2. Reopen Claude Code in ClaudeTools directory
3. Check if context is automatically injected at the start
**Expected:** You should see a "Previous Context" section automatically appear without needing to ask for it.
---
## Quick Reference
**Monitoring Script:** `monitor_zombies.ps1`
**Periodic Save Log:** `.claude\periodic-save.log`
**Results Log:** `zombie_test_results.txt` (created by monitor script)
**Project ID:** 3c1bb5549a84735e551afb332ce04947
---
## Success Criteria
✅ Process count increase <100 in 30 minutes (vs. ~505 before)
✅ No encoding errors in periodic-save.log
✅ Context auto-injected on Claude Code restart
✅ Memory usage stable (not growing rapidly)
---
**DELETE THIS FILE after successful testing**