recoverlisted
Install: claude install-skill buildproven/claude-kit
# Recovery Skill
Systematic recovery from crashes, broken state, and lost context.
## Live State (auto-injected)
- Git status: !`git status --short 2>/dev/null || echo "not a git repo"`
- Git locks: !`ls -la .git/*.lock 2>/dev/null || echo "no locks"`
- Incomplete ops: !`ls .git/rebase-merge .git/rebase-apply .git/MERGE_HEAD 2>/dev/null || echo "none"`
- Branch: !`git branch --show-current 2>/dev/null || echo "unknown"`
## When This Activates
- Claude Code crashed or won't start
- Lost context mid-task
- Broken or inconsistent state
- Hung or frozen process
- Stale lock files
- Incomplete git operations (rebase, merge, cherry-pick)
## Immediate Diagnostics
The live state above covers the basics. Run these for deeper assessment:
```bash
# Check for stale git locks
ls -la .git/*.lock 2>/dev/null
# Check for incomplete git operations
git status
ls .git/rebase-merge .git/rebase-apply .git/MERGE_HEAD 2>/dev/null
# Check for orphaned processes
ps aux | grep -E '(claude|node|esbuild|next|vite)' | grep -v grep
# Check system resources
vm_stat | head -5 # Memory pressure (macOS)
sysctl vm.swapusage # Swap usage (macOS)
df -h . # Disk space
```
## Recovery Procedures
### 1. Git Lock Cleanup
```bash
# Remove stale lock (only if no git process running)
rm -f .git/index.lock
rm -f .git/shallow.lock
rm -f .git/config.lock
```
### 2. Abort Incomplete Git Operations
```bash
# Incomplete rebase
git rebase --abort
# Incomplete merge
git merge --abo