Running Claude Code Overnight
Do these before walking away. Total: ~2 minutes.
Before You Leave
Git
1 Commit or stash all changes git stash 10s
2 Create a feature branch git checkout -b auto/overnight 5s
Safety Hooks
3 Install safety hooks npx cc-safe-setup --shield 30s
4 Verify they work npx cc-safe-setup --doctor 10s
5 Test a block npx cc-safe-setup --simulate "rm -rf /" 5s
CLAUDE.md
6 Add autonomy rules: "Don't ask questions. Decide and act."
7 Define scope: "Only modify files in src/ and tests/"
8 Set goal: "Complete all items in tasks/todo.md"
Task Queue
9 Write tasks in a file Claude can read (todo.md, tasks.yaml)
10 Order by priority — Claude works top to bottom
When You Return
Check
11 git log --oneline -20 — what did it do?
12 git diff main..auto/overnight --stat — how much changed?
13 Run your test suite — does everything pass?
14 Review the diff before merging to main
If Something Went Wrong
Recovery
→ Session stuck? npx cc-safe-setup --safe-mode
→ Bad code? git checkout main (branch keeps your work safe)
→ Hook broke? npx cc-safe-setup --validate
→ Context lost? Check .claude/session-state.md