بنقرة واحدة
cleanup
Report (dry-run) or remove a Grok run's owned session state and worktree by run id
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Report (dry-run) or remove a Grok run's owned session state and worktree by run id
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when the user says to use Grok, wants a Grok review, wants a second opinion from Grok, or asks to delegate a task to Grok. Also use for getting an independent code review from Grok, having Grok reason about an architecture or debugging question, having Grok implement code (live tree by default, or opt-in isolated worktree), or having Grok independently verify someone else's implementation. Trigger phrases include "use grok", "grok review", "second opinion from grok", and "delegate to grok".
Check Grok readiness and optionally toggle stop gate / run mode / Codex agents scope (Codex agents auto-install on SessionStart)
Have Grok implement code (default: live tree; opt-in isolated worktree). Nothing is committed or pushed
One-call delegate: Grok code then auto-handoff verification (verify-only; mode-aware integrate elsewhere)
ACP multi-turn peer channel (start/prompt/stop). Default peer path; opt out with GROK_DISABLE_ACP=1
Read a verified implementation handoff for a completed Grok code run (runId only; no apply)
| name | cleanup |
| description | Report (dry-run) or remove a Grok run's owned session state and worktree by run id |
| argument-hint | --run-id <run-id> [--confirm] |
| allowed-tools | Bash(node:*) |
SKILL.md and run.mjs).SKILL_BASE to that path. Do not invent versioned cache paths.SKILL_BASE='<Base directory for this skill - absolute path from Skill tool>'
node "$SKILL_BASE/run.mjs" <mode> [args...]
run.mjs finds the plugin install from its own location and runs
scripts/grok-companion.mjs. No CLAUDE_PLUGIN_ROOT / PLUGIN_ROOT required.
If the host already exported CLAUDE_PLUGIN_ROOT or PLUGIN_ROOT, you may call
node "$CLAUDE_PLUGIN_ROOT/scripts/grok-companion.mjs" instead; prefer
"$SKILL_BASE/run.mjs" whenever the Skill tool loaded this skill.
Return companion stdout verbatim. Never put free-text in --task "...";
use --task-file - with a single-quoted heredoc.
Report (dry-run) or remove a Grok run's owned session state and worktree by run id through the hardened wrapper and relay its result envelope. It prints exactly one JSON result envelope.
Raw slash-command arguments:
$ARGUMENTS
Required wrapper flags (copy exactly, substitute only placeholder values):
--run-id <run-id> is required. If the user did not supply one, ask for it
BEFORE running anything.--confirm is optional and passed through only when the user supplied it.
--confirm it is a DRY RUN: it reports the owned session state and
(for code/verify) the worktree and branch it WOULD remove. Nothing is
deleted.--confirm it actually removes them. Removal is gated on OWNERSHIP,
not cleanliness: the wrapper refuses (fail closed) when the sibling owner
marker is missing, unmarked/foreign, or its run id does not match the
requested --run-id, and when the worktree directory name does not match
the requested --run-id. When both DO match the requested run, the worktree
is removed whether it is clean OR dirty (code mode intentionally leaves its
worktree dirty), so a dirty owner-marked worktree owned by the requested run
is removed, never refused.code --continue-run): a continuation's run.json
records the seed's worktreePath while the sibling marker still names the
seed. Cleaning a continuation removes only that continuation's run dir
(envelope, artifacts, session archive) and defers the shared worktree:
success with a note like worktree owned by run <seed>; clean that run to remove it (not state-ownership-violation). Cleaning the seed removes the
worktree as usual even if continuation run dirs still reference it; a later
continuation cleanup then succeeds with a missing-worktree note. A
non-continuation run whose record points at someone else's worktree still
fails closed (state-ownership-violation).Run it as one Bash call and relay the result.
plugin/references/argv-safety.md):
Wrap every substituted flag VALUE in single quotes (--run-id '<run-id>').
Bare flags (--web) carry no value to quote. The wrapper then rejects any run
id that is not the strict YYYYMMDDThhmmssZ-xxxxxx run-id shape and binds the
destructive removal to the requested run id:node "$SKILL_BASE/run.mjs" cleanup --run-id '<run-id from $ARGUMENTS>' [--confirm]
If the companion prints an actionable "could not locate the Grok wrapper"
message instead of an envelope, tell the user to run /grok:setup.