cancel-task-loop

A command that stops an active loop that is repeatedly working on a coding task. The loop is a background-style workflow that retries or continues task implementation until it finishes or reaches its limit.

In plain words
What is it for?
Use it to find the current task-loop state and remove the files that keep that loop active.
Why use it?
It lets you halt an automated implementation process when it is stuck, taking the wrong approach, or no longer needed.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jsegov/shipspec-claude-code-plugin/cancel-task-loop
Clone the repo
git clone --depth 1 https://github.com/jsegov/shipspec-claude-code-plugin
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 449 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00005 $0.00449
Opus 5 $0.00003 $0.00225
Sonnet 5 $0.00001 $0.00090
Haiku 4.5 $0.00001 $0.00045

Measured 2d ago against content hash 0cdc6d7ec27a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cancel-task-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/cancel-task-loop.md · 73 lines

What it actually says

Cancel Task Loop

Cancel an active task implementation loop.

Step 1: Check for Active Loop

Check for the pointer file:

test -f .shipspec/active-loop.local.json && echo "POINTER_EXISTS" || echo "NOT_FOUND"

If NOT_FOUND:

"No active task loop found."

Stop here.

If POINTER_EXISTS: Read the pointer file and verify it's a task-loop:

jq -r '.loop_type // empty' .shipspec/active-loop.local.json

If loop_type is NOT "task-loop":

"No active task loop found. (A different loop type is active)"

Stop here.

Step 2: Read Current State

Extract the state path from the pointer:

jq -r '.state_path // empty' .shipspec/active-loop.local.json

Parse the state file (JSON) to extract:

jq -r '.task_id // empty' [state_path]
jq -r '.feature // empty' [state_path]
jq -r '.iteration // 0' [state_path]
jq -r '.max_iterations // 5' [state_path]
  • task_id - the task being implemented
  • feature - the feature name
  • iteration - current attempt number
  • max_iterations - maximum attempts configured

Step 3: Cancel the Loop

Remove both the state file and pointer:

rm -f [state_path] .shipspec/active-loop.local.json

Step 4: Report

"Cancelled task loop for [TASK_ID] in feature [FEATURE]

  • Was at iteration: [ITERATION]/[MAX_ITERATIONS]

The task remains in in_progress status in TASKS.json. Run /implement-task [feature] to resume, or use task-manager to update the task status."

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 73 lines · 5 tokens per session scan A 0cdc6d7ec27a

Subscribe to this mod's changes

cancel-task-loop is a command published in the GitHub repository jsegov/shipspec-claude-code-plugin (20 stars, last pushed 7mo ago), licensed MIT. It adds 5 tokens to every session and 449 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.