cancel
Skill40k starsChanged 2 months agoMITView on GitHub
Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state
6 other projects use a version of this.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- Q00/ouroborostheir own version, first seen Jul 31, 2026
- sendbird/cc-plugin-codextheir own version, first seen Jul 29, 2026
- mrzhangguoguo/oh-my-workbuddytheir own version, first seen Jul 8, 2026
- lza6/claw-code-tingfengtheir own version, first seen Apr 22, 2026
- Jkudjo/oh-my-cursortheir own version, first seen Apr 3, 2026
- AGMO-Inc/agmo-everywheretheir own version, first seen Mar 18, 2026
Who's talking about Yeachan-Heo/oh-my-claudecode
- @camilleroux.com“oh-my-claudecode : orchestration multi-agents pour Claude Code, pensée pour des équipes de workers (Codex, …”Bluesky · Apr 6, 2026 · 8 likes
- TechNickAI/ai-coding-config“Upgrade skill frontmatter for declarative composition (pipelines, handoffs, model hints)”GitHub · May 4, 2026 · 2 reactions
- TechNickAI/ai-coding-config“Add verify-deliverables SubagentStop hook to harden subagent completion claims”GitHub · May 4, 2026 · 2 reactions
- @github-trending-js.bsky.social“💎 Hidden Gem! 💎 (1000+ new stars) 📦 Yeachan-Heo / oh-my-claudecode ⭐ 17,120 (+1,785) 🗒 TypeScript …”Bluesky · Mar 31, 2026 · 2 likes
- @github-trending.bsky.social“🎉 Celebrating! 🎉 (500+ new stars) 📦 Yeachan-Heo / oh-my-claudecode ⭐ 11,966 (+576) 🗒 TypeScript …”Bluesky · Mar 27, 2026 · 2 likes
The biggest 5 of 60 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 60
Talked about on GitHub and Bluesky (60 times).
On GitHub · 50
- May 4, 2026Upgrade skill frontmatter for declarative composition (pipelines, handoffs, model hints) — TechNickAI/ai-coding-config2 reactions · 2 comments
- May 4, 2026Add verify-deliverables SubagentStop hook to harden subagent completion claims — TechNickAI/ai-coding-config2 reactions · 2 comments
- May 5, 2026[redesign-research] oh-my-claudecode first-pass survey (cycle 75 dispatch — companion to oh-my-codex per #2774) — EvaLok/schema-org-json-ld1 reaction · 3 comments
- Mar 8, 2026feat: Add OMC (oh-my-claudecode) and OMX (oh-my-codex) agent runners — junhoyeo/contrabass1 reaction · 1 comment
- Feb 6, 2026fix(ai-dev): use Claude Code plugin system for oh-my-claudecode — danstis/coder-templates1 reaction
45 more on GitHub
- Nov 23, 2026🤖 [auto] 죽은 링크 3개 제거 (2026-11-23) — J-nowcow/awesome-korean-agent-skills0 reactions
- Nov 20, 2026Find quick wins from other multi-agent setups that cut friction — roykollensvendsen/claude-voice0 reactions
- Nov 20, 2026Start workers on demand and let them exit when their task is done — roykollensvendsen/claude-voice0 reactions
- Nov 19, 2026🤖 [auto] 죽은 링크 2개 제거 (2026-11-19) — J-nowcow/awesome-korean-agent-skills0 reactions
- Nov 11, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.8.5 → 5.8.6 — sudosubin/agents.nix0 reactions
- Nov 11, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.8.4 → 5.8.6 — sudosubin/agents.nix0 reactions
- Nov 11, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.8.4 → 5.8.6 — sudosubin/agents.nix0 reactions
- Nov 11, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.8.4 → 5.8.5 — sudosubin/agents.nix0 reactions
- Nov 10, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.8.3 → 5.8.4 — sudosubin/agents.nix0 reactions
- Nov 10, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.8.3 → 5.8.4 — sudosubin/agents.nix0 reactions
- Nov 10, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.8.3 → 5.8.4 — sudosubin/agents.nix0 reactions
- Nov 9, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.8.2 → 5.8.3 — sudosubin/agents.nix0 reactions
- Nov 9, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.8.1 → 5.8.3 — sudosubin/agents.nix0 reactions
- Nov 9, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.8.1 → 5.8.3 — sudosubin/agents.nix0 reactions
- Nov 9, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.8.1 → 5.8.2 — sudosubin/agents.nix0 reactions
- Nov 9, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.8.0 → 5.8.1 — sudosubin/agents.nix0 reactions
- Nov 9, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.8.0 → 5.8.1 — sudosubin/agents.nix0 reactions
- Nov 9, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.8.0 → 5.8.1 — sudosubin/agents.nix0 reactions
- Nov 8, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.7.31 → 5.8.0 — sudosubin/agents.nix0 reactions
- Nov 8, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.31 → 5.8.0 — sudosubin/agents.nix0 reactions
- Nov 8, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.7.31 → 5.8.0 — sudosubin/agents.nix0 reactions
- Nov 4, 2026Review and adopt oh-my-claudecode patterns — cbartens/bkit0 reactions · 1 comment
- Nov 3, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.30 → 5.7.31 — sudosubin/agents.nix0 reactions
- Nov 3, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.7.30 → 5.7.31 — sudosubin/agents.nix0 reactions
- Nov 3, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.7.30 → 5.7.31 — sudosubin/agents.nix0 reactions
- Nov 2, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.7.29 → 5.7.30 — sudosubin/agents.nix0 reactions
- Nov 2, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.29 → 5.7.30 — sudosubin/agents.nix0 reactions
- Nov 2, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.7.29 → 5.7.30 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.7.26 → 5.7.29 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.27 → 5.7.29 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.26 → 5.7.27 — sudosubin/agents.nix0 reactions
- Nov 1, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.7.25 → 5.7.29 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.25 → 5.7.26 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.7.25 → 5.7.26 — sudosubin/agents.nix0 reactions
- Nov 1, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.7.24 → 5.7.25 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.24 → 5.7.25 — sudosubin/agents.nix0 reactions
- Nov 1, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.7.24 → 5.7.25 — sudosubin/agents.nix0 reactions
- Nov 1, 2026agent-skills.github.yeachan-heo.oh-my-claudecode: 5.7.23 → 5.7.24 — sudosubin/agents.nix0 reactions
- Oct 31, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.23 → 5.7.24 — sudosubin/agents.nix0 reactions
- Oct 31, 2026claude-code-plugins.github.yeachan-heo.oh-my-claudecode: 5.7.23 → 5.7.24 — sudosubin/agents.nix0 reactions
- Oct 31, 2026claude-code-marketplaces.github.yeachan-heo.oh-my-claudecode: 5.7.22 → 5.7.23 — sudosubin/agents.nix0 reactions
- Oct 16, 2026Telemetry for Claude Code marketplace plugin installs via plugin hooks — aws-solutions/konductor0 reactions
- Oct 4, 2026copycat: deletion-first cleanup stage in /etp — lucasmccomb/ccgm0 reactions
- Oct 4, 2026copycat: off/shadow/active rollout for autoheal and dreaming decisions — lucasmccomb/ccgm0 reactions
- Oct 4, 2026copycat: read-budget hook - deny unranged Read of large files — lucasmccomb/ccgm0 reactions
On Bluesky · 10
- Apr 6, 2026oh-my-claudecode : orchestration multi-agents pour Claude Code, pensée pour des équipes de workers (Codex, Gemini, Claude) qui tournent en… — @camilleroux.com8 likes and reposts · 1 reply
- Mar 31, 2026💎 Hidden Gem! 💎 (1000+ new stars) 📦 Yeachan-Heo / oh-my-claudecode ⭐ 17,120 (+1,785) 🗒 TypeScript Teams-first Multi-agent orchestration… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- Mar 27, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 Yeachan-Heo / oh-my-claudecode ⭐ 11,966 (+576) 🗒 TypeScript Teams-first Multi-agent orchestration… — @github-trending.bsky.social2 likes and reposts · 1 reply
- Oct 10, 2026📦 Yeachan-Heo / oh-my-claudecode ⭐ 39,757 (+44) 🗒 TypeScript Teams-first Multi-agent orchestration for Claude Code — @github-trending-js.bsky.social1 likes and repost
- Apr 1, 2026Claude Code使いなら「oh-my-claudecode」は絶対に入れるべき。 複数エージェントをスタックしてタスク実行できる仕組みが神すぎる。特に`/team`コマンドで「プラン→実行→検証→修正」のパイプラインを自動化できるのは、手動作業の次元が違う。… — @woody-ai-tools.bsky.social1 likes and repost
5 more on Bluesky
- Mar 29, 2026今日のGitHubトレンド Yeachan-Heo/oh-my-claudecode Claude Code向けのマルチエージェントオーケストレーションツールです。 Claude Code自体の学習は不要で、簡単に利用できます。… — @dailygithubtrends.bsky.social1 likes and repost
- Mar 28, 2026github.com/Yeachan-Heo/oh-... GitHub - Yeachan-Heo/oh-my-claudecode: Teams-first Multi-agent orchestration for Claude Code — @technews4869.bsky.social1 likes and repost
- Mar 27, 2026oh-my-claudecodeはClaude Code向けのチーム重視型マルチエージェントオーケストレーションツールらしい 複雑なコーディング作業を自動化したい開発者には便利そうかな yug1224 starred Yeachan-Heo/oh-my-claudecode… — @yug1224.com1 likes and repost
- Mar 30, 2026💎 Hidden Gem! 💎 (1000+ new stars) 📦 Yeachan-Heo / oh-my-claudecode ⭐ 16,968 (+1,785) 🗒 TypeScript Teams-first Multi-agent orchestration… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Mar 26, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 Yeachan-Heo / oh-my-claudecode ⭐ 11,966 (+576) 🗒 TypeScript Teams-first Multi-agent orchestration… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
Used with
Projects with it also use review.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillreview
Fixture review skill.
Also in 3 projects that use this
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- Q00/ouroboros★ 6.2ksame name
- sendbird/cc-plugin-codex★ 219same name
- AGMO-Inc/agmo-everywhere★ 4same name
- lza6/claw-code-tingfeng★ 4same name
- mrzhangguoguo/oh-my-workbuddy★ 2same name
- Jkudjo/oh-my-cursor★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- .github/CLAUDE.mdCLAUDE.md
- commandsSkill
- agent-doc-disciplineSkill
- ai-slop-cleanerSkill
- architecture-surveySkill
- ask-navigatorSkill
- askSkill
- autopilotSkill
- autoresearchSkill
- configure-notificationsSkill
- debugSkill
- deepinitSkill
- deep-interviewSkill
- diagramSkill
- drydockSkill
- executeSkill
- external-contextSkill
- graphSkill
- harborSkill
- hudSkill
- intentSkill
- launchSkill
- loftSkill
- mapSkill
- minimal-code-disciplineSkill
- minimal-prose-disciplineSkill
- omc-doctorSkill
- omc-setupSkill
- omc-planSkill
- project-session-managerSkill
- prSkill
- ralphSkill
- ralplanSkill
- refitSkill
- releaseSkill
- rememberSkill
- researchSkill
- omc-reviewSkill
- self-improveSkill
- skillifySkill
- skillSkill
- tddSkill
- teamSkill
- traceSkill
- ultragoalSkill
- verifySkill
- visual-verdictSkill
- wikiSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 7 are distinctive, and 11 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
When the stop hook detects completion, it instructs the LLM to invoke this skill for state cleanup.
- Distinctive: line 55
OMC Teams, Plan Consensus, and Self-Improve: Use their mode-specific protected cleanup and preserve artifacts designated for resume.
- Very specific: line 79
If state_clear is unavailable or fails, retry the same scoped operation and report the failure.
- Distinctive: line 164
Use this dependency order when several modes appear in one scoped status:
- Very specific: line 189
Read the exact session state, including workflowRunId when present.
- Very specific: line 191
If the primary write fails, stop this session's dependent cleanup.
- Very specific: line 205
Read state_read(mode="team", session_id="<session_id>") and obtain the captured team name and active worker labels.
- Very specific: line 211
After graceful confirmation/timeouts (or immediately when forced), clear state_clear(mode="team", session_id="<session_id>").
- Very specific: line 215
Only after Team clear succeeds, inspect linked Ralph and clear it with the same session id (state_read(mode="ralph", …
- Very specific: line 235
Use --dry-run to inspect without terminating workers.
- Distinctive: line 241
If cancellation starts while Ralph is linked, apply the same Team-first ordering.
- Distinctive: line 276
If all-session enumeration itself fails, returns an ambiguous id, or cannot capture a Team owner, treat the affected scope as unresolved …
- Distinctive: line 281
Use protected state tools for the explicit pass, for example:
- Very specific: line 320
Do not interpret this list as permission to remove arbitrary files under .omc/state, ~/.claude/teams, or ~/.claude/tasks.
- Very specific: line 330
If no active mode is found in the selected scope, report: “No active OMC modes detected.” For a current-session command, do not silently …
- Distinctive: line 351
Do not turn a timeout, missing identity, lock conflict, ownership mismatch, or malformed state into a success message.
- Distinctive: line 362
Remove their heartbeat/registry entries only after protected cleanup succeeds.
- Very specific: line 364
After every concrete session succeeds, the authorized --all global runtime cleanup may remove shared legacy bridge state for captured Team …
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 --allOr 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")"
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/sessions/$SESSION_ID/cancel-signal-state.json"
fiCancellation Flow
This is the authoritative procedure for every invocation.
1. Parse Arguments
Parse exact flags independently; unknown or near-match arguments do nothing:
FORCE_MODE=false
ALL_MODE=false
for arg in "$@"; do
case "$arg" in
--force) FORCE_MODE=true ;;
--all) ALL_MODE=true ;;
esac
done
SCOPE="current"
if [[ "$ALL_MODE" == true ]]; then SCOPE="all"; fi
GRACEFUL_MODE=true
if [[ "$FORCE_MODE" == true ]]; then GRACEFUL_MODE=false; fiThe parsed values select exactly one row in the contract above.
2. Detect Active Modes
- For no flags or
--force, require one unambiguous current session id and callstate_list_active(session_id="<current_session_id>"). Its scoped result is authoritative; never use an aggregate result to infer ownership. - For
--all, callstate_list_active(all=true)once and retain every concrete session id. Discovery enumerates targets; it is not a Team read. - For each selected id, call
state_get_status(mode="<mode>", session_id="<session_id>")before mode cleanup. Treat Ultrawork as retired cleanup input. - Pass the selected id to every read, write, and clear. Protected state tools enforce the shared mutation lock and ownership boundary; no flag bypasses either one.
Use this dependency order when several modes appear in one scoped status:
- Autopilot (including its linked Ralph and retired-state cleanup)
- Standalone Ralph
- Retired Ultrawork and UltraQA
- Ultragoal runtime guard
- Shared Swarm state (global pass only)
- Ultrapilot and Pipeline
- Native Team
- Legacy OMC Teams
- Plan Consensus and Self-Improve
Ralph linked to Team is excluded from the standalone step and is handled only after Team succeeds; this prevents the persistence loop from outliving workers.
3. Cancel Each Selected Session
Process each selected session independently in this dependency order. A failed
or unresolved scoped operation marks that session unsuccessful: retain affected
state/runtime records, report the scope and reason, and do not claim linked
cleanup. An --all run may continue other ids, but any such failure blocks the
final global pass.
Autopilot (primary first)
- Read the exact session state, including
workflowRunIdwhen present. - Pause only that run with
state_write(mode="autopilot", session_id="<session_id>", active=false, state={workflowRunId: "<exact run id>"}); do not replay the readback. The state tool revalidates workflow integrity under its mutation lock. - If the primary write fails, stop this session's dependent cleanup. Otherwise,
clear only same-session named-workflow
state_clear(mode="ralplan", session_id="<session_id>"), then linked Ralph, then retired UltraQA. Preserve the paused primary for resume when a dependent clear fails. Force mode keeps this primary-first ordering.
The primary pause preserves workflow, pipeline tracking, and task identity. A
target_state_sha256 may be supplied only when it is the exact hash of the
current serialized state. Never clear nested ralplan, linked state, cancel
signals, or runtime artifacts after a failed primary write; report the exact
dependent failure and retry it in the same session.
Team (native Claude Code)
- Read
state_read(mode="team", session_id="<session_id>")and obtain the captured team name and active worker labels. Never select a Team from an aggregate read. - On graceful paths, signal each named teammate through the active surface, wait up to 15 seconds per member, then reconcile for 5 more seconds. Record acknowledgements and timeouts. Forced paths skip both waits.
- After graceful confirmation/timeouts (or immediately when forced), clear
state_clear(mode="team", session_id="<session_id>"). If the protected clear fails for lock, ownership, corruption, or another reason, retain Team runtime records and linked Ralph; do not use an unscoped clear or fallback. - Only after Team clear succeeds, inspect linked Ralph and clear it with the
same session id (
state_read(mode="ralph", session_id="<session_id>")thenstate_clear(mode="ralph", session_id="<session_id>")). For legacyomc team//omc-teamsworkers, run the captured team-name orphan scan after state cleanup; native Team has noTeamDelete.
Report the team name, signaled members, responses, timeouts, whether Team and
linked Ralph state cleared, and any manual cleanup needed. A graceful timeout
is recorded separately; only an unresolved protected operation blocks the global
pass. The legacy orphan scan is limited to the captured name and must not
terminate an uncaptured native Team or delete a ~/.claude/teams root.
The legacy scan, when applicable, is:
node "${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-orphans.mjs" \
--team-name "<captured_team_name>"Use --dry-run to inspect without terminating workers. This scan is not a
substitute for the protected Team clear and is never inferred from a
name-prefix match.
Linked Ralph context
If cancellation starts while Ralph is linked, apply the same Team-first ordering. Never clear Ralph before a linked Team has been successfully handled; if Team fails, Ralph remains protected. Both operations use the selected id.
Other modes
- Standalone Ralph:
state_clear(mode="ralph", session_id="<session_id>"). - Retired Ultrawork:
state_clear(mode="ultrawork", session_id="<session_id>")only for the stale scoped record; never reactivate or route it. - Retired UltraQA:
state_clear(mode="ultraqa", session_id="<session_id>")only for stale pre-5.0.0 state. - Ultragoal:
state_clear(mode="ultragoal", session_id="<session_id>")clears only its runtime guard; preserve.omc/ultragoal/artifacts. - Ultrapilot, Pipeline, Plan Consensus, and Self-Improve: use their protected session-scoped clear and mode-specific resume/artifact rules.
- Swarm and other shared state are not guessed from a session; process them in the authorized global pass only. OMC Teams use their own tmux/runtime cleanup.
Self-Improve cleanup clears its resolved state and orphaned worktrees while
preserving iteration_state and recording status: "user_stopped" in the
resolved agent-settings.json. New topic roots are not replaced by a flat
legacy root. OMC Teams are cleaned through their own captured tmux/runtime
records, never as native Team state; clear omc-teams only through that
mode's protected session operation.
Finally, clear state_clear(mode="skill-active", session_id="<session_id>") as
the last scoped operation. A failure also makes that session unresolved.
4. Authorized Global Pass
The global pass is allowed only for --all, after every concrete session id is
attempted successfully and has completed its scoped flow, including the final
skill-active clear. If any session operation failed or remains unresolved,
report partial completion and omit this pass. Never replace a failed scoped
operation with a global retry.
If all-session enumeration itself fails, returns an ambiguous id, or cannot
capture a Team owner, treat the affected scope as unresolved and stop before
any unscoped operation. A legacy-only entry may be reported, but it does not
authorize guessing a current session or deleting a native Team root.
Use protected state tools for the explicit pass, for example:
state_clear(mode="<legacy-mode>") # no session_id: --all authorization onlyAn unscoped state_clear is not a legacy-only API: it can revisit session
state as well as legacy/shared artifacts. Restrict it to the compatibility
paths explicitly authorized for this pass, including legacy mode JSON, Swarm
databases/markers, checkpoints, and shared OMC worker registries. Do not clear
native Claude roots or any Team root whose owner was not successfully captured
and cleared; uncaptured Team roots remain protected. Report global cleanup
failures separately from scoped session failures.
The explicit compatibility set is:
.omc/state/{autopilot,ralph,ralph-plan,ralph-verification}-state.json.omc/state/{ultrawork,ultraqa,ultrapilot,pipeline,omc-teams}-state.json.omc/state/{ultrapilot-ownership,plan-consensus,ralplan,boulder,hud}.json.omc/state/subagent-tracking.jsonand.omc/state/subagent-tracker.lock.omc/state/{swarm.db,swarm.db-wal,swarm.db-shm,swarm-active.marker,swarm-tasks.db}.omc/state/{rate-limit-daemon.pid,rate-limit-daemon.log}.omc/state/checkpoints/and an empty.omc/state/sessions/directory- shared legacy Team bridge heartbeats and
.omc/state/team-mcp-workers.json, only after captured owners succeed
These names expand to the following legacy records (and no session-owned
replacement): autopilot-state.json, ralph-state.json,
ralph-plan-state.json, ralph-verification.json, ultrawork-state.json,
ultraqa-state.json, ultrapilot-state.json, ultrapilot-ownership.json,
pipeline-state.json, omc-teams-state.json, plan-consensus.json,
ralplan-state.json, boulder.json, hud-state.json,
subagent-tracking.json, and subagent-tracker.lock.
Shared database compatibility records are swarm.db, swarm.db-wal,
swarm.db-shm, swarm-active.marker, and swarm-tasks.db; daemon records
are rate-limit-daemon.pid and rate-limit-daemon.log. Checkpoints are
removed only as part of this authorized global pass.
Do not interpret this list as permission to remove arbitrary files under
.omc/state, ~/.claude/teams, or ~/.claude/tasks. Unlisted or uncaptured
Team/runtime records remain for inspection and future ownership resolution.
The global pass must retain the same lock and ownership checks as scoped operations. It may continue recording an error for one compatibility item after the per-session gate opens, but must report that global failure and never claim a complete reset. It must not delete durable Autopilot, Ultragoal, Self-Improve, or Team handoff artifacts merely because they share a directory.
If no active mode is found in the selected scope, report: “No active OMC modes
detected.” For a current-session command, do not silently broaden that result;
use --all to enumerate other sessions and perform the global pass.
Preserved State
| Mode | Cancellation result |
| Autopilot | active=false with progress, phase, plan, and verdicts preserved |
| Ralph, Ultrawork, UltraQA, Swarm, Ultrapilot, Pipeline | State cleared when the protected scoped/global operation succeeds |
| Ultragoal | Runtime guard cleared; durable plan/ledger preserved |
| Team | Handoffs and uncaptured runtime roots preserved; selected state cleared only after its flow |
| Plan Consensus / Self-Improve | Mode-specific resume/artifact records preserved as documented by the mode |
Autopilot can resume with /oh-my-claudecode:autopilot; Ultragoal's durable
plan and ledger can resume through /ultragoal. Ralph and retired state do not
provide a resume path. Team handoffs remain available for a later scoped
resume, while shared Swarm and legacy records require explicit authorization.
Cancellation reports should identify the selected scope, modes observed, successful and failed operations, skipped waits, and any retained records. Do not turn a timeout, missing identity, lock conflict, ownership mismatch, or malformed state into a success message. A successful current-session report does not imply that another session or a shared legacy artifact was touched.
MCP Worker Cleanup
For selected-session cancellation, inspect only the captured team's
.omc/state/team-bridge/{team}/*.heartbeat.json records and capture exact worker
handles before state cleanup. Send shutdown signals and terminate only those
exact tmux session identifiers, not sessions selected by name prefix. If ownership
or identity cannot be established, retain the records and report manual cleanup.
Remove their heartbeat/registry entries only after protected cleanup succeeds.
After every concrete session succeeds, the authorized --all global runtime
cleanup may remove shared legacy bridge state for captured Team names. Populate
CAPTURED_TEAM_NAMES only from successful scoped Team reads; retain every
uncaptured registry/root. Use the exact captured worker identities for shutdown;
a team-name prefix is not ownership evidence. Remove only matching bridge
records and registry entries after their cleanup succeeds.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

