# 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**
