DOCS · REFERENCE · COMMANDS · BUILD

cancel-loop/synthex:cancel-loop

Build

Cancel a loop by id, or every running loop with --all. Idempotent.

Invocation

Run from inside Claude Code in any project where Synthex is installed:

/synthex:cancel-loop

Some commands accept parameters; see the source-of-truth file linked below for the full parameter list and workflow.

Lifecycle phase

Build. Parallel-executed, peer-reviewed task delivery.

Source

The command's parameters, workflow, and sub-agent invocations are defined in markdown at bluminal/lumenai/blob/main/plugins/synthex/commands/cancel-loop.md.

Last modified:

What it does, end-to-end

cancel-loop/synthex:cancel-loop marks a running loop as cancelled. The cancel is polled at the iteration boundary by the looping command — a loop that's mid-iteration when you cancel it will finish that iteration's work, then exit cleanly on the next boundary check. Worst case: one iteration of latency before the loop stops.

The mutation is atomic: tmp file + mv -f rename, so concurrent reads from

list-loops/synthex:list-loops or another session's iteration boundary never see a half-written state.

The command is idempotent. Cancelling an already-cancelled (or completed, or max-iterations-reached, or crashed) loop is a no-op with a single confirmation line — never an error.

Parameters

ParameterDescriptionDefaultRequired
loop_idPositional. The loop-id slug to cancel.—Required unless --all
--allCancel every running loop in the project. Mutually exclusive with loop_id.off—

Examples

Cancel a single loop

/synthex:cancel-loop release-1
# → Cancelled loop "release-1" (was at iteration 12/30).

Cancel a loop you've already cancelled (idempotent)

/synthex:cancel-loop release-1
# → Loop "release-1" is already cancelled — nothing to do.

Cancel everything running in this project

/synthex:cancel-loop --all
# → Cancelled (3):
#     release-1                       was at iter 12/30
#     review-check-7e1d               was at iter 4/10
#     write-implementation-plan-4c66  was at iter 6/15

If nothing is running:

/synthex:cancel-loop --all
# → No running loops to cancel.

Refusal paths

  • Neither loop_id nor --all supplied. Prints Usage: /synthex:cancel-loop <loop-id> | --all and exits non-zero.
  • Both loop_id and --all supplied. Mutually exclusive; pick one.
  • loop_id doesn't match an existing state file. Names the slug and suggests list-loops/synthex:list-loops.

If .synthex/loops/ doesn't exist at all (no loop has ever run in this project), the command prints No loops in this project. and exits 0 — not a refusal.

Cancellation timing

--loop-bearing commands check the state file's status at every iteration boundary, in the same script call that advances the counter (see the iteration loop spec). The cancel takes effect on that next read. A loop sitting in an idle wait notices the cancel too and stops waiting. Cancellation never interrupts an iteration that is currently executing — the worst-case latency is one iteration's worth of work before the loop exits.

cancel-loop/synthex:cancel-loop only changes the loop's status. Whatever the current iteration was doing finishes and cleans up the way it normally would.

What it does not do

  • Delete the state file. Terminal-status state files are archived later by any loop command that touches .synthex/loops/. The cancel leaves the file in place so you can read the iteration history (started_at, iteration, exit_reason) until then.
  • Touch loops in .archive/. Archived loops are historical and immutable.
  • Prompt the user. No AskUserQuestion — single deterministic mutation + confirmation line.

See also

  • Native looping — the full framework explainer.
  • loop/synthex:loop — start or resume a loop.
  • list-loops/synthex:list-loops — enumerate loops in the project.