Skip to content
Development
Skill

/ralph-abort

Abort a running agent loop and optionally revert changes

From plugin
aiwg
229200 skills199 agents26 commands

Claude Code

$ npx -y skills add jmagly/aiwg --skill ralph-abort --agent claude-code

SKILL.md

ralph-abort.SKILL.md
namespace: aiwg
name: ralph-abort
platforms: [all]
description: Abort a running agent loop and optionally revert changes
commandHint:
  argumentHint: '[--keep-changes] [--revert] [--force --interactive --guidance "text"]'
  allowedTools: "Read, Write, Bash"
  model: haiku
  category: automation
  modelRole: efficiency
  modelTier: economy

Al Abort

Abort a running or paused agent loop.

HITL authorization checkpoints

Before any confirmation below, read and apply [agent-loop authorization checkpoints](../../docs/hitl-authorization.md). Call `aiwg config authorization check --action-file "$ACTION_FILE" --target "$TARGET_REPO"` for host-classified effects. Only `auto-authorized` with a signed receipt skips that workflow prompt; retain existing prompts/refusals otherwise. Platform prompts are never bypassed. Limits, regression and threat overrides still require review.

Usage

/ralph-abort               # Abort, keep changes
/ralph-abort --revert      # Abort and revert all changes
/ralph-abort --force       # Abort even if no active loop

Parameters

--keep-changes (default)

Stop the loop but keep all file changes made during iterations.

--revert

Revert all changes made during the agent loop using git:

  • Identify commits made during loop (prefix: `ralph: iteration`)
  • Reset to commit before loop started
  • **Warning**: This discards work

--force

Abort even if state indicates no active loop (for cleanup).

Your Actions

Standard Abort

1. Read `.aiwg/ralph/current-loop.json` 2. Verify there's an active loop 3. Mark loop as aborted 4. Generate partial completion report 5. Confirm to user

**Output**:

Agent Loop: ABORTED

Task: {task}
Iterations completed: {N}
Duration: {time}

Changes have been kept. To revert:
  git reset --hard HEAD~{N}

Partial report: .aiwg/ralph/completion-{timestamp}.md

With --revert

1. Read loop state 2. Find all `ralph: iteration` commits from this loop 3. Confirm with user before reverting 4. Reset git to pre-loop state 5. Clean up state files

**Confirmation prompt**:

This will revert {N} commits:
- ralph: iteration 1 - initial attempt
- ralph: iteration 2 - fixed auth
- ralph: iteration 3 - in progress

Files to be reverted:
- src/auth.ts
- test/auth.test.ts

Type 'yes' to confirm revert:

**After revert**:

Agent Loop: ABORTED + REVERTED

Reverted {N} commits.
Working directory restored to pre-loop state.

State cleaned: .aiwg/ralph/current-loop.json archived

Error Handling

**No active loop**:

No active agent loop to abort.

Use --force to clean up stale state files if needed.

**Git not available**:

Git not available for --revert option.

Loop aborted, but changes cannot be reverted automatically.
Manual cleanup may be needed.

**Dirty working directory (for --revert)**:

Cannot revert: uncommitted changes exist.

Options:
1. Commit or stash changes first
2. Use /ralph-abort without --revert to keep current state

State Changes

After abort:

  • `current-loop.json` marked with `status: "aborted"`
  • `active: false`
  • Completion report generated with partial results
  • Loop can no longer be resumed

Related

  • `/ralph-status` - Check loop status before aborting
  • `/ralph-resume` - Continue instead of abort

References

  • @$AIWG_ROOT/agentic/code/addons/agent-loop/README.md — Ralph addon overview and loop executor documentation
  • @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/human-authorization.md — Authorization rules for irreversible actions like revert
  • @$AIWG_ROOT/docs/cli-reference.md — CLI reference for ralph-abort and related commands
  • @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/README.md — SDLC framework context
Read more
@jmagly
Ships withaiwg

Reusable project context and specialist workflows for the AI tools you already use. Plan software, coordinate specialist reviews, prepare campaigns, investigate incidents, organize research, curate media, and maintain operational knowledge.

229200 skills199 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
229
Star history of jmagly/aiwg on GitHub, a chart by star-history.com

Other skills on aiwg.

agent-loop-ext

agent-loop-ext

Crash-resilient external agent loop with state persistence and CI/CD integration

@jmagly@jmaglyInstall Skill
agent-loop

agent-loop

Detect requests for iterative autonomous agent loops and route to the appropriate loop executor

@jmagly@jmaglyInstall Skill
auto-test-execution

auto-test-execution

Automatically execute tests when code-generating agents modify source files, enforcing the execute-before-return pattern

@jmagly@jmaglyInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about ralph-abort.

Which coding agents can use ralph-abort?
ralph-abort installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.