Agent skill
cancel
Cancel active Loop. Use when loop needs to stop early, done iterating manually, want to abort, or change direction. Triggers on "cancel loop", "stop iterating", "end loop", "terminate loop", "abort loop", "kill loop", "stop the loop", "halt". Graceful termination that preserves completed work.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/cancel
SKILL.md
Cancel Loop
Gracefully terminate an active loop while preserving all completed work.
When to Use
| Situation | Action |
|---|---|
| Need to change direction | Cancel, then start new loop with updated spec |
| Spec was wrong | Cancel, clarify with /hope:intent, restart |
| Good enough | Cancel when partial progress is sufficient |
| Taking too long | Cancel to review approach before continuing |
| Emergency stop | Cancel immediately halts next iteration |
Cancel vs Natural Completion
- Natural completion: Loop satisfied spec, clean exit with success summary
- Cancel: User-initiated stop, preserves progress, enables restart
Cancel when you want control back. Let it complete when spec is being satisfied.
What Happens
- Read state — Load
.loop/state.json - Set status — Update status to
"cancelled"in state file - Find active task — TaskList for in_progress task (subject starts with "Loop:")
- Mark terminated — TaskUpdate status=completed with cancellation note
- Report state — Iterations, cost, accomplished work, remaining items
Current iteration completes before cancel takes effect. No mid-operation interruption.
State File Update (Required)
Update .loop/state.json:
{
"status": "cancelled",
"exit_signal": false
}
This ensures the stop hook allows the cancellation to proceed.
Output
Loop cancelled.
Completed: [N] iterations, $[X] cost
Accomplished:
- [list of completed steps]
Remaining:
- [list of incomplete steps]
Criteria status:
- [criterion 1]: ✓/✗
- [criterion 2]: ✓/✗
To restart: /loop [spec]
Guarantees
- All completed work preserved (no rollback)
- State file updated to prevent resume
- Clean termination (no dangling state)
- Full accounting (iterations, cost, progress)
- Restart possible with same or modified spec
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?