Execute beads iteratively until all tasks complete
Executes prioritized beads iteratively with step-mode control until all tasks complete.
/plugin marketplace add GantisStorm/essentials-claude-code/plugin install essentials@essentials-claude-code[--step|--auto] [--label <label>] [--max-iterations N]Execute beads iteratively until all ready tasks are complete. This is Stage 5 of the 5-stage workflow.
IMPORTANT: This command runs in step mode by default, pausing after each bead for human control. Use --auto to skip pauses.
Beads loop provides iterative execution of self-contained tasks with built-in progress tracking and human oversight:
bd ready priority order to handle dependencies correctlyThis command is the final stage after:
/plan-creator, /bug-plan-creator, or /code-quality-plan-creator - Create architectural plan/proposal-creator - Create OpenSpec proposal/beads-creator - Convert spec to self-contained beads/beads-loop - Execute beads iterativelyThe command accepts the following flags:
--step: Run in step mode (default) - pauses after each bead for confirmation--auto: Run in auto mode - skips pauses but still follows priority order--label <label>: Filter beads by label (e.g., --label openspec:my-change)--max-iterations N: Maximum number of beads to execute before stoppingYou are now in beads loop mode. Execute all ready beads until complete.
"${CLAUDE_PLUGIN_ROOT}/scripts/setup-beads-loop.sh" $ARGUMENTS
bd ready
Shows tasks with no blockers, sorted by priority.
Select the highest priority ready task. Note its ID.
bd show <id>
The task description should be self-contained with requirements, acceptance criteria, and files to modify.
bd update <id> --status in_progress
Follow the task description:
bd close <id> --reason "Done: <brief summary>"
IMPORTANT: If working on an OpenSpec change (label starts with openspec:):
Edit openspec/changes/<name>/tasks.md to mark that task complete:
# Before
- [ ] Task description here
# After
- [x] Task description here
Continue until bd ready returns no tasks.
When no ready tasks remain, say: "All beads complete"
Then archive the OpenSpec change if applicable:
openspec archive <change-name>
Step mode pauses after each bead for human control. This prevents context compaction and quality degradation on large task sets.
After completing each bead, you MUST:
bd ready to get updated task list with prioritiesBefore pausing, output execution status:
===============================================================
BEAD COMPLETED: <bead-id>
===============================================================
Progress: N/M beads complete
EXECUTION ORDER (remaining):
Next → <bead-id>: <title> (P0)
Then → <bead-id>: <title> (P0)
Then → <bead-id>: <title> (P1, blocked until P0 done)
===============================================================
Then use AskUserQuestion:
The options MUST include:
Example with 2 ready beads:
Use AskUserQuestion with:
- question: "Bead complete. Next: my-bead-id-1 (Create user auth). Continue?"
- header: "Next step"
- options:
- label: "Continue (Recommended)"
description: "Proceed to my-bead-id-1: Create user authentication module"
- label: "Stop"
description: "End the beads loop here"
- label: "my-bead-id-2"
description: "Skip to: Add validation middleware"
Based on the response:
bd ready priority)Auto mode (--auto flag): Skips pauses but still follows bd ready priority order.
If you lose track:
bd ready # See what's next
bd list --status in_progress # Find current work
bd show <id> # Full task details
For brownfield development, beads should run in stealth mode to avoid committing tracking files:
bd init --stealth # First time only - adds .beads/ to .gitignore
Stealth mode keeps all beads functionality but doesn't pollute the repo.
| Scenario | Action |
|---|---|
| No ready tasks found | Check if all tasks are complete or blocked; run bd list to see status |
| Lost track of current work | Run bd list --status in_progress to find in-progress tasks |
| Task has unmet dependencies | Task won't appear in bd ready; complete blocking tasks first |
| Max iterations reached | Loop stops automatically; resume with /beads-loop to continue |
| Context compaction needed | Use step mode to pause after each bead; reduces context buildup |
/cancel-beads to stop early# Run in default step mode (pauses after each bead)
/beads-loop
# Run in auto mode (no pauses)
/beads-loop --auto
# Run only beads with a specific label
/beads-loop --label openspec:add-auth
# Limit to 5 iterations
/beads-loop --max-iterations 5
# Combine flags
/beads-loop --auto --label openspec:refactor --max-iterations 10