cancel
What it does
This skill ends running automated modes in oh-my-claudecode and cleans up their leftover state. It is for people who want to stop a background mode or reset it after it is done.
When to use it
- ✓When you want to stop an automated mode, such as autopilot or ralph, that is still running.
- ✓When an automated mode has finished and its saved state needs to be cleaned up.
- ✓When you want to stop automated modes across all of your sessions.
Skill link
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/cancel/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Please stop the autopilot run that is still going and clean up its state.”
5 new skills a week. 1 minute to read.
How it works
The agent detects which mode is active and cancels it in the current session. It reaches other sessions only when you explicitly ask for all of them, and it respects locks so it does not interfere with work in progress.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Cancel Skill
Intelligent cancellation that detects and cancels the active OMC mode.
The cancel skill is the standard way to complete and exit any OMC mode.
When the stop hook detects completion, it instructs the LLM to invoke this
skill for state cleanup. Retry a failed operation in the same scope and report
what remains; --force changes shutdown urgency, never scope, lock handling,
or ownership checks. --all is the only cross-session authorization.
Cancellation Contract
The flags control independent scope and shutdown dimensions:
| Invocation | Scope | Shutdown behavior |
|---|---|---|
| no flags | Current session only | Graceful cancellation, including teammate shutdown waits |
--force |
Current session only | Forced cancellation: skip graceful waits, but still use protected state tools and honor locks/ownership |
--all |
Every known session, by explicit session id | Normal safe cancellation independently for each session, then explicit legacy/global cleanup |
--force --all |
Every known session, by explicit session id | Forced-all: skip graceful waits for each session, then perform the authorized legacy/global cleanup |
Resolve the current identity from OMC_SESSION_ID in CLI contexts or the
hook-provided session_id. A missing or ambiguous identity for no flags or
--force fails closed: do not aggregate state, choose a discovered session,
or issue an unscoped cleanup. This is a fail-closed error for the default
command and for --force. --all may enumerate known sessions, but every
concrete id is still read, cancelled, and cleared independently.
What It Does
Automatically detects and cancels active modes:
- Autopilot: Stops the workflow while preserving progress for resume.
- Ralph: Stops the persistence loop.
- Legacy Ultrawork / UltraQA: Removes stale upgraded-installation state only; neither is a live workflow.
- Ultragoal: Clears its session runtime guard while preserving durable
.omc/ultragoal/plan and ledger artifacts. - Swarm: Stops coordinated agents and releases claimed tasks only in its authorized shared cleanup path.
- Ultrapilot / Pipeline: Stops their worker or sequential execution.
- Team: Uses the active team surface for graceful shutdown, then clears
session-scoped Team state; forced paths skip waits. Claude Code 2.1.178+ has
no
TeamDelete. - Team + Ralph: Team is cancelled first, then linked Ralph is cleared in the same session; a Team failure retains linked Ralph.
- OMC Teams, Plan Consensus, and Self-Improve: Use their mode-specific protected cleanup and preserve artifacts designated for resume.
Usage
/oh-my-claudecode:cancel
/oh-my-claudecode:cancel --force
/oh-my-claudecode:cancel --all
/oh-my-claudecode:cancel --force --all
Or say: cancelomc, stopomc.
Critical: Deferred Tool Handling
The state tools (state_clear, state_read, state_write,
state_list_active, state_get_status) may be deferred by Claude Code. Before
calling any of them, load all of them with ToolSearch:
ToolSearch(query="select:mcp__plugin_oh-my-claudecode_t__state_clear,mcp__plugin_oh-my-claudecode_t__state_read,mcp__plugin_oh-my-claudecode_t__state_write,mcp__plugin_oh-my-claudecode_t__state_list_active,mcp__plugin_oh-my-claudecode_t__state_get_status")
If state_clear is unavailable or fails, retry the same scoped operation and
report the failure. The fallback below is only an emergency escape from a
stop-hook loop for a non-force, non-Team cancellation. It removes files only
for an explicitly identified current session. Do NOT use this fallback for
autopilot, team, or omc-teams, or for --force/--all; never use it to
bypass a lock, ownership check, corruption, or another state-tool failure.
Linked modes need one protected operation per mode.
Replace MODE with the specific mode (for example ralplan, ralph,
ultrawork, or ultragoal).
# Emergency fallback: direct file removal for one identified session only.
SESSION_ID="${OMC_SESSION_ID:-${CLAUDE_SESSION_ID:-${CLAUDECODE_SESSION_ID:-}}}"
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || { d="$PWD"; while [ "$d" != "/" ] && [ ! -d "$d/.omc" ]; do d="$(dirname "$d")"; done; echo "$d"; })"
sha256portable() { printf '%s' "$1" | (sha256sum 2>/dev/null || shasum -a 256) | cut -c1-16; }
if [ -n "${OMC_STATE_DIR:-}" ]; then
SOURCE="$(git remote get-url origin 2>/dev/null || echo "$REPO_ROOT")"
HA
FAQ
What does the force option do?
It skips the graceful wait during shutdown, but it still respects locks and ownership checks.
Will it cancel every session by default?
No. By default it works only on the current session, and cancelling all sessions needs an explicit request.
Is this needed after every run?
It is the standard way to finish and exit an automated mode, so it is used to close one out cleanly.
Details
Original description by the author
Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state
Popularity
- GitHub stars
- 41k
- Ranking position
- #6996
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
agent-doc-discipline
41kTeaches your agent to write instructions that other AI agents can follow on their own, with rules that can be checked and a clear reason behind each.
ai-slop-cleaner
41kHelps your agent tidy up AI-written code that works but is bloated or repetitive, removing extra code without changing what it does.
architecture-survey
41kHelps your agent review a codebase's structure and list the parts that are getting hard to change, with evidence, without changing anything itself.
ask-navigator
41kHelps your agent turn a fuzzy project into a map of clear decision questions, then work through them one at a time until the path is clear.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.