Auto Mode
Unattended execution. specweave auto writes a session file; the plugin's Stop
hook reads it after every turn and either blocks (with what remains) or lets the
session end. There is no daemon and no background process — the loop is the hook.
Start / inspect / stop
| Intent | Command |
|---|---|
| Start on specific increments | specweave auto 0042 0043 |
| Start on whatever is active | specweave auto |
| Preview without activating | specweave auto --dry-run |
| Clear stale session state | specweave auto --reset |
| Progress of the running session | specweave auto-status [--json] |
| Stop it (emergency) | specweave cancel-auto [--force] |
How the loop actually ends
The Stop handler decides each turn, in this order (any error → the session is released, never trapped):
- No
auto-mode.json, oractive !== true→ session over. - Session file older than
auto.maxSessionAge(default 7200 s) → released. - Turn count above
auto.maxTurns(default 20) → safety stop. stop_hook_activeand no progress for 3 consecutive turns → loop guard releases it.- No increment left to work on → released.
- Zero pending tasks and every AC satisfied → blocks once with
all_complete_needs_closure— that is your cue to close. - Otherwise → blocks with
<P> task(s) / <A> AC(s) remainand you keep going.
So: you never decide to keep looping. You do the next task, stop, and the hook either returns you or lets you go.
What you do inside the loop
specweave task next <id>→task claim→ implement inside the task'sFiles→ commit<id>: …→specweave task done T-NN <id> --run "<Test>". Same loop assw:do.- Test fails → fix it in the next turn. Never mark a task done without a passing run.
- Genuinely blocked (missing secret, ambiguous spec, external dependency) →
specweave task block T-NN <id> --note "<what is missing>"and stop. Blocked tasks do not count as remaining work, so the loop ends instead of thrashing. - On
all_complete_needs_closure:specweave verify <id>, thensw:done <id>.
Rules
- Never edit
.specweave/state/auto-mode.jsonor.stop-auto-turnsby hand.specweave auto --resetis the supported way to clear them. - Do not start auto mode on an increment whose spec has open questions — resolve them first.
- Auto mode does not lower the bar: same claim-before-edit, same evidence for
task done. - If the hook is not installed (plugin not loaded),
specweave autostill writes the session but nothing feeds you back — say so rather than pretending to loop. - One auto session per project. Check
specweave auto-statusbefore starting another.
Resources
specweave auto --help,specweave auto-status --help- Official Documentation