# Feature: Plan Todos Iteration (Phase 3)

**Gated by `prefs.global.planTodos.enabled`** (default: `false`). When enabled and Phase 2 Step 4.5 emitted a `plan.todos[]` (conforming to `$HOME/.claude/schemas/plan-todos.schema.json`), Phase 3 iterates with the helper instead of walking `tasks[]` directly:

```bash
while next=$(bash "$HOME/.claude/lib/plan-todos.sh" next "$TASK_ID"); [ -n "$next" ]; do
  id=$(printf '%s' "$next" | cut -f1)
  task=$(printf '%s' "$next" | cut -f2)
  bash "$HOME/.claude/lib/plan-todos.sh" start "$TASK_ID" "$id"
  # ... TDD cycle for "$task" ...
  if build_passed; then
    bash "$HOME/.claude/lib/plan-todos.sh" complete "$TASK_ID" "$id" "${COMMIT_HASH} · tests:${TEST_COUNT}"
  else
    bash "$HOME/.claude/lib/plan-todos.sh" fail "$TASK_ID" "$id" "build failed after 3 retries"
    break
  fi
done
```

When disabled, the loop still walks `tasks[]` from `planning-output`  -  `plan-todos.sh` adds visibility (status, notes, deps-respecting `next`) but the underlying TDD contract is unchanged.
