agent-doc-discipline
Writing-time discipline for documents agents consume (the five surfaces, specs, tickets, .omc/skills/) — every rule checkable and…
Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state
Claude Code
$ npx -y skills add Yeachan-Heo/oh-my-claudecode --skill cancel --agent claude-code
Codex
$ npx skills add Yeachan-Heo/oh-my-claudecode --skill cancel -a codex -y
Cursor
$ npx skills add Yeachan-Heo/oh-my-claudecode --skill cancel -a cursor -y
Gemini CLI
$ npx skills add Yeachan-Heo/oh-my-claudecode --skill cancel -a gemini-cli -y
GitHub Copilot
$ npx skills add Yeachan-Heo/oh-my-claudecode --skill cancel -a github-copilot -y
OpenCode
$ npx skills add Yeachan-Heo/oh-my-claudecode --skill cancel -a opencode -y
Windsurf
$ npx skills add Yeachan-Heo/oh-my-claudecode --skill cancel -a windsurf -y
name: cancel aliases: [cancel-ralph] description: Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state argument-hint: "[--force] [--all]" level: 2
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.
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.
Automatically detects and cancels active modes:
neither is a live workflow.
`.omc/ultragoal/` plan and ledger artifacts.
authorized shared cleanup path.
session-scoped Team state; forced paths skip waits. Claude Code 2.1.178+ has no `TeamDelete`.
the same session; a Team failure retains linked Ralph.
protected cleanup and preserve artifacts designated for resume.
/oh-my-claudecode:cancel /oh-my-claudecode:cancel --force /oh-my-claudecode:cancel --all /oh-my-claudecode:cancel --force --all
Or say: `cancelomc`, `stopomc`.
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")"
HASH="$(sha256portable "$SOURCE")"
DIR_NAME="$(basename "$REPO_ROOT" | sed 's/[^a-zA-Z0-9_-]/_/g')"
OMC_STATE="$OMC_STATE_DIR/${DIR_NAME}-${HASH}/state"
elif [ "$REPO_ROOT" != "/" ] && [ -d "$REPO_ROOT/.omc" ]; then
OMC_STATE="$REPO_ROOT/.omc/state"
else
echo "ERROR: Could not locate .omc state directory" >&2; exit 1
fi
[ -d "$OMC_STATE" ] || { echo "ERROR: State dir not found at $OMC_STATE" >&2; exit 1; }
MODE="ralplan" # replace with the target mode
[ -n "$SESSION_ID" ] || { echo "ERROR: current session identity is required; refusing unscoped fallback" >&2; exit 1; }
if [ -d "$OMC_STATE/sessions/$SESSION_ID" ]; then
rm -f "$OMC_STATE/sessions/$SESSION_ID/${MODE}-state.json" \
"$OMC_STATE/sessions/$SESSION_ID/${MODE}-stop-breaker.json" \
"$OMC_STATE/sessions/$SESSION_ID/skill-active-state.json"
NOW_ISO="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
EXPIRES_ISO="$(date -u -d "+30 seconds" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || python3 - <<'PY'
from datetime import datetime, timedelta, timezone
print((datetime.now(timezone.utc) + timedelta(seconds=30)).strftime('%Y-%m-%dT%H:%M:%SZ'))
PY
)"
printf '{"active":true,"requested_at":"%s","expires_at":"%s","mode":"%s","source":"bash_fallback"}' \
"$NOW_ISO" "$EXPIRES_ISO" "$MODE" > "$OMC_STATE/seFor Codex users: Check out oh-my-codex — the same orchestration experience for OpenAI Codex CLI. Liked OmC but found it a bit overkill? Try gajae-code.
Writing-time discipline for documents agents consume (the five surfaces, specs, tickets, .omc/skills/) — every rule checkable and…
Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode
Settle types and module shape before cross-boundary code — competing designs explored in parallel, compared on API surface and…
Periodic architecture survey — walks the module graph and reports ranked deepening candidates (shallow modules, hypothetical…
Run N parallel candidates at one brief and synthesize: rubric-first framing, isolated fan-out, a cross-judge on a different…
Shipyard's navigator — chart a foggy effort (destination unclear, questions not yet stateable) into a map of decision tickets on…
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
Create a new Architecture Decision Record with sequential numbering and AgentDB registration