Auto Mode
Fully autonomous development. Works through all tasks without stopping until complete.
Entry Flow
code
auto ├─ Check prd.json exists? │ ├─ No → Bootstrap from context │ └─ Yes → Check pending tasks │ ├─ None pending → All done! │ └─ Has pending → Execute tasks │ └─ Execute until done or interrupted
CRITICAL: NEVER STOP
FORBIDDEN:
- •NEVER use
AskUserQuestion- make decisions yourself - •NEVER ask "Should I continue?"
- •NEVER show summaries and wait
- •NEVER say "Let me know..."
- •NEVER output minimal responses (
.,—,Idle.)
REQUIRED:
- •Make autonomous decisions
- •Log decisions to
.claude/decisions.md - •Keep working until truly done
Bootstrap (No prd.json)
When prd.json doesn't exist:
- •Read CLAUDE.md, README.md, package.json for context
- •Generate 5-10 starter tasks based on project
- •Create prd.json with stories
- •Continue immediately - don't stop for approval
Pre-flight (Quick)
Before first task:
bash
git status --short # Warn if dirty, continue anyway npm run build 2>&1 | tail -5 # Fail if broken, fix first
Skip if takes >10 seconds.
Task Execution
Find Next Task
javascript
// Find executable tasks (not done, not blocked)
const executable = stories.filter(s =>
s.passes !== true &&
(s.blockedBy || []).every(dep =>
stories.find(d => d.id === dep)?.passes === true
)
);
Execute Each Task
- •Read the task description
- •Implement the solution
- •
npm run typecheck- Fix if fails - •
npm run build- Fix if fails - •Verify (see below)
- •Update prd.json:
passes: true - •IMMEDIATELY start next task
Verification
| Task Type | Verification |
|---|---|
| UX/UI | agent-browser visual check |
| Feature | Build passes |
| API | Endpoint returns expected data |
| Bug fix | Reproduce → verify fixed |
For UX tasks - browser check required:
bash
agent-browser open http://localhost:3000/path agent-browser snapshot -i # Verify expected element
Parallel Execution (Optional)
For independent tasks, launch multiple agents:
code
Task({ subagent_type: "general-purpose", prompt: "...", run_in_background: true })
Task({ subagent_type: "general-purpose", prompt: "...", run_in_background: true })
Smart Retry
On failure:
- •Log to
.claude/mistakes.md - •Retry 1: Different approach
- •Retry 2: Simplest implementation
- •Still fails →
passes: false, continue to next
Commit Cadence
- •Commit every 3 completed tasks
- •Or after major milestones
- •Use conventional commits:
feat|fix|refactor
Auto-Checkpoint (Token Protection)
After every 3 completed tasks, save checkpoint and recommend /compact:
code
if (completedThisSession % 3 === 0) {
Write checkpoint to .claude/checkpoint.md
Output:
"💾 Checkpoint saved. Run /compact to reclaim ~40% tokens.
Use /clear only at major transitions (~70% but wipes context)."
}
Be concise. Long responses burn tokens. Short responses = more runway.
Completion
When stories.every(s => s.passes === true):
code
All [N] tasks complete. Summary: - [X] features implemented - [X] bugs fixed - [X] improvements made Run `status` to see full results.
IDLE Detection
If no tasks to work on:
- •Check: Are ALL stories
passes: true?- •YES → Output completion summary
- •NO → Find blocked tasks and resolve blockers
Quick Reference
| Situation | Action |
|---|---|
| No prd.json | Bootstrap from context |
| All done | Output completion summary |
| Build broken | Fix first |
| Task fails | Retry 2x, then skip |
| UX task | Browser verify required |
| Blocked task | Skip, work on unblocked |