cancel
Skill này làm gì
Skill này kết thúc các chế độ tự động đang chạy trong oh-my-claudecode và dọn dẹp trạng thái còn sót lại của chúng. Skill dành cho người muốn dừng một chế độ nền hoặc đặt lại nó sau khi đã xong.
Khi nào nên dùng
- ✓Khi bạn muốn dừng một chế độ tự động như autopilot hoặc ralph vẫn đang chạy.
- ✓Khi một chế độ tự động đã kết thúc và trạng thái đã lưu của nó cần được dọn dẹp.
- ✓Khi bạn muốn dừng các chế độ tự động trên tất cả các phiên làm việc của mình.
Liên kết skill
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/cancel/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy dừng lần chạy autopilot đang tiếp tục và dọn dẹp trạng thái của nó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent phát hiện chế độ nào đang hoạt động và hủy nó trong phiên hiện tại. Nó chỉ tác động đến các phiên khác khi bạn yêu cầu rõ ràng là tất cả, và nó tôn trọng các khóa để không can thiệp vào công việc đang diễn ra.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Tùy chọn force làm gì?
Nó bỏ qua giai đoạn chờ nhẹ nhàng khi tắt, nhưng vẫn tôn trọng các khóa và kiểm tra quyền sở hữu.
Nó có hủy mọi phiên theo mặc định không?
Không. Theo mặc định nó chỉ làm việc trên phiên hiện tại, và hủy tất cả các phiên cần một yêu cầu rõ ràng.
Có cần dùng nó sau mỗi lần chạy không?
Đây là cách chuẩn để kết thúc và thoát một chế độ tự động một cách gọn gàng, nên nó được dùng để đóng một chế độ lại.
Chi tiết
Mô tả gốc của tác giả
Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6996
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-doc-discipline
41kDạy agent của bạn viết hướng dẫn mà các agent AI khác có thể tự làm theo, với các quy tắc có thể kiểm tra và lý do rõ ràng đằng sau mỗi quy tắc.
ai-slop-cleaner
41kGiúp agent của bạn dọn dẹp mã do AI viết mà chạy được nhưng cồng kềnh hoặc lặp lại, loại bỏ mã thừa mà không thay đổi những gì nó làm.
architecture-survey
41kGiúp agent của bạn xem xét cấu trúc một codebase và liệt kê các phần ngày càng khó thay đổi, kèm bằng chứng, mà không tự thay đổi gì.
ask-navigator
41kGiúp agent của bạn biến một dự án còn mơ hồ thành bản đồ các câu hỏi quyết định rõ ràng, rồi giải quyết từng câu một cho đến khi con đường trở nên rõ.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.