setup ยท diff
git:20260716.eae94de to git:20260718.2e5dcfa
2 added, 1 removed. Audit B to A.
---
- description: Check whether the local Grok CLI is ready for the companion runtime
+ name: setup
+ description: Check whether the local Grok CLI is ready for the companion runtime. Use when validating or changing the local companion setup.
argument-hint: '[--continuity <manual|claude-session>] [--enable-stop-gate | --disable-stop-gate] [--json]'
disable-model-invocation: true
allowed-tools: Bash(node:*), Read, Write
---
Treat the complete raw request as opaque data and never place any part of it in Bash. Run the fixed `transport-create` companion operation in one foreground Bash call, accept only its 48 character lowercase hexadecimal token, and use `Read` once on the returned file, requiring it to be empty. Use `Write` to replace that same file with the raw request exactly as received. Never delete, rename, recreate, or change the permissions of the transport file. Run `node "${CLAUDE_PLUGIN_ROOT}/scripts/grok-companion.mjs" setup --raw-args-token TOKEN` in one foreground Bash call with timeout `600000`, replacing only `TOKEN` with the validated token. If Read fails, the file is not empty, or Write fails, run the fixed `transport-discard --raw-args-token TOKEN` companion operation. Never use shell redirection, encoding, command substitution, backticks, environment variables, or heredocs for the raw request.
Present the setup output to the user.
- If the Grok CLI is missing, preserve the install guidance from the command output.
- Model and effort defaults belong in `~/.grok/config.toml`, not in plugin flags. Preserve that guidance when present.
- Preserve the reported continuity policy. `manual` is the default and resumes only when the caller explicitly supplies `--resume` or `--resume-last`. `/grok:setup --continuity claude-session` persists automatic affinity for ordinary direct tasks from the same Claude session, exact resolved working directory, mode, and memory setting. Fusion routed briefs do not receive automatic affinity and stay fresh unless explicitly resumed. Review, stop gate, and best-of-n remain fresh. `/grok:task --fresh` bypasses affinity for one task.
- Preserve the capability readiness line in text output. With `--json`, also preserve capability detail and every per-flag verdict across the plugin surface: `--prompt-file`, `--output-format`, `--sandbox`, `--tools`, `--disallowed-tools`, `--deny`, `--max-turns`, `--no-auto-update`, `--permission-mode`, `--allow`, `--disable-web-search`, `--always-approve`, `--json-schema`, `--best-of-n`, `--no-wait-for-background`, and `--background-wait-timeout`; `--no-subagents` is an informational compatibility hint because current headless mode accepts it without applying it. Top-level `ready` requires the binary, private data directory access, every universal and mode-specific capability, and a bounded background-wait path. Every managed run requires a new matching `ProfileApplied` sandbox event containing its unique private `TMPDIR` before sending the prompt because the shared event log exposes no run id or pid. Builder tracing starts only after stdin is consumed; fallback or unmatched warnings terminate early, and a successful close is rejected without positive applied evidence. `/fusion:doctor` audits the transport, environment isolation, worktree, and future ACP boundaries after an upgrade.
- A CLI installation, version, or required capability preflight failure persists and renders failure kind `setup`. Preserve its upgrade or repair guidance and tell the user to rerun `/grok:setup`; do not retry the unchanged task against the incompatible surface.
- The primary switch for the stop-time review gate is the plugin's `Stop gate review` setting in Claude Code's plugin configuration: when enabled, the Stop hook asks Grok to review the working tree diff whenever Claude Code stops with uncommitted changes. Only `BLOCK: <reason>` on the first nonempty reply line blocks the stop; a preamble before `BLOCK` and infrastructure failures fail open. SessionEnd attempts verified process cleanup for jobs owned by that Claude session and removes verified unused raw transports, but it does not delete terminal job records, briefs, or logs. `--enable-stop-gate` and `--disable-stop-gate` remain as a scripting fallback that persists the same toggle locally; they only take effect when the plugin setting is left unset. The report shows the current gate state.
- Native Grok sessions are retained by upstream storage for 30 days by default. `~/.grok/config.toml` accepts a positive integer at `[storage] cleanup_ttl_days`; `0` falls back to the default 30 days. The companion does not promise automatic garbage collection for its own job ledger under `~/.claude/plugins/data/grok-claude-code-fusion/`; clearing that ledger requires manually deleting the data directory after no jobs need collection or resume evidence.
The opaque raw request begins after the next newline and continues to the end of this command prompt:
$ARGUMENTS