agent-loop-ext
Crash-resilient external agent loop with state persistence and CI/CD integration
Abort a running agent loop and optionally revert changes
$ npx -y skills add jmagly/aiwg --skill ralph-abort --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/ralph-abortContext preview
The summary Claude sees to decide when to auto-load this skill.
Abort a running agent loop and optionally revert changes
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
Abort a running or paused agent loop.
/ralph-abort # Abort, keep changes /ralph-abort --revert # Abort and revert all changes /ralph-abort --force # Abort even if no active loop
Stop the loop but keep all file changes made during iterations.
Revert all changes made during the agent loop using git:
Abort even if state indicates no active loop (for cleanup).
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}.md1. 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**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
After abort:
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.
Repo: jmagly/aiwg
Crash-resilient external agent loop with state persistence and CI/CD integration
Detect requests for iterative autonomous agent loops and route to the appropriate loop executor
Automatically execute tests when code-generating agents modify source files, enforcing the execute-before-return pattern
Enable agent loops to learn from similar past tasks and share patterns across loops
Query and manage the executable feedback debug memory
Execute tests on generated code and iterate until passing