Best use case
ralph-abort is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
It is a strong fit for teams already working in Codex.
Abort a running agent loop and optionally revert changes
Teams using ralph-abort should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ralph-abort/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ralph-abort Compares
| Feature / Agent | ralph-abort | Standard Approach |
|---|---|---|
| Platform Support | Codex | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Abort a running agent loop and optionally revert changes
Which AI agents support this skill?
This skill is designed for Codex.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# Al Abort
Abort a running or paused agent loop.
## 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/ralph/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 contextRelated Skills
ralph-status
Check status of current or previous agent loop
ralph-resume
Resume an interrupted agent loop from last checkpoint
ralph-reflect
View and manage agent loop reflections and episodic memory
ralph-memory
Manage Al semantic memory entries — list, query, and clear lessons learned across loop iterations
ralph-external
Crash-resilient external loop with state persistence and CI/CD integration
ralph-config
View and configure agent loop settings — show, set, reset, and apply named presets
ralph-attach
Attach to a running agent loop's live output stream
ralph-analytics
Show analytics and metrics from agent loop execution history
aiwg-orchestrate
Route structured artifact work to AIWG workflows via MCP with zero parent context cost
venv-manager
Create, manage, and validate Python virtual environments. Use for project isolation and dependency management.
pytest-runner
Execute Python tests with pytest, supporting fixtures, markers, coverage, and parallel execution. Use for Python test automation.
vitest-runner
Execute JavaScript/TypeScript tests with Vitest, supporting coverage, watch mode, and parallel execution. Use for JS/TS test automation.